diff options
author | cyBerta <cyberta@riseup.net> | 2021-11-25 14:16:05 +0100 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2021-11-25 14:16:05 +0100 |
commit | 5e457e95683241501846d0d0403533a293307a88 (patch) | |
tree | 0df9926e6c4766f4b22285f8da413f514251d70c /app/src/main/java/se/leap | |
parent | 31a7b66d7c6c04a7ee7cccbe5d6ed059cd3a054e (diff) |
ensure advanced settings subtitle is shown after orientation change or after moving back from sub fragment
Diffstat (limited to 'app/src/main/java/se/leap')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java | 1 | ||||
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java | 13 |
2 files changed, 13 insertions, 1 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java index e9881094..cc3ecca6 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java @@ -275,7 +275,6 @@ public class NavigationDrawerFragment extends Fragment implements SharedPreferen advancedSettings.setOnClickListener(v -> { closeDrawer(); Fragment fragment = new SettingsFragment(); - setActionBarTitle(advanced_settings); fragmentManager.replace(R.id.main_container, fragment, MainActivity.TAG); }); } diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java index 7157d1cc..ae2a1052 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java @@ -10,6 +10,9 @@ import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.annotation.StringRes; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.DialogFragment; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentTransaction; @@ -30,6 +33,7 @@ import se.leap.bitmaskclient.firewall.FirewallManager; import static android.content.Context.MODE_PRIVATE; import static android.view.View.GONE; import static android.view.View.VISIBLE; +import static se.leap.bitmaskclient.R.string.advanced_settings; import static se.leap.bitmaskclient.base.MainActivity.ACTION_SHOW_VPN_FRAGMENT; import static se.leap.bitmaskclient.base.models.Constants.SHARED_PREFERENCES; import static se.leap.bitmaskclient.base.models.Constants.USE_BRIDGES; @@ -70,6 +74,7 @@ public class SettingsFragment extends Fragment implements SharedPreferences.OnSh initUseSnowflakeEntry(view); initFirewallEntry(view); initTetheringEntry(view); + setActionBarTitle(advanced_settings); return view; } @@ -242,4 +247,12 @@ public class SettingsFragment extends Fragment implements SharedPreferences.OnSh initFirewallEntry(getView()); } } + + private void setActionBarTitle(@StringRes int stringId) { + ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar(); + if (actionBar != null) { + actionBar.setSubtitle(stringId); + } + } + } |