diff options
author | cyBerta <cyberta@riseup.net> | 2024-01-17 15:16:30 +0100 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2024-01-17 15:16:30 +0100 |
commit | a7725722c35136c42c9acc242a50588e1fac8bb0 (patch) | |
tree | e32004b7f3eba196078537e5e5e74924ec9f08b8 /app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java | |
parent | 32578d46bea3e54cdd3021b0dd3fac4fb724267a (diff) |
replace deprectated Observer and Observables by PropertyChangeListener and PropertyChangeSupport
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java | 10 |
1 files changed, 5 insertions, 5 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 60c21c40..e74d70a2 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 @@ -53,8 +53,8 @@ import androidx.core.view.GravityCompat; import androidx.drawerlayout.widget.DrawerLayout; import androidx.fragment.app.Fragment; -import java.util.Observable; -import java.util.Observer; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; import se.leap.bitmaskclient.BuildConfig; import se.leap.bitmaskclient.R; @@ -74,7 +74,7 @@ import se.leap.bitmaskclient.tethering.TetheringObservable; * See the <a href="https://developer.android.com/design/patterns/navigation-drawer.html#Interaction"> * design guidelines</a> for a complete explanation of the behaviors implemented here. */ -public class NavigationDrawerFragment extends Fragment implements SharedPreferences.OnSharedPreferenceChangeListener, Observer { +public class NavigationDrawerFragment extends Fragment implements SharedPreferences.OnSharedPreferenceChangeListener, PropertyChangeListener { /** * Per the design guidelines, you should show the drawer on launch until the user manually @@ -444,8 +444,8 @@ public class NavigationDrawerFragment extends Fragment implements SharedPreferen } @Override - public void update(Observable o, Object arg) { - if (o instanceof TetheringObservable || o instanceof EipStatus) { + public void propertyChange(PropertyChangeEvent evt) { + if (EipStatus.PROPERTY_CHANGE.equals(evt.getPropertyName()) || TetheringObservable.PROPERTY_CHANGE.equals(evt.getPropertyName())) { try { getActivity().runOnUiThread(() -> enableSaveBatteryEntry(!TetheringObservable.getInstance().getTetheringState().isVpnTetheringRunning())); |