Accessibility tweaks reported by Google Play (#7549)
This commit is contained in:
parent
a92691cf57
commit
f835c5adae
@ -1,6 +1,7 @@
|
||||
package de.danoeh.antennapod.ui.screen.playback;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
@ -10,6 +11,8 @@ import androidx.annotation.Nullable;
|
||||
import androidx.core.util.Consumer;
|
||||
import de.danoeh.antennapod.R;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class PlaybackSpeedSeekBar extends FrameLayout {
|
||||
private SeekBar seekBar;
|
||||
private Consumer<Float> progressChangedListener;
|
||||
@ -56,6 +59,9 @@ public class PlaybackSpeedSeekBar extends FrameLayout {
|
||||
|
||||
public void updateSpeed(float speedMultiplier) {
|
||||
seekBar.setProgress(Math.round((20 * speedMultiplier) - 10));
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
seekBar.setStateDescription(String.format(Locale.getDefault(), "%1$.2f", speedMultiplier));
|
||||
}
|
||||
}
|
||||
|
||||
public void setProgressChangedListener(Consumer<Float> progressChangedListener) {
|
||||
|
@ -21,6 +21,7 @@ public class EmptyViewHandler {
|
||||
private boolean layoutAdded = false;
|
||||
private ListAdapter listAdapter;
|
||||
private RecyclerView.Adapter<?> recyclerAdapter;
|
||||
private View listView;
|
||||
|
||||
private final View emptyView;
|
||||
private final TextView tvTitle;
|
||||
@ -65,6 +66,7 @@ public class EmptyViewHandler {
|
||||
}
|
||||
addToParentView(listView);
|
||||
layoutAdded = true;
|
||||
this.listView = listView;
|
||||
listView.setEmptyView(emptyView);
|
||||
updateAdapter(listView.getAdapter());
|
||||
}
|
||||
@ -75,6 +77,7 @@ public class EmptyViewHandler {
|
||||
}
|
||||
addToParentView(recyclerView);
|
||||
layoutAdded = true;
|
||||
this.listView = recyclerView;
|
||||
updateAdapter(recyclerView.getAdapter());
|
||||
}
|
||||
|
||||
@ -152,5 +155,6 @@ public class EmptyViewHandler {
|
||||
empty = true;
|
||||
}
|
||||
emptyView.setVisibility(empty ? View.VISIBLE : View.GONE);
|
||||
listView.setVisibility(empty ? View.INVISIBLE : View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
@ -42,6 +41,7 @@
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
app:cardCornerRadius="28dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
@ -88,6 +88,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="16dp"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:name="de.danoeh.antennapod.ui.discovery.QuickFeedDiscoveryFragment" />
|
||||
|
||||
<TextView
|
||||
|
@ -41,6 +41,7 @@
|
||||
android:id="@+id/newTagEditText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/add_tag"
|
||||
android:layout_weight="1"
|
||||
android:padding="16dp"
|
||||
android:inputType="text"
|
||||
|
@ -19,9 +19,9 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:background="@color/image_readability_tint"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_alignParentBottom="true">
|
||||
|
||||
<View
|
||||
@ -34,40 +34,41 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/subscribe_label"
|
||||
android:visibility="gone"
|
||||
android:layout_marginVertical="4dp"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/butShowInfo"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:contentDescription="@string/show_info_label"
|
||||
android:layout_marginLeft="-8dp"
|
||||
android:layout_marginStart="-8dp"
|
||||
android:layout_marginLeft="-4dp"
|
||||
android:layout_marginStart="-4dp"
|
||||
android:scaleType="fitXY"
|
||||
android:padding="8dp"
|
||||
android:padding="12dp"
|
||||
app:srcCompat="@drawable/ic_info_white"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/butFilter"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:contentDescription="@string/filter"
|
||||
android:scaleType="fitXY"
|
||||
android:padding="8dp"
|
||||
android:padding="12dp"
|
||||
app:srcCompat="@drawable/ic_filter_white"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/butShowSettings"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:contentDescription="@string/show_feed_settings_label"
|
||||
android:scaleType="fitXY"
|
||||
android:padding="8dp"
|
||||
android:padding="12dp"
|
||||
app:srcCompat="@drawable/ic_settings_white"
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
@ -10,8 +10,7 @@
|
||||
android:id="@+id/useGlobalCheckbox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/global_default"
|
||||
android:layout_marginBottom="8dp" />
|
||||
android:text="@string/global_default" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -1,47 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
<ImageView
|
||||
android:id="@+id/butDecSpeed"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:gravity="center"
|
||||
android:text="-"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="14dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:scrollbars="none"
|
||||
android:textStyle="bold"
|
||||
android:textSize="24sp"
|
||||
android:textColor="?attr/colorSecondary"
|
||||
android:src="@drawable/ic_minus"
|
||||
android:contentDescription="@string/decrease_speed"
|
||||
android:background="?attr/selectableItemBackgroundBorderless" />
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
app:tint="?attr/colorSecondary" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/playback_speed"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="40dp"
|
||||
android:max="70"
|
||||
android:paddingVertical="4dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
<ImageView
|
||||
android:id="@+id/butIncSpeed"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:gravity="center"
|
||||
android:text="+"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="14dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:scrollbars="none"
|
||||
android:textStyle="bold"
|
||||
android:textSize="24sp"
|
||||
android:textColor="?attr/colorSecondary"
|
||||
android:src="@drawable/ic_add"
|
||||
android:contentDescription="@string/increase_speed"
|
||||
android:background="?attr/selectableItemBackgroundBorderless" />
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
app:tint="?attr/colorSecondary" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -28,7 +28,7 @@
|
||||
android:id="@+id/speed_seek_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp" />
|
||||
android:layout_marginTop="-8dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
5
ui/common/src/main/res/drawable/ic_minus.xml
Normal file
5
ui/common/src/main/res/drawable/ic_minus.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="?attr/action_icon_color" android:pathData="M19 13h-14v-2h14z"/>
|
||||
</vector>
|
@ -309,9 +309,13 @@
|
||||
<item name="android:drawablePadding">8dp</item>
|
||||
<item name="android:paddingTop">8dp</item>
|
||||
<item name="android:paddingBottom">8dp</item>
|
||||
<item name="android:paddingStart">16dp</item>
|
||||
<item name="android:paddingEnd">16dp</item>
|
||||
<item name="android:background">?android:attr/selectableItemBackground</item>
|
||||
<item name="android:textColor">?android:attr/textColorPrimary</item>
|
||||
<item name="android:clickable">true</item>
|
||||
<item name="android:minHeight">48dp</item>
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
</style>
|
||||
|
||||
<style name="TextPill">
|
||||
|
Loading…
x
Reference in New Issue
Block a user