Add content descriptions to toolbar and search menu icons
This commit is contained in:
parent
f737f6c38b
commit
b055e0508f
3 changed files with 8 additions and 5 deletions
|
@ -352,6 +352,7 @@ abstract class BaseSimpleActivity : AppCompatActivity() {
|
|||
if (toolbarNavigationIcon != NavigationIcon.None) {
|
||||
val drawableId = if (toolbarNavigationIcon == NavigationIcon.Cross) R.drawable.ic_cross_vector else R.drawable.ic_arrow_left_vector
|
||||
toolbar.navigationIcon = resources.getColoredDrawableWithColor(drawableId, contrastColor)
|
||||
toolbar.setNavigationContentDescription(toolbarNavigationIcon.accessibilityResId)
|
||||
}
|
||||
|
||||
toolbar.setNavigationOnClickListener {
|
||||
|
|
|
@ -7,6 +7,7 @@ import android.os.Looper
|
|||
import android.provider.ContactsContract
|
||||
import android.util.Log
|
||||
import androidx.annotation.ChecksSdkIntAtLeast
|
||||
import androidx.annotation.StringRes
|
||||
import com.simplemobiletools.commons.R
|
||||
import com.simplemobiletools.commons.extensions.normalizeString
|
||||
import com.simplemobiletools.commons.models.contacts.LocalContact
|
||||
|
@ -376,10 +377,10 @@ const val TIME_FORMAT_12 = "hh:mm a"
|
|||
const val TIME_FORMAT_24 = "HH:mm"
|
||||
|
||||
// possible icons at the top left corner
|
||||
enum class NavigationIcon {
|
||||
Cross,
|
||||
Arrow,
|
||||
None
|
||||
enum class NavigationIcon(@StringRes val accessibilityResId: Int) {
|
||||
Cross(R.string.close),
|
||||
Arrow(R.string.back),
|
||||
None(0)
|
||||
}
|
||||
|
||||
val appIconColorStrings = arrayListOf(
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
android:layout_height="match_parent"
|
||||
android:layout_centerVertical="true"
|
||||
android:paddingStart="@dimen/activity_margin"
|
||||
android:src="@drawable/ic_search_vector" />
|
||||
android:src="@drawable/ic_search_vector"
|
||||
android:contentDescription="@string/search" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/top_toolbar_search"
|
||||
|
|
Loading…
Reference in a new issue