From 708c6178733e4de70dffbe31398d0895e2e333c7 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 5 Nov 2018 08:29:21 +0000 Subject: [PATCH] Use ContentLoadingProgressBar --- .../eu/faircode/email/AdapterMessage.java | 26 +++++++++---------- .../eu/faircode/email/FragmentAccount.java | 26 +++++++++---------- .../eu/faircode/email/FragmentAccounts.java | 8 +++--- .../eu/faircode/email/FragmentAnswer.java | 8 +++--- .../eu/faircode/email/FragmentAnswers.java | 8 +++--- .../eu/faircode/email/FragmentCompose.java | 8 +++--- .../eu/faircode/email/FragmentFolder.java | 20 +++++++------- .../eu/faircode/email/FragmentFolders.java | 8 +++--- .../eu/faircode/email/FragmentIdentities.java | 8 +++--- .../eu/faircode/email/FragmentIdentity.java | 16 ++++++------ .../java/eu/faircode/email/FragmentLogs.java | 8 +++--- .../eu/faircode/email/FragmentMessages.java | 16 ++++++------ .../eu/faircode/email/FragmentOperations.java | 8 +++--- app/src/main/res/layout/fragment_account.xml | 6 ++--- app/src/main/res/layout/fragment_accounts.xml | 2 +- app/src/main/res/layout/fragment_answer.xml | 2 +- app/src/main/res/layout/fragment_answers.xml | 2 +- app/src/main/res/layout/fragment_compose.xml | 2 +- app/src/main/res/layout/fragment_folder.xml | 4 +-- app/src/main/res/layout/fragment_folders.xml | 2 +- .../main/res/layout/fragment_identities.xml | 2 +- app/src/main/res/layout/fragment_identity.xml | 4 +-- app/src/main/res/layout/fragment_logs.xml | 2 +- app/src/main/res/layout/fragment_messages.xml | 2 +- .../main/res/layout/fragment_operations.xml | 2 +- .../main/res/layout/item_message_compact.xml | 6 ++--- .../main/res/layout/item_message_normal.xml | 6 ++--- 27 files changed, 106 insertions(+), 106 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 69d9339653..f17a66ff1f 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -59,7 +59,6 @@ import android.view.ViewGroup; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; -import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; @@ -92,6 +91,7 @@ import androidx.annotation.Nullable; import androidx.appcompat.widget.PopupMenu; import androidx.constraintlayout.widget.Group; import androidx.core.content.ContextCompat; +import androidx.core.widget.ContentLoadingProgressBar; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentTransaction; import androidx.lifecycle.LifecycleOwner; @@ -146,7 +146,7 @@ public class AdapterMessage extends PagedListAdapter 0 && show_expanded ? View.VISIBLE : View.GONE); grpExpanded.setVisibility(viewType == ViewType.THREAD && show_expanded ? View.VISIBLE : View.GONE); @@ -436,7 +436,7 @@ public class AdapterMessage extends PagedListAdapter>() { diff --git a/app/src/main/java/eu/faircode/email/FragmentAccounts.java b/app/src/main/java/eu/faircode/email/FragmentAccounts.java index 5584835da4..1c7db394dc 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAccounts.java +++ b/app/src/main/java/eu/faircode/email/FragmentAccounts.java @@ -23,7 +23,6 @@ import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.ProgressBar; import com.google.android.material.floatingactionbutton.FloatingActionButton; @@ -33,6 +32,7 @@ import java.util.List; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.constraintlayout.widget.Group; +import androidx.core.widget.ContentLoadingProgressBar; import androidx.fragment.app.FragmentTransaction; import androidx.lifecycle.Observer; import androidx.recyclerview.widget.LinearLayoutManager; @@ -40,7 +40,7 @@ import androidx.recyclerview.widget.RecyclerView; public class FragmentAccounts extends FragmentEx { private RecyclerView rvAccount; - private ProgressBar pbWait; + private ContentLoadingProgressBar pbWait; private Group grpReady; private FloatingActionButton fab; @@ -81,7 +81,7 @@ public class FragmentAccounts extends FragmentEx { // Initialize grpReady.setVisibility(View.GONE); - pbWait.setVisibility(View.VISIBLE); + pbWait.show(); return view; } @@ -99,7 +99,7 @@ public class FragmentAccounts extends FragmentEx { adapter.set(accounts); - pbWait.setVisibility(View.GONE); + pbWait.hide(); grpReady.setVisibility(View.VISIBLE); } }); diff --git a/app/src/main/java/eu/faircode/email/FragmentAnswer.java b/app/src/main/java/eu/faircode/email/FragmentAnswer.java index e3413a6ab6..317ee37b4f 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAnswer.java +++ b/app/src/main/java/eu/faircode/email/FragmentAnswer.java @@ -27,13 +27,13 @@ import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; -import android.widget.ProgressBar; import com.google.android.material.bottomnavigation.BottomNavigationView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.constraintlayout.widget.Group; +import androidx.core.widget.ContentLoadingProgressBar; import androidx.lifecycle.Observer; public class FragmentAnswer extends FragmentEx { @@ -41,7 +41,7 @@ public class FragmentAnswer extends FragmentEx { private EditText etName; private EditText etText; private BottomNavigationView bottom_navigation; - private ProgressBar pbWait; + private ContentLoadingProgressBar pbWait; private Group grpReady; private long id = -1; @@ -85,7 +85,7 @@ public class FragmentAnswer extends FragmentEx { // Initialize grpReady.setVisibility(View.GONE); - pbWait.setVisibility(View.VISIBLE); + pbWait.show(); return view; } @@ -101,7 +101,7 @@ public class FragmentAnswer extends FragmentEx { etText.setText(answer == null ? null : Html.fromHtml(answer.text)); bottom_navigation.findViewById(R.id.action_delete).setVisibility(answer == null ? View.GONE : View.VISIBLE); - pbWait.setVisibility(View.GONE); + pbWait.hide(); grpReady.setVisibility(View.VISIBLE); } }); diff --git a/app/src/main/java/eu/faircode/email/FragmentAnswers.java b/app/src/main/java/eu/faircode/email/FragmentAnswers.java index c6761b872b..552323308c 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAnswers.java +++ b/app/src/main/java/eu/faircode/email/FragmentAnswers.java @@ -23,7 +23,6 @@ import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.ProgressBar; import com.google.android.material.floatingactionbutton.FloatingActionButton; @@ -32,6 +31,7 @@ import java.util.List; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.constraintlayout.widget.Group; +import androidx.core.widget.ContentLoadingProgressBar; import androidx.fragment.app.FragmentTransaction; import androidx.lifecycle.Observer; import androidx.recyclerview.widget.LinearLayoutManager; @@ -39,7 +39,7 @@ import androidx.recyclerview.widget.RecyclerView; public class FragmentAnswers extends FragmentEx { private RecyclerView rvAnswer; - private ProgressBar pbWait; + private ContentLoadingProgressBar pbWait; private Group grpReady; private FloatingActionButton fab; @@ -78,7 +78,7 @@ public class FragmentAnswers extends FragmentEx { // Initialize grpReady.setVisibility(View.GONE); - pbWait.setVisibility(View.VISIBLE); + pbWait.show(); return view; } @@ -92,7 +92,7 @@ public class FragmentAnswers extends FragmentEx { @Override public void onChanged(List answers) { adapter.set(answers); - pbWait.setVisibility(View.GONE); + pbWait.hide(); grpReady.setVisibility(View.VISIBLE); } }); diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index b18d528bba..24f6722016 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -58,7 +58,6 @@ import android.widget.EditText; import android.widget.FilterQueryProvider; import android.widget.ImageView; import android.widget.MultiAutoCompleteTextView; -import android.widget.ProgressBar; import android.widget.Spinner; import android.widget.TextView; import android.widget.Toast; @@ -97,6 +96,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.constraintlayout.widget.Group; import androidx.core.content.ContextCompat; +import androidx.core.widget.ContentLoadingProgressBar; import androidx.cursoradapter.widget.SimpleCursorAdapter; import androidx.fragment.app.FragmentTransaction; import androidx.lifecycle.Lifecycle; @@ -120,7 +120,7 @@ public class FragmentCompose extends FragmentEx { private RecyclerView rvAttachment; private EditText etBody; private BottomNavigationView bottom_navigation; - private ProgressBar pbWait; + private ContentLoadingProgressBar pbWait; private Group grpHeader; private Group grpAddresses; private Group grpAttachments; @@ -228,7 +228,7 @@ public class FragmentCompose extends FragmentEx { grpAttachments.setVisibility(View.GONE); etBody.setVisibility(View.GONE); bottom_navigation.setVisibility(View.GONE); - pbWait.setVisibility(View.VISIBLE); + pbWait.show(); getActivity().invalidateOptionsMenu(); spFrom.setEnabled(false); @@ -1242,7 +1242,7 @@ public class FragmentCompose extends FragmentEx { getActivity().invalidateOptionsMenu(); Helper.setViewsEnabled(view, true); - pbWait.setVisibility(View.GONE); + pbWait.hide(); grpHeader.setVisibility(View.VISIBLE); grpAddresses.setVisibility("reply_all".equals(action) ? View.VISIBLE : View.GONE); etBody.setVisibility(View.VISIBLE); diff --git a/app/src/main/java/eu/faircode/email/FragmentFolder.java b/app/src/main/java/eu/faircode/email/FragmentFolder.java index fd06d95d94..abcc34a9ac 100644 --- a/app/src/main/java/eu/faircode/email/FragmentFolder.java +++ b/app/src/main/java/eu/faircode/email/FragmentFolder.java @@ -31,7 +31,6 @@ import android.widget.Button; import android.widget.CheckBox; import android.widget.EditText; import android.widget.ImageButton; -import android.widget.ProgressBar; import com.google.android.material.snackbar.Snackbar; import com.sun.mail.imap.IMAPFolder; @@ -44,6 +43,7 @@ import javax.mail.Session; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.core.widget.ContentLoadingProgressBar; import androidx.lifecycle.Observer; public class FragmentFolder extends FragmentEx { @@ -56,8 +56,8 @@ public class FragmentFolder extends FragmentEx { private EditText etAfter; private Button btnSave; private ImageButton ibDelete; - private ProgressBar pbSave; - private ProgressBar pbWait; + private ContentLoadingProgressBar pbSave; + private ContentLoadingProgressBar pbWait; private long id = -1; private long account = -1; @@ -97,7 +97,7 @@ public class FragmentFolder extends FragmentEx { Helper.setViewsEnabled(view, false); btnSave.setEnabled(false); ibDelete.setEnabled(false); - pbSave.setVisibility(View.VISIBLE); + pbSave.show(); Bundle args = new Bundle(); args.putLong("id", id); @@ -199,7 +199,7 @@ public class FragmentFolder extends FragmentEx { Helper.setViewsEnabled(view, true); btnSave.setEnabled(true); ibDelete.setEnabled(true); - pbSave.setVisibility(View.GONE); + pbSave.hide(); if (ex instanceof IllegalArgumentException) Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show(); @@ -221,7 +221,7 @@ public class FragmentFolder extends FragmentEx { Helper.setViewsEnabled(view, false); btnSave.setEnabled(false); ibDelete.setEnabled(false); - pbSave.setVisibility(View.VISIBLE); + pbSave.show(); Bundle args = new Bundle(); args.putLong("id", id); @@ -272,7 +272,7 @@ public class FragmentFolder extends FragmentEx { Helper.setViewsEnabled(view, true); btnSave.setEnabled(true); ibDelete.setEnabled(true); - pbSave.setVisibility(View.GONE); + pbSave.hide(); if (ex instanceof IllegalArgumentException) Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show(); @@ -292,8 +292,8 @@ public class FragmentFolder extends FragmentEx { btnSave.setEnabled(false); ibDelete.setEnabled(false); ibDelete.setVisibility(View.GONE); - pbSave.setVisibility(View.GONE); - pbWait.setVisibility(View.VISIBLE); + pbSave.hide(); + pbWait.show(); return view; } @@ -323,7 +323,7 @@ public class FragmentFolder extends FragmentEx { } // Consider previous save as cancelled - pbWait.setVisibility(View.GONE); + pbWait.hide(); Helper.setViewsEnabled(view, true); etRename.setEnabled(folder == null || EntityFolder.USER.equals(folder.type)); btnSave.setEnabled(true); diff --git a/app/src/main/java/eu/faircode/email/FragmentFolders.java b/app/src/main/java/eu/faircode/email/FragmentFolders.java index 949cac8dcd..642b773ef0 100644 --- a/app/src/main/java/eu/faircode/email/FragmentFolders.java +++ b/app/src/main/java/eu/faircode/email/FragmentFolders.java @@ -27,7 +27,6 @@ import android.view.View; import android.view.ViewGroup; import android.widget.CompoundButton; import android.widget.ImageButton; -import android.widget.ProgressBar; import android.widget.ToggleButton; import com.google.android.material.floatingactionbutton.FloatingActionButton; @@ -37,6 +36,7 @@ import java.util.List; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.constraintlayout.widget.Group; +import androidx.core.widget.ContentLoadingProgressBar; import androidx.fragment.app.FragmentTransaction; import androidx.lifecycle.Observer; import androidx.recyclerview.widget.LinearLayoutManager; @@ -46,7 +46,7 @@ public class FragmentFolders extends FragmentEx { private ImageButton ibHintActions; private ToggleButton tbShowHidden; private RecyclerView rvFolder; - private ProgressBar pbWait; + private ContentLoadingProgressBar pbWait; private Group grpHintActions; private Group grpReady; private FloatingActionButton fab; @@ -118,7 +118,7 @@ public class FragmentFolders extends FragmentEx { // Initialize tbShowHidden.setVisibility(View.GONE); grpReady.setVisibility(View.GONE); - pbWait.setVisibility(View.VISIBLE); + pbWait.show(); return view; } @@ -160,7 +160,7 @@ public class FragmentFolders extends FragmentEx { adapter.set(folders); - pbWait.setVisibility(View.GONE); + pbWait.hide(); grpReady.setVisibility(View.VISIBLE); } }); diff --git a/app/src/main/java/eu/faircode/email/FragmentIdentities.java b/app/src/main/java/eu/faircode/email/FragmentIdentities.java index 1ee1c477f3..5405cc782a 100644 --- a/app/src/main/java/eu/faircode/email/FragmentIdentities.java +++ b/app/src/main/java/eu/faircode/email/FragmentIdentities.java @@ -23,7 +23,6 @@ import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.ProgressBar; import com.google.android.material.floatingactionbutton.FloatingActionButton; @@ -33,6 +32,7 @@ import java.util.List; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.constraintlayout.widget.Group; +import androidx.core.widget.ContentLoadingProgressBar; import androidx.fragment.app.FragmentTransaction; import androidx.lifecycle.Observer; import androidx.recyclerview.widget.LinearLayoutManager; @@ -40,7 +40,7 @@ import androidx.recyclerview.widget.RecyclerView; public class FragmentIdentities extends FragmentEx { private RecyclerView rvIdentity; - private ProgressBar pbWait; + private ContentLoadingProgressBar pbWait; private Group grpReady; private FloatingActionButton fab; @@ -81,7 +81,7 @@ public class FragmentIdentities extends FragmentEx { // Initialize grpReady.setVisibility(View.GONE); - pbWait.setVisibility(View.VISIBLE); + pbWait.show(); return view; } @@ -96,7 +96,7 @@ public class FragmentIdentities extends FragmentEx { public void onChanged(@Nullable List identities) { adapter.set(identities == null ? new ArrayList() : identities); - pbWait.setVisibility(View.GONE); + pbWait.hide(); grpReady.setVisibility(View.VISIBLE); } }); diff --git a/app/src/main/java/eu/faircode/email/FragmentIdentity.java b/app/src/main/java/eu/faircode/email/FragmentIdentity.java index 150321f151..5809b9f93e 100644 --- a/app/src/main/java/eu/faircode/email/FragmentIdentity.java +++ b/app/src/main/java/eu/faircode/email/FragmentIdentity.java @@ -37,7 +37,6 @@ import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.EditText; import android.widget.ImageButton; -import android.widget.ProgressBar; import android.widget.ScrollView; import android.widget.Spinner; import android.widget.TextView; @@ -61,6 +60,7 @@ import javax.mail.Transport; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.constraintlayout.widget.Group; +import androidx.core.widget.ContentLoadingProgressBar; import androidx.lifecycle.Observer; public class FragmentIdentity extends FragmentEx { @@ -84,9 +84,9 @@ public class FragmentIdentity extends FragmentEx { private CheckBox cbPrimary; private CheckBox cbStoreSent; private Button btnSave; - private ProgressBar pbSave; + private ContentLoadingProgressBar pbSave; private ImageButton ibDelete; - private ProgressBar pbWait; + private ContentLoadingProgressBar pbWait; private Group grpAdvanced; private long id = -1; @@ -301,7 +301,7 @@ public class FragmentIdentity extends FragmentEx { public void onClick(View v) { Helper.setViewsEnabled(view, false); btnSave.setEnabled(false); - pbSave.setVisibility(View.VISIBLE); + pbSave.show(); EntityAccount account = (EntityAccount) spAccount.getSelectedItem(); @@ -431,7 +431,7 @@ public class FragmentIdentity extends FragmentEx { protected void onException(Bundle args, Throwable ex) { Helper.setViewsEnabled(view, true); btnSave.setEnabled(true); - pbSave.setVisibility(View.GONE); + pbSave.hide(); new DialogBuilderLifecycle(getContext(), getViewLifecycleOwner()) .setMessage(Helper.formatThrowable(ex)) @@ -453,7 +453,7 @@ public class FragmentIdentity extends FragmentEx { public void onClick(DialogInterface dialog, int which) { Helper.setViewsEnabled(view, false); btnSave.setEnabled(false); - pbWait.setVisibility(View.VISIBLE); + pbWait.show(); Bundle args = new Bundle(); args.putLong("id", id); @@ -491,7 +491,7 @@ public class FragmentIdentity extends FragmentEx { btnSave.setVisibility(View.GONE); btnAdvanced.setVisibility(View.GONE); grpAdvanced.setVisibility(View.GONE); - pbSave.setVisibility(View.GONE); + pbSave.hide(); ibDelete.setVisibility(View.GONE); return view; @@ -560,7 +560,7 @@ public class FragmentIdentity extends FragmentEx { // Consider previous save/delete as cancelled ibDelete.setVisibility(identity == null ? View.GONE : View.VISIBLE); - pbWait.setVisibility(View.GONE); + pbWait.hide(); db.account().liveAccounts().removeObservers(getViewLifecycleOwner()); db.account().liveAccounts().observe(getViewLifecycleOwner(), new Observer>() { diff --git a/app/src/main/java/eu/faircode/email/FragmentLogs.java b/app/src/main/java/eu/faircode/email/FragmentLogs.java index f3cca2482f..dcd4220de1 100644 --- a/app/src/main/java/eu/faircode/email/FragmentLogs.java +++ b/app/src/main/java/eu/faircode/email/FragmentLogs.java @@ -23,7 +23,6 @@ import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.ProgressBar; import java.util.ArrayList; import java.util.Date; @@ -32,13 +31,14 @@ import java.util.List; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.constraintlayout.widget.Group; +import androidx.core.widget.ContentLoadingProgressBar; import androidx.lifecycle.Observer; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; public class FragmentLogs extends FragmentEx { private RecyclerView rvLog; - private ProgressBar pbWait; + private ContentLoadingProgressBar pbWait; private Group grpReady; private AdapterLog adapter; @@ -66,7 +66,7 @@ public class FragmentLogs extends FragmentEx { // Initialize grpReady.setVisibility(View.GONE); - pbWait.setVisibility(View.VISIBLE); + pbWait.show(); return view; } @@ -86,7 +86,7 @@ public class FragmentLogs extends FragmentEx { adapter.set(logs); - pbWait.setVisibility(View.GONE); + pbWait.hide(); grpReady.setVisibility(View.VISIBLE); } }); diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index d2cc69ba5e..e76cddf49b 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -36,7 +36,6 @@ import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.ImageButton; -import android.widget.ProgressBar; import android.widget.TextView; import com.google.android.material.bottomnavigation.BottomNavigationView; @@ -58,6 +57,7 @@ import androidx.annotation.Nullable; import androidx.appcompat.widget.PopupMenu; import androidx.appcompat.widget.SearchView; import androidx.constraintlayout.widget.Group; +import androidx.core.widget.ContentLoadingProgressBar; import androidx.fragment.app.FragmentTransaction; import androidx.lifecycle.Lifecycle; import androidx.lifecycle.LiveData; @@ -83,7 +83,7 @@ public class FragmentMessages extends FragmentEx { private TextView tvNoEmail; private RecyclerView rvMessage; private BottomNavigationView bottom_navigation; - private ProgressBar pbWait; + private ContentLoadingProgressBar pbWait; private Group grpSupport; private Group grpHintSupport; private Group grpHintSwipe; @@ -704,7 +704,7 @@ public class FragmentMessages extends FragmentEx { tvNoEmail.setVisibility(View.GONE); bottom_navigation.setVisibility(View.GONE); grpReady.setVisibility(View.GONE); - pbWait.setVisibility(View.VISIBLE); + pbWait.show(); fab.hide(); fabMove.hide(); @@ -1087,12 +1087,12 @@ public class FragmentMessages extends FragmentEx { new BoundaryCallbackMessages.IBoundaryCallbackMessages() { @Override public void onLoading() { - pbWait.setVisibility(View.VISIBLE); + pbWait.show(); } @Override public void onLoaded() { - pbWait.setVisibility(View.GONE); + pbWait.hide(); } @Override @@ -1129,12 +1129,12 @@ public class FragmentMessages extends FragmentEx { @Override public void onLoading() { tvNoEmail.setVisibility(View.GONE); - pbWait.setVisibility(View.VISIBLE); + pbWait.show(); } @Override public void onLoaded() { - pbWait.setVisibility(View.GONE); + pbWait.hide(); if (messages.getValue() == null || messages.getValue().size() == 0) tvNoEmail.setVisibility(View.VISIBLE); } @@ -1238,7 +1238,7 @@ public class FragmentMessages extends FragmentEx { boolean searching = (searchCallback != null && searchCallback.isSearching()); if (!searching) - pbWait.setVisibility(View.GONE); + pbWait.hide(); grpReady.setVisibility(View.VISIBLE); if (messages.size() == 0) { diff --git a/app/src/main/java/eu/faircode/email/FragmentOperations.java b/app/src/main/java/eu/faircode/email/FragmentOperations.java index 0fcb18a951..8cb94e4079 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOperations.java +++ b/app/src/main/java/eu/faircode/email/FragmentOperations.java @@ -23,7 +23,6 @@ import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.ProgressBar; import java.util.ArrayList; import java.util.List; @@ -31,13 +30,14 @@ import java.util.List; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.constraintlayout.widget.Group; +import androidx.core.widget.ContentLoadingProgressBar; import androidx.lifecycle.Observer; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; public class FragmentOperations extends FragmentEx { private RecyclerView rvOperation; - private ProgressBar pbWait; + private ContentLoadingProgressBar pbWait; private Group grpReady; private AdapterOperation adapter; @@ -65,7 +65,7 @@ public class FragmentOperations extends FragmentEx { // Initialize grpReady.setVisibility(View.GONE); - pbWait.setVisibility(View.VISIBLE); + pbWait.show(); return view; } @@ -83,7 +83,7 @@ public class FragmentOperations extends FragmentEx { adapter.set(operations); - pbWait.setVisibility(View.GONE); + pbWait.hide(); grpReady.setVisibility(View.VISIBLE); } }); diff --git a/app/src/main/res/layout/fragment_account.xml b/app/src/main/res/layout/fragment_account.xml index 530546d38f..5b11acec32 100644 --- a/app/src/main/res/layout/fragment_account.xml +++ b/app/src/main/res/layout/fragment_account.xml @@ -372,7 +372,7 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/etInterval" /> - - - - - - - - - - - - - - - - - - - - - -