diff --git a/app/src/main/java/eu/faircode/email/AdapterAnswer.java b/app/src/main/java/eu/faircode/email/AdapterAnswer.java index 3f5612c2b6..8091b17294 100644 --- a/app/src/main/java/eu/faircode/email/AdapterAnswer.java +++ b/app/src/main/java/eu/faircode/email/AdapterAnswer.java @@ -52,8 +52,8 @@ public class AdapterAnswer extends RecyclerView.Adapter() { @Override - protected EntityAnswer onExecute(Context context, Bundle args) throws Throwable { + protected EntityAnswer onExecute(Context context, Bundle args) { long id = args.getLong("id"); return DB.getInstance(context).answer().getAnswer(id); } @@ -130,7 +130,7 @@ public class FragmentAnswer extends FragmentBase { }.execute(this, args, "answer:get"); } - private void onActionTrash() { + private void onActionDelete() { new DialogBuilderLifecycle(getContext(), getViewLifecycleOwner()) .setMessage(R.string.title_ask_delete_answer) .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { diff --git a/app/src/main/java/eu/faircode/email/FragmentAnswers.java b/app/src/main/java/eu/faircode/email/FragmentAnswers.java index f5082ab8ef..1b87f3f1d6 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAnswers.java +++ b/app/src/main/java/eu/faircode/email/FragmentAnswers.java @@ -26,6 +26,7 @@ import android.view.ViewGroup; import com.google.android.material.floatingactionbutton.FloatingActionButton; +import java.util.ArrayList; import java.util.List; import androidx.annotation.NonNull; @@ -90,7 +91,11 @@ public class FragmentAnswers extends FragmentBase { db.answer().liveAnswers().observe(getViewLifecycleOwner(), new Observer>() { @Override public void onChanged(List answers) { + if (answers == null) + answers = new ArrayList<>(); + adapter.set(answers); + pbWait.setVisibility(View.GONE); grpReady.setVisibility(View.VISIBLE); } diff --git a/app/src/main/res/layout/item_answer.xml b/app/src/main/res/layout/item_answer.xml index c32f129bab..13def8f3bc 100644 --- a/app/src/main/res/layout/item_answer.xml +++ b/app/src/main/res/layout/item_answer.xml @@ -8,14 +8,14 @@ android:id="@+id/tvName" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_marginEnd="6dp" android:layout_marginStart="6dp" android:layout_marginTop="6dp" + android:layout_marginEnd="6dp" android:ellipsize="end" android:maxLines="1" android:text="Name" android:textAppearance="@style/TextAppearance.AppCompat.Medium" - app:layout_constraintEnd_toStartOf="@+id/tvSize" + app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -23,8 +23,8 @@ android:id="@+id/vSeparator" android:layout_width="match_parent" android:layout_height="1dp" - android:layout_marginBottom="6dp" android:layout_marginTop="6dp" + android:layout_marginBottom="6dp" android:background="?attr/colorSeparator" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tvName" />