From fac7ae0fdfff1ce2864e2d5a7cb1cffd26585385 Mon Sep 17 00:00:00 2001 From: Domagalski Date: Sun, 6 Jan 2019 15:36:49 +0100 Subject: [PATCH] bottom nav focus fixed --- .idea/misc.xml | 2 +- .../java/com/uam/wmi/findmytutor/activity/BaseActivity.java | 3 +-- .../com/uam/wmi/findmytutor/activity/SharingFragment.java | 6 +++--- .../com/uam/wmi/findmytutor/activity/UsersListFragment.java | 1 + 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index b0c7b20..dc44dda 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -29,7 +29,7 @@ - + diff --git a/app/src/main/java/com/uam/wmi/findmytutor/activity/BaseActivity.java b/app/src/main/java/com/uam/wmi/findmytutor/activity/BaseActivity.java index 31d11e0..4183098 100644 --- a/app/src/main/java/com/uam/wmi/findmytutor/activity/BaseActivity.java +++ b/app/src/main/java/com/uam/wmi/findmytutor/activity/BaseActivity.java @@ -266,7 +266,6 @@ public abstract class BaseActivity setUpNav(); actionBarDrawerToggle.syncState(); - } @Override @@ -423,7 +422,7 @@ public abstract class BaseActivity } - private void updateNavigationBarState() { + public void updateNavigationBarState() { int actionId = getNavigationMenuItemId(); selectBottomNavigationBarItem(actionId); } diff --git a/app/src/main/java/com/uam/wmi/findmytutor/activity/SharingFragment.java b/app/src/main/java/com/uam/wmi/findmytutor/activity/SharingFragment.java index 8882bfd..a6b41f8 100644 --- a/app/src/main/java/com/uam/wmi/findmytutor/activity/SharingFragment.java +++ b/app/src/main/java/com/uam/wmi/findmytutor/activity/SharingFragment.java @@ -5,6 +5,7 @@ import android.app.AlertDialog; import android.app.FragmentTransaction; import android.content.DialogInterface; import android.content.SharedPreferences; +import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.preference.ListPreference; import android.preference.Preference; @@ -269,11 +270,10 @@ public class SharingFragment extends PreferenceFragment implements SharedPrefere FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction(); fragmentTransaction.hide(SharingFragment.this); fragmentTransaction.commit(); + ((MapActivity) getActivity()).updateNavigationBarState(); return true; }); - statusSwitch.setOnPreferenceChangeListener((preference, newValue) -> { - return true; - }); + statusSwitch.setOnPreferenceChangeListener((preference, newValue) -> true); /** Status list change listener **/ statusList.setOnPreferenceChangeListener((preference, newValue) -> { ListPreference lp = (ListPreference) preference; diff --git a/app/src/main/java/com/uam/wmi/findmytutor/activity/UsersListFragment.java b/app/src/main/java/com/uam/wmi/findmytutor/activity/UsersListFragment.java index c0f9ac0..3c7028a 100644 --- a/app/src/main/java/com/uam/wmi/findmytutor/activity/UsersListFragment.java +++ b/app/src/main/java/com/uam/wmi/findmytutor/activity/UsersListFragment.java @@ -231,6 +231,7 @@ public class UsersListFragment extends Fragment { List list = new ArrayList(); list.add(user); ((MapActivity) getActivity()).filterMarkers(list); + ((MapActivity) getActivity()).updateNavigationBarState(); }); } alertDialog = alertDialogBuilderUserInput.create(); -- 2.20.1