From d82616f871e22aa492de03bb513181024c943baa Mon Sep 17 00:00:00 2001 From: Grishka Date: Thu, 7 Apr 2022 19:46:54 +0300 Subject: [PATCH] Accessibility improvements --- .../android/fragments/ComposeFragment.java | 5 +++ .../android/fragments/HomeFragment.java | 1 + .../fragments/NotificationsListFragment.java | 1 - .../displayitems/FooterStatusDisplayItem.java | 39 +++++++++++++++++-- .../displayitems/HeaderStatusDisplayItem.java | 2 + .../displayitems/ImageStatusDisplayItem.java | 2 + .../android/ui/photoviewer/PhotoViewer.java | 2 + .../joinmastodon/android/ui/views/TabBar.java | 4 -- .../main/res/layout/display_item_header.xml | 1 + .../src/main/res/layout/fragment_compose.xml | 5 +++ .../main/res/layout/item_settings_header.xml | 1 + .../main/res/layout/item_settings_switch.xml | 1 + .../res/layout/recycler_fragment_with_fab.xml | 1 + mastodon/src/main/res/layout/tab_bar.xml | 4 ++ mastodon/src/main/res/values/strings.xml | 19 ++++++++- 15 files changed, 78 insertions(+), 10 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java index 5b8fe89c..5e154cfd 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java @@ -1094,6 +1094,11 @@ public class ComposeFragment extends ToolbarFragment implements OnBackPressedLis finishAutocomplete(); } + @Override + public CharSequence getTitle(){ + return getString(R.string.new_post); + } + @Override public boolean wantsLightStatusBar(){ return !UiUtils.isDarkTheme(); diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeFragment.java index 53f87d90..c91b9795 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeFragment.java @@ -66,6 +66,7 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); accountID=getArguments().getString("account"); + setTitle(R.string.app_name); if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.N) setRetainInstance(true); diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java index e6c3c1fd..34b158bc 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java @@ -40,7 +40,6 @@ public class NotificationsListFragment extends BaseStatusListFragment \ No newline at end of file diff --git a/mastodon/src/main/res/layout/item_settings_switch.xml b/mastodon/src/main/res/layout/item_settings_switch.xml index d3fc123c..42f13e84 100644 --- a/mastodon/src/main/res/layout/item_settings_switch.xml +++ b/mastodon/src/main/res/layout/item_settings_switch.xml @@ -34,6 +34,7 @@ android:layout_height="wrap_content" android:layout_marginStart="16dp" android:layout_marginEnd="12dp" + android:focusable="false" android:clickable="false"/> \ No newline at end of file diff --git a/mastodon/src/main/res/layout/recycler_fragment_with_fab.xml b/mastodon/src/main/res/layout/recycler_fragment_with_fab.xml index 74c6c0d8..4dcdac75 100644 --- a/mastodon/src/main/res/layout/recycler_fragment_with_fab.xml +++ b/mastodon/src/main/res/layout/recycler_fragment_with_fab.xml @@ -31,6 +31,7 @@ android:tint="@color/fab_icon" android:scaleType="center" android:stateListAnimator="@animator/fab_shadow" + android:contentDescription="@string/new_post" android:src="@drawable/ic_edit_34"/> diff --git a/mastodon/src/main/res/layout/tab_bar.xml b/mastodon/src/main/res/layout/tab_bar.xml index 87d346be..a5e9f797 100644 --- a/mastodon/src/main/res/layout/tab_bar.xml +++ b/mastodon/src/main/res/layout/tab_bar.xml @@ -19,6 +19,7 @@ android:layout_width="52dp" android:layout_height="52dp" android:scaleType="center" + android:contentDescription="@string/home_timeline" android:background="?android:selectableItemBackgroundBorderless" android:tint="?android:colorPrimary" android:src="@drawable/ic_fluent_home_28_selector"/> @@ -33,6 +34,7 @@ android:layout_width="52dp" android:layout_height="52dp" android:scaleType="center" + android:contentDescription="@string/search_hint" android:background="?android:selectableItemBackgroundBorderless" android:tint="?android:colorPrimary" android:src="@drawable/ic_fluent_search_28_selector"/> @@ -47,6 +49,7 @@ android:layout_width="52dp" android:layout_height="52dp" android:scaleType="center" + android:contentDescription="@string/notifications" android:background="?android:selectableItemBackgroundBorderless" android:tint="?android:colorPrimary" android:src="@drawable/ic_fluent_alert_28_selector"/> @@ -60,6 +63,7 @@ android:id="@+id/tab_profile" android:layout_width="52dp" android:layout_height="52dp" + android:contentDescription="@string/my_profile" android:foreground="@drawable/bg_tab_profile" android:background="?android:selectableItemBackgroundBorderless"> %dh %dd - Share toot + Share Settings Publish Discard draft? @@ -267,4 +267,21 @@ Sensitive content The author marked this media as sensitive. Tap to reveal. Tap to reveal + Go to %s\'s profile + More options + Reveal content + Hide content + New post + Reply + Reblog + Favorite + Share + Media without description + Add media + Add a poll + Emoji + Post visibility + Home timeline + My profile + Media viewer \ No newline at end of file