Browse Source

Added body loading spinner

main
M66B 6 years ago
parent
commit
2bf32e2748
2 changed files with 17 additions and 0 deletions
  1. +5
    -0
      app/src/main/java/eu/faircode/email/FragmentMessage.java
  2. +12
    -0
      app/src/main/res/layout/fragment_message.xml

+ 5
- 0
app/src/main/java/eu/faircode/email/FragmentMessage.java View File

@ -84,6 +84,7 @@ public class FragmentMessage extends FragmentEx {
private TextView tvError; private TextView tvError;
private View vSeparatorBody; private View vSeparatorBody;
private TextView tvBody; private TextView tvBody;
private ProgressBar pbBody;
private FloatingActionButton fab; private FloatingActionButton fab;
private BottomNavigationView bottom_navigation; private BottomNavigationView bottom_navigation;
private ProgressBar pbWait; private ProgressBar pbWait;
@ -125,6 +126,7 @@ public class FragmentMessage extends FragmentEx {
tvError = view.findViewById(R.id.tvError); tvError = view.findViewById(R.id.tvError);
vSeparatorBody = view.findViewById(R.id.vSeparatorBody); vSeparatorBody = view.findViewById(R.id.vSeparatorBody);
tvBody = view.findViewById(R.id.tvBody); tvBody = view.findViewById(R.id.tvBody);
pbBody = view.findViewById(R.id.pbBody);
fab = view.findViewById(R.id.fab); fab = view.findViewById(R.id.fab);
bottom_navigation = view.findViewById(R.id.bottom_navigation); bottom_navigation = view.findViewById(R.id.bottom_navigation);
pbWait = view.findViewById(R.id.pbWait); pbWait = view.findViewById(R.id.pbWait);
@ -263,6 +265,7 @@ public class FragmentMessage extends FragmentEx {
grpAddresses.setVisibility(View.GONE); grpAddresses.setVisibility(View.GONE);
grpAttachments.setVisibility(View.GONE); grpAttachments.setVisibility(View.GONE);
grpMessage.setVisibility(View.GONE); grpMessage.setVisibility(View.GONE);
pbBody.setVisibility(View.GONE);
bottom_navigation.setVisibility(View.GONE); bottom_navigation.setVisibility(View.GONE);
tvCount.setVisibility(View.GONE); tvCount.setVisibility(View.GONE);
tvError.setVisibility(View.GONE); tvError.setVisibility(View.GONE);
@ -343,6 +346,7 @@ public class FragmentMessage extends FragmentEx {
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putLong("id", message.id); args.putLong("id", message.id);
pbBody.setVisibility(View.VISIBLE);
new SimpleTask<Spanned>() { new SimpleTask<Spanned>() {
@Override @Override
protected Spanned onLoad(Context context, Bundle args) throws Throwable { protected Spanned onLoad(Context context, Bundle args) throws Throwable {
@ -357,6 +361,7 @@ public class FragmentMessage extends FragmentEx {
tvBody.setText(body); tvBody.setText(body);
grpMessage.setVisibility(View.VISIBLE); grpMessage.setVisibility(View.VISIBLE);
fab.setVisibility(free ? View.GONE : View.VISIBLE); fab.setVisibility(free ? View.GONE : View.VISIBLE);
pbBody.setVisibility(View.GONE);
} }
}.load(FragmentMessage.this, args); }.load(FragmentMessage.this, args);


+ 12
- 0
app/src/main/res/layout/fragment_message.xml View File

@ -248,6 +248,18 @@
android:textIsSelectable="true" /> android:textIsSelectable="true" />
</ScrollView> </ScrollView>
<ProgressBar
android:id="@+id/pbBody"
style="@style/Base.Widget.AppCompat.ProgressBar"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="12dp"
android:indeterminate="true"
app:layout_constraintBottom_toBottomOf="@id/scroll"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/scroll" />
<com.google.android.material.floatingactionbutton.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab" android:id="@+id/fab"
android:layout_width="wrap_content" android:layout_width="wrap_content"


Loading…
Cancel
Save