Show message is downloading

This commit is contained in:
M66B 2019-10-05 12:54:41 +02:00
parent ef890934e2
commit 076b97c955
3 changed files with 44 additions and 2 deletions

2
FAQ.md
View File

@ -607,7 +607,7 @@ The message text will keep loading if there is no connection to the account, see
You can check the account and folder list for the account and folder state (see the legend for the meaning of the icons)
and the operation list accessible via the main navigation menu for pending operations (see [this FAQ](#user-content-faq3) for the meaning of the operations).
In the advanced settings you can set the maximum size for automatically downloading of messages on metered connections.
In the receive settings you can set the maximum size for automatically downloading of messages on metered connections.
Mobile connections are almost always metered and some (paid) Wi-Fi hotspots are too.

View File

@ -326,6 +326,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private View wvBody;
private ContentLoadingProgressBar pbBody;
private TextView tvNoInternetBody;
private ImageButton ibDownloading;
private Group grpDownloading;
private TextView tvCalendarSummary;
private TextView tvCalendarStart;
@ -482,6 +484,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
wvBody = vsBody.findViewById(R.id.wvBody);
pbBody = vsBody.findViewById(R.id.pbBody);
tvNoInternetBody = vsBody.findViewById(R.id.tvNoInternetBody);
ibDownloading = vsBody.findViewById(R.id.ibDownloading);
grpDownloading = vsBody.findViewById(R.id.grpDownloading);
rvImage = vsBody.findViewById(R.id.rvImage);
rvImage.setHasFixedSize(false);
@ -549,6 +553,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibUnsubscribe.setOnClickListener(this);
ibDecrypt.setOnClickListener(this);
ibDownloading.setOnClickListener(this);
tvBody.setOnTouchListener(this);
tvBody.addOnLayoutChangeListener(this);
@ -602,6 +608,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibUnsubscribe.setOnClickListener(null);
ibDecrypt.setOnClickListener(null);
ibDownloading.setOnClickListener(null);
tvBody.setOnTouchListener(null);
tvBody.removeOnLayoutChangeListener(this);
@ -960,6 +968,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
wvBody.setVisibility(View.GONE);
pbBody.setVisibility(View.GONE);
tvNoInternetBody.setVisibility(View.GONE);
grpDownloading.setVisibility(View.GONE);
}
private void bindFlagged(TupleMessageEx message, boolean expanded) {
@ -1229,6 +1238,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private void bindBody(TupleMessageEx message) {
tvBody.setText(null);
grpDownloading.setVisibility(message.content ? View.GONE : View.VISIBLE);
if (!message.content)
return;
@ -1982,6 +1992,10 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
onActionDecrypt(message);
break;
case R.id.ibDownloading:
Helper.viewFAQ(context, 15);
break;
case R.id.btnCalendarAccept:
case R.id.btnCalendarDecline:
case R.id.btnCalendarMaybe:

View File

@ -51,6 +51,28 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/inNavigation" />
<TextView
android:id="@+id/tvDownloading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:text="@string/title_download_message"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvNoInternetBody" />
<ImageButton
android:id="@+id/ibDownloading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:contentDescription="@string/title_download_message"
app:layout_constraintBottom_toBottomOf="@+id/tvDownloading"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/tvDownloading"
app:srcCompat="@drawable/baseline_info_24" />
<TextView
android:id="@+id/tvBody"
android:layout_width="0dp"
@ -65,7 +87,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvNoInternetBody" />
app:layout_constraintTop_toBottomOf="@id/tvDownloading" />
<View
android:id="@+id/wvBody"
@ -104,4 +126,10 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/inAttachmentsAlt" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpDownloading"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="tvDownloading,ibDownloading" />
</androidx.constraintlayout.widget.ConstraintLayout>