Fix touchable area for close button
|
@ -90,8 +90,10 @@ public class OsmExtractionUI implements IMapLocationListener {
|
||||||
if(!(e instanceof ThreadDeath)){
|
if(!(e instanceof ThreadDeath)){
|
||||||
ExceptionHandler.handle("Error in thread " + t.getName(), e); //$NON-NLS-1$
|
ExceptionHandler.handle("Error in thread " + t.getName(), e); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
if(defaultHandler != null){
|
||||||
defaultHandler.uncaughtException(t, e);
|
defaultHandler.uncaughtException(t, e);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
MAIN_APP = new OsmExtractionUI();
|
MAIN_APP = new OsmExtractionUI();
|
||||||
|
|
Before Width: | Height: | Size: 797 B After Width: | Height: | Size: 989 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 797 B After Width: | Height: | Size: 989 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 773 B After Width: | Height: | Size: 792 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.4 KiB |
|
@ -4,6 +4,7 @@
|
||||||
android:background="@drawable/tab_menu_item_small">
|
android:background="@drawable/tab_menu_item_small">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:src="@drawable/expandable_category_unpushed"
|
||||||
android:id="@+id/explist_indicator"
|
android:id="@+id/explist_indicator"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|
|
@ -36,42 +36,4 @@ public class AndroidUtils {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param closeButton expand area of which element
|
|
||||||
* @param left multiplier of width to add to left, 1 does nothing
|
|
||||||
* @param top multiplier of height to add to top, 1 does nothing
|
|
||||||
* @param right multiplier of width to add to right, 1 does nothing
|
|
||||||
* @param bottom multiplier of height to add to bottom, 1 does nothing
|
|
||||||
*/
|
|
||||||
public static void expandClickableArea(final View closeButton,
|
|
||||||
final int left, final int top, final int right, final int bottom) {
|
|
||||||
closeButton.setOnTouchListener(new OnTouchListener() {
|
|
||||||
@Override
|
|
||||||
public boolean onTouch(View v, MotionEvent event) {
|
|
||||||
v.post(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
closeButton.performClick();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// increase touch area for the button
|
|
||||||
final View parent = (View) closeButton.getParent();
|
|
||||||
parent.post(new Runnable() {
|
|
||||||
// Post in the parent's message queue to make sure the parent
|
|
||||||
// lays out its children before we call getHitRect()
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Rect r = new Rect();
|
|
||||||
closeButton.getHitRect(r);
|
|
||||||
r.left -= r.width() * left;
|
|
||||||
r.top -= r.height() * top;
|
|
||||||
r.right += r.width() * right;
|
|
||||||
r.bottom += r.height() * bottom;
|
|
||||||
parent.setTouchDelegate(new TouchDelegate(r, closeButton));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ import java.io.File;
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import net.osmand.AndroidUtils;
|
|
||||||
import net.osmand.Version;
|
import net.osmand.Version;
|
||||||
import net.osmand.access.AccessibleAlertBuilder;
|
import net.osmand.access.AccessibleAlertBuilder;
|
||||||
import net.osmand.plus.OsmandApplication;
|
import net.osmand.plus.OsmandApplication;
|
||||||
|
@ -223,8 +222,6 @@ public class MainMenuActivity extends Activity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
AndroidUtils.expandClickableArea(closeButton, 1,1,3,3);
|
|
||||||
|
|
||||||
View searchButton = window.findViewById(R.id.SearchButton);
|
View searchButton = window.findViewById(R.id.SearchButton);
|
||||||
searchButton.setOnClickListener(new OnClickListener() {
|
searchButton.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -353,7 +353,7 @@ public class EditingPOIActivity implements DialogProvider {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
v.invalidate();
|
layout.requestLayout();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|