Rename items

This commit is contained in:
Victor Shcherb 2014-10-25 19:41:36 +02:00
parent dfdc983676
commit 1b281b3b77
6 changed files with 32 additions and 29 deletions

View file

@ -20,13 +20,13 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<CheckBox android:id="@+id/check_item"
android:focusable="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="11dp"/>
<!-- android:layout_marginLeft="8dp"
android:layout_marginRight="8dp" -->
<CheckBox
android:id="@+id/check_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="11dp"
android:focusable="false"
android:layout_gravity="center_vertical" />
</LinearLayout>

View file

@ -3,21 +3,18 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fffc00"
android:paddingLeft="16dp"
android:layout_height="40dp"
android:paddingLeft="16dp"
android:layout_marginBottom="4dp">
<TextView android:id="@+id/title"
android:layout_marginBottom="4dp"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:capitalize="characters"
android:inputType="textCapCharacters"
android:textScaleX="1.5"
android:textSize="14sp"
android:ellipsize="end"
android:background="#ff0202"
android:gravity="left|bottom"
android:layout_height="36dp"/>
<!--
android:layout_marginTop="16dp" -->
<!-- android:maxLines="2" -->
android:gravity="left|bottom"/>
</LinearLayout>

View file

@ -262,6 +262,10 @@ public class ContextMenuAdapter {
return defaultLayoutId;
}
public void setDefaultLayoutId(int defaultLayoutId) {
this.defaultLayoutId = defaultLayoutId;
}
public ListAdapter createListAdapter(final Activity activity, final boolean holoLight) {
final int padding = (int) (12 * activity.getResources().getDisplayMetrics().density + 0.5f);

View file

@ -28,6 +28,7 @@ public class ConfigureMapMenu {
public ContextMenuAdapter createListAdapter(final MapActivity ma) {
ContextMenuAdapter adapter = new ContextMenuAdapter(ma);
adapter.item(R.string.configure_map).icons(R.drawable.ic_back_drawer_dark, R.drawable.ic_back_drawer_white)
.layout(R.layout.drawer_list_header)
.listen(new OnContextMenuClick() {
@Override
@ -36,6 +37,7 @@ public class ConfigureMapMenu {
return false;
}
}).reg();
adapter.setDefaultLayoutId(R.layout.drawer_list_item);
createLayersItems(adapter, ma);
createRenderingAttributeItems(adapter, ma);
return adapter;
@ -94,21 +96,21 @@ public class ConfigureMapMenu {
adapter.item(R.string.layers_category_show).setCategory(true).layout(R.layout.drawer_list_sub_header).reg();
// String appMode = " [" + settings.getApplicationMode().toHumanString(view.getApplication()) +"] ";
adapter.item(R.string.layer_poi).selected(settings.SHOW_POI_OVER_MAP.get() ? 1 : 0)
.icons(R.drawable.ic_action_info_dark, R.drawable.ic_action_info_light).listen(l).layout(R.layout.drawer_list_layer).reg();
.icons(R.drawable.ic_action_info_dark, R.drawable.ic_action_info_light).listen(l).reg();
adapter.item(R.string.layer_amenity_label).selected(settings.SHOW_POI_LABEL.get() ? 1 : 0)
.icons(R.drawable.ic_action_text_dark, R.drawable.ic_action_text_light).listen(l).layout(R.layout.drawer_list_layer).reg();
.icons(R.drawable.ic_action_text_dark, R.drawable.ic_action_text_light).listen(l).reg();
adapter.item(R.string.layer_favorites).selected(settings.SHOW_FAVORITES.get() ? 1 : 0)
.icons(R.drawable.ic_action_fav_dark, R.drawable.ic_action_fav_light).listen(l).layout(R.layout.drawer_list_layer).reg();
.icons(R.drawable.ic_action_fav_dark, R.drawable.ic_action_fav_light).listen(l).reg();
adapter.item(R.string.layer_gpx_layer).selected(
app.getSelectedGpxHelper().isShowingAnyGpxFiles() ? 1 : 0)
// .icons(R.drawable.ic_action_foot_dark, R.drawable.ic_action_foot_light)
.icons(R.drawable.ic_action_polygom_dark, R.drawable.ic_action_polygom_light)
.listen(l).layout(R.layout.drawer_list_layer).reg();
.listen(l).reg();
adapter.item(R.string.layer_transport).selected(settings.SHOW_TRANSPORT_OVER_MAP.get() ? 1 : 0)
.icons(R.drawable.ic_action_bus_dark, R.drawable.ic_action_bus_light).listen(l).layout(R.layout.drawer_list_layer).reg();
.icons(R.drawable.ic_action_bus_dark, R.drawable.ic_action_bus_light).listen(l).reg();
if(TransportRouteHelper.getInstance().routeIsCalculated()){
adapter.item(R.string.layer_transport_route).selected(1)
.icons(R.drawable.ic_action_bus_dark, R.drawable.ic_action_bus_light).listen(l).layout(R.layout.drawer_list_layer).reg();
.icons(R.drawable.ic_action_bus_dark, R.drawable.ic_action_bus_light).listen(l).reg();
}
OsmandPlugin.registerLayerContextMenu(activity.getMapView(), adapter, activity);
@ -161,7 +163,7 @@ public class ConfigureMapMenu {
bld.show();
return false;
}
}).description(descr).layout(R.layout.drawer_list_rendering).reg();
}).description(descr).layout(R.layout.drawer_list_doubleitem).reg();
adapter.item(R.string.map_widget_day_night).description(activity.getMyApplication().getSettings().DAYNIGHT_MODE.get().toHumanString(activity)).listen(new OnContextMenuClick() {
@Override
@ -185,7 +187,7 @@ public class ConfigureMapMenu {
bld.show();
return false;
}
}).layout(R.layout.drawer_list_rendering).reg();
}).layout(R.layout.drawer_list_doubleitem).reg();
int scale = (int)(activity.getMyApplication().getSettings().TEXT_SCALE.get() * 100);
adapter.item(R.string.text_size).listen(new OnContextMenuClick() {
@ -214,7 +216,7 @@ public class ConfigureMapMenu {
b.show();
return false;
}
}).description(scale + " %").layout(R.layout.drawer_list_rendering).reg();
}).description(scale + " %").layout(R.layout.drawer_list_doubleitem).reg();
RenderingRulesStorage renderer = activity.getMyApplication().getRendererRegistry().getCurrentSelectedRenderer();
if (renderer != null) {
@ -245,7 +247,7 @@ public class ConfigureMapMenu {
refreshMapComplete(activity);
return false;
}
}).selected(pref.get() ? 1 : 0).layout(R.layout.drawer_list_rendering).reg();
}).selected(pref.get() ? 1 : 0).reg();
} else {
final OsmandSettings.CommonPreference<String> pref = view.getApplication().getSettings()
.getCustomRenderProperty(p.getAttrName());
@ -279,7 +281,7 @@ public class ConfigureMapMenu {
b.show();
return false;
}
}).description(descr).layout(R.layout.drawer_list_rendering).reg();
}).description(descr).layout(R.layout.drawer_list_doubleitem).reg();
}
}
}

View file

@ -103,7 +103,7 @@ public class SRTMPlugin extends OsmandPlugin {
}
};
adapter.item(R.string.layer_hillshade).selected(HILLSHADE.get()? 1 : 0)
.icons( R.drawable.ic_action_hillshade_dark, R.drawable.ic_action_hillshade_light).listen(listener).position(9).layout(R.layout.drawer_list_layer).reg();
.icons( R.drawable.ic_action_hillshade_dark, R.drawable.ic_action_hillshade_light).listen(listener).position(9).layout(R.layout.drawer_list_item).reg();
}
@Override