Merge pull request #10388 from osmandapp/HideDashboardByDefault
Hide Dashboard by default in drawer
This commit is contained in:
commit
8355308765
4 changed files with 11 additions and 2 deletions
|
@ -13,7 +13,7 @@ public class ContextMenuItemsPreference extends CommonPreference<ContextMenuItem
|
|||
|
||||
@Override
|
||||
protected ContextMenuItemsSettings getValue(Object prefs, ContextMenuItemsSettings defaultValue) {
|
||||
String s = getSettingsAPI().getString(prefs, getId(), "");
|
||||
String s = getSettingsAPI().getString(prefs, getId(), defaultValue.writeToJsonString(idScheme));
|
||||
return readValue(s);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@ import java.util.ArrayList;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static net.osmand.aidlapi.OsmAndCustomizationConstants.DRAWER_DASHBOARD_ID;
|
||||
|
||||
public class ContextMenuItemsSettings implements Serializable {
|
||||
|
||||
private static final Log LOG = PlatformUtil.getLog(ContextMenuItemsSettings.class.getName());
|
||||
|
@ -99,4 +101,10 @@ public class ContextMenuItemsSettings implements Serializable {
|
|||
public List<String> getOrderIds() {
|
||||
return Collections.unmodifiableList(orderIds);
|
||||
}
|
||||
|
||||
public static ContextMenuItemsSettings getDefaultInstanceForDrawer() {
|
||||
ArrayList<String> hiddenByDefault = new ArrayList<>();
|
||||
hiddenByDefault.add(DRAWER_DASHBOARD_ID);
|
||||
return new ContextMenuItemsSettings(hiddenByDefault, new ArrayList<String>());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2518,7 +2518,7 @@ public class OsmandSettings {
|
|||
new ListStringPreference(this, "inactive_poi_filters", null, ",,").makeProfile().cache();
|
||||
|
||||
public final ContextMenuItemsPreference DRAWER_ITEMS =
|
||||
(ContextMenuItemsPreference) new ContextMenuItemsPreference(this, "drawer_items", DRAWER_ITEM_ID_SCHEME, new ContextMenuItemsSettings())
|
||||
(ContextMenuItemsPreference) new ContextMenuItemsPreference(this, "drawer_items", DRAWER_ITEM_ID_SCHEME, ContextMenuItemsSettings.getDefaultInstanceForDrawer())
|
||||
.makeProfile().cache();
|
||||
|
||||
public final ContextMenuItemsPreference CONFIGURE_MAP_ITEMS =
|
||||
|
|
|
@ -506,6 +506,7 @@ public class ConfigureMenuItemsFragment extends BaseOsmAndFragment
|
|||
mainActionItems.clear();
|
||||
}
|
||||
instantiateContextMenuAdapter();
|
||||
initSavedIds(appMode);
|
||||
initMainActionsIds(appMode);
|
||||
rearrangeAdapter.updateItems(getAdapterItems());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue