Some more accessibility tweaks (#6713)

This commit is contained in:
ByteHamster 2023-10-22 13:14:36 +02:00 committed by GitHub
parent 61669d32fa
commit 0b7403e1dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 59 additions and 50 deletions

View File

@ -375,10 +375,16 @@ public class AudioPlayerFragment extends Fragment implements
return;
}
txtvPosition.setText(Converter.getDurationStringLong(currentPosition));
txtvPosition.setContentDescription(getString(R.string.position,
Converter.getDurationStringLocalized(getContext(), currentPosition)));
showTimeLeft = UserPreferences.shouldShowRemainingTime();
if (showTimeLeft) {
txtvLength.setContentDescription(getString(R.string.remaining_time,
Converter.getDurationStringLocalized(getContext(), remainingTime)));
txtvLength.setText(((remainingTime > 0) ? "-" : "") + Converter.getDurationStringLong(remainingTime));
} else {
txtvLength.setContentDescription(getString(R.string.chapter_duration,
Converter.getDurationStringLocalized(getContext(), duration)));
txtvLength.setText(Converter.getDurationStringLong(duration));
}

View File

@ -79,7 +79,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:focusableInTouchMode="true"
android:padding="16dp">
<androidx.fragment.app.FragmentContainerView
@ -95,6 +94,7 @@
android:textSize="18sp"
android:layout_marginTop="16dp"
android:layout_marginBottom="8dp"
android:accessibilityHeading="true"
android:textColor="?android:attr/textColorPrimary" />
<TextView

View File

@ -16,6 +16,55 @@
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"
@ -89,55 +138,6 @@
</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

View File

@ -19,6 +19,7 @@
android:textColor="?android:attr/textColorPrimary"
android:textSize="18sp"
android:layout_marginVertical="8dp"
android:accessibilityHeading="true"
app:layout_constraintWidth_max="wrap"
app:layout_constraintWidth_percent="0.6"
app:layout_constraintBottom_toBottomOf="@id/barrier"

View File

@ -19,6 +19,7 @@
android:textSize="18sp"
android:layout_marginBottom="8dp"
android:layout_weight="1"
android:accessibilityHeading="true"
android:textColor="?android:attr/textColorPrimary" />
<Button

View File

@ -682,6 +682,7 @@
<string name="is_inbox_label">Episode is in the inbox</string>
<string name="load_next_page_label">Load next page</string>
<string name="position">Position: %1$s</string>
<string name="remaining_time">Remaining time: %1$s</string>
<string name="apply_action">Apply action</string>
<string name="play_chapter">Play chapter</string>
<string name="prev_chapter">Previous chapter</string>