compose: downloads: Replace text button with icons
Text can be quite long in translations, better use icons Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -123,13 +123,19 @@ fun DownloadComposable(
|
|||||||
when {
|
when {
|
||||||
download.isRunning -> {
|
download.isRunning -> {
|
||||||
SplitButtonDefaults.LeadingButton(onClick = onCancel) {
|
SplitButtonDefaults.LeadingButton(onClick = onCancel) {
|
||||||
Text(text = stringResource(R.string.action_cancel))
|
Icon(
|
||||||
|
painter = painterResource(R.drawable.ic_cancel),
|
||||||
|
contentDescription = stringResource(R.string.action_cancel)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
SplitButtonDefaults.LeadingButton(onClick = onClear) {
|
SplitButtonDefaults.LeadingButton(onClick = onClear) {
|
||||||
Text(text = stringResource(R.string.action_clear))
|
Icon(
|
||||||
|
painter = painterResource(R.drawable.ic_delete_forever),
|
||||||
|
contentDescription = stringResource(R.string.action_clear)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
14
app/src/main/res/drawable/ic_delete_forever.xml
Normal file
14
app/src/main/res/drawable/ic_delete_forever.xml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
~ SPDX-FileCopyrightText: Material Design Authors / Google LLC
|
||||||
|
~ SPDX-License-Identifier: Apache-2.0
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="960"
|
||||||
|
android:viewportHeight="960">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M376,660L480,556L584,660L640,604L536,500L640,396L584,340L480,444L376,340L320,396L424,500L320,604L376,660ZM280,840Q247,840 223.5,816.5Q200,793 200,760L200,240L160,240L160,160L360,160L360,120L600,120L600,160L800,160L800,240L760,240L760,760Q760,793 736.5,816.5Q713,840 680,840L280,840ZM680,240L280,240L280,760Q280,760 280,760Q280,760 280,760L680,760Q680,760 680,760Q680,760 680,760L680,240ZM280,240L280,240L280,760Q280,760 280,760Q280,760 280,760L280,760Q280,760 280,760Q280,760 280,760L280,240Z"/>
|
||||||
|
</vector>
|
||||||
Reference in New Issue
Block a user