diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2023-10-06 18:24:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-06 18:24:13 +0200 |
commit | c38b2634582d74fe3a7c7a4273cac8750dbc7e7d (patch) | |
tree | ccf4c93e1a92b8aa6f58716e5eba009d3642e9cf /app/src/main | |
parent | 3fae29b375380ca785e57ed74e5942c496b2370b (diff) | |
download | AntennaPod-c38b2634582d74fe3a7c7a4273cac8750dbc7e7d.zip |
Better content descriptions for TalkBack (#6684)
Diffstat (limited to 'app/src/main')
13 files changed, 63 insertions, 54 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/VariableSpeedDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/VariableSpeedDialog.java index acb1f1694..987206743 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/VariableSpeedDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/VariableSpeedDialog.java @@ -23,7 +23,6 @@ import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; -import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.util.ArrayList; import java.util.Collections; @@ -32,7 +31,6 @@ import java.util.Locale; public class VariableSpeedDialog extends BottomSheetDialogFragment { private SpeedSelectionAdapter adapter; - private final DecimalFormat speedFormat; private PlaybackController controller; private final List<Float> selectedSpeeds; private PlaybackSpeedSeekBar speedSeekBar; @@ -41,7 +39,6 @@ public class VariableSpeedDialog extends BottomSheetDialogFragment { public VariableSpeedDialog() { DecimalFormatSymbols format = new DecimalFormatSymbols(Locale.US); format.setDecimalSeparator('.'); - speedFormat = new DecimalFormat("0.00", format); selectedSpeeds = new ArrayList<>(UserPreferences.getPlaybackSpeedArray()); } @@ -70,7 +67,7 @@ public class VariableSpeedDialog extends BottomSheetDialogFragment { @Subscribe(threadMode = ThreadMode.MAIN) public void updateSpeed(SpeedChangedEvent event) { speedSeekBar.updateSpeed(event.getNewSpeed()); - addCurrentSpeedChip.setText(speedFormat.format(event.getNewSpeed())); + addCurrentSpeedChip.setText(String.format(Locale.getDefault(), "%1$.2f", event.getNewSpeed())); } @Nullable @@ -95,6 +92,7 @@ public class VariableSpeedDialog extends BottomSheetDialogFragment { addCurrentSpeedChip.setCloseIconVisible(true); addCurrentSpeedChip.setCloseIconResource(R.drawable.ic_add); addCurrentSpeedChip.setOnCloseIconClickListener(v -> addCurrentSpeed()); + addCurrentSpeedChip.setCloseIconContentDescription(getString(R.string.add_preset)); addCurrentSpeedChip.setOnClickListener(v -> addCurrentSpeed()); return root; } @@ -126,7 +124,7 @@ public class VariableSpeedDialog extends BottomSheetDialogFragment { public void onBindViewHolder(@NonNull ViewHolder holder, int position) { float speed = selectedSpeeds.get(position); - holder.chip.setText(speedFormat.format(speed)); + holder.chip.setText(String.format(Locale.getDefault(), "%1$.2f", speed)); holder.chip.setOnLongClickListener(v -> { selectedSpeeds.remove(speed); UserPreferences.setPlaybackSpeedArray(selectedSpeeds); diff --git a/app/src/main/java/de/danoeh/antennapod/view/viewholder/HorizontalItemViewHolder.java b/app/src/main/java/de/danoeh/antennapod/view/viewholder/HorizontalItemViewHolder.java index f809de175..21a29a920 100644 --- a/app/src/main/java/de/danoeh/antennapod/view/viewholder/HorizontalItemViewHolder.java +++ b/app/src/main/java/de/danoeh/antennapod/view/viewholder/HorizontalItemViewHolder.java @@ -65,6 +65,7 @@ public class HorizontalItemViewHolder extends RecyclerView.ViewHolder { .load(); title.setText(item.getTitle()); date.setText(DateFormatter.formatAbbrev(activity, item.getPubDate())); + date.setContentDescription(DateFormatter.formatForAccessibility(item.getPubDate())); ItemActionButton actionButton = ItemActionButton.forItem(item); actionButton.configure(secondaryActionIcon, secondaryActionIcon, activity); secondaryActionIcon.setFocusable(false); diff --git a/app/src/main/res/layout/addfeed.xml b/app/src/main/res/layout/addfeed.xml index 8082b9c8a..f2b7bed63 100644 --- a/app/src/main/res/layout/addfeed.xml +++ b/app/src/main/res/layout/addfeed.xml @@ -20,6 +20,7 @@ android:minHeight="?attr/actionBarSize" android:theme="?attr/actionBarTheme" app:title="@string/add_feed_label" + app:navigationContentDescription="@string/toolbar_back_button_content_description" app:navigationIcon="?homeAsUpIndicator" /> </com.google.android.material.appbar.AppBarLayout> diff --git a/app/src/main/res/layout/episodes_list_fragment.xml b/app/src/main/res/layout/episodes_list_fragment.xml index 3d59bcddc..19b21f4f6 100644 --- a/app/src/main/res/layout/episodes_list_fragment.xml +++ b/app/src/main/res/layout/episodes_list_fragment.xml @@ -16,6 +16,7 @@ android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" + app:navigationContentDescription="@string/toolbar_back_button_content_description" app:navigationIcon="?homeAsUpIndicator" /> <TextView diff --git a/app/src/main/res/layout/feed_item_list_fragment.xml b/app/src/main/res/layout/feed_item_list_fragment.xml index a4288ef2d..1072924d5 100644 --- a/app/src/main/res/layout/feed_item_list_fragment.xml +++ b/app/src/main/res/layout/feed_item_list_fragment.xml @@ -39,6 +39,7 @@ android:minHeight="?attr/actionBarSize" android:layout_alignParentTop="true" app:navigationIcon="?homeAsUpIndicator" + app:navigationContentDescription="@string/toolbar_back_button_content_description" app:layout_collapseMode="pin" /> </com.google.android.material.appbar.CollapsingToolbarLayout> diff --git a/app/src/main/res/layout/feeditemlist_header.xml b/app/src/main/res/layout/feeditemlist_header.xml index 45f8e8ff8..0b7181cf2 100644 --- a/app/src/main/res/layout/feeditemlist_header.xml +++ b/app/src/main/res/layout/feeditemlist_header.xml @@ -16,55 +16,6 @@ android:orientation="horizontal" android:gravity="bottom"> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:padding="8dp" - android:background="@color/image_readability_tint" - android:orientation="horizontal" - android:layout_alignParentBottom="true"> - - <View - android:layout_width="148dp" - android:layout_height="match_parent" /> - - <ImageButton - android:id="@+id/butShowInfo" - android:layout_width="40dp" - android:layout_height="40dp" - android:background="?attr/selectableItemBackground" - android:contentDescription="@string/show_info_label" - android:layout_marginLeft="-8dp" - android:layout_marginStart="-8dp" - android:scaleType="fitXY" - android:padding="8dp" - app:srcCompat="@drawable/ic_info_white" - tools:visibility="visible" /> - - <ImageButton - android:id="@+id/butFilter" - android:layout_width="40dp" - android:layout_height="40dp" - android:background="?attr/selectableItemBackground" - android:contentDescription="@string/filter" - android:scaleType="fitXY" - android:padding="8dp" - app:srcCompat="@drawable/ic_filter_white" - tools:visibility="visible" /> - - <ImageButton - android:id="@+id/butShowSettings" - android:layout_width="40dp" - android:layout_height="40dp" - android:background="?attr/selectableItemBackground" - android:contentDescription="@string/show_feed_settings_label" - android:scaleType="fitXY" - android:padding="8dp" - app:srcCompat="@drawable/ic_settings_white" - tools:visibility="visible" /> - - </LinearLayout> - <ImageView android:layout_width="12dp" android:layout_height="12dp" @@ -138,6 +89,55 @@ </LinearLayout> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="8dp" + android:background="@color/image_readability_tint" + android:orientation="horizontal" + android:layout_alignParentBottom="true"> + + <View + android:layout_width="148dp" + android:layout_height="match_parent" /> + + <ImageButton + android:id="@+id/butShowInfo" + android:layout_width="40dp" + android:layout_height="40dp" + android:background="?attr/selectableItemBackground" + android:contentDescription="@string/show_info_label" + android:layout_marginLeft="-8dp" + android:layout_marginStart="-8dp" + android:scaleType="fitXY" + android:padding="8dp" + app:srcCompat="@drawable/ic_info_white" + tools:visibility="visible" /> + + <ImageButton + android:id="@+id/butFilter" + android:layout_width="40dp" + android:layout_height="40dp" + android:background="?attr/selectableItemBackground" + android:contentDescription="@string/filter" + android:scaleType="fitXY" + android:padding="8dp" + app:srcCompat="@drawable/ic_filter_white" + tools:visibility="visible" /> + + <ImageButton + android:id="@+id/butShowSettings" + android:layout_width="40dp" + android:layout_height="40dp" + android:background="?attr/selectableItemBackground" + android:contentDescription="@string/show_feed_settings_label" + android:scaleType="fitXY" + android:padding="8dp" + app:srcCompat="@drawable/ic_settings_white" + tools:visibility="visible" /> + + </LinearLayout> + </RelativeLayout> <com.joanzapata.iconify.widget.IconTextView diff --git a/app/src/main/res/layout/fragment_itunes_search.xml b/app/src/main/res/layout/fragment_itunes_search.xml index e4d2d7492..4dd767d58 100644 --- a/app/src/main/res/layout/fragment_itunes_search.xml +++ b/app/src/main/res/layout/fragment_itunes_search.xml @@ -21,6 +21,7 @@ android:minHeight="?attr/actionBarSize" android:theme="?attr/actionBarTheme" app:title="@string/discover" + app:navigationContentDescription="@string/toolbar_back_button_content_description" app:navigationIcon="?homeAsUpIndicator" /> </com.google.android.material.appbar.AppBarLayout> diff --git a/app/src/main/res/layout/fragment_subscriptions.xml b/app/src/main/res/layout/fragment_subscriptions.xml index f60f925ab..ac40bf5a4 100644 --- a/app/src/main/res/layout/fragment_subscriptions.xml +++ b/app/src/main/res/layout/fragment_subscriptions.xml @@ -17,6 +17,7 @@ android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" app:title="@string/subscriptions_label" + app:navigationContentDescription="@string/toolbar_back_button_content_description" app:navigationIcon="?homeAsUpIndicator" /> <LinearLayout diff --git a/app/src/main/res/layout/home_section.xml b/app/src/main/res/layout/home_section.xml index a8885b514..8a1e21907 100644 --- a/app/src/main/res/layout/home_section.xml +++ b/app/src/main/res/layout/home_section.xml @@ -39,6 +39,7 @@ android:layout_marginLeft="8dp" android:background="?attr/selectableItemBackgroundBorderless" android:visibility="gone" + android:contentDescription="@string/shuffle_suggestions" app:layout_constraintBottom_toBottomOf="@id/barrier" app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toEndOf="@id/titleLabel" diff --git a/app/src/main/res/layout/queue_fragment.xml b/app/src/main/res/layout/queue_fragment.xml index 67b8eda80..50a0337fb 100644 --- a/app/src/main/res/layout/queue_fragment.xml +++ b/app/src/main/res/layout/queue_fragment.xml @@ -17,6 +17,7 @@ android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" + app:navigationContentDescription="@string/toolbar_back_button_content_description" app:navigationIcon="?homeAsUpIndicator" app:title="@string/queue_label" /> diff --git a/app/src/main/res/layout/search_fragment.xml b/app/src/main/res/layout/search_fragment.xml index 0d4ea6556..ff5de0f9f 100644 --- a/app/src/main/res/layout/search_fragment.xml +++ b/app/src/main/res/layout/search_fragment.xml @@ -19,6 +19,7 @@ android:minHeight="?attr/actionBarSize" android:theme="?attr/actionBarTheme" app:title="@string/search_label" + app:navigationContentDescription="@string/toolbar_back_button_content_description" app:navigationIcon="?homeAsUpIndicator" /> </com.google.android.material.appbar.AppBarLayout> diff --git a/app/src/main/res/layout/simple_list_fragment.xml b/app/src/main/res/layout/simple_list_fragment.xml index fc08dccf2..bcc43cfcc 100644 --- a/app/src/main/res/layout/simple_list_fragment.xml +++ b/app/src/main/res/layout/simple_list_fragment.xml @@ -15,6 +15,7 @@ android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" + app:navigationContentDescription="@string/toolbar_back_button_content_description" app:navigationIcon="?homeAsUpIndicator" /> </com.google.android.material.appbar.AppBarLayout> diff --git a/app/src/main/res/layout/subscription_item.xml b/app/src/main/res/layout/subscription_item.xml index 0b689fa28..d9a2800c1 100644 --- a/app/src/main/res/layout/subscription_item.xml +++ b/app/src/main/res/layout/subscription_item.xml @@ -82,6 +82,7 @@ android:gravity="start" android:textColor="?android:attr/textColorPrimary" android:lines="2" + android:importantForAccessibility="no" tools:text="@sample/episodes.json/data/title" /> </LinearLayout> |