diff options
author | cyBerta <cyberta@riseup.net> | 2023-10-31 23:57:41 +0100 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2023-10-31 23:57:41 +0100 |
commit | bf7168d1faf1b8c3841cbb006600751cdd521f04 (patch) | |
tree | ea76be319ecdccf4b7da86f12bc95c62e7fa4e3e /app/src/main | |
parent | f89b03b587931130e495cf3082086975a2265582 (diff) |
disable location button in EipFragment in case there's only 1 Location available
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java index c500b55b..f4e09e62 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java @@ -171,11 +171,16 @@ public class EipFragment extends Fragment implements Observer { } restoreFromSavedInstance(savedInstanceState); - locationButton.setOnClickListener(v -> { + if (provider != null && provider.hasGatewaysInDifferentLocations()) { + locationButton.setOnClickListener(v -> { FragmentManagerEnhanced fragmentManager = new FragmentManagerEnhanced(getActivity().getSupportFragmentManager()); Fragment fragment = new GatewaySelectionFragment(); fragmentManager.replace(R.id.main_container, fragment, MainActivity.TAG); - }); + }); + locationButton.setEnabled(true); + } else { + locationButton.setEnabled(false); + } mainButton.setOnClickListener(v -> { handleIcon(); |