Accessibility fixes

This commit is contained in:
Sylvia van Os
2022-01-07 22:02:51 +01:00
parent cb0deaae27
commit eb38d0a8aa
30 changed files with 45 additions and 24 deletions

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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<Integer, Integer> mIndexCardMap;
private HashMap<Integer, Boolean> mInGroupOverlay;

View File

@@ -61,6 +61,7 @@
app:layout_constraintTop_toBottomOf="@id/version_history_main" />
<TextView
android:importantForAccessibility="no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
@@ -101,6 +102,7 @@
app:layout_constraintTop_toBottomOf="@id/credits_main" />
<TextView
android:importantForAccessibility="no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
@@ -143,6 +145,7 @@
app:layout_constraintTop_toBottomOf="@id/translate_main"/>
<TextView
android:importantForAccessibility="no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
@@ -185,6 +188,7 @@
app:layout_constraintTop_toBottomOf="@id/license_main"/>
<TextView
android:importantForAccessibility="no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
@@ -226,6 +230,7 @@
app:layout_constraintTop_toBottomOf="@id/repo_main" />
<TextView
android:importantForAccessibility="no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
@@ -267,6 +272,7 @@
app:layout_constraintTop_toBottomOf="@id/privacy_main" />
<TextView
android:importantForAccessibility="no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
@@ -308,6 +314,7 @@
app:layout_constraintTop_toBottomOf="@id/rate_main" />
<TextView
android:importantForAccessibility="no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
@@ -349,6 +356,7 @@
android:padding="2dp"/>
<TextView
android:importantForAccessibility="no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"

View File

@@ -5,6 +5,7 @@
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView
android:importantForAccessibility="no"
android:layout_width="match_parent"
android:layout_height="@dimen/barcode_disp_height"
android:layout_gravity="center_horizontal"

View File

@@ -2,6 +2,7 @@
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
@@ -62,7 +63,8 @@
android:hint="AB1234"
android:importantForAutofill="no"
android:inputType="text"
android:minHeight="48dp" />
android:minHeight="48dp"
tools:ignore="ContentDescription" />
</LinearLayout>
<Button
android:id="@+id/noBarcode"

View File

@@ -188,6 +188,7 @@
android:layout_height="wrap_content"
android:id="@+id/barcodeLayout">
<ImageView
android:importantForAccessibility="no"
android:layout_width="0dp"
android:layout_height="@dimen/barcode_disp_height"
android:layout_gravity="center_horizontal"
@@ -249,6 +250,7 @@
android:orientation="horizontal">
<com.google.android.material.chip.ChipGroup
android:contentDescription="@string/groups"
android:id="@+id/groupChips"
android:layout_height="match_parent"
android:layout_width="match_parent"

View File

@@ -23,6 +23,7 @@
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:importantForAccessibility="no"
android:id="@+id/thumbnail"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -35,6 +36,7 @@
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:importantForAccessibility="no"
android:id="@+id/selected_thumbnail"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -58,7 +60,7 @@
android:layout_height="@dimen/cardThumbnailSize"
android:layout_gravity="end"
android:alpha="0.5"
android:contentDescription="@string/starImage"
android:contentDescription="@string/starred"
android:elevation="4dp"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
@@ -67,6 +69,7 @@
tools:ignore="ImageContrastCheck" />
<ImageView
android:importantForAccessibility="no"
android:id="@+id/star_border"
android:layout_width="@dimen/cardThumbnailSize"
android:layout_height="@dimen/cardThumbnailSize"
@@ -85,6 +88,7 @@
</com.google.android.material.card.MaterialCardView>
<TextView
android:accessibilityPaneTitle="@string/storeName"
android:id="@+id/store"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -99,6 +103,7 @@
tools:text="Example store"/>
<TextView
android:accessibilityPaneTitle="@string/note"
android:id="@+id/note"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -131,6 +136,7 @@
app:layout_constraintStart_toStartOf="parent"/>
<TextView
android:accessibilityPaneTitle="@string/balance"
android:id="@+id/balance"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -150,6 +156,7 @@
tools:text="525 points"/>
<TextView
android:accessibilityPaneTitle="@string/expiryDate"
android:id="@+id/expiry"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

@@ -25,6 +25,7 @@
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/mainLayout"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical">
@@ -107,6 +108,7 @@
app:layout_constraintTop_toBottomOf="@+id/minimizeButton"/>
<SeekBar
android:contentDescription="@string/set_scale"
android:id="@+id/barcodeScaler"
android:visibility="gone"
android:max="100"
@@ -168,7 +170,7 @@
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_gravity="top|start"
android:contentDescription="@string/toggleMoreInfo"
android:contentDescription="@string/showMoreInfo"
android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_baseline_arrow_drop_up_24"
app:tint="#ffffff" />

View File

@@ -188,7 +188,6 @@
<string name="settings_system_locale">Система</string>
<string name="settings_locale">Език</string>
<string name="noGroupCards">Групата не съдържа карти</string>
<string name="toggleMoreInfo">Превключване на повече информация</string>
<string name="barcodeImageDescriptionWithType">Изображение на щрихкод на карта от вида <xliff:g>%s</xliff:g></string>
<string name="swipeToSwitchImages">Плъзване или задържане за смяна на изображения</string>
<string name="sort_by">Сортиране по</string>

View File

@@ -66,7 +66,6 @@
<string name="settings_green_theme">সবুজ থিম</string>
<string name="settings_brown_theme">বাদামী থিম</string>
<string name="sort">সাজান</string>
<string name="toggleMoreInfo">আরও তথ্য টগল করুন</string>
<string name="swipeToSwitchImages">ছবি পরিবর্তন করতে সোয়াইপ করুন</string>
<string name="sort_by_name">নামের দ্বারা সাজান</string>
<string name="sort_by_most_recently_used">সর্বাধিক সম্প্রতি ব্যবহৃত দ্বারা সাজান</string>

View File

@@ -66,7 +66,6 @@
<string name="settings_green_theme">Zeleno</string>
<string name="settings_brown_theme">Braun</string>
<string name="sort">Poništi sortiranje</string>
<string name="toggleMoreInfo">Uključi savjete</string>
<string name="swipeToSwitchImages">Swipe ili long press za prebacivanje slika</string>
<string name="sort_by_name">Ime</string>
<string name="sort_by_most_recently_used">Nedavno Korišten</string>

View File

@@ -199,7 +199,6 @@
<string name="sort_by_most_recently_used">Naposledy použité</string>
<string name="sort_by_name">Název</string>
<string name="swipeToSwitchImages">Přejetím nebo dlouhým stisknutím přepínáte obrázky</string>
<string name="toggleMoreInfo">Přepnout zobrazení dalších informací</string>
<string name="sort">Seřadit</string>
<string name="barcodeImageDescriptionWithType">Obrázek čárového kódu karty typu <xliff:g>%s</xliff:g></string>
<string name="version_history">Historie verzí</string>

View File

@@ -188,7 +188,6 @@
<string name="settings_catima_theme">Catima</string>
<string name="settings_theme_color">Designfarbe</string>
<string name="app_contributors">Ermöglicht durch: <xliff:g id="app_contributors">%s</xliff:g></string>
<string name="toggleMoreInfo">Umschalten, um weitere Informationen anzuzeigen</string>
<string name="barcodeImageDescriptionWithType">Bild <xliff:g>%s</xliff:g> Barcode</string>
<string name="swipeToSwitchImages">Wischen oder langes Drücken zum Wechseln der Bilder</string>
<string name="sort_by">Sortieren nach</string>

View File

@@ -188,7 +188,6 @@
<string name="settings_theme_color">Couleur du thème</string>
<string name="app_contributors">Rendu possible par : <xliff:g id="app_contributors">%s</xliff:g></string>
<string name="noGroupCards">Ce groupe est vide</string>
<string name="toggleMoreInfo">Activer/désactiver laffichage de plus dinfos</string>
<string name="barcodeImageDescriptionWithType">Image <xliff:g>%s</xliff:g> code-barres</string>
<string name="swipeToSwitchImages">Balayez ou appuyez longuement pour changer dimage</string>
<string name="sort">Trier</string>

View File

@@ -180,7 +180,6 @@
<string name="exportPassword">Tetapkan kata sandi untuk melindungi ekspor anda (opsional)</string>
<string name="failedGeneratingShareURL">Tidak dapat membuat alamat berbagi. Mohon laporkan ini.</string>
<string name="app_contributors">Pengembangan dibantu oleh: <xliff:g id="app_contributors">%s</xliff:g></string>
<string name="toggleMoreInfo">Tampilkan info selengkapnya</string>
<string name="swipeToSwitchImages">Geser atau tekan yang lama untuk mengganti gambar</string>
<string name="reverse">Ubah urutan</string>
<string name="version_history">Riwayat Versi</string>

View File

@@ -188,7 +188,6 @@
<string name="settings_theme_color">Colore del tema</string>
<string name="app_contributors">Reso possibile da: <xliff:g id="app_contributors">%s</xliff:g></string>
<string name="noGroupCards">Questo gruppo è vuoto</string>
<string name="toggleMoreInfo">Attiva/disattiva la visualizzazione di altre informazioni</string>
<string name="barcodeImageDescriptionWithType">Immagine del codice a barre in formato <xliff:g>%s</xliff:g></string>
<string name="swipeToSwitchImages">Scorri o premi a lungo per cambiare immagine</string>
<string name="sort_by">Ordina per</string>

View File

@@ -171,7 +171,6 @@
<item quantity="other"><xliff:g>%d</xliff:g> 枚のカードの削除</item>
</plurals>
<string name="barcodeImageDescriptionWithType">バーコード形式の画像 <xliff:g>%s</xliff:g></string>
<string name="toggleMoreInfo">詳細を表示する</string>
<string name="app_contributors">Made possible by: <xliff:g id="app_contributors">%s</xliff:g></string>
<string name="settings_brown_theme">Brown</string>
<string name="settings_grey_theme">Gray</string>

View File

@@ -192,7 +192,6 @@
<string name="settings_theme_color">Temos spalva</string>
<string name="app_contributors">Tapo įmanoma su pagalba: <xliff:g id="app_contributors">%s</xliff:g></string>
<string name="noGroupCards">Šioje grupėje nėra jokių kortelių</string>
<string name="toggleMoreInfo">Perjungti išsamios informacijos rodymą</string>
<string name="barcodeImageDescriptionWithType"><xliff:g>%s</xliff:g> tipo kortelės brūkšninio kodo vaizdas</string>
<string name="swipeToSwitchImages">Perbraukite arba ilgai palaikykite paspaudę, kad perjungtumėte vaizdus</string>
<string name="sort_by">Rikiuoti pagal</string>

View File

@@ -186,7 +186,6 @@
<string name="settings_catima_theme">Catima</string>
<string name="settings_theme_color">Draktfarge</string>
<string name="noGroupCards">Denne gruppen er tom</string>
<string name="toggleMoreInfo">Veksle visning av mer info</string>
<string name="barcodeImageDescriptionWithType">Bilde av <xliff:g>%s</xliff:g>-strekkode</string>
<string name="swipeToSwitchImages">Dra eller hold lenge for å bygge bilder</string>
<string name="sort_by">Sorter etter</string>

View File

@@ -188,7 +188,6 @@
<string name="settings_theme_color">Themakleur</string>
<string name="app_contributors">Mede mogelijk gemaakt door: <xliff:g id="app_contributors">%s</xliff:g></string>
<string name="noGroupCards">Deze groep bevat geen kaarten</string>
<string name="toggleMoreInfo">Meer informatie tonen/verbergen</string>
<string name="barcodeImageDescriptionWithType">Afbeelding van barcode <xliff:g>%s</xliff:g></string>
<string name="swipeToSwitchImages">Veeg of houd lang ingedrukt om te bladeren</string>
<string name="sort_by">Sorteren op</string>

View File

@@ -196,7 +196,6 @@
<item quantity="many"><xliff:g>%d</xliff:g> zaznaczonych</item>
<item quantity="other"><xliff:g>%d</xliff:g> zaznaczonych</item>
</plurals>
<string name="toggleMoreInfo">Przełącz wyświetlanie większej ilości informacji</string>
<string name="shortcutSelectCard">Wybierz kartę</string>
<string name="action_show_details">Pokaż szczegóły</string>
<string name="action_hide_details">Ukryj szczegóły</string>

View File

@@ -127,7 +127,6 @@
<string name="settings_brown_theme">Castanho</string>
<string name="app_contributors">Tornado possível por: <xliff:g id="app_contributors">%s</xliff:g></string>
<string name="sort">Ordenar</string>
<string name="toggleMoreInfo">Alternar mostrar mais informação</string>
<string name="swipeToSwitchImages">Deslize ou pressione prolongadamente para mudar as imagens</string>
<string name="sort_by_name">Nome</string>
<string name="sort_by_most_recently_used">Mais usados recentemente</string>

View File

@@ -180,7 +180,6 @@
<string name="settings_blue_theme">Azul</string>
<string name="app_contributors">Tornado possível por: <xliff:g id="app_contributors">%s</xliff:g></string>
<string name="sort">Ordenar</string>
<string name="toggleMoreInfo">Alternar mostrar mais informação</string>
<string name="swipeToSwitchImages">Deslize ou pressione prolongadamente para mudar as imagens</string>
<string name="sort_by_name">Nome</string>
<string name="sort_by_most_recently_used">Mais usados recentemente</string>

View File

@@ -197,7 +197,6 @@
<string name="app_contributors">Создано при поддержке: <xliff:g id="app_contributors">%s</xliff:g></string>
<string name="noGroupCards">Группа пуста</string>
<string name="barcodeImageDescriptionWithType">Изображение штрих-кода <xliff:g>%s</xliff:g></string>
<string name="toggleMoreInfo">Переключение отображения дополнительной информации</string>
<string name="swipeToSwitchImages">Смахивание или долгое нажатие для переключения изображений</string>
<string name="sort_by_expiry">Срок действия</string>
<string name="sort_by">Сортировать по</string>

View File

@@ -188,7 +188,6 @@
<string name="settings_catima_theme">Catima</string>
<string name="settings_theme_color">Temafärg</string>
<string name="noGroupCards">Denna grupp är tom</string>
<string name="toggleMoreInfo">Växla mellan att visa mer info</string>
<string name="barcodeImageDescriptionWithType">Bild <xliff:g>%s</xliff:g> streckkod</string>
<string name="swipeToSwitchImages">Svep eller tryck länge för att växla bild</string>
<string name="reverse">...i omvänd ordning</string>

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2" xmlns:tools="http://schemas.android.com/tools">
<string name="swipeToSwitchImages">Resimler arasında geçiş yapmak için kaydırın veya uzun basın</string>
<string name="toggleMoreInfo">Daha fazla bilgi göstermeyi aç/kapat</string>
<string name="app_contributors">Katkıda bulunanlar: <xliff:g id="app_contributors">%s</xliff:g></string>
<string name="settings_brown_theme">Kahverengi</string>
<string name="settings_grey_theme">Gri</string>

View File

@@ -196,7 +196,6 @@
<string name="settings_sky_blue_theme">Небесно-синій</string>
<string name="app_contributors">Стало можливим завдяки: <xliff:g id="app_contributors">%s</xliff:g></string>
<string name="noGroupCards">Пуста група</string>
<string name="toggleMoreInfo">Показувати додаткову інформацію</string>
<string name="barcodeImageDescriptionWithType">Зображення штрих-коду <xliff:g>%s</xliff:g></string>
<string name="swipeToSwitchImages">Свайп чи довге натискання для зміни зображень</string>
<string name="sort_by">Сортувати за</string>

View File

@@ -201,7 +201,6 @@
<string name="backImageDescription">卡片 (背面)</string>
<string name="updateBarcodeQuestionText">您已更新了條碼 ID是否要更新條碼內容以匹配此 ID</string>
<string name="failedGeneratingShareURL">無法建立可分享的 URL請回報此錯誤。</string>
<string name="toggleMoreInfo">切換顯示更多內容</string>
<string name="swipeToSwitchImages">滑動或長按以切換圖片</string>
<string name="starImage">收藏標示</string>
</resources>

View File

@@ -235,7 +235,8 @@
<string name="settings_key_brown_theme" translatable="false">brown_theme</string>
<string name="app_contributors">Made possible by: <xliff:g id="app_contributors">%s</xliff:g></string>
<string name="sort">Sort</string>
<string name="toggleMoreInfo">Toggle showing more info</string>
<string name="showMoreInfo">Show more info</string>
<string name="hideMoreInfo">Hide more info</string>
<string name="swipeToSwitchImages">Swipe or long press to switch images</string>
<string name="sort_by_name">Name</string>
<string name="sort_by_most_recently_used">Most Recently Used</string>
@@ -260,4 +261,6 @@
<string name="translate_platform">on Weblate</string>
<string name="shortcutSelectCard">Select a card</string>
<string name="options">Options</string>
<string name="starred">Starred</string>
<string name="set_scale">Set scale</string>
</resources>