Hide Dashboard by default in drawer

This commit is contained in:
nazar-kutz 2020-12-11 21:59:41 +02:00
parent 20e2293f9b
commit 6d784b8129
3 changed files with 10 additions and 1 deletions

View file

@ -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>());
}
}

View file

@ -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 =

View file

@ -506,6 +506,7 @@ public class ConfigureMenuItemsFragment extends BaseOsmAndFragment
mainActionItems.clear();
}
instantiateContextMenuAdapter();
initSavedIds(appMode);
initMainActionsIds(appMode);
rearrangeAdapter.updateItems(getAdapterItems());
}