Message when no operations

This commit is contained in:
M66B 2019-01-13 09:16:42 +00:00
parent c6aca68daa
commit a333ecccd5
3 changed files with 17 additions and 0 deletions

View File

@ -31,6 +31,7 @@ import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
@ -43,6 +44,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
public class FragmentOperations extends FragmentEx {
private TextView tvNoOperation;
private RecyclerView rvOperation;
private ContentLoadingProgressBar pbWait;
private Group grpReady;
@ -58,6 +60,7 @@ public class FragmentOperations extends FragmentEx {
View view = inflater.inflate(R.layout.fragment_operations, container, false);
// Get controls
tvNoOperation = view.findViewById(R.id.tvNoOperation);
rvOperation = view.findViewById(R.id.rvOperation);
pbWait = view.findViewById(R.id.pbWait);
grpReady = view.findViewById(R.id.grpReady);
@ -72,6 +75,7 @@ public class FragmentOperations extends FragmentEx {
rvOperation.setAdapter(adapter);
// Initialize
tvNoOperation.setVisibility(View.GONE);
grpReady.setVisibility(View.GONE);
pbWait.setVisibility(View.VISIBLE);
@ -89,6 +93,7 @@ public class FragmentOperations extends FragmentEx {
if (operations == null)
operations = new ArrayList<>();
tvNoOperation.setVisibility(operations.size() == 0 ? View.VISIBLE : View.GONE);
adapter.set(operations);
pbWait.setVisibility(View.GONE);

View File

@ -6,6 +6,17 @@
android:layout_height="match_parent"
tools:context=".ActivityView">
<TextView
android:id="@+id/tvNoOperation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/title_no_operations"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvOperation"
android:layout_width="0dp"

View File

@ -221,6 +221,7 @@
<string name="title_empty_trash_ask">Delete all trashed messages permanently?</string>
<string name="title_delete_operation">Delete operations with an error message?</string>
<string name="title_no_operations">No pending operations</string>
<string name="title_folder_name">Folder name</string>
<string name="title_display_name">Display name</string>