diff --git a/OsmAnd/res/layout/profile_list_item.xml b/OsmAnd/res/layout/profile_list_item.xml
index eec9ff448d..cf08529e6d 100644
--- a/OsmAnd/res/layout/profile_list_item.xml
+++ b/OsmAnd/res/layout/profile_list_item.xml
@@ -1,104 +1,96 @@
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/profile_settings"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="?attr/selectableItemBackground"
+ android:descendantFocusability="blocksDescendants"
+ android:gravity="center"
+ android:orientation="horizontal">
-
+
-
+
+
-
+
-
+
-
+
-
-
+
-
- android:orientation="horizontal">
+
-
+
-
-
+
+
-
+
-
-
-
-
+
\ No newline at end of file
diff --git a/OsmAnd/res/values/sizes.xml b/OsmAnd/res/values/sizes.xml
index 2b6b24f3b3..3cf69a10d3 100644
--- a/OsmAnd/res/values/sizes.xml
+++ b/OsmAnd/res/values/sizes.xml
@@ -343,9 +343,7 @@
3dp
4dp
-
64dp
- 24dp
18dp
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/profiles/AppModesBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/profiles/AppModesBottomSheetDialogFragment.java
index f9715e1e5e..8a676783c2 100644
--- a/OsmAnd/src/net/osmand/plus/profiles/AppModesBottomSheetDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/profiles/AppModesBottomSheetDialogFragment.java
@@ -23,11 +23,12 @@ import java.util.List;
import java.util.Set;
import net.osmand.AndroidUtils;
import net.osmand.plus.ApplicationMode;
+import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.base.MenuBottomSheetDialogFragment;
import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem;
import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem;
-import net.osmand.plus.profiles.ProfileMenuAdapter.ProfileListener;
+import net.osmand.plus.profiles.ProfileMenuAdapter.ProfileMenuAdapterListener;
import net.osmand.util.Algorithms;
public class AppModesBottomSheetDialogFragment extends MenuBottomSheetDialogFragment {
@@ -40,7 +41,7 @@ public class AppModesBottomSheetDialogFragment extends MenuBottomSheetDialogFrag
private ProfileMenuAdapter adapter;
private RecyclerView recyclerView;
- private ProfileListener listener;
+ private ProfileMenuAdapterListener listener;
private UpdateMapRouteMenuListener updateMapRouteMenuListener;
@Override
@@ -55,7 +56,7 @@ public class AppModesBottomSheetDialogFragment extends MenuBottomSheetDialogFrag
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup parent,
Bundle savedInstanceState) {
themeRes = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme;
- adapter = new ProfileMenuAdapter(allModes, selectedModes, getMyApplication(), true);
+ adapter = new ProfileMenuAdapter(allModes, selectedModes, getMyApplication(), getString(R.string.shared_string_manage));
recyclerView = new RecyclerView(getContext());
recyclerView = (RecyclerView) View
.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.recyclerview, null);
@@ -75,27 +76,37 @@ public class AppModesBottomSheetDialogFragment extends MenuBottomSheetDialogFrag
@Override
public void onResume() {
super.onResume();
- listener = new ProfileListener() {
- @Override
- public void changeProfileStatus(ApplicationMode item, boolean isSelected) {
- if (isSelected) {
- selectedModes.add(item);
- } else {
- selectedModes.remove(item);
+ if (listener == null) {
+ listener = new ProfileMenuAdapterListener() {
+ @Override
+ public void onProfileSelected(ApplicationMode item, boolean selected) {
+ if (selected) {
+ selectedModes.add(item);
+ } else {
+ selectedModes.remove(item);
+ }
+ ApplicationMode.changeProfileStatus(item, selected, getMyApplication());
}
- ApplicationMode.changeProfileStatus(item, isSelected, getMyApplication());
- }
- @Override
- public void editProfile(ApplicationMode item) {
- Intent intent = new Intent(getActivity(), EditProfileActivity.class);
- intent.putExtra(PROFILE_STRING_KEY, item.getStringKey());
- if (!Algorithms.isEmpty(item.getUserProfileName())) {
- intent.putExtra(IS_USER_PROFILE, true);
+ @Override
+ public void onProfilePressed(ApplicationMode item) {
+ Intent intent = new Intent(getActivity(), EditProfileActivity.class);
+ intent.putExtra(PROFILE_STRING_KEY, item.getStringKey());
+ if (!Algorithms.isEmpty(item.getUserProfileName())) {
+ intent.putExtra(IS_USER_PROFILE, true);
+ }
+ startActivity(intent);
}
- startActivity(intent);
- }
- };
+
+ @Override
+ public void onButtonPressed() {
+ OsmandApplication app = requiredMyApplication();
+ Intent intent = new Intent(app, SettingsProfileActivity.class);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ app.startActivity(intent);
+ }
+ };
+ }
adapter.setListener(listener);
allModes = ApplicationMode.allPossibleValues();
allModes.remove(ApplicationMode.DEFAULT);
diff --git a/OsmAnd/src/net/osmand/plus/profiles/ProfileMenuAdapter.java b/OsmAnd/src/net/osmand/plus/profiles/ProfileMenuAdapter.java
index 950c87d56b..eae1caffc6 100644
--- a/OsmAnd/src/net/osmand/plus/profiles/ProfileMenuAdapter.java
+++ b/OsmAnd/src/net/osmand/plus/profiles/ProfileMenuAdapter.java
@@ -1,14 +1,17 @@
package net.osmand.plus.profiles;
-import android.content.Intent;
import android.support.annotation.ColorRes;
import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SwitchCompat;
import android.view.LayoutInflater;
+import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
+import android.widget.CompoundButton;
+import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
@@ -26,22 +29,25 @@ public class ProfileMenuAdapter extends RecyclerView.Adapter
private List