From cfa1cf307eafe65a5d2818e2594f441613c237cb Mon Sep 17 00:00:00 2001 From: Suhas Dissanayake Date: Tue, 14 May 2024 11:34:04 +0530 Subject: [PATCH] style: add 'no sms' icon --- .idea/misc.xml | 46 +++++++++++++++++++ .../presentation/components/BlobIconBox.kt | 39 ++++++++++++++++ .../presentation/screens/sms/SmsListScreen.kt | 6 +-- app/src/main/res/drawable/blob.xml | 10 ++++ app/src/main/res/drawable/ic_no_sms.xml | 29 ++++++++++++ 5 files changed, 126 insertions(+), 4 deletions(-) create mode 100644 app/src/main/java/com/bnyro/contacts/presentation/components/BlobIconBox.kt create mode 100755 app/src/main/res/drawable/blob.xml create mode 100644 app/src/main/res/drawable/ic_no_sms.xml diff --git a/.idea/misc.xml b/.idea/misc.xml index 2188b52b..2998c5e1 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,3 +1,4 @@ + @@ -5,6 +6,51 @@ + + + + diff --git a/app/src/main/java/com/bnyro/contacts/presentation/components/BlobIconBox.kt b/app/src/main/java/com/bnyro/contacts/presentation/components/BlobIconBox.kt new file mode 100644 index 00000000..a444833f --- /dev/null +++ b/app/src/main/java/com/bnyro/contacts/presentation/components/BlobIconBox.kt @@ -0,0 +1,39 @@ +package com.bnyro.contacts.presentation.components + +import androidx.annotation.DrawableRes +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.size +import androidx.compose.material3.MaterialTheme +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.alpha +import androidx.compose.ui.graphics.ColorFilter +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.unit.dp +import com.bnyro.contacts.R + +@Composable +fun BlobIconBox(@DrawableRes icon: Int) { + Box( + contentAlignment = Alignment.Center, + modifier = Modifier + .fillMaxSize() + .alpha(0.3f) + ) { + Image( + modifier = Modifier.size(350.dp), + painter = painterResource(id = R.drawable.blob), + contentDescription = null, + colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.secondaryContainer) + ) + Image( + modifier = Modifier.size(250.dp), + painter = painterResource(id = icon), + contentDescription = null, + colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.onSecondaryContainer) + ) + } +} diff --git a/app/src/main/java/com/bnyro/contacts/presentation/screens/sms/SmsListScreen.kt b/app/src/main/java/com/bnyro/contacts/presentation/screens/sms/SmsListScreen.kt index 32467ed3..c3fd5920 100644 --- a/app/src/main/java/com/bnyro/contacts/presentation/screens/sms/SmsListScreen.kt +++ b/app/src/main/java/com/bnyro/contacts/presentation/screens/sms/SmsListScreen.kt @@ -54,8 +54,8 @@ import com.bnyro.contacts.R import com.bnyro.contacts.domain.model.ContactData import com.bnyro.contacts.domain.model.SmsThread import com.bnyro.contacts.navigation.NavRoutes +import com.bnyro.contacts.presentation.components.BlobIconBox import com.bnyro.contacts.presentation.components.ClickableIcon -import com.bnyro.contacts.presentation.components.NothingHere import com.bnyro.contacts.presentation.components.TopBarMoreMenu import com.bnyro.contacts.presentation.features.NumberPickerDialog import com.bnyro.contacts.presentation.screens.calllog.SheetSettingItem @@ -162,9 +162,7 @@ fun SmsListScreen( SmsSearchScreen(smsModel, threadList, { showSearch = false }, onClickMessage) } } else { - Column(Modifier.padding(pv)) { - NothingHere() - } + BlobIconBox(icon = R.drawable.ic_no_sms) } if (showNumberPicker) { diff --git a/app/src/main/res/drawable/blob.xml b/app/src/main/res/drawable/blob.xml new file mode 100755 index 00000000..3bd4d837 --- /dev/null +++ b/app/src/main/res/drawable/blob.xml @@ -0,0 +1,10 @@ + + + + diff --git a/app/src/main/res/drawable/ic_no_sms.xml b/app/src/main/res/drawable/ic_no_sms.xml new file mode 100644 index 00000000..425cccb0 --- /dev/null +++ b/app/src/main/res/drawable/ic_no_sms.xml @@ -0,0 +1,29 @@ + + + + +