From eaef71dea0b66f82570fdfeb5629900b38ff8f28 Mon Sep 17 00:00:00 2001
From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>
Date: Thu, 5 Sep 2024 13:21:56 -0400
Subject: Continue adding contentDescription for image views.
---
.../activities/SearchResultActivity.java | 13 +++++++++++++
app/src/main/res/layout/activity_search_result.xml | 3 ++-
.../res/layout/activity_selected_subreddits.xml | 3 ++-
.../main/res/layout/activity_submit_crosspost.xml | 3 ++-
...ctivity_subscribed_subreddits_multiselection.xml | 3 ++-
.../layout/activity_subscribed_thing_listing.xml | 1 +
app/src/main/res/layout/activity_theme_preview.xml | 13 +++++++++----
.../main/res/layout/activity_view_image_or_gif.xml | 9 ++++++---
app/src/main/res/values/strings.xml | 21 +++++++++++++++++++++
9 files changed, 58 insertions(+), 11 deletions(-)
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchResultActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchResultActivity.java
index 8db414e4..fe0c16fe 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchResultActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchResultActivity.java
@@ -280,45 +280,58 @@ public class SearchResultActivity extends BaseActivity implements SortTypeSelect
switch (fabOption) {
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_REFRESH:
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_refresh_24dp);
+ binding.fabSearchResultActivity.setContentDescription(getString(R.string.content_description_refresh));
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_CHANGE_SORT_TYPE:
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_sort_toolbar_24dp);
+ binding.fabSearchResultActivity.setContentDescription(getString(R.string.content_description_change_sort_type));
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_CHANGE_POST_LAYOUT:
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_post_layout_24dp);
+ binding.fabSearchResultActivity.setContentDescription(getString(R.string.content_description_change_post_layout));
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_SEARCH:
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_search_24dp);
+ binding.fabSearchResultActivity.setContentDescription(getString(R.string.content_description_search));
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_GO_TO_SUBREDDIT:
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_subreddit_24dp);
+ binding.fabSearchResultActivity.setContentDescription(getString(R.string.content_description_go_to_subreddit));
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_GO_TO_USER:
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_user_24dp);
+ binding.fabSearchResultActivity.setContentDescription(getString(R.string.content_description_go_to_user));
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_RANDOM:
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_random_24dp);
+ binding.fabSearchResultActivity.setContentDescription(getString(R.string.content_description_random));
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_HIDE_READ_POSTS:
if (accountName.equals(Account.ANONYMOUS_ACCOUNT)) {
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_filter_24dp);
fabOption = SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_FILTER_POSTS;
+ binding.fabSearchResultActivity.setContentDescription(getString(R.string.content_description_filter_posts));
} else {
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_hide_read_posts_24dp);
+ binding.fabSearchResultActivity.setContentDescription(getString(R.string.content_description_hide_read_posts));
}
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_FILTER_POSTS:
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_filter_24dp);
+ binding.fabSearchResultActivity.setContentDescription(getString(R.string.content_description_filter_posts));
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_GO_TO_TOP:
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_keyboard_double_arrow_up_24);
+ binding.fabSearchResultActivity.setContentDescription(getString(R.string.content_description_go_to_top));
break;
default:
if (accountName.equals(Account.ANONYMOUS_ACCOUNT)) {
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_filter_24dp);
fabOption = SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_FILTER_POSTS;
+ binding.fabSearchResultActivity.setContentDescription(getString(R.string.content_description_filter_posts));
} else {
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_add_day_night_24dp);
+ binding.fabSearchResultActivity.setContentDescription(getString(R.string.content_description_submit_post));
}
break;
}
diff --git a/app/src/main/res/layout/activity_search_result.xml b/app/src/main/res/layout/activity_search_result.xml
index a9e730fa..6a5189b6 100644
--- a/app/src/main/res/layout/activity_search_result.xml
+++ b/app/src/main/res/layout/activity_search_result.xml
@@ -52,6 +52,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/fab_margin"
- android:layout_gravity="bottom|end" />
+ android:layout_gravity="bottom|end"
+ android:contentDescription="@null" />
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_selected_subreddits.xml b/app/src/main/res/layout/activity_selected_subreddits.xml
index c9700c72..fd1dbdbb 100644
--- a/app/src/main/res/layout/activity_selected_subreddits.xml
+++ b/app/src/main/res/layout/activity_selected_subreddits.xml
@@ -44,6 +44,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/fab_margin"
android:layout_gravity="bottom|end"
- android:src="@drawable/ic_add_24dp" />
+ android:src="@drawable/ic_add_24dp"
+ android:contentDescription="@string/content_description_add_subreddit_or_user" />
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_submit_crosspost.xml b/app/src/main/res/layout/activity_submit_crosspost.xml
index 5412697e..36caa335 100644
--- a/app/src/main/res/layout/activity_submit_crosspost.xml
+++ b/app/src/main/res/layout/activity_submit_crosspost.xml
@@ -242,7 +242,8 @@
android:layout_margin="16dp"
android:layout_gravity="start"
android:background="@drawable/play_button_round_background"
- android:visibility="gone" />
+ android:visibility="gone"
+ android:contentDescription="@string/content_description_video_indicator" />
diff --git a/app/src/main/res/layout/activity_subscribed_subreddits_multiselection.xml b/app/src/main/res/layout/activity_subscribed_subreddits_multiselection.xml
index 4f7a26ad..8c95da13 100644
--- a/app/src/main/res/layout/activity_subscribed_subreddits_multiselection.xml
+++ b/app/src/main/res/layout/activity_subscribed_subreddits_multiselection.xml
@@ -61,7 +61,8 @@
+ android:layout_height="wrap_content"
+ android:contentDescription="@string/content_description_no_subscriptions_indicator" />
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_theme_preview.xml b/app/src/main/res/layout/activity_theme_preview.xml
index 9f40fd7a..89d02306 100644
--- a/app/src/main/res/layout/activity_theme_preview.xml
+++ b/app/src/main/res/layout/activity_theme_preview.xml
@@ -157,7 +157,8 @@
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:src="@drawable/ic_subscritptions_bottom_app_bar_24dp"
- android:background="?attr/selectableItemBackgroundBorderless" />
+ android:background="?attr/selectableItemBackgroundBorderless"
+ android:contentDescription="@string/content_description_bottom_navigation_bar_button" />
+ android:background="?attr/selectableItemBackgroundBorderless"
+ android:contentDescription="@string/content_description_bottom_navigation_bar_button" />
+ android:background="?attr/selectableItemBackgroundBorderless"
+ android:contentDescription="@string/content_description_bottom_navigation_bar_button" />
+ android:background="?attr/selectableItemBackgroundBorderless"
+ android:contentDescription="@string/content_description_bottom_navigation_bar_button" />
@@ -208,6 +212,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/fab_margin"
+ android:contentDescription="@string/content_description_fab"
app:srcCompat="@drawable/ic_add_day_night_24dp"
app:tint="@android:color/white"
app:layout_anchor="@id/bottom_navigation_theme_preview_activity" />
diff --git a/app/src/main/res/layout/activity_view_image_or_gif.xml b/app/src/main/res/layout/activity_view_image_or_gif.xml
index c7791c9f..24d433ee 100644
--- a/app/src/main/res/layout/activity_view_image_or_gif.xml
+++ b/app/src/main/res/layout/activity_view_image_or_gif.xml
@@ -73,7 +73,8 @@
android:layout_height="wrap_content"
android:padding="16dp"
android:src="@drawable/ic_file_download_toolbar_white_24dp"
- android:background="?attr/selectableItemBackgroundBorderless" />
+ android:background="?attr/selectableItemBackgroundBorderless"
+ android:contentDescription="@string/content_description_download" />
+ android:background="?attr/selectableItemBackgroundBorderless"
+ android:contentDescription="@string/content_description_share" />
+ android:background="?attr/selectableItemBackgroundBorderless"
+ android:contentDescription="@string/content_description_set_as_wallpaper" />
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 49f04e0a..2e7e9995 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1453,6 +1453,27 @@
Select video
Delete texts
Handle link
+ Submit post
+ Refresh
+ Change sort type
+ Change post layout
+ Search
+ Go to subreddit
+ Go to user
+ Random
+ Filter posts
+ Hide read posts
+ Go to top
+ Add subreddit or user
+ Video indicator
+ No subscriptions indicator
+ Create multireddit
+ Bottom navigation bar button
+ Floating action button
+ Download
+ Share
+ Set as wallpaper
+
--
cgit v1.2.3