diff options
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java | 9 | ||||
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java | 47 |
2 files changed, 33 insertions, 23 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 409efcf0..a2fb2683 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 @@ -227,6 +227,12 @@ public class EipFragment extends Fragment implements Observer { public void onPause() { super.onPause(); Log.d(TAG, "onPause"); + if (stateView.getDrawable() instanceof Animatable) { + Animatable animatedDrawable = (Animatable) stateView.getDrawable(); + if (animatedDrawable.isRunning()) { + animatedDrawable.stop(); + } + } } @Override @@ -575,6 +581,9 @@ public class EipFragment extends Fragment implements Observer { @Override public void onAnimationEnd(Drawable drawable) { super.onAnimationEnd(drawable); + if (!isResumed()) { + return; + } if (pendingAnimationState != 0) { int newAnimationRes = pendingAnimationState; pendingAnimationState = 0; 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 d57d725e..40bc256c 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 @@ -228,14 +228,15 @@ public class SettingsFragment extends Fragment implements SharedPreferences.OnSh } private void initGatewayPinningEntry(View rootView) { + IconTextEntry gatewayPinning = rootView.findViewById(R.id.gateway_pinning); if (!BuildConfig.BUILD_TYPE.equals("debug")) { + gatewayPinning.setVisibility(GONE); return; } Context context = this.getContext(); if (context == null) { return; } - IconTextEntry gatewayPinning = rootView.findViewById(R.id.gateway_pinning); String pinnedGateway = PreferenceHelper.getPinnedGateway(rootView.getContext()); gatewayPinning.setSubtitle(pinnedGateway != null ? pinnedGateway : "Connect to a specific Gateway for debugging purposes"); @@ -264,30 +265,30 @@ public class SettingsFragment extends Fragment implements SharedPreferences.OnSh public void initObfuscationPinningEntry(View rootView) { IconSwitchEntry obfuscationPinning = rootView.findViewById(R.id.obfuscation_proxy_pinning); - if (useObfsVpn()) { - obfuscationPinning.setVisibility(VISIBLE); - boolean useBridges = getUseBridges(getContext()); - obfuscationPinning.setEnabled(useBridges); - obfuscationPinning.setSubtitle(useBridges ? "Connect to a specific obfuscation proxy for debugging purposes" : "Enable Bridges to use this option"); - obfuscationPinning.setChecked(useObfuscationPinning(getContext())); - obfuscationPinning.setOnCheckedChangeListener((buttonView, isChecked) -> { - if (!buttonView.isPressed()) { - return; - } - if (!isChecked) { - setUseObfuscationPinning(getContext(), false); - } else { - showObfuscationPinningDialog(); - } - }); - obfuscationPinning.setOnClickListener(v -> { - if (obfuscationPinning.isChecked()) { - showObfuscationPinningDialog(); - } - }); - } else { + if (!BuildConfig.BUILD_TYPE.equals("debug") || !useObfsVpn()) { obfuscationPinning.setVisibility(GONE); + return; } + obfuscationPinning.setVisibility(VISIBLE); + boolean useBridges = getUseBridges(getContext()); + obfuscationPinning.setEnabled(useBridges); + obfuscationPinning.setSubtitle(useBridges ? "Connect to a specific obfuscation proxy for debugging purposes" : "Enable Bridges to use this option"); + obfuscationPinning.setChecked(useObfuscationPinning(getContext())); + obfuscationPinning.setOnCheckedChangeListener((buttonView, isChecked) -> { + if (!buttonView.isPressed()) { + return; + } + if (!isChecked) { + setUseObfuscationPinning(getContext(), false); + } else { + showObfuscationPinningDialog(); + } + }); + obfuscationPinning.setOnClickListener(v -> { + if (obfuscationPinning.isChecked()) { + showObfuscationPinningDialog(); + } + }); } public void showObfuscationPinningDialog() { |