Fixing raster map menu design.

This commit is contained in:
GaidamakUA 2016-02-16 14:30:07 +02:00
parent cd0607e5e7
commit 33855ba805
4 changed files with 32 additions and 19 deletions

View file

@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="56dp"
android:minHeight="54dp"
android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingRight="16dp">

View file

@ -3,7 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_height="74dp"
android:descendantFocusability="blocksDescendants"
android:gravity="center_vertical"
android:minHeight="@dimen/list_item_height"
@ -13,24 +13,30 @@
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_list_text_size"
tools:text="Germany"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="0dp"
android:layout_weight="1">
<ImageView
android:src="@drawable/ic_action_opacity"
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content"
tools:src="@drawable/ic_action_opacity"/>
<SeekBar
android:id="@+id/seekbar"
style="?android:attr/progressBarStyleHorizontal"
android:max="255"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content"
android:max="255"/>
</LinearLayout>
</LinearLayout>

View file

@ -3,11 +3,12 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_height="72dp"
android:descendantFocusability="blocksDescendants"
android:gravity="center_vertical"
android:minHeight="@dimen/list_item_height"
android:orientation="horizontal"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:paddingLeft="16dp"
android:paddingRight="16dp">
@ -22,14 +23,16 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_list_text_size"
tools:text="Germany"/>
@ -37,8 +40,9 @@
<TextView
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_height="0dp"
android:layout_weight="1"
android:maxLines="25"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_sub_text_size"

View file

@ -1,7 +1,6 @@
package net.osmand.plus.dialogs;
import android.support.annotation.StringRes;
import android.util.Log;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Toast;
@ -76,7 +75,6 @@ public class RasterMapMenu {
ContextMenuAdapter.OnRowItemClick l = new ContextMenuAdapter.OnRowItemClick() {
@Override
public boolean onRowItemClick(ArrayAdapter<?> adapter, View view, int itemId, int pos) {
Log.v(TAG, "onRowItemClick(" + "adapter=" + adapter + ", view=" + view + ", itemId=" + itemId + ", pos=" + pos + ")");
if (itemId == mapTypeString) {
if (selected) {
plugin.selectMapOverlayLayer(mapActivity.getMapView(), mapTypePreference,
@ -108,7 +106,8 @@ public class RasterMapMenu {
int selectedCode = selected ? 1 : 0;
mapTypeDescr = selected ? mapTypeDescr : mapActivity.getString(R.string.shared_string_none);
contextMenuAdapter.item(toggleActionStringId).listen(l).selected(selectedCode).reg();
contextMenuAdapter.item(mapTypeString).listen(l).layout(R.layout.two_line_list_item).description(mapTypeDescr).reg();
contextMenuAdapter.item(mapTypeString).listen(l).layout(R.layout.two_line_list_item)
.description(mapTypeDescr).reg();
ContextMenuAdapter.OnIntegerValueChangedListener integerListener =
new ContextMenuAdapter.OnIntegerValueChangedListener() {
@Override
@ -119,10 +118,14 @@ public class RasterMapMenu {
}
};
// android:max="255" in layout is expected
contextMenuAdapter.item(mapTypeStringTransparency).layout(R.layout.progress_list_item)
.progress(mapTransparencyPreference.get()).listenInteger(integerListener).reg();
contextMenuAdapter.item(mapTypeStringTransparency)
.layout(R.layout.progress_list_item)
.iconColor(R.drawable.ic_action_opacity)
.progress(mapTransparencyPreference.get())
.listenInteger(integerListener).reg();
if (type == OsmandRasterMapsPlugin.RasterMapType.UNDERLAY) {
contextMenuAdapter.item(R.string.show_polygons).listen(l).selected(hidePolygonsPref.get() ? 0 : 1).reg();
contextMenuAdapter.item(R.string.show_polygons).listen(l)
.selected(hidePolygonsPref.get() ? 0 : 1).reg();
}
}