Skip to content

Commit

Permalink
More automatic testing accessibility fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
DonnKey committed May 23, 2020
1 parent 8ad5cd2 commit 4db4595
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 24 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ released versions... proGuard dependency issue.)
Fix problem with hang if the computation of the book size hasn't
finished before the book is started.

## Version 1.1.3 (pending release)
## Version 1.1.3
Fix a number of accessibility issues and some potential crashes shown by
automatic testing.

Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ android {
multiDexEnabled true
minSdkVersion 17
targetSdkVersion 29
versionCode 6
versionCode 7
versionName getVersionName()
}
buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,12 @@ else if (provisioning.fragmentParameter instanceof AudioBook) {
normalizeButton.setOnClickListener((v) ->
finalTitle.setText(AudioBook.titleCase(Objects.requireNonNull(finalTitle.getText()).toString())));

addAuthorButton.setEnabled(author.getText() != null);
addAuthorButton.setOnClickListener((v) -> {
String a = author.getText().toString();
if (a.length() > 0) {
String s = Objects.requireNonNull(finalTitle.getText()).toString();
s += " - " + a;
finalTitle.setText(s);
}
});
if (author.getText() != null) {
addAuthorButton.setEnabled(true);
author.setEnabled(true);
author.setOnClickListener((v) -> doAddAuthor(author));
addAuthorButton.setOnClickListener((v) -> doAddAuthor(author));
}

doneButton.setOnClickListener((v) -> {
String s = Objects.requireNonNull(finalTitle.getText()).toString();
Expand Down Expand Up @@ -199,6 +196,16 @@ else if (provisioning.fragmentParameter instanceof AudioBook) {
return view;
}

private void doAddAuthor(TextView author) {
String a = author.getText().toString();
if (a.length() > 0) {
String s = Objects.requireNonNull(finalTitle.getText()).toString();
s += " - " + a;
finalTitle.setText(s);
}
}


class inputFilter implements TextWatcher {
boolean textChanged;

Expand Down
5 changes: 3 additions & 2 deletions app/src/main/res/layout/fragment_book_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
app:layout_constraintDimensionRatio="1"
app:layout_constraintEnd_toStartOf="@id/copyBooksInstruction"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintHorizontal_weight="15"
app:layout_constraintHorizontal_weight="18"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="?attr/startSettingsIcon" />
Expand Down Expand Up @@ -80,7 +80,7 @@
app:layout_constraintDimensionRatio="1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintHorizontal_weight="15"
app:layout_constraintHorizontal_weight="18"
app:layout_constraintStart_toEndOf="@id/copyBooksInstruction"
app:layout_constraintTop_toTopOf="parent">

Expand Down Expand Up @@ -200,6 +200,7 @@
android:layout_height="match_parent"
android:background="@color/transparent"
android:gravity="center_vertical|center"
android:importantForAccessibility="no"
android:text="@string/button_start"
android:textAllCaps="true"
android:textColor="?attr/buttonStartTextColor"
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/res/layout/fragment_no_books.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
app:layout_constraintDimensionRatio="1"
app:layout_constraintEnd_toStartOf="@id/h_spacer"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintHorizontal_weight="15"
app:layout_constraintHorizontal_weight="18"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_settings_black_24dp" />
Expand Down Expand Up @@ -85,7 +85,7 @@
app:layout_constraintDimensionRatio="1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintHorizontal_weight="15"
app:layout_constraintHorizontal_weight="18"
app:layout_constraintStart_toEndOf="@id/h_spacer"
app:layout_constraintTop_toTopOf="parent">

Expand Down Expand Up @@ -121,7 +121,7 @@
app:layout_constraintBottom_toTopOf="@id/downloadSamplesButton"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/h_spacer"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="spread_inside"
app:layout_constraintVertical_weight="0" />

Expand All @@ -138,7 +138,7 @@
app:layout_constraintStart_toEndOf="@id/h_space2"
app:layout_constraintTop_toBottomOf="@id/space1"
app:layout_constraintVertical_chainStyle="spread_inside"
app:layout_constraintVertical_weight="30" />
app:layout_constraintVertical_weight="35" />

<Space
android:id="@+id/space2"
Expand Down Expand Up @@ -193,7 +193,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/space3"
app:layout_constraintVertical_chainStyle="spread_inside"
app:layout_constraintVertical_weight="20"
app:layout_constraintVertical_weight="15"
tools:text="Path to books" />

<Space
Expand Down Expand Up @@ -276,7 +276,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/space5"
app:layout_constraintVertical_chainStyle="spread_inside"
app:layout_constraintVertical_weight="20" />
app:layout_constraintVertical_weight="15" />

<Button
android:id="@+id/goToWeb"
Expand All @@ -288,7 +288,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/installViaSettings"
app:layout_constraintVertical_weight="25" />
app:layout_constraintVertical_weight="30" />

<Space
android:id="@+id/space6"
Expand Down
7 changes: 5 additions & 2 deletions app/src/main/res/layout/fragment_title_edit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
android:layout_height="wrap_content"
android:autofillHints=""
android:background="#FFFFFF"
android:ems="10"
android:hint="@string/title_edit_hint_book_title"
android:textSize="20sp"
android:inputType="text"
android:maxLines="1"
android:paddingTop="10dp"
Expand Down Expand Up @@ -100,11 +100,11 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:clickable="true"
android:ems="10"
android:enabled="true"
android:focusable="true"
android:gravity="start"
android:textColor="?attr/provisioningTextColor2"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/button_normalize"
Expand All @@ -121,6 +121,7 @@
android:focusable="true"
android:gravity="start"
android:textColor="?attr/provisioningTextColor2"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -138,6 +139,7 @@
android:focusable="true"
android:gravity="start"
android:textColor="?attr/provisioningTextColor2"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/audio_title"
Expand Down Expand Up @@ -171,6 +173,7 @@
android:focusable="true"
android:gravity="start"
android:textColor="?attr/provisioningTextColor2"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="@+id/button_cancel"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/button_cancel"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/menu/provisioning_navigation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@

<item
android:id="@+id/navigation_settings"
android:title="@string/title_settings"
android:contentDescription="@string/return_to_settings_screen"
android:icon="@drawable/ic_settings_white_24dp"
android:title="@string/title_settings" />
android:icon="@drawable/ic_settings_white_24dp" />

<item
android:id="@+id/navigation_maintenance"
Expand Down

0 comments on commit 4db4595

Please sign in to comment.