mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 04:35:57 +00:00
Simplification
This commit is contained in:
parent
8036319e6f
commit
a22fcc9064
3 changed files with 10 additions and 33 deletions
|
@ -917,15 +917,8 @@ public class FragmentCompose extends FragmentBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void check() {
|
private void check() {
|
||||||
Activity activity = getActivity();
|
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
||||||
if (activity != null)
|
checkInternet();
|
||||||
activity.runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
|
||||||
checkInternet();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2734,15 +2734,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||||
}
|
}
|
||||||
|
|
||||||
private void check() {
|
private void check() {
|
||||||
Activity activity = getActivity();
|
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
||||||
if (activity != null)
|
adapter.checkInternet();
|
||||||
activity.runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
|
||||||
adapter.checkInternet();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -277,21 +277,12 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
|
||||||
};
|
};
|
||||||
|
|
||||||
private void showConnectionType() {
|
private void showConnectionType() {
|
||||||
FragmentActivity activity = getActivity();
|
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {
|
||||||
if (activity == null)
|
ConnectionHelper.NetworkState networkState = ConnectionHelper.getNetworkState(getContext());
|
||||||
return;
|
|
||||||
|
|
||||||
activity.runOnUiThread(new Runnable() {
|
tvConnectionType.setText(networkState.isUnmetered() ? R.string.title_legend_unmetered : R.string.title_legend_metered);
|
||||||
@Override
|
tvConnectionType.setVisibility(networkState.isConnected() ? View.VISIBLE : View.GONE);
|
||||||
public void run() {
|
tvConnectionRoaming.setVisibility(networkState.isRoaming() ? View.VISIBLE : View.GONE);
|
||||||
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {
|
}
|
||||||
ConnectionHelper.NetworkState networkState = ConnectionHelper.getNetworkState(getContext());
|
|
||||||
|
|
||||||
tvConnectionType.setText(networkState.isUnmetered() ? R.string.title_legend_unmetered : R.string.title_legend_metered);
|
|
||||||
tvConnectionType.setVisibility(networkState.isConnected() ? View.VISIBLE : View.GONE);
|
|
||||||
tvConnectionRoaming.setVisibility(networkState.isRoaming() ? View.VISIBLE : View.GONE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue