Accessibility for iconified nav menu

pull/217/head
M66B 5 months ago
parent cf05210d7c
commit d3bd2ec2f4

@ -19,6 +19,9 @@ package eu.faircode.email;
Copyright 2018-2025 by Marcel Bokhorst (M66B)
*/
import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO;
import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_YES;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@ -172,6 +175,9 @@ public class AdapterNavAccountFolder extends RecyclerView.Adapter<AdapterNavAcco
tvItem.setTypeface(count == 0 ? Typeface.DEFAULT : Typeface.DEFAULT_BOLD);
tvItem.setVisibility(expanded ? View.VISIBLE : View.GONE);
ivItem.setContentDescription(tvItem.getText());
ivItem.setImportantForAccessibility(expanded ? IMPORTANT_FOR_ACCESSIBILITY_NO : IMPORTANT_FOR_ACCESSIBILITY_YES);
if (account.folderName == null) {
if (account.last_connected != null && expanded && nav_last_sync) {
Calendar cal = Calendar.getInstance();

@ -19,6 +19,9 @@ package eu.faircode.email;
Copyright 2018-2025 by Marcel Bokhorst (M66B)
*/
import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO;
import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_YES;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.ColorStateList;
@ -118,6 +121,9 @@ public class AdapterNavMenu extends RecyclerView.Adapter<AdapterNavMenu.ViewHold
tvItem.setTypeface(count == null ? Typeface.DEFAULT : Typeface.DEFAULT_BOLD);
tvItem.setVisibility(expanded ? View.VISIBLE : View.GONE);
ivItem.setContentDescription(tvItem.getText());
ivItem.setImportantForAccessibility(expanded ? IMPORTANT_FOR_ACCESSIBILITY_NO : IMPORTANT_FOR_ACCESSIBILITY_YES);
tvItemExtra.setText(menu.getSubtitle());
tvItemExtra.setVisibility(menu.getSubtitle() != null && expanded ? View.VISIBLE : View.GONE);

@ -19,6 +19,9 @@ package eu.faircode.email;
Copyright 2018-2025 by Marcel Bokhorst (M66B)
*/
import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO;
import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_YES;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
@ -93,6 +96,9 @@ public class AdapterNavSearch extends RecyclerView.Adapter<AdapterNavSearch.View
tvCount.setVisibility(View.GONE);
tvItem.setText(search.name);
ivItem.setContentDescription(tvItem.getText());
ivItem.setImportantForAccessibility(expanded ? IMPORTANT_FOR_ACCESSIBILITY_NO : IMPORTANT_FOR_ACCESSIBILITY_YES);
tvItemExtra.setVisibility(View.GONE);
ivExtra.setVisibility(View.GONE);
ivWarning.setVisibility(View.GONE);

@ -19,6 +19,9 @@ package eu.faircode.email;
Copyright 2018-2025 by Marcel Bokhorst (M66B)
*/
import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO;
import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_YES;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@ -155,6 +158,9 @@ public class AdapterNavUnified extends RecyclerView.Adapter<AdapterNavUnified.Vi
tvItem.setTypeface(count == 0 ? Typeface.DEFAULT : Typeface.DEFAULT_BOLD);
tvItem.setVisibility(expanded ? View.VISIBLE : View.GONE);
ivItem.setContentDescription(tvItem.getText());
ivItem.setImportantForAccessibility(expanded ? IMPORTANT_FOR_ACCESSIBILITY_NO : IMPORTANT_FOR_ACCESSIBILITY_YES);
tvItemExtra.setText(NF.format(folder.messages));
tvItemExtra.setVisibility(nav_count && expanded ? View.VISIBLE : View.GONE);

@ -18,7 +18,6 @@
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:gravity="center_vertical"
android:importantForAccessibility="no"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"

Loading…
Cancel
Save