Skip to content
This repository was archived by the owner on Dec 14, 2021. It is now read-only.

Commit ade612d

Browse files
author
Elise Richards
authored
Use red trash icon and fix deleted string (#1146)
* Use red trash icon and fix deleted string * Reformat toast
1 parent fa4e6d9 commit ade612d

9 files changed

Lines changed: 28 additions & 12 deletions

File tree

app/src/main/java/mozilla/lockbox/action/ToastNotificationAction.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ sealed class ToastNotificationAction(
3737
data class ShowDeleteToast(val entryName: String?) : ToastNotificationAction(
3838
ToastNotificationViewModel(
3939
R.string.entry_deleted_toast,
40-
R.drawable.ic_check,
40+
R.drawable.ic_delete_red,
4141
entryName
4242
)
4343
)

app/src/main/java/mozilla/lockbox/presenter/RoutePresenter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ abstract class RoutePresenter(
122122
val layoutInflater = LayoutInflater.from(activity)
123123

124124
toast.view = layoutInflater.inflate(R.layout.toast_view, container, false)
125-
toast.setGravity(Gravity.FILL_HORIZONTAL or Gravity.BOTTOM, 0, 0)
125+
toast.setGravity(Gravity.FILL_HORIZONTAL or Gravity.BOTTOM, 0, 216)
126126

127127
val view = toast.view.findViewById(R.id.message) as TextView
128128
val message = action.viewModel.message
496 Bytes
Loading
330 Bytes
Loading
579 Bytes
Loading
985 Bytes
Loading
1.19 KB
Loading
Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,44 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3-
android:layout_width="match_parent"
4-
android:layout_height="wrap_content"
5-
android:background="@android:color/transparent">
2+
3+
<androidx.constraintlayout.widget.ConstraintLayout
4+
xmlns:android="http://schemas.android.com/apk/res/android"
5+
xmlns:app="http://schemas.android.com/apk/res-auto"
6+
android:layout_width="match_parent"
7+
android:layout_height="wrap_content"
8+
android:layout_marginBottom="87dp"
9+
android:background="@android:color/transparent" >
610

711
<LinearLayout
812
android:layout_width="match_parent"
913
android:layout_height="48dp"
1014
android:layout_margin="10dp"
15+
android:layout_marginBottom="87dp"
1116
android:background="@drawable/rounded_corner_bg"
1217
android:elevation="2dp"
13-
android:gravity="center_vertical">
18+
android:gravity="center_vertical"
19+
app:layout_constraintTop_toTopOf="parent"
20+
>
1421

1522
<ImageView
1623
android:id="@+id/icon"
17-
android:src="@drawable/ic_check"
1824
android:layout_width="wrap_content"
1925
android:layout_height="wrap_content"
2026
android:layout_marginStart="16sp"
21-
android:contentDescription="@string/toast_icon_description" />
27+
android:contentDescription="@string/toast_icon_description"
28+
android:src="@drawable/ic_check"
29+
app:layout_constraintBottom_toBottomOf="parent"
30+
app:layout_constraintStart_toStartOf="parent"
31+
app:layout_constraintTop_toTopOf="parent" />
32+
2233
<TextView
2334
android:id="@+id/message"
2435
style="@style/ToastTextAppearance"
2536
android:layout_width="match_parent"
26-
android:layout_height="wrap_content" />
37+
android:layout_height="wrap_content"
38+
android:layout_marginStart="8sp"
39+
app:layout_constraintBottom_toBottomOf="parent"
40+
app:layout_constraintEnd_toEndOf="parent"
41+
app:layout_constraintStart_toEndOf="@id/icon"
42+
app:layout_constraintTop_toTopOf="parent" />
2743
</LinearLayout>
28-
</LinearLayout>
44+
</androidx.constraintlayout.widget.ConstraintLayout>

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,6 @@
313313
<string name="toast_icon_description">The icon that appears on a toast notification.</string>
314314

315315
<!-- This is the toast message that appears when an entry has been successfully deleted. -->
316-
<string name="entry_deleted_toast">%1$s deleted.</string>
316+
<string name="entry_deleted_toast">%1$s deleted</string>
317317

318318
</resources>

0 commit comments

Comments
 (0)