A fully functional Android app built entirely with Kotlin and Jetpack Compose
Make empty bookmark icon dynamic to dynamic color settings
Angie Sasmitaaa6f338f38ce
diff --git a/feature/bookmarks/src/main/java/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksScreen.kt b/feature/bookmarks/src/main/java/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksScreen.ktindex d5d70e9f7..eed7be1ff 100644--- a/feature/bookmarks/src/main/java/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksScreen.kt+++ b/feature/bookmarks/src/main/java/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksScreen.kt@@ -40,6 +40,7 @@ import androidx.compose.runtime.Composableimport androidx.compose.runtime.getValueimport androidx.compose.ui.Alignmentimport androidx.compose.ui.Modifier+import androidx.compose.ui.graphics.ColorFilterimport androidx.compose.ui.platform.testTagimport androidx.compose.ui.res.painterResourceimport androidx.compose.ui.res.stringResource@@ -51,6 +52,7 @@ import androidx.hilt.navigation.compose.hiltViewModelimport androidx.lifecycle.compose.ExperimentalLifecycleComposeApiimport androidx.lifecycle.compose.collectAsStateWithLifecycleimport com.google.samples.apps.nowinandroid.core.designsystem.component.NiaLoadingWheel+import com.google.samples.apps.nowinandroid.core.designsystem.theme.LocalTintThemeimport com.google.samples.apps.nowinandroid.core.designsystem.theme.NiaThemeimport com.google.samples.apps.nowinandroid.core.domain.model.previewUserNewsResourcesimport com.google.samples.apps.nowinandroid.core.ui.NewsFeedUiState@@ -142,9 +144,11 @@ private fun EmptyState(modifier: Modifier = Modifier) {verticalArrangement = Arrangement.Center,horizontalAlignment = Alignment.CenterHorizontally) {+ val iconTint = LocalTintTheme.current.iconTintImage(modifier = Modifier.fillMaxWidth(),painter = painterResource(id = R.drawable.img_empty_bookmarks),+ colorFilter = if(iconTint != null) ColorFilter.tint(iconTint) else null,contentDescription = null)diff --git a/feature/bookmarks/src/main/res/drawable/img_empty_bookmarks.png b/feature/bookmarks/src/main/res/drawable/img_empty_bookmarks.pngnew file mode 100644index 000000000..4755a9ec0Binary files /dev/null and b/feature/bookmarks/src/main/res/drawable/img_empty_bookmarks.png differdiff --git a/feature/bookmarks/src/main/res/drawable/img_empty_bookmarks.xml b/feature/bookmarks/src/main/res/drawable/img_empty_bookmarks.xmldeleted file mode 100644index b9e2f2963..000000000--- a/feature/bookmarks/src/main/res/drawable/img_empty_bookmarks.xml+++ /dev/null@@ -1,31 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<!--- Copyright 2022 The Android Open Source Project-- Licensed under the Apache License, Version 2.0 (the "License");- you may not use this file except in compliance with the License.- You may obtain a copy of the License at-- http://www.apache.org/licenses/LICENSE-2.0-- Unless required by applicable law or agreed to in writing, software- distributed under the License is distributed on an "AS IS" BASIS,- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- See the License for the specific language governing permissions and- limitations under the License.--->-<vector xmlns:android="http://schemas.android.com/apk/res/android"- android:width="192dp"- android:height="192dp"- android:viewportWidth="64"- android:viewportHeight="64">- <path- android:fillColor="#8B418F"- android:pathData="M16,1C15.448,1 15,1.448 15,2C15,2.552 15.448,3 16,3V1ZM58,52C58,52.552 58.448,53 59,53C59.552,53 60,52.552 60,52H58ZM16,3H55V1H16V3ZM58,6V52H60V6H58ZM55,3C56.657,3 58,4.343 58,6H60C60,3.239 57.761,1 55,1V3Z" />- <path- android:fillColor="#00000000"- android:pathData="M45,10H9C6.791,10 5,11.791 5,14V55.854C5,59.177 8.817,61.051 11.446,59.019L24.554,48.89C25.995,47.777 28.005,47.777 29.446,48.89L42.554,59.019C45.183,61.051 49,59.177 49,55.854V14C49,11.791 47.209,10 45,10Z"- android:strokeColor="#8B418F"- android:strokeLineCap="round"- android:strokeWidth="2" />-</vector>