mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-03 11:28:41 +01:00
Show spinners only after 0.5 seconds
This commit is contained in:
@@ -62,7 +62,6 @@ import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||
@@ -160,7 +159,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
private ImageView ivThread;
|
||||
private TextView tvPreview;
|
||||
private TextView tvError;
|
||||
private ProgressBar pbLoading;
|
||||
private ContentLoadingProgressBar pbLoading;
|
||||
|
||||
private ImageView ivExpanderAddress;
|
||||
private TextView tvFromEx;
|
||||
@@ -175,7 +174,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
private TextView tvKeywords;
|
||||
|
||||
private TextView tvHeaders;
|
||||
private ProgressBar pbHeaders;
|
||||
private ContentLoadingProgressBar pbHeaders;
|
||||
private TextView tvNoInternetHeaders;
|
||||
|
||||
private RecyclerView rvAttachment;
|
||||
@@ -187,7 +186,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
private ImageButton ibQuotes;
|
||||
private ImageButton ibImages;
|
||||
private TextView tvBody;
|
||||
private ProgressBar pbBody;
|
||||
private ContentLoadingProgressBar pbBody;
|
||||
private TextView tvNoInternetBody;
|
||||
|
||||
private Group grpAddress;
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package eu.faircode.email;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
public class ContentLoadingProgressBar extends ProgressBar {
|
||||
public ContentLoadingProgressBar(@NonNull Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public ContentLoadingProgressBar(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisibility(int visibility) {
|
||||
removeCallbacks(delayedShow);
|
||||
if (visibility == VISIBLE) {
|
||||
super.setVisibility(INVISIBLE);
|
||||
postDelayed(delayedShow, 500);
|
||||
} else
|
||||
super.setVisibility(visibility);
|
||||
}
|
||||
|
||||
private final Runnable delayedShow = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ContentLoadingProgressBar.super.setVisibility(VISIBLE);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -51,7 +51,6 @@ import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
@@ -117,7 +116,7 @@ public class FragmentAccount extends FragmentEx {
|
||||
private EditText etPrefix;
|
||||
|
||||
private Button btnCheck;
|
||||
private ProgressBar pbCheck;
|
||||
private ContentLoadingProgressBar pbCheck;
|
||||
private TextView tvIdle;
|
||||
|
||||
private ArrayAdapter<EntityFolder> adapter;
|
||||
@@ -128,8 +127,8 @@ public class FragmentAccount extends FragmentEx {
|
||||
private Spinner spJunk;
|
||||
|
||||
private Button btnSave;
|
||||
private ProgressBar pbSave;
|
||||
private ProgressBar pbWait;
|
||||
private ContentLoadingProgressBar pbSave;
|
||||
private ContentLoadingProgressBar pbWait;
|
||||
|
||||
private Group grpServer;
|
||||
private Group grpAuthorize;
|
||||
|
||||
@@ -25,7 +25,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;
|
||||
|
||||
@@ -42,7 +41,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;
|
||||
private ObjectAnimator animator;
|
||||
|
||||
@@ -28,7 +28,6 @@ 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;
|
||||
|
||||
@@ -42,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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -39,7 +38,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;
|
||||
|
||||
|
||||
@@ -64,7 +64,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;
|
||||
@@ -138,7 +137,7 @@ public class FragmentCompose extends FragmentEx {
|
||||
private TextView tvReference;
|
||||
private BottomNavigationView edit_bar;
|
||||
private BottomNavigationView bottom_navigation;
|
||||
private ProgressBar pbWait;
|
||||
private ContentLoadingProgressBar pbWait;
|
||||
private Group grpHeader;
|
||||
private Group grpExtra;
|
||||
private Group grpAddresses;
|
||||
|
||||
@@ -34,7 +34,6 @@ import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
|
||||
@@ -57,8 +56,8 @@ public class FragmentFolder extends FragmentEx {
|
||||
private EditText etKeepDays;
|
||||
private CheckBox cbKeepAll;
|
||||
private Button btnSave;
|
||||
private ProgressBar pbSave;
|
||||
private ProgressBar pbWait;
|
||||
private ContentLoadingProgressBar pbSave;
|
||||
private ContentLoadingProgressBar pbWait;
|
||||
|
||||
private long id = -1;
|
||||
private long account = -1;
|
||||
|
||||
@@ -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;
|
||||
@@ -46,7 +45,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;
|
||||
|
||||
@@ -25,7 +25,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;
|
||||
|
||||
@@ -42,7 +41,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;
|
||||
private ObjectAnimator animator;
|
||||
|
||||
@@ -44,7 +44,6 @@ import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
@@ -110,8 +109,8 @@ public class FragmentIdentity extends FragmentEx {
|
||||
private Spinner spSent;
|
||||
|
||||
private Button btnSave;
|
||||
private ProgressBar pbSave;
|
||||
private ProgressBar pbWait;
|
||||
private ContentLoadingProgressBar pbSave;
|
||||
private ContentLoadingProgressBar pbWait;
|
||||
|
||||
private Group grpAuthorize;
|
||||
private Group grpAdvanced;
|
||||
|
||||
@@ -26,7 +26,6 @@ import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@@ -41,7 +40,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
public class FragmentLogs extends FragmentEx {
|
||||
private RecyclerView rvLog;
|
||||
private ProgressBar pbWait;
|
||||
private ContentLoadingProgressBar pbWait;
|
||||
private Group grpReady;
|
||||
|
||||
private boolean autoScroll = true;
|
||||
|
||||
@@ -42,7 +42,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;
|
||||
@@ -90,7 +89,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;
|
||||
|
||||
@@ -31,7 +31,6 @@ import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -45,7 +44,7 @@ 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;
|
||||
|
||||
Reference in New Issue
Block a user