Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2015-06-26 13:22:21 +02:00
commit 331ef5d18b
5 changed files with 37 additions and 11 deletions

View file

@ -47,6 +47,16 @@
android:scaleType="center"
android:src="@drawable/ic_action_settings" />
<ImageView
android:id="@+id/toolbar_configure_screen"
android:layout_width="@dimen/list_item_height"
android:layout_height="@dimen/list_item_height"
android:layout_gravity="right"
android:background="@drawable/dashboard_button_light"
android:scaleType="center"
android:src="@drawable/ic_configure_screen_dark" />
<ImageView
android:id="@+id/toolbar_ok"

View file

@ -56,6 +56,7 @@ public class DashSearchFragment extends DashBaseFragment {
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dashboard.hideDashboard(false);
searchActivity(activity, appCustomization, SearchActivity.POI_TAB_INDEX);
}
});
@ -66,6 +67,7 @@ public class DashSearchFragment extends DashBaseFragment {
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dashboard.hideDashboard(false);
searchActivity(activity, appCustomization, SearchActivity.ADDRESS_TAB_INDEX);
}
});
@ -76,6 +78,7 @@ public class DashSearchFragment extends DashBaseFragment {
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dashboard.hideDashboard(false);
searchActivity(activity, appCustomization, SearchActivity.LOCATION_TAB_INDEX);
}
});
@ -85,6 +88,7 @@ public class DashSearchFragment extends DashBaseFragment {
(view.findViewById(R.id.recents)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dashboard.hideDashboard(false);
searchActivity(activity, appCustomization, SearchActivity.HISTORY_TAB_INDEX);
}
});

View file

@ -208,6 +208,8 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
flat.setVisibility(View.GONE);
ImageView settings = (ImageView) dashboardView.findViewById(R.id.toolbar_settings);
settings.setVisibility(View.GONE);
ImageView configureScreen = (ImageView) dashboardView.findViewById(R.id.toolbar_configure_screen);
configureScreen.setVisibility(View.GONE);
IconsCache iconsCache = mapActivity.getMyApplication().getIconsCache();
ImageView lst = (ImageView) dashboardView.findViewById(R.id.toolbar_list);
lst.setVisibility(View.GONE);
@ -269,6 +271,16 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
});
}
if (visibleType == DashboardType.DASHBOARD || visibleType == DashboardType.LIST_MENU) {
configureScreen.setVisibility(View.VISIBLE);
configureScreen.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
setDashboardVisibility(true, DashboardType.CONFIGURE_SCREEN);
}
});
settings.setVisibility(View.VISIBLE);
settings.setOnClickListener(new View.OnClickListener() {

View file

@ -63,14 +63,14 @@ public class ConfigureMapMenu {
});
createLayersItems(adapter, ma);
createRenderingAttributeItems(adapter, ma);
adapter.item(R.string.layer_map_appearance).
iconColor(R.drawable.ic_configure_screen_dark).listen(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
ma.getDashboard().setDashboardVisibility(true, DashboardType.CONFIGURE_SCREEN);
return false;
}
}).reg();
// adapter.item(R.string.layer_map_appearance).
// iconColor(R.drawable.ic_configure_screen_dark).listen(new OnContextMenuClick() {
// @Override
// public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
// ma.getDashboard().setDashboardVisibility(true, DashboardType.CONFIGURE_SCREEN);
// return false;
// }
// }).reg();
return adapter;
}
@ -556,7 +556,7 @@ public class ConfigureMapMenu {
final OsmandSettings.CommonPreference<String> pref = view.getApplication().getSettings()
.getCustomRenderProperty(p.getAttrName());
String descr;
if(Algorithms.isEmpty(pref.get())) {
if(!Algorithms.isEmpty(pref.get())) {
descr = SettingsActivity.getStringPropertyValue(activity, pref.get());
} else {
descr = SettingsActivity.getStringPropertyValue(view.getContext(),

View file

@ -378,7 +378,7 @@ public class MapWidgetRegistry {
}
public ContextMenuAdapter getViewConfigureMenuAdapter(final MapActivity map) {
ContextMenuAdapter cm = new ContextMenuAdapter(map);
final ContextMenuAdapter cm = new ContextMenuAdapter(map);
cm.setDefaultLayoutId(R.layout.drawer_list_item);
cm.item(R.string.app_modes_choose).layout(R.layout.mode_toggles).reg();
cm.setChangeAppModeListener(new ConfigureMapMenu.OnClickListener() {
@ -398,7 +398,7 @@ public class MapWidgetRegistry {
if (mil != null) {
mil.recreateControls();
}
adapter.notifyDataSetInvalidated();
map.getDashboard().updateListAdapter(getViewConfigureMenuAdapter(map));
return false;
}
}).reg();