From d1f450dc853ce7b018b54b6e8c12ce64c43253a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C9=91rry=20Shiv=C9=91m?= Date: Sat, 24 Feb 2024 14:54:56 +0530 Subject: [PATCH] Remove some depriciated stuffs (#74) Signed-off-by: starry-shivam --- .../starry/greenstash/ui/common/ExpandableCard.kt | 2 +- .../greenstash/ui/common/SelectableChipGroup.kt | 4 ++-- .../greenstash/ui/screens/backups/BackupScreen.kt | 5 +++-- .../ui/screens/home/composables/GoalItem.kt | 2 +- .../ui/screens/settings/composables/AboutScreen.kt | 13 +++++++------ .../ui/screens/settings/composables/OSLScreen.kt | 4 ++-- .../screens/settings/composables/SettingsScreen.kt | 5 +++-- .../com/starry/greenstash/widget/WidgetViewModel.kt | 4 +--- .../widget/configuration/WidgetConfigActivity.kt | 11 ++++++----- 9 files changed, 26 insertions(+), 24 deletions(-) diff --git a/app/src/main/java/com/starry/greenstash/ui/common/ExpandableCard.kt b/app/src/main/java/com/starry/greenstash/ui/common/ExpandableCard.kt index 358b0033..510d1d85 100644 --- a/app/src/main/java/com/starry/greenstash/ui/common/ExpandableCard.kt +++ b/app/src/main/java/com/starry/greenstash/ui/common/ExpandableCard.kt @@ -74,7 +74,7 @@ fun ExpandableCard( ) { var expandedState by remember { mutableStateOf(expanded) } val rotationState by animateFloatAsState( - targetValue = if (expandedState) 180f else 0f + targetValue = if (expandedState) 180f else 0f, label = "expandable card rotation state" ) Card( diff --git a/app/src/main/java/com/starry/greenstash/ui/common/SelectableChipGroup.kt b/app/src/main/java/com/starry/greenstash/ui/common/SelectableChipGroup.kt index e174d47a..c2e75898 100644 --- a/app/src/main/java/com/starry/greenstash/ui/common/SelectableChipGroup.kt +++ b/app/src/main/java/com/starry/greenstash/ui/common/SelectableChipGroup.kt @@ -11,11 +11,11 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material.Icon -import androidx.compose.material.Text import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Check +import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier diff --git a/app/src/main/java/com/starry/greenstash/ui/screens/backups/BackupScreen.kt b/app/src/main/java/com/starry/greenstash/ui/screens/backups/BackupScreen.kt index 3b1a09db..20b220dc 100644 --- a/app/src/main/java/com/starry/greenstash/ui/screens/backups/BackupScreen.kt +++ b/app/src/main/java/com/starry/greenstash/ui/screens/backups/BackupScreen.kt @@ -40,7 +40,7 @@ import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.verticalScroll import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.ArrowBack +import androidx.compose.material.icons.automirrored.filled.ArrowBack import androidx.compose.material3.Button import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon @@ -101,7 +101,8 @@ fun BackupScreen(navController: NavController) { }, navigationIcon = { IconButton(onClick = { navController.navigateUp() }) { Icon( - imageVector = Icons.Filled.ArrowBack, contentDescription = null + imageVector = Icons.AutoMirrored.Filled.ArrowBack, + contentDescription = null ) } }, colors = TopAppBarDefaults.centerAlignedTopAppBarColors( diff --git a/app/src/main/java/com/starry/greenstash/ui/screens/home/composables/GoalItem.kt b/app/src/main/java/com/starry/greenstash/ui/screens/home/composables/GoalItem.kt index a1943b8e..8940be43 100644 --- a/app/src/main/java/com/starry/greenstash/ui/screens/home/composables/GoalItem.kt +++ b/app/src/main/java/com/starry/greenstash/ui/screens/home/composables/GoalItem.kt @@ -104,11 +104,11 @@ fun GoalItem( contentScale = ContentScale.Crop ) LinearProgressIndicator( + progress = { progress }, modifier = Modifier .height(4.dp) .fillMaxWidth() .clip(RoundedCornerShape(40.dp)), - progress = progress ) /** Title, Primary & Secondary text */ diff --git a/app/src/main/java/com/starry/greenstash/ui/screens/settings/composables/AboutScreen.kt b/app/src/main/java/com/starry/greenstash/ui/screens/settings/composables/AboutScreen.kt index abf7b95c..9e80b2c2 100644 --- a/app/src/main/java/com/starry/greenstash/ui/screens/settings/composables/AboutScreen.kt +++ b/app/src/main/java/com/starry/greenstash/ui/screens/settings/composables/AboutScreen.kt @@ -33,7 +33,7 @@ import android.os.Build import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.ArrowBack +import androidx.compose.material.icons.automirrored.filled.ArrowBack import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.IconButton @@ -59,12 +59,12 @@ import com.starry.greenstash.BuildConfig import com.starry.greenstash.R sealed class AboutLinks(val url: String) { - object ReadMe : AboutLinks("https://github.com/Pool-Of-Tears/GreenStash") - object PrivacyPolicy : + data object ReadMe : AboutLinks("https://github.com/Pool-Of-Tears/GreenStash") + data object PrivacyPolicy : AboutLinks("https://github.com/Pool-Of-Tears/GreenStash/blob/main/legal/PRIVACY-POLICY.md") - object GithubIssues : AboutLinks("https://github.com/Pool-Of-Tears/GreenStash/issues") - object Telegram : AboutLinks("https://t.me/PotApps") + data object GithubIssues : AboutLinks("https://github.com/Pool-Of-Tears/GreenStash/issues") + data object Telegram : AboutLinks("https://t.me/PotApps") } @ExperimentalMaterial3Api @@ -85,7 +85,8 @@ fun AboutScreen(navController: NavController) { }, navigationIcon = { IconButton(onClick = { navController.navigateUp() }) { Icon( - imageVector = Icons.Filled.ArrowBack, contentDescription = null + imageVector = Icons.AutoMirrored.Filled.ArrowBack, + contentDescription = null ) } }, scrollBehavior = scrollBehavior, colors = TopAppBarDefaults.largeTopAppBarColors( diff --git a/app/src/main/java/com/starry/greenstash/ui/screens/settings/composables/OSLScreen.kt b/app/src/main/java/com/starry/greenstash/ui/screens/settings/composables/OSLScreen.kt index 6fe8c20b..282b3930 100644 --- a/app/src/main/java/com/starry/greenstash/ui/screens/settings/composables/OSLScreen.kt +++ b/app/src/main/java/com/starry/greenstash/ui/screens/settings/composables/OSLScreen.kt @@ -29,7 +29,7 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.ArrowBack +import androidx.compose.material.icons.automirrored.filled.ArrowBack import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.IconButton @@ -62,7 +62,7 @@ fun OSLScreen(navController: NavController) { }, navigationIcon = { IconButton(onClick = { navController.navigateUp() }) { Icon( - imageVector = Icons.Filled.ArrowBack, contentDescription = null + imageVector = Icons.AutoMirrored.Filled.ArrowBack, contentDescription = null ) } }, colors = TopAppBarDefaults.centerAlignedTopAppBarColors( diff --git a/app/src/main/java/com/starry/greenstash/ui/screens/settings/composables/SettingsScreen.kt b/app/src/main/java/com/starry/greenstash/ui/screens/settings/composables/SettingsScreen.kt index 7ea5adad..02aea0fb 100644 --- a/app/src/main/java/com/starry/greenstash/ui/screens/settings/composables/SettingsScreen.kt +++ b/app/src/main/java/com/starry/greenstash/ui/screens/settings/composables/SettingsScreen.kt @@ -42,7 +42,7 @@ import androidx.compose.foundation.selection.selectableGroup import androidx.compose.foundation.verticalScroll import androidx.compose.material.ExperimentalMaterialApi import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.ArrowBack +import androidx.compose.material.icons.automirrored.filled.ArrowBack import androidx.compose.material3.AlertDialog import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon @@ -117,7 +117,8 @@ fun SettingsScreen(navController: NavController) { }, navigationIcon = { IconButton(onClick = { navController.navigateUp() }) { Icon( - imageVector = Icons.Filled.ArrowBack, contentDescription = null + imageVector = Icons.AutoMirrored.Filled.ArrowBack, + contentDescription = null ) } }, scrollBehavior = scrollBehavior, colors = TopAppBarDefaults.largeTopAppBarColors( diff --git a/app/src/main/java/com/starry/greenstash/widget/WidgetViewModel.kt b/app/src/main/java/com/starry/greenstash/widget/WidgetViewModel.kt index 5270d525..aac2669c 100644 --- a/app/src/main/java/com/starry/greenstash/widget/WidgetViewModel.kt +++ b/app/src/main/java/com/starry/greenstash/widget/WidgetViewModel.kt @@ -30,7 +30,6 @@ import androidx.lifecycle.viewModelScope import com.starry.greenstash.database.core.GoalWithTransactions import com.starry.greenstash.database.goal.GoalDao import com.starry.greenstash.database.widget.WidgetDao -import com.starry.greenstash.utils.PreferenceUtil import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext @@ -38,8 +37,7 @@ import javax.inject.Inject class WidgetViewModel @Inject constructor( private val widgetDao: WidgetDao, - private val goalDao: GoalDao, - private val preferenceUtil: PreferenceUtil + private val goalDao: GoalDao ) : ViewModel() { fun getGoalFromWidgetId( diff --git a/app/src/main/java/com/starry/greenstash/widget/configuration/WidgetConfigActivity.kt b/app/src/main/java/com/starry/greenstash/widget/configuration/WidgetConfigActivity.kt index f7d1c58d..3f7ff3b4 100644 --- a/app/src/main/java/com/starry/greenstash/widget/configuration/WidgetConfigActivity.kt +++ b/app/src/main/java/com/starry/greenstash/widget/configuration/WidgetConfigActivity.kt @@ -49,7 +49,7 @@ import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.ExperimentalMaterialApi import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.ArrowBack +import androidx.compose.material.icons.automirrored.filled.ArrowBack import androidx.compose.material3.Card import androidx.compose.material3.CardDefaults import androidx.compose.material3.ExperimentalMaterial3Api @@ -177,7 +177,8 @@ class WidgetConfigActivity : AppCompatActivity() { finish() }) { Icon( - imageVector = Icons.Filled.ArrowBack, contentDescription = null + imageVector = Icons.AutoMirrored.Filled.ArrowBack, + contentDescription = null ) } }, colors = TopAppBarDefaults.centerAlignedTopAppBarColors( @@ -343,12 +344,12 @@ class WidgetConfigActivity : AppCompatActivity() { Spacer(modifier = Modifier.height(8.dp)) LinearProgressIndicator( - progress = progress, - color = MaterialTheme.colorScheme.secondary, + progress = { progress }, modifier = Modifier .fillMaxWidth() .height(10.dp) - .clip(RoundedCornerShape(40.dp)) + .clip(RoundedCornerShape(40.dp)), + color = MaterialTheme.colorScheme.secondary, ) Spacer(modifier = Modifier.height(8.dp)) }