diff --git a/CHANGELOG.md b/CHANGELOG.md index 6457c45c0..d6acf3bbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Unreleased - 98 + +- Fix various TalkBack-related bugs + ## v2.13.0 - 97 (2022-01-03) - Fixed pressing the save button multiple times creating multiple entries diff --git a/app/src/main/java/protect/card_locker/LoyaltyCardViewActivity.java b/app/src/main/java/protect/card_locker/LoyaltyCardViewActivity.java index 13d6e1263..b6a795f13 100644 --- a/app/src/main/java/protect/card_locker/LoyaltyCardViewActivity.java +++ b/app/src/main/java/protect/card_locker/LoyaltyCardViewActivity.java @@ -46,6 +46,7 @@ import androidx.appcompat.app.ActionBar; import androidx.appcompat.content.res.AppCompatResources; import androidx.appcompat.widget.AppCompatTextView; import androidx.appcompat.widget.Toolbar; +import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.Guideline; import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.core.content.ContextCompat; @@ -63,6 +64,7 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements private GestureDetector mGestureDetector; CoordinatorLayout coordinatorLayout; + ConstraintLayout mainLayout; TextView cardIdFieldView; BottomSheetBehavior behavior; LinearLayout bottomSheet; @@ -262,6 +264,7 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements importURIHelper = new ImportURIHelper(this); coordinatorLayout = findViewById(R.id.coordinator_layout); + mainLayout = findViewById(R.id.mainLayout); cardIdFieldView = findViewById(R.id.cardIdView); bottomSheet = findViewById(R.id.bottom_sheet); bottomSheetContentWrapper = findViewById(R.id.bottomSheetContentWrapper); @@ -379,9 +382,13 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements editButton.hide(); } else if (newState == BottomSheetBehavior.STATE_EXPANDED) { bottomSheetButton.setImageResource(R.drawable.ic_baseline_arrow_drop_down_24); + bottomSheetButton.setContentDescription(getString(R.string.hideMoreInfo)); + mainLayout.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS); editButton.hide(); } else if (newState == BottomSheetBehavior.STATE_COLLAPSED) { bottomSheetButton.setImageResource(R.drawable.ic_baseline_arrow_drop_up_24); + bottomSheetButton.setContentDescription(getString(R.string.showMoreInfo)); + mainLayout.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_AUTO); if (!isFullscreen) { editButton.show(); } @@ -830,12 +837,15 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements drawBarcode(); } mainImage.setBackgroundColor(Color.WHITE); + mainImage.setContentDescription(getString(R.string.barcodeImageDescriptionWithType, format.prettyName())); } else if (wantedImageType == ImageType.IMAGE_FRONT) { mainImage.setImageBitmap(frontImageBitmap); mainImage.setBackgroundColor(Color.TRANSPARENT); + mainImage.setContentDescription(getString(R.string.frontImageDescription)); } else if (wantedImageType == ImageType.IMAGE_BACK) { mainImage.setImageBitmap(backImageBitmap); mainImage.setBackgroundColor(Color.TRANSPARENT); + mainImage.setContentDescription(getString(R.string.backImageDescription)); } else { throw new IllegalArgumentException("Unknown image type: " + wantedImageType); } diff --git a/app/src/main/java/protect/card_locker/ManageGroupCursorAdapter.java b/app/src/main/java/protect/card_locker/ManageGroupCursorAdapter.java index 9e198719b..1ec9b6c2d 100644 --- a/app/src/main/java/protect/card_locker/ManageGroupCursorAdapter.java +++ b/app/src/main/java/protect/card_locker/ManageGroupCursorAdapter.java @@ -8,6 +8,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import androidx.recyclerview.widget.RecyclerView; + public class ManageGroupCursorAdapter extends LoyaltyCardCursorAdapter { private HashMap mIndexCardMap; private HashMap mInGroupOverlay; diff --git a/app/src/main/res/layout/about_activity.xml b/app/src/main/res/layout/about_activity.xml index 38c21e419..c0df438dd 100644 --- a/app/src/main/res/layout/about_activity.xml +++ b/app/src/main/res/layout/about_activity.xml @@ -61,6 +61,7 @@ app:layout_constraintTop_toBottomOf="@id/version_history_main" /> @@ -62,7 +63,8 @@ android:hint="AB1234" android:importantForAutofill="no" android:inputType="text" - android:minHeight="48dp" /> + android:minHeight="48dp" + tools:ignore="ContentDescription" />