Fixed item layout.

This commit is contained in:
GaidamakUA 2016-04-04 17:15:15 +03:00
parent 9118075dac
commit 615e869a03
7 changed files with 137 additions and 61 deletions

View file

@ -1,50 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:minHeight="48dp"
android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingRight="16dp">
<android.support.v7.widget.AppCompatImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="3dp"
tools:src="@drawable/ic_world_globe_dark"/>
<TextView
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:maxLines="2"
android:textSize="@dimen/default_list_text_size"/>
<TextView
android:id="@+id/description"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:ellipsize="end"
android:gravity="right"
android:maxLines="1"
android:textColor="#bebebe"
android:textSize="@dimen/default_desc_text_size"/>
<CheckBox
android:id="@+id/toggle_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="11dp"
android:focusable="false"/>
</LinearLayout>

View file

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/bg_color">
<android.support.v7.widget.AppCompatImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
tools:src="@drawable/ic_world_globe_dark"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="56dp"
android:gravity="center_vertical"
android:orientation="horizontal"
tools:height="48dp">
<TextView
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:maxLines="2"
android:textSize="@dimen/default_list_text_size"
tools:text="Overlay map..."/>
<TextView
android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:ellipsize="end"
android:gravity="end"
android:maxLines="1"
android:maxWidth="150dp"
android:textColor="#bebebe"
android:textSize="@dimen/default_desc_text_size"
tools:text="Offline vector maps"/>
</LinearLayout>
<View
android:id="@+id/divider"
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_gravity="bottom"
android:background="?attr/dashboard_divider"/>
</FrameLayout>
</LinearLayout>

View file

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/bg_color">
<android.support.v7.widget.AppCompatImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
tools:src="@drawable/ic_world_globe_dark"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="60dp"
android:orientation="horizontal"
tools:height="48dp">
<TextView
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:maxLines="2"
android:textSize="@dimen/default_list_text_size"
tools:text="Overlay map..."/>
<TextView
android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:ellipsize="end"
android:gravity="end"
android:maxLines="1"
android:maxWidth="150dp"
android:textColor="#bebebe"
android:textSize="@dimen/default_desc_text_size"
tools:text="Offline vector maps"/>
</LinearLayout>
<View
android:id="@+id/divider"
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_gravity="bottom"
android:background="?attr/dashboard_divider"/>
</FrameLayout>
</LinearLayout>

View file

@ -862,7 +862,8 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
if (visibleType != DashboardType.WAYPOINTS
&& visibleType != DashboardType.MAP_MARKERS
&& visibleType != DashboardType.MAP_MARKERS_SELECTION
&& visibleType != DashboardType.CONFIGURE_SCREEN) {
&& visibleType != DashboardType.CONFIGURE_SCREEN
&& visibleType != DashboardType.CONFIGURE_MAP) {
listView.setDivider(dividerDrawable);
listView.setDividerHeight(dpToPx(1f));
} else {

View file

@ -273,7 +273,7 @@ public class ConfigureMapMenu {
bld.show();
return false;
}
}).setDescription(descr).setLayout(R.layout.drawer_list_doubleitem).createItem());
}).setDescription(descr).setLayout(R.layout.list_item_single_line_descrition_narrow).createItem());
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.map_widget_day_night, activity)
@ -304,7 +304,7 @@ public class ConfigureMapMenu {
bld.show();
return false;
}
}).setLayout(R.layout.drawer_list_doubleitem).createItem());
}).setLayout(R.layout.list_item_single_line_descrition_narrow).createItem());
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.map_magnifier, activity).setListener(new ContextMenuAdapter.ItemClickListener() {
@ -357,7 +357,7 @@ public class ConfigureMapMenu {
return false;
}
}).setDescription(String.format("%.0f", 100f * activity.getMyApplication().getSettings().MAP_DENSITY.get()) + " %")
.setLayout(R.layout.drawer_list_doubleitem)
.setLayout(R.layout.list_item_single_line_descrition_narrow)
.createItem());
adapter.addItem(new ContextMenuItem.ItemBuilder()
@ -391,7 +391,7 @@ public class ConfigureMapMenu {
b.show();
return false;
}
}).setDescription(getScale(activity)).setLayout(R.layout.drawer_list_doubleitem).createItem());
}).setDescription(getScale(activity)).setLayout(R.layout.list_item_single_line_descrition_narrow).createItem());
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.map_locale, activity).setListener(new ContextMenuAdapter.ItemClickListener() {
@ -426,7 +426,7 @@ public class ConfigureMapMenu {
}
})
.setDescription(activity.getMyApplication().getSettings().MAP_PREFERRED_LOCALE.get())
.setLayout(R.layout.drawer_list_doubleitem).createItem());
.setLayout(R.layout.list_item_single_line_descrition_narrow).createItem());
RenderingRulesStorage renderer = activity.getMyApplication().getRendererRegistry().getCurrentSelectedRenderer();
if (renderer != null) {
@ -515,7 +515,7 @@ public class ConfigureMapMenu {
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(strId, activity)
.setDescription(descr)
.setLayout(R.layout.drawer_list_doubleitem)
.setLayout(R.layout.list_item_single_line_descrition_narrow)
.setListener(new ContextMenuAdapter.ItemClickListener() {
@Override
@ -687,7 +687,7 @@ public class ConfigureMapMenu {
b.show();
return false;
}
}).setDescription(descr).setLayout(R.layout.drawer_list_doubleitem).createItem());
}).setDescription(descr).setLayout(R.layout.list_item_single_line_descrition_narrow).createItem());
}
}
}

View file

@ -256,7 +256,7 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
String overlayMapDescr = settings.MAP_OVERLAY.get();
overlayMapDescr = overlayMapDescr != null ? overlayMapDescr : mapActivity.getString(R.string.shared_string_none);
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.layer_overlay, mapActivity)
.setLayout(R.layout.drawer_list_doubleitem)
.setLayout(R.layout.list_item_single_line_descrition_wide)
.setDescription(overlayMapDescr)
.setIcon(R.drawable.ic_layer_top_dark)
.setListener(listener)
@ -265,7 +265,7 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
String underlayMapDescr = settings.MAP_UNDERLAY.get();
underlayMapDescr = underlayMapDescr != null ? underlayMapDescr : mapActivity.getString(R.string.shared_string_none);
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.layer_underlay, mapActivity)
.setLayout(R.layout.drawer_list_doubleitem)
.setLayout(R.layout.list_item_single_line_descrition_wide)
.setDescription(underlayMapDescr)
.setIcon(R.drawable.ic_layer_bottom_dark)
.setListener(listener)

View file

@ -121,7 +121,6 @@ public class SRTMPlugin extends OsmandPlugin {
.setIcon(R.drawable.ic_action_hillshade_dark)
.setListener(listener)
.setPosition(13)
.setLayout(R.layout.drawer_list_item)
.createItem());
}