diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java index 907779eb4b..13fdaa5270 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java @@ -68,7 +68,7 @@ import net.osmand.plus.measurementtool.command.ClearPointsCommand; import net.osmand.plus.measurementtool.command.MovePointCommand; import net.osmand.plus.measurementtool.command.RemovePointCommand; import net.osmand.plus.measurementtool.command.ReorderPointCommand; -import net.osmand.plus.profiles.ReorderItemTouchHelperCallback; +import net.osmand.plus.views.controls.ReorderItemTouchHelperCallback; import net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory; import net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory.TopToolbarController; diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/adapter/MeasurementToolAdapter.java b/OsmAnd/src/net/osmand/plus/measurementtool/adapter/MeasurementToolAdapter.java index cd5fb5c3de..9e0b157c9e 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/adapter/MeasurementToolAdapter.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/adapter/MeasurementToolAdapter.java @@ -20,7 +20,7 @@ import net.osmand.plus.R; import net.osmand.plus.UiUtilities; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.measurementtool.NewGpxData.ActionType; -import net.osmand.plus.profiles.ReorderItemTouchHelperCallback; +import net.osmand.plus.views.controls.ReorderItemTouchHelperCallback; import java.util.Collections; import java.util.List; diff --git a/OsmAnd/src/net/osmand/plus/profiles/EditProfilesFragment.java b/OsmAnd/src/net/osmand/plus/profiles/EditProfilesFragment.java index 325c135f74..c3ceb7dc3a 100644 --- a/OsmAnd/src/net/osmand/plus/profiles/EditProfilesFragment.java +++ b/OsmAnd/src/net/osmand/plus/profiles/EditProfilesFragment.java @@ -29,6 +29,7 @@ import net.osmand.plus.UiUtilities; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.base.BaseOsmAndFragment; import net.osmand.plus.settings.BaseSettingsFragment; +import net.osmand.plus.views.controls.ReorderItemTouchHelperCallback; import java.util.ArrayList; import java.util.Collections; @@ -47,6 +48,9 @@ public class EditProfilesFragment extends BaseOsmAndFragment { private EditProfilesAdapter adapter; + private boolean nightMode; + private boolean wasDrawerDisabled; + @Nullable @Override public View onCreateView(@NonNull final LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { @@ -59,6 +63,8 @@ public class EditProfilesFragment extends BaseOsmAndFragment { appModesOrders.put(mode.getStringKey(), mode.getOrder()); } } + nightMode = !app.getSettings().isLightContent(); + View mainView = inflater.inflate(R.layout.edit_profiles_list_fragment, container, false); AndroidUtils.addStatusBarPadding21v(getContext(), mainView); @@ -186,6 +192,41 @@ public class EditProfilesFragment extends BaseOsmAndFragment { outState.putStringArrayList(DELETED_APP_MODES_KEY, deletedModesKeys); } + @Override + public void onResume() { + super.onResume(); + MapActivity mapActivity = getMapActivity(); + if (mapActivity != null) { + wasDrawerDisabled = mapActivity.isDrawerDisabled(); + if (!wasDrawerDisabled) { + mapActivity.disableDrawer(); + } + } + } + + public void onPause() { + super.onPause(); + MapActivity mapActivity = getMapActivity(); + if (mapActivity != null && !wasDrawerDisabled) { + mapActivity.enableDrawer(); + } + } + + @Override + public int getStatusBarColorId() { + return nightMode ? R.color.status_bar_color_dark : R.color.status_bar_color_light; + } + + @Nullable + public MapActivity getMapActivity() { + FragmentActivity activity = getActivity(); + if (activity instanceof MapActivity) { + return (MapActivity) activity; + } else { + return null; + } + } + public List getProfiles(boolean deleted) { List profiles = new ArrayList<>(); for (ApplicationMode mode : ApplicationMode.allPossibleValues()) { diff --git a/OsmAnd/src/net/osmand/plus/quickaction/QuickActionListFragment.java b/OsmAnd/src/net/osmand/plus/quickaction/QuickActionListFragment.java index 66bce540dd..998a1464a1 100644 --- a/OsmAnd/src/net/osmand/plus/quickaction/QuickActionListFragment.java +++ b/OsmAnd/src/net/osmand/plus/quickaction/QuickActionListFragment.java @@ -28,9 +28,9 @@ import net.osmand.plus.R; import net.osmand.plus.UiUtilities; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.base.BaseOsmAndFragment; -import net.osmand.plus.profiles.ReorderItemTouchHelperCallback; -import net.osmand.plus.profiles.ReorderItemTouchHelperCallback.UnmovableItem; -import net.osmand.plus.profiles.ReorderItemTouchHelperCallback.OnItemMoveCallback; +import net.osmand.plus.views.controls.ReorderItemTouchHelperCallback; +import net.osmand.plus.views.controls.ReorderItemTouchHelperCallback.UnmovableItem; +import net.osmand.plus.views.controls.ReorderItemTouchHelperCallback.OnItemMoveCallback; import java.util.ArrayList; import java.util.Collections; diff --git a/OsmAnd/src/net/osmand/plus/quickaction/SwitchableAction.java b/OsmAnd/src/net/osmand/plus/quickaction/SwitchableAction.java index abad8a7432..3c8dcd9464 100644 --- a/OsmAnd/src/net/osmand/plus/quickaction/SwitchableAction.java +++ b/OsmAnd/src/net/osmand/plus/quickaction/SwitchableAction.java @@ -20,7 +20,7 @@ import android.widget.TextView; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.dialogs.SelectMapViewQuickActionsBottomSheet; -import net.osmand.plus.profiles.ReorderItemTouchHelperCallback; +import net.osmand.plus.views.controls.ReorderItemTouchHelperCallback; import java.util.ArrayList; import java.util.Collections; diff --git a/OsmAnd/src/net/osmand/plus/profiles/ReorderItemTouchHelperCallback.java b/OsmAnd/src/net/osmand/plus/views/controls/ReorderItemTouchHelperCallback.java similarity index 97% rename from OsmAnd/src/net/osmand/plus/profiles/ReorderItemTouchHelperCallback.java rename to OsmAnd/src/net/osmand/plus/views/controls/ReorderItemTouchHelperCallback.java index c6b72e413a..832f7a10fa 100644 --- a/OsmAnd/src/net/osmand/plus/profiles/ReorderItemTouchHelperCallback.java +++ b/OsmAnd/src/net/osmand/plus/views/controls/ReorderItemTouchHelperCallback.java @@ -1,4 +1,4 @@ -package net.osmand.plus.profiles; +package net.osmand.plus.views.controls; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.helper.ItemTouchHelper;