use a vector asset for flashlight icon

This commit is contained in:
tibbi 2022-12-21 10:06:32 +01:00
parent f51efb05cc
commit 6f8db7c15c
10 changed files with 10 additions and 7 deletions

View File

@ -63,8 +63,8 @@
<activity
android:name=".activities.BrightDisplayActivity"
android:exported="false"
android:launchMode="singleInstance"
android:label="@string/bright_display"
android:launchMode="singleInstance"
android:theme="@style/FullScreenTheme" />
<activity
@ -106,7 +106,7 @@
<receiver
android:name=".helpers.MyWidgetTorchProvider"
android:exported="true"
android:icon="@drawable/ic_flashlight"
android:icon="@drawable/ic_flashlight_vector"
android:label="@string/app_launcher_name">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />

View File

@ -69,7 +69,7 @@ class MyWidgetTorchProvider : AppWidgetProvider() {
}
private fun getColoredIcon(context: Context, color: Int, alpha: Int): Bitmap {
val drawable = context.resources.getColoredDrawableWithColor(R.drawable.ic_flashlight, color, alpha)
val drawable = context.resources.getColoredDrawableWithColor(R.drawable.ic_flashlight_vector, color, alpha)
return context.drawableToBitmap(drawable)
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="192dp" android:height="192dp" android:viewportWidth="192" android:viewportHeight="192">
<path android:fillColor="#FFFFFFFF" android:fillType="evenOdd" android:pathData="M100.17 30.03c0 2.05-1.66 3.72-3.72 3.72-2.05 0-3.72-1.66-3.72-3.72V13.31c0-2.05 1.66-3.72 3.72-3.72 2.05 0 3.72 1.66 3.72 3.72zM71.24 20c1.69-0.99 3.87-0.42 4.86 1.27l6.58 11.24c0.99 1.69 0.42 3.87-1.27 4.86-1.69 0.99-3.87 0.42-4.86-1.27l-6.58-11.25c-0.99-1.69-0.42-3.87 1.27-4.86zm49.59 0c-1.69-0.99-3.87-0.42-4.86 1.27l-6.58 11.24c-0.99 1.69-0.42 3.87 1.27 4.86 1.69 0.99 3.87 0.42 4.86-1.27l6.58-11.24c0.99-1.69 0.42-3.87-1.27-4.86zm-41.5 66.61c-0.6 1.78-0.93 3.69-0.93 5.68v72.47c0 9.75 7.9 17.65 17.65 17.65 9.75 0 17.65-7.9 17.65-17.65l0.01-72.48c0-2.01-0.34-3.94-0.96-5.74 7.69-4.02 12.93-10.71 15.82-17.95l0.52-1.53 0.01-0.02c0.57-1.65 0.9-2.6 1.33-4.95 1.1-6.04 0.93-7.9 0.46-8.83-2.52-5.05-15.6-9.29-34.84-9.29-19.24 0-35.31 5.04-35.31 10.69v0.42c0 1.69-0.01 3.26 0.47 6.09 0.46 2.79 0.93 4.18 2.32 7.43 3.24 7.55 8.33 14.11 15.8 18.02zm16.72 14.04c-3.59 0-6.5 2.91-6.5 6.5v9.29c0 3.59 2.91 6.5 6.5 6.5s6.5-2.91 6.5-6.5v-9.29c0-3.59-2.91-6.5-6.5-6.5zm27.88-46c-4.65 2.79-12.69 5.11-28.34 5.11s-23.23-2.32-28.34-5.11c3.25-2.32 12.69-5.11 28.34-5.11s25.09 3.25 28.34 5.11z"/>
</vector>

View File

@ -32,7 +32,7 @@
android:layout_height="@dimen/main_button_size"
android:layout_marginTop="@dimen/normal_margin"
android:layout_marginBottom="@dimen/normal_margin"
android:background="@drawable/ic_flashlight"
android:background="@drawable/ic_flashlight_vector"
app:layout_constraintBottom_toTopOf="@+id/bright_display_btn"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"

View File

@ -23,7 +23,7 @@
android:id="@+id/config_image"
android:layout_width="@dimen/main_button_size"
android:layout_height="@dimen/main_button_size"
android:background="@drawable/ic_flashlight" />
android:background="@drawable/ic_flashlight_vector" />
</RelativeLayout>

View File

@ -1,7 +1,7 @@
<resources>
<dimen name="seekbar_width">250dp</dimen>
<dimen name="main_button_size">150dp</dimen>
<dimen name="smaller_button_size">80dp</dimen>
<dimen name="main_button_size">180dp</dimen>
<dimen name="smaller_button_size">60dp</dimen>
<dimen name="shortcut_padding">60dp</dimen>
<dimen name="sos_text_size">26sp</dimen>