mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-01 22:56:33 +02:00
Keep network state
This commit is contained in:
@@ -687,11 +687,10 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||
@Override
|
||||
public void run() {
|
||||
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED)) {
|
||||
Boolean metered = Helper.isMetered(getContext(), false);
|
||||
Helper.NetworkState networkState = Helper.getNetworkState(getContext());
|
||||
|
||||
tvConnectionType.setVisibility(metered == null ? View.GONE : View.VISIBLE);
|
||||
if (metered != null)
|
||||
tvConnectionType.setText(metered ? R.string.title_legend_metered : R.string.title_legend_unmetered);
|
||||
tvConnectionType.setText(networkState.isUnmetered() ? R.string.title_legend_unmetered : R.string.title_legend_metered);
|
||||
tvConnectionType.setVisibility(networkState.isConnected() ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user