ContentDescription を無視する - [Accessibility] Missing contentDescription attribute on image

これの件です。

ContentDescription を無視する

公式の説明には、次のように書いてます。

スクリーン リーダーなどのユーザー補助機能サービスを利用している場合は、コンテンツ ラベルを通してユーザー インターフェースの各要素の意味を把握することになります。

ImageView、ImageButton、CheckBox など、情報を画像で伝える View を使用している場合は、android:contentDescription 属性を使用して、その View のコンテンツ ラベルを設定します。

意味のある情報を伝えない装飾的な画像には、コンテンツ ラベルは必要ありません。この場合は、"@null" の android:contentDescription 属性または "no" の android:importantForAccessibility 属性を設定します。

👉 コンテンツ ラベル - Android のユーザー補助機能 ヘルプ hatena-bookmark

要するに、

「飾りの意味のみの音声化する必要のないものはテキスト不要」

ということのようです。

以下、GitHub から、著名な開発組織のリポジトリから引用してきました。

 

android:contentDescription="@null"


<ImageView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="48dp"
    android:layout_height="48dp"
    android:contentDescription="@null"
    app:srcCompat="@drawable/io_logo_color" />


<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="top|right"
    android:contentDescription="@null"
    android:src="@drawable/avatar_photo" />

 

android:importantForAccessibility="no"


<ImageView
    android:id="@+id/trending_repository_avatar"
    android:layout_width="40dp"
    android:layout_height="40dp"
    android:layout_alignParentStart="true"
    android:layout_marginEnd="16dp"
    android:importantForAccessibility="no"
    tools:src="@drawable/avatar"
    />


<ImageView
    android:id="@+id/speaker_item_headshot"
    android:layout_width="@dimen/speaker_headshot_size"
    android:layout_height="@dimen/speaker_headshot_size"
    android:layout_marginStart="@dimen/margin_normal"
    android:importantForAccessibility="no"
    android:transitionName="@string/speaker_headshot_transition"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:speakerImage="@{speaker}" />

 

tools:ignore="ContentDescription"

上位タグに


xmlns:tools="http://schemas.android.com/tools"

が必要になります。


<ImageView
     android:id="@+id/direction_indicator"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_gravity="center_vertical"
     android:src="@drawable/ic_action_maps_navigation"
     tools:ignore="ContentDescription" />


<ImageView
    android:id="@+id/inputModeIcon"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/stream_ui_ic_arrow_curve_left"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    tools:ignore="ContentDescription"
    />

 

まとめ

3つの記述スタイルがあるようですが、


android:importantForAccessibility="no"

が一番手軽で、意味分かりやすい記述ではないかなと。

👉 【IDEA】typo チェックを無視する設定 元に戻したい リセットしたい【AndroidStudio】 hatena-bookmark


【IDEA】typo チェックを無視する設定 元に戻したい リセットしたい【AndroidStudio】

おかしな単語をチェックしてくれる

IDEエディタってえらいです!

しかし、たまにその

「チェックを無視してほしい」

ときがありますが、これも

「右クリック」

から設定や編集できます。

【IDEA】typo チェックを無視する設定 元に戻したい リセットしたい【AndroidStudio】
以下の機能の利用が可能です。


Typo チェック機能を停止する

- process code
- process literals
- process comments


単語辞書に追加する

- dictionary project
- dictionary application


コードにアノテーションを付ける

- @file:Suppress("SpellCheckingInspection")
- @Suppress("SpellCheckingInspection")

まじ、えらいですね!

しかし、ここで言いたいのは、

これら右クリックから直感的に行ったTypo警告無視設定や対応を

「元に戻したい」

「リセットしたい」

ときはどうしたらいいのか、です。

 

Typo チェック機能を復活したい

Typo チェック機能を復活したい


Preferences

  ↓

Editor

  ↓

Inspections

  ↓

Proofreading 

  ↓

Typo

デフォルトから変更をしている場合は、

「Reset」 ボタン

も表示されます。

 

保存した辞書から消したい

保存した単語は編集できます。

保存した辞書から消したい


Preferences

  ↓

Editor

  ↓

Spelling

  ↓

Accepted Words

「承認する単語(Accepted Words)」は、

いつでも、この画面で、

追加・編集・削除 することができます。

 

まとめ

非常に機能の多くなった設定の検索もキーワードが分かりづらいときがあります。

今回の typo まわりの設定では、

設定の検索キーワードとしては、


typo


dictionary

ぐらいがよさそうです。


👉 ContentDescription を無視する - [Accessibility] Missing contentDescription attribute on image hatena-bookmark


【iPhone】あなたのスマホが最新絵文字 Emoji 14.0 を表示できるか確認してみよう【Android】

微妙な時期なので確認してみますか。

そのスマホが最新絵文字 Emoji 14.0 を表示できる確認する

まあ、表示できない場合の原因は、フォントであり、その原因は、そのアプリであり、その原因は、OSのそのバージョンであり、などさまざまです。

New Emojis for 2021, 2022 hatena-bookmark

以下、Emoji バージョンごとに3つずつ。

Android 絵文字ポリシー - Play Console ヘルプ
Android 絵文字ポリシー - Play Console ヘルプ hatena-bookmark

表示できていますか。


 ‍ 14.0
‍️ ‍♀️ ‍❤️‍13.1
  ‍❄️13.0
‍ ‍ ‍‍12.1
  ‍‍12.0

表示できていませんね!

同じ端末の同じブラウザで見ていても表示しているサイト側のテキスト処理や指定しているフォントで変わってきます。

以下、Unicode Emoji 14.0 の新規絵文字を貼っておきます。

GitHub Gist の埋め込みでは、右下の「view raw」から出力すると、とりあえずサイトのフォント指定の影響は受けません。

コピーしていろんなとこに貼り付けてみましょう!

顔文字/絵文字辞書 単語リスト - Google Play のアプリ hatena-bookmark