Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3fee85df authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add content description to tile" into tm-qpr-dev am: 27eb1be0

parents 0f08bb95 27eb1be0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ class TileRequestDialog(
            icon = tileData.icon?.loadDrawable(context)?.let {
                QSTileImpl.DrawableIcon(it)
            } ?: ResourceIcon.get(R.drawable.android)
            contentDescription = label
        }
        tile.onStateChanged(state)
        tile.post {
+17 −1
Original line number Diff line number Diff line
@@ -163,4 +163,20 @@ class TileRequestDialogTest : SysuiTestCase() {
        assertThat(tile.isClickable).isFalse()
        assertThat(tile.isLongClickable).isFalse()
    }

    @Test
    fun setTileData_tileHasCorrectContentDescription() {
        val icon = Icon.createWithResource(mContext, R.drawable.cloud)
        val tileData = TileRequestDialog.TileData(APP_NAME, LABEL, icon)

        dialog.setTileData(tileData)
        dialog.show()

        TestableLooper.get(this).processAllMessages()

        val content = dialog.requireViewById<ViewGroup>(TileRequestDialog.CONTENT_ID)
        val tile = content.getChildAt(1) as QSTileView

        assertThat(tile.contentDescription).isEqualTo(LABEL)
    }
}