From 2bf32e27489a872a1a4974f0f0e5f8245cd77192 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 24 Aug 2018 06:33:52 +0000 Subject: [PATCH] Added body loading spinner --- .../main/java/eu/faircode/email/FragmentMessage.java | 5 +++++ app/src/main/res/layout/fragment_message.xml | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessage.java b/app/src/main/java/eu/faircode/email/FragmentMessage.java index a4f7683d..452fc9ed 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessage.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessage.java @@ -84,6 +84,7 @@ public class FragmentMessage extends FragmentEx { private TextView tvError; private View vSeparatorBody; private TextView tvBody; + private ProgressBar pbBody; private FloatingActionButton fab; private BottomNavigationView bottom_navigation; private ProgressBar pbWait; @@ -125,6 +126,7 @@ public class FragmentMessage extends FragmentEx { tvError = view.findViewById(R.id.tvError); vSeparatorBody = view.findViewById(R.id.vSeparatorBody); tvBody = view.findViewById(R.id.tvBody); + pbBody = view.findViewById(R.id.pbBody); fab = view.findViewById(R.id.fab); bottom_navigation = view.findViewById(R.id.bottom_navigation); pbWait = view.findViewById(R.id.pbWait); @@ -263,6 +265,7 @@ public class FragmentMessage extends FragmentEx { grpAddresses.setVisibility(View.GONE); grpAttachments.setVisibility(View.GONE); grpMessage.setVisibility(View.GONE); + pbBody.setVisibility(View.GONE); bottom_navigation.setVisibility(View.GONE); tvCount.setVisibility(View.GONE); tvError.setVisibility(View.GONE); @@ -343,6 +346,7 @@ public class FragmentMessage extends FragmentEx { Bundle args = new Bundle(); args.putLong("id", message.id); + pbBody.setVisibility(View.VISIBLE); new SimpleTask() { @Override protected Spanned onLoad(Context context, Bundle args) throws Throwable { @@ -357,6 +361,7 @@ public class FragmentMessage extends FragmentEx { tvBody.setText(body); grpMessage.setVisibility(View.VISIBLE); fab.setVisibility(free ? View.GONE : View.VISIBLE); + pbBody.setVisibility(View.GONE); } }.load(FragmentMessage.this, args); diff --git a/app/src/main/res/layout/fragment_message.xml b/app/src/main/res/layout/fragment_message.xml index fab56fd8..49a0009c 100644 --- a/app/src/main/res/layout/fragment_message.xml +++ b/app/src/main/res/layout/fragment_message.xml @@ -248,6 +248,18 @@ android:textIsSelectable="true" /> + +