Drop compose material

Material3 is already present so legacy material is redundant
This commit is contained in:
William Brawner 2024-03-16 09:15:51 -06:00
parent 68c0724a52
commit 3980d2729b
4 changed files with 4 additions and 8 deletions

View file

@ -17,8 +17,8 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll import androidx.compose.foundation.verticalScroll
import androidx.compose.material.CircularProgressIndicator
import androidx.compose.material3.Card import androidx.compose.material3.Card
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.LinearProgressIndicator import androidx.compose.material3.LinearProgressIndicator
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
@ -121,13 +121,11 @@ fun CategoryListItem(category: Category, balance: Long?, onClick: (Category) ->
Spacer(modifier = Modifier.height(8.dp)) Spacer(modifier = Modifier.height(8.dp))
balance?.let { balance?.let {
val denominator = remember { max(abs(it), abs(category.amount)).toFloat() } val denominator = remember { max(abs(it), abs(category.amount)).toFloat() }
val progress =
remember { if (denominator == 0f) 0f else abs(it).toFloat() / denominator }
LinearProgressIndicator( LinearProgressIndicator(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.clip(RoundedCornerShape(4.dp)), .clip(RoundedCornerShape(4.dp)),
progress = progress, progress = { if (denominator == 0f) 0f else abs(it).toFloat() / denominator },
color = if (category.expense) MaterialTheme.colorScheme.error else MaterialTheme.colorScheme.primary, color = if (category.expense) MaterialTheme.colorScheme.error else MaterialTheme.colorScheme.primary,
trackColor = Color.LightGray trackColor = Color.LightGray
) )

View file

@ -13,8 +13,8 @@ import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll import androidx.compose.foundation.verticalScroll
import androidx.compose.material.CircularProgressIndicator
import androidx.compose.material3.Card import androidx.compose.material3.Card
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text import androidx.compose.material3.Text

View file

@ -16,7 +16,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.itemsIndexed import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.shape.CornerSize import androidx.compose.foundation.shape.CornerSize
import androidx.compose.material.CircularProgressIndicator import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable

View file

@ -31,7 +31,6 @@ androidx-test-runner = { module = "androidx.test:runner", version.ref = "android
androidx-test-orchestrator = { module = "androidx.test:orchestrator", version.ref = "androidx-test-orchestrator" } androidx-test-orchestrator = { module = "androidx.test:orchestrator", version.ref = "androidx-test-orchestrator" }
compose-activity = { module = "androidx.activity:activity-compose", version = "1.8.2" } compose-activity = { module = "androidx.activity:activity-compose", version = "1.8.2" }
compose-compiler = { module = "androidx.compose.compiler:compiler", version.ref = "compose-compiler" } compose-compiler = { module = "androidx.compose.compiler:compiler", version.ref = "compose-compiler" }
compose-material = { module = "androidx.compose.material:material", version.ref = "compose-material" }
compose-material-icons = { module = "androidx.compose.material:material-icons-extended", version.ref = "compose-material" } compose-material-icons = { module = "androidx.compose.material:material-icons-extended", version.ref = "compose-material" }
compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "compose-material3" } compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "compose-material3" }
compose-material3-window = { module = "androidx.compose.material3:material3-window-size-class", version.ref = "compose-material3" } compose-material3-window = { module = "androidx.compose.material3:material3-window-size-class", version.ref = "compose-material3" }
@ -71,7 +70,6 @@ test-ext = { module = "androidx.test.ext:junit", version = "1.1.5" }
[bundles] [bundles]
compose = [ compose = [
"compose-activity", "compose-activity",
"compose-material",
"compose-material-icons", "compose-material-icons",
"compose-material3", "compose-material3",
"compose-material3-window", "compose-material3-window",