mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-28 20:06:29 +01:00
Refactoring
This commit is contained in:
@@ -556,6 +556,8 @@ public class FragmentAccount extends FragmentBase {
|
||||
grpFolders.setVisibility(View.GONE);
|
||||
grpError.setVisibility(View.GONE);
|
||||
|
||||
pbWait.setVisibility(VISIBLE);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -1406,6 +1408,17 @@ public class FragmentAccount extends FragmentBase {
|
||||
args.putLong("id", copy < 0 ? id : copy);
|
||||
|
||||
new SimpleTask<EntityAccount>() {
|
||||
@Override
|
||||
protected void onPreExecute(Bundle args) {
|
||||
pbWait.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Bundle args) {
|
||||
// Consider previous check/save/delete as cancelled
|
||||
pbWait.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected EntityAccount onExecute(Context context, Bundle args) {
|
||||
long id = args.getLong("id");
|
||||
@@ -1535,9 +1548,6 @@ public class FragmentAccount extends FragmentBase {
|
||||
cbOnDemand.setEnabled(cbSynchronize.isChecked());
|
||||
cbPrimary.setEnabled(cbSynchronize.isChecked());
|
||||
|
||||
// Consider previous check/save/delete as cancelled
|
||||
pbWait.setVisibility(View.GONE);
|
||||
|
||||
if (copy < 0 && account != null) {
|
||||
args.putLong("account", account.id);
|
||||
|
||||
|
||||
@@ -138,6 +138,7 @@ public class FragmentAnswer extends FragmentBase {
|
||||
// Initialize
|
||||
grpReady.setVisibility(View.GONE);
|
||||
style_bar.setVisibility(View.GONE);
|
||||
|
||||
pbWait.setVisibility(View.VISIBLE);
|
||||
|
||||
return view;
|
||||
@@ -151,6 +152,16 @@ public class FragmentAnswer extends FragmentBase {
|
||||
args.putLong("id", copy < 0 ? id : copy);
|
||||
|
||||
new SimpleTask<EntityAnswer>() {
|
||||
@Override
|
||||
protected void onPreExecute(Bundle args) {
|
||||
pbWait.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Bundle args) {
|
||||
pbWait.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected EntityAnswer onExecute(Context context, Bundle args) {
|
||||
long id = args.getLong("id");
|
||||
@@ -176,7 +187,6 @@ public class FragmentAnswer extends FragmentBase {
|
||||
|
||||
bottom_navigation.findViewById(R.id.action_delete).setVisibility(answer == null ? View.GONE : View.VISIBLE);
|
||||
|
||||
pbWait.setVisibility(View.GONE);
|
||||
grpReady.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
@@ -214,6 +214,7 @@ public class FragmentFolder extends FragmentBase {
|
||||
btnSave.setEnabled(false);
|
||||
pbSave.setVisibility(View.GONE);
|
||||
tvInboxRootHint.setVisibility(View.GONE);
|
||||
|
||||
pbWait.setVisibility(View.VISIBLE);
|
||||
|
||||
return view;
|
||||
@@ -227,6 +228,17 @@ public class FragmentFolder extends FragmentBase {
|
||||
args.putLong("id", id);
|
||||
|
||||
new SimpleTask<EntityFolder>() {
|
||||
@Override
|
||||
protected void onPreExecute(Bundle args) {
|
||||
pbWait.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Bundle args) {
|
||||
// Consider previous save as cancelled
|
||||
pbWait.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected EntityFolder onExecute(Context context, Bundle args) {
|
||||
long id = args.getLong("id");
|
||||
@@ -286,9 +298,6 @@ public class FragmentFolder extends FragmentBase {
|
||||
tvInboxRootHint.setVisibility(folder == null && parent == null ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
// Consider previous save as cancelled
|
||||
pbWait.setVisibility(View.GONE);
|
||||
|
||||
Helper.setViewsEnabled(view, true);
|
||||
|
||||
boolean always = (!ondemand && (pollInterval == 0 || exempted));
|
||||
|
||||
@@ -507,6 +507,8 @@ public class FragmentIdentity extends FragmentBase {
|
||||
grpAdvanced.setVisibility(View.GONE);
|
||||
grpError.setVisibility(View.GONE);
|
||||
|
||||
pbWait.setVisibility(View.VISIBLE);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -1052,6 +1054,16 @@ public class FragmentIdentity extends FragmentBase {
|
||||
args.putLong("id", copy < 0 ? id : copy);
|
||||
|
||||
new SimpleTask<EntityIdentity>() {
|
||||
@Override
|
||||
protected void onPreExecute(Bundle args) {
|
||||
pbWait.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Bundle args) {
|
||||
pbWait.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected EntityIdentity onExecute(Context context, Bundle args) {
|
||||
long id = args.getLong("id");
|
||||
@@ -1146,8 +1158,6 @@ public class FragmentIdentity extends FragmentBase {
|
||||
|
||||
cbPrimary.setEnabled(cbSynchronize.isChecked());
|
||||
|
||||
pbWait.setVisibility(View.GONE);
|
||||
|
||||
new SimpleTask<List<EntityAccount>>() {
|
||||
@Override
|
||||
protected List<EntityAccount> onExecute(Context context, Bundle args) {
|
||||
|
||||
@@ -510,6 +510,7 @@ public class FragmentRule extends FragmentBase {
|
||||
grpAnswer.setVisibility(View.GONE);
|
||||
grpTts.setVisibility(View.GONE);
|
||||
grpAutomation.setVisibility(View.GONE);
|
||||
|
||||
pbWait.setVisibility(View.VISIBLE);
|
||||
|
||||
return view;
|
||||
@@ -744,6 +745,16 @@ public class FragmentRule extends FragmentBase {
|
||||
rargs.putString("subject", getArguments().getString("subject"));
|
||||
|
||||
new SimpleTask<TupleRuleEx>() {
|
||||
@Override
|
||||
protected void onPreExecute(Bundle args) {
|
||||
pbWait.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Bundle args) {
|
||||
pbWait.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TupleRuleEx onExecute(Context context, Bundle args) {
|
||||
long id = args.getLong("id");
|
||||
@@ -894,7 +905,6 @@ public class FragmentRule extends FragmentBase {
|
||||
grpReady.setVisibility(View.VISIBLE);
|
||||
bottom_navigation.findViewById(R.id.action_delete).setVisibility(id < 0 ? View.GONE : View.VISIBLE);
|
||||
bottom_navigation.setVisibility(View.VISIBLE);
|
||||
pbWait.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user