Skip to content

Commit

Permalink
Remove some depriciated stuffs (#74)
Browse files Browse the repository at this point in the history
Signed-off-by: starry-shivam <[email protected]>
  • Loading branch information
starry-shivam authored Feb 24, 2024
1 parent adf714b commit d1f450d
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,14 @@ 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
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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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))
}
Expand Down

0 comments on commit d1f450d

Please sign in to comment.