Skip to content

Commit ee95be9

Browse files
committed
Update strings. Add content descriptions and dimensions
1 parent f99e9a0 commit ee95be9

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

app/src/main/res/layout/nav_header.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,19 @@
1717
<FrameLayout
1818
xmlns:android="http://schemas.android.com/apk/res/android"
1919
android:layout_width="match_parent"
20-
android:layout_height="192dp"
20+
android:layout_height="@dimen/header_height"
2121
android:background="?attr/colorPrimaryDark"
2222
android:gravity="bottom"
2323
android:orientation="vertical"
24-
android:padding="16dp"
24+
android:padding="@dimen/header_padding"
2525
android:theme="@style/ThemeOverlay.AppCompat.Dark">
2626

2727
<ImageView
28-
android:layout_width="100dp"
28+
android:layout_width="@dimen/header_image_width"
2929
android:layout_height="wrap_content"
3030
android:layout_gravity="center"
31-
android:src="@drawable/logo_no_fill" />
31+
android:src="@drawable/logo_no_fill"
32+
android:contentDescription="@string/tasks_header_image_content_description" />
3233

3334
<TextView
3435
android:layout_width="wrap_content"

app/src/main/res/layout/tasks_frag.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@
8989
android:layout_width="96dp"
9090
android:layout_height="96dp"
9191
android:layout_gravity="center"
92-
android:src="@{ContextCompat.getDrawable(context, viewmodel.noTaskIconRes)}" />
92+
android:src="@{ContextCompat.getDrawable(context, viewmodel.noTaskIconRes)}"
93+
android:contentDescription="@string/no_tasks_image_content_description" />
9394

9495
<TextView
9596
android:id="@+id/no_tasks_text"

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@
1919
<dimen name="activity_horizontal_margin">16dp</dimen>
2020
<dimen name="activity_vertical_margin">16dp</dimen>
2121

22-
<dimen name="list_item_padding">8dp</dimen>
23-
2422
<dimen name="fab_margin">16dp</dimen>
2523

24+
<dimen name="list_item_padding">8dp</dimen>
25+
<dimen name="header_height">192dp</dimen>
26+
<dimen name="header_padding">16dp</dimen>
27+
<dimen name="header_image_width">100dp</dimen>
28+
2629
</resources>

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
-->
1616

1717
<resources>
18-
<string name="app_name">Todo</string>
18+
<string name="app_name">Tasks</string>
1919
<string name="add_task">New Task</string>
2020
<string name="edit_task">Edit Task</string>
2121
<string name="task_marked_complete">Task marked complete</string>
@@ -25,10 +25,10 @@
2525
<string name="menu_filter">Filter</string>
2626
<string name="menu_clear">Clear completed</string>
2727
<string name="menu_delete_task">Delete task</string>
28-
<string name="navigation_view_header_title">Todo</string>
28+
<string name="navigation_view_header_title">Tasks</string>
2929
<string name="title_hint">Title</string>
3030
<string name="description_hint">Enter your task here.</string>
31-
<string name="empty_task_message">TO DOs cannot be empty</string>
31+
<string name="empty_task_message">Tasks cannot be empty</string>
3232
<string name="successfully_saved_task_message">Task saved</string>
3333
<string name="list_title">Task List</string>
3434
<string name="statistics_title">Statistics</string>
@@ -58,4 +58,8 @@
5858
<string name="successfully_added_task_message">Task added</string>
5959
<string name="no_data_description" />
6060

61+
<!-- Content Descriptions -->
62+
<string name="tasks_header_image_content_description">Tasks header image</string>
63+
<string name="no_tasks_image_content_description">No tasks image</string>
64+
6165
</resources>

0 commit comments

Comments
 (0)