Skip to content

Commit

Permalink
feat: add monochrome icon
Browse files Browse the repository at this point in the history
  • Loading branch information
aliernfrog committed Jan 17, 2024
1 parent 0447e17 commit 020aa99
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import androidx.compose.animation.slideInHorizontally
import androidx.compose.animation.slideInVertically
import androidx.compose.animation.slideOutHorizontally
import androidx.compose.animation.slideOutVertically
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.WindowInsets
Expand Down Expand Up @@ -38,15 +37,15 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.draw.scale
import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.core.graphics.drawable.toBitmap
import androidx.navigation.NavController
import androidx.navigation.compose.currentBackStackEntryAsState
import com.aliernfrog.lactool.R
Expand Down Expand Up @@ -227,20 +226,13 @@ private fun NavigationItemIcon(

@Composable
private fun AppIcon() {
val context = LocalContext.current
val appIcon = remember {
context.packageManager.getApplicationIcon(context.packageName)
.toBitmap().asImageBitmap()
}
Image(
bitmap = appIcon,
Icon(
painter = painterResource(R.drawable.lactool),
contentDescription = stringResource(R.string.app_name),
tint = MaterialTheme.colorScheme.onSurface,
modifier = Modifier
.padding(bottom = 12.dp)
.height(64.dp)
.padding(
horizontal = 16.dp,
vertical = 8.dp
)
.scale(1.5f)
)
}
20 changes: 20 additions & 0 deletions app/src/main/res/drawable/lactool.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="90dp"
android:height="90dp"
android:viewportWidth="90"
android:viewportHeight="90">
<path
android:fillColor="#FFFFFFFF"
android:pathData="m53.3,27.8 l0.2,0.6 1.6,7.8c0,0.4 0,0.6 -0.5,0.6l-1.7,0.4c-0.4,0 -0.5,0 -0.6,-0.4l-1.4,-7.4 -0.1,-0.4c0,-0.4 -0.2,-0.6 -0.6,-0.7 0.5,0 0.6,-0.3 0.9,-0.6 0.4,-0.7 0.9,-0.8 1.5,-0.3l0.6,0.4ZM61.5,27.8 L62.3,30.6 64,36.2v0.4c-0.8,0 -1.7,0 -2.6,-0.2 -0.2,0 -0.3,-0.3 -0.4,-0.5L59,28l-0.3,-0.7 0.6,-0.1 1.5,-0.7c0.3,-0.1 0.5,0 0.5,0.3l0.3,1h-0.1ZM45.5,30.4L45.5,36L44,32.7l-0.7,-2.3h2Z"
android:strokeAlpha="0.5"
android:strokeWidth="0"
android:fillAlpha="0.5"/>
<path
android:fillColor="#FFFFFFFF"
android:pathData="M70,42.7v-0.2l-0.2,-0.6c-0.6,-5 -2.5,-9.3 -5.7,-13.1q-1,-1.3 -2.6,-1c-0.4,0.2 -0.2,0.4 -0.2,0.6l2,6.5c0.5,1.4 0.5,1.5 -1,1.4 -0.8,0 -1,-0.2 -1.2,-1l-2,-7c0,-0.3 -0.1,-0.7 -0.4,-1L57,26h-0.5l-3.3,1.8v0.4l1,5.3 0.5,2.3c0,0.6 0,0.8 -0.6,1h-0.7c-0.7,0.1 -0.8,0 -1,-0.6l-1.3,-7q-0.1,-0.8 -1,-0.8l-2.6,-0.4c-0.2,0 -0.5,0 -0.6,0.3l-1.4,2.1c-0.3,0.2 -0.3,0.5 -0.3,0.7 0,1.7 0.1,3.3 0.4,5l1,0.6 5.8,4.4c0.8,0.6 1.6,1.1 2.6,1l3.6,0.2c1,0 1.8,0.2 2.7,0.8a12,12 0,0 1,3.7 3.1l0.4,0.3c0.5,0 1,-0.2 1.3,0 0.3,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 -0.7,-0.5 -1,-0.8L46,41l-1.5,-1.2 -1.2,-0.8c-0.2,-0.2 -0.4,-0.5 -0.7,-0.6 -0.4,0 -0.5,-0.4 -0.5,-0.7l-0.3,-2.6c0,-1 -1,-1.7 -1.2,-2.6l-1.2,-1.3 -1,-0.7 -1.2,-0.6c-0.7,-0.2 -1.3,-0.6 -1.8,-0.6 -1.3,0 -2.6,-0.2 -3.9,0.4l-1,0.3 0.6,0.5 5,3.7 0.2,0.6v3.6c0.1,0.4 0,0.6 -0.4,0.7 -0.9,0.2 -1.8,0.3 -2.6,0.7 -1,0.4 -1.6,0.2 -2.4,-0.5l-4.7,-3.6c-0.3,1 -0.2,2 0,3a8,8 0,0 0,5.1 6.1c0.7,0.2 1.5,0.5 2.3,0.5 1,0 2,-0.3 3.1,-0.4 0.3,0 0.7,0 1,0.2l2.2,1.7 3,2.2 2.3,1.7 2.7,2c0.2,0.2 0.2,0.5 0.2,0.7L48.1,55c0.4,1 0.7,2 1.3,3 0.5,0.7 1.2,1.3 2,2 0.3,0.2 1,0.3 1.3,0.6 0.4,0.6 1,0.6 1.6,0.7 0.9,0.1 1.8,0.4 2.7,0.2 0.5,0 1,0 1.5,-0.3 0.7,-0.5 1.7,-0.5 2.3,-1.3 0.3,-0.4 1,-0.5 1.2,-1 0.4,-0.6 1,-1 1.2,-1.9 0.2,-0.7 0.8,-1.3 0.7,-2l0.1,-0.6 0.1,-0.8ZM49.5,50.3 L39.5,42.9 41,40.9 51,48.2 49.5,50.2v0.1ZM60.3,54.5 L58,57.5 57.6,57.8 53.4,57.2 51.6,53.2 51.7,52.7 54.7,49.4 58.5,49.9c0.3,0 0.5,0.2 0.6,0.5l1.3,3.3 -0.1,0.8Z"
android:strokeWidth="0"/>
</vector>
1 change: 1 addition & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/lactool"/>
</adaptive-icon>
1 change: 1 addition & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/lactool"/>
</adaptive-icon>

0 comments on commit 020aa99

Please sign in to comment.