Remove deprecated code.

This commit is contained in:
Thomas Andres Gomez 2023-03-30 11:50:38 +02:00
parent 5aaa3e325d
commit 7298ab0958
21 changed files with 178 additions and 208 deletions

View file

@ -54,7 +54,7 @@ class SearchRepository constructor(
when (type) { when (type) {
SortType.New -> BookDbo.run { "$TABLE.$NEW_ORDER" } SortType.New -> BookDbo.run { "$TABLE.$NEW_ORDER" }
SortType.Title -> BookDbo.run { "$TABLE.$SORT" } SortType.Title -> BookDbo.run { "$TABLE.$SORT" }
SortType.Series -> BookDbo.run { "$TABLE.$SERIES_INDEX" } SortType.Series -> BookDbo.run { "$TABLE.$SERIES_ID DESC, $TABLE.$SERIES_INDEX" }
} }
} }
} }

View file

@ -156,7 +156,7 @@ fun AuthenticationProgress(
contentAlignment = Alignment.Center, contentAlignment = Alignment.Center,
) { ) {
CircularProgressIndicator( CircularProgressIndicator(
modifier = Modifier.size(MaterialTheme.bibLib.dimen.dialog.iconSize), modifier = Modifier.size(MaterialTheme.bibLib.dimen.progress.iconSize),
) )
} }
} }

View file

@ -28,13 +28,13 @@ import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.text.input.VisualTransformation import androidx.compose.ui.text.input.VisualTransformation
import androidx.compose.ui.text.withStyle import androidx.compose.ui.text.withStyle
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.pixelized.biblib.R import com.pixelized.biblib.R
import com.pixelized.biblib.ui.composable.animation.AnimatedDelayer import com.pixelized.biblib.ui.composable.animation.AnimatedDelayer
import com.pixelized.biblib.ui.composable.animation.AnimatedOffset import com.pixelized.biblib.ui.composable.animation.AnimatedOffset
import com.pixelized.biblib.ui.theme.BibLibTheme import com.pixelized.biblib.ui.theme.BibLibTheme
import com.pixelized.biblib.ui.theme.color.GoogleColorPalette import com.pixelized.biblib.ui.theme.color.GoogleColorPalette
import com.pixelized.biblib.utils.extention.autofill import com.pixelized.biblib.utils.extention.autofill
import com.pixelized.biblib.utils.extention.bibLib
@Composable @Composable
fun AuthenticationScreenContent( fun AuthenticationScreenContent(
@ -62,7 +62,7 @@ fun AuthenticationScreenContent(
AnimatedOffset( AnimatedOffset(
modifier = Modifier modifier = Modifier
.padding(all = MaterialTheme.bibLib.dimen.dp16) .padding(all = 16.dp)
.align(alignment = Alignment.CenterHorizontally), .align(alignment = Alignment.CenterHorizontally),
) { ) {
Text( Text(
@ -75,7 +75,7 @@ fun AuthenticationScreenContent(
Spacer(modifier = Modifier.weight(1f)) Spacer(modifier = Modifier.weight(1f))
AnimatedOffset( AnimatedOffset(
modifier = Modifier.padding(horizontal = MaterialTheme.bibLib.dimen.dp16), modifier = Modifier.padding(horizontal = 16.dp),
) { ) {
LoginField( LoginField(
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
@ -85,10 +85,10 @@ fun AuthenticationScreenContent(
) )
} }
Spacer(modifier = Modifier.height(MaterialTheme.bibLib.dimen.dp8)) Spacer(modifier = Modifier.height(8.dp))
AnimatedOffset( AnimatedOffset(
modifier = Modifier.padding(horizontal = MaterialTheme.bibLib.dimen.dp16), modifier = Modifier.padding(horizontal = 16.dp),
) { ) {
PasswordField( PasswordField(
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
@ -99,10 +99,10 @@ fun AuthenticationScreenContent(
) )
} }
Spacer(modifier = Modifier.height(MaterialTheme.bibLib.dimen.dp16)) Spacer(modifier = Modifier.height(16.dp))
AnimatedOffset( AnimatedOffset(
modifier = Modifier.padding(horizontal = MaterialTheme.bibLib.dimen.dp16), modifier = Modifier.padding(horizontal = 16.dp),
) { ) {
CredentialRemember( CredentialRemember(
value = rememberPassword, value = rememberPassword,
@ -110,11 +110,11 @@ fun AuthenticationScreenContent(
) )
} }
Spacer(modifier = Modifier.height(MaterialTheme.bibLib.dimen.dp16)) Spacer(modifier = Modifier.height(16.dp))
AnimatedOffset( AnimatedOffset(
modifier = Modifier modifier = Modifier
.padding(horizontal = MaterialTheme.bibLib.dimen.dp16) .padding(horizontal = 16.dp)
.align(Alignment.End), .align(Alignment.End),
) { ) {
Row { Row {
@ -125,7 +125,7 @@ fun AuthenticationScreenContent(
Text(text = stringResource(id = R.string.action_register)) Text(text = stringResource(id = R.string.action_register))
} }
Spacer(modifier = Modifier.width(MaterialTheme.bibLib.dimen.dp8)) Spacer(modifier = Modifier.width(8.dp))
Button( Button(
colors = ButtonDefaults.buttonColors(), colors = ButtonDefaults.buttonColors(),
@ -141,7 +141,7 @@ fun AuthenticationScreenContent(
AnimatedOffset { AnimatedOffset {
Button( Button(
modifier = Modifier modifier = Modifier
.padding(all = MaterialTheme.bibLib.dimen.dp16) .padding(all = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
colors = ButtonDefaults.outlinedButtonColors(), colors = ButtonDefaults.outlinedButtonColors(),
onClick = onGoogleSignIn, onClick = onGoogleSignIn,
@ -235,7 +235,7 @@ private fun CredentialRemember(
onCheckedChange = null onCheckedChange = null
) )
Spacer(modifier = Modifier.width(MaterialTheme.bibLib.dimen.dp8)) Spacer(modifier = Modifier.width(8.dp))
Text( Text(
modifier = Modifier.align(Alignment.CenterVertically), modifier = Modifier.align(Alignment.CenterVertically),

View file

@ -444,6 +444,7 @@ private fun HomeScreenLayout(
) { ) {
Surface( Surface(
modifier = modifier, modifier = modifier,
color = MaterialTheme.bibLib.colors.base.background,
) { ) {
Column( Column(
modifier = Modifier.fillMaxSize() modifier = Modifier.fillMaxSize()

View file

@ -16,6 +16,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.pixelized.biblib.R import com.pixelized.biblib.R
import com.pixelized.biblib.ui.theme.BibLibTheme import com.pixelized.biblib.ui.theme.BibLibTheme
import com.pixelized.biblib.utils.extention.bibLib import com.pixelized.biblib.utils.extention.bibLib
@ -38,19 +39,19 @@ fun ConnectivityHeader(
.sizeIn(minHeight = ButtonDefaults.MinHeight) .sizeIn(minHeight = ButtonDefaults.MinHeight)
.padding( .padding(
horizontal = MaterialTheme.bibLib.dimen.thumbnail.padding, horizontal = MaterialTheme.bibLib.dimen.thumbnail.padding,
vertical = MaterialTheme.bibLib.dimen.dp8, vertical = 8.dp,
), ),
horizontalArrangement = Arrangement.Center, horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {
Icon( Icon(
modifier = Modifier.size(MaterialTheme.bibLib.dimen.dp16), modifier = Modifier.size(16.dp),
imageVector = Icons.Default.CloudOff, imageVector = Icons.Default.CloudOff,
tint = MaterialTheme.colors.onError, tint = MaterialTheme.colors.onError,
contentDescription = null contentDescription = null
) )
Text( Text(
modifier = Modifier.padding(start = MaterialTheme.bibLib.dimen.dp8), modifier = Modifier.padding(start = 8.dp),
style = MaterialTheme.typography.caption, style = MaterialTheme.typography.caption,
color = MaterialTheme.colors.onError, color = MaterialTheme.colors.onError,
text = stringResource(id = R.string.error_offline), text = stringResource(id = R.string.error_offline),

View file

@ -22,6 +22,7 @@ import com.pixelized.biblib.ui.theme.BibLibTheme
import com.pixelized.biblib.utils.extention.bibLib import com.pixelized.biblib.utils.extention.bibLib
import com.pixelized.biblib.utils.extention.default import com.pixelized.biblib.utils.extention.default
import com.pixelized.biblib.utils.extention.modifier.drawDiagonalLabel import com.pixelized.biblib.utils.extention.modifier.drawDiagonalLabel
import com.pixelized.biblib.utils.extention.placeholder
import com.skydoves.landscapist.glide.GlideImage import com.skydoves.landscapist.glide.GlideImage
@Stable @Stable
@ -83,10 +84,10 @@ private fun LargeBookThumbnailPlaceHolder(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.aspectRatio(64f / 102f) .aspectRatio(64f / 102f)
.background( .placeholder(
color = MaterialTheme.bibLib.colors.placeHolder,
shape = MaterialTheme.bibLib.shapes.bookThumbnailCoverLarge, shape = MaterialTheme.bibLib.shapes.bookThumbnailCoverLarge,
), visible = { true }
)
) )
} }

View file

@ -2,13 +2,11 @@ package com.pixelized.biblib.ui.screen.home.common.item
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.res.Configuration import android.content.res.Configuration
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.Card import androidx.compose.material.Card
import androidx.compose.material.MaterialTheme import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text import androidx.compose.material.Text
@ -29,8 +27,8 @@ import androidx.constraintlayout.compose.Dimension
import com.pixelized.biblib.R import com.pixelized.biblib.R
import com.pixelized.biblib.ui.theme.BibLibTheme import com.pixelized.biblib.ui.theme.BibLibTheme
import com.pixelized.biblib.utils.extention.bibLib import com.pixelized.biblib.utils.extention.bibLib
import com.pixelized.biblib.utils.extention.default
import com.pixelized.biblib.utils.extention.modifier.drawDiagonalLabel import com.pixelized.biblib.utils.extention.modifier.drawDiagonalLabel
import com.pixelized.biblib.utils.extention.placeholder
import com.skydoves.landscapist.glide.GlideImage import com.skydoves.landscapist.glide.GlideImage
@Stable @Stable
@ -47,7 +45,7 @@ data class MicroBookThumbnailUio(
fun MicroBookThumbnail( fun MicroBookThumbnail(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
thumbnail: MicroBookThumbnailUio?, thumbnail: MicroBookThumbnailUio?,
onClick: (MicroBookThumbnailUio) -> Unit = default<MicroBookThumbnailUio>(), onClick: (MicroBookThumbnailUio) -> Unit,
) { ) {
if (thumbnail != null) { if (thumbnail != null) {
MicroBookThumbnailContent( MicroBookThumbnailContent(
@ -66,9 +64,8 @@ fun MicroBookThumbnail(
private fun MicroBookThumbnailContent( private fun MicroBookThumbnailContent(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
thumbnail: MicroBookThumbnailUio, thumbnail: MicroBookThumbnailUio,
onClick: (MicroBookThumbnailUio) -> Unit = default<MicroBookThumbnailUio>(), onClick: (MicroBookThumbnailUio) -> Unit,
) { ) {
val dimen = MaterialTheme.bibLib.dimen
Card( Card(
modifier = modifier modifier = modifier
.clickable { onClick(thumbnail) } .clickable { onClick(thumbnail) }
@ -97,9 +94,9 @@ private fun MicroBookThumbnailContent(
Text( Text(
modifier = Modifier.constrainAs(title) { modifier = Modifier.constrainAs(title) {
top.linkTo(parent.top, margin = dimen.dp8) top.linkTo(parent.top, margin = 8.dp)
start.linkTo(cover.end, margin = dimen.dp8) start.linkTo(cover.end, margin = 8.dp)
end.linkTo(parent.end, margin = dimen.dp8) end.linkTo(parent.end, margin = 8.dp)
width = Dimension.fillToConstraints width = Dimension.fillToConstraints
}, },
style = MaterialTheme.typography.body1, style = MaterialTheme.typography.body1,
@ -111,13 +108,13 @@ private fun MicroBookThumbnailContent(
Text( Text(
modifier = Modifier.constrainAs(author) { modifier = Modifier.constrainAs(author) {
top.linkTo(title.bottom, margin = dimen.dp4) top.linkTo(title.bottom, margin = 4.dp)
start.linkTo(cover.end, margin = dimen.dp8) start.linkTo(cover.end, margin = 8.dp)
end.linkTo(parent.end, margin = dimen.dp8) end.linkTo(parent.end, margin = 8.dp)
width = Dimension.fillToConstraints width = Dimension.fillToConstraints
}, },
style = MaterialTheme.typography.caption, style = MaterialTheme.typography.caption,
color = MaterialTheme.bibLib.colors.typography.easy, color = MaterialTheme.bibLib.colors.typography.light,
overflow = TextOverflow.Ellipsis, overflow = TextOverflow.Ellipsis,
maxLines = 1, maxLines = 1,
text = thumbnail.author, text = thumbnail.author,
@ -125,13 +122,13 @@ private fun MicroBookThumbnailContent(
Text( Text(
modifier = Modifier.constrainAs(series) { modifier = Modifier.constrainAs(series) {
top.linkTo(author.bottom, margin = dimen.dp4) top.linkTo(author.bottom, margin = 4.dp)
start.linkTo(cover.end, margin = dimen.dp8) start.linkTo(cover.end, margin = 8.dp)
end.linkTo(parent.end, margin = dimen.dp8) end.linkTo(parent.end, margin = 8.dp)
width = Dimension.fillToConstraints width = Dimension.fillToConstraints
}, },
style = MaterialTheme.typography.caption, style = MaterialTheme.typography.caption,
color = MaterialTheme.bibLib.colors.typography.easy, color = MaterialTheme.bibLib.colors.typography.light,
overflow = TextOverflow.Ellipsis, overflow = TextOverflow.Ellipsis,
maxLines = 1, maxLines = 1,
text = thumbnail.series, text = thumbnail.series,
@ -144,7 +141,6 @@ private fun MicroBookThumbnailContent(
private fun MicroBookThumbnailPlaceHolder( private fun MicroBookThumbnailPlaceHolder(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
) { ) {
val dimen = MaterialTheme.bibLib.dimen
Card( Card(
modifier = modifier modifier = modifier
.fillMaxWidth() .fillMaxWidth()
@ -164,36 +160,30 @@ private fun MicroBookThumbnailPlaceHolder(
start.linkTo(parent.start) start.linkTo(parent.start)
} }
.size(size = MaterialTheme.bibLib.dimen.thumbnail.micro) .size(size = MaterialTheme.bibLib.dimen.thumbnail.micro)
.background( .placeholder(
color = MaterialTheme.bibLib.colors.placeHolder,
shape = MaterialTheme.bibLib.shapes.bookThumbnailCoverSmall, shape = MaterialTheme.bibLib.shapes.bookThumbnailCoverSmall,
visible = { true },
), ),
) )
Box( Box(
modifier = Modifier modifier = Modifier
.constrainAs(title) { .constrainAs(title) {
top.linkTo(parent.top, margin = dimen.dp8) top.linkTo(parent.top, margin = 8.dp)
start.linkTo(cover.end, margin = dimen.dp8) start.linkTo(cover.end, margin = 8.dp)
} }
.size(width = 120.dp, height = 16.dp) .size(width = 120.dp, height = 16.dp)
.background( .placeholder { true },
color = MaterialTheme.bibLib.colors.placeHolder,
shape = CircleShape,
),
) )
Box( Box(
modifier = Modifier modifier = Modifier
.constrainAs(author) { .constrainAs(author) {
top.linkTo(title.bottom, margin = dimen.dp4) top.linkTo(title.bottom, margin = 4.dp)
start.linkTo(cover.end, margin = dimen.dp8) start.linkTo(cover.end, margin = 8.dp)
} }
.size(width = 100.dp, height = 16.dp) .size(width = 100.dp, height = 16.dp)
.background( .placeholder { true },
color = MaterialTheme.bibLib.colors.placeHolder,
shape = CircleShape,
),
) )
} }
} }
@ -236,7 +226,8 @@ private fun MicroBookThumbnailPreview() {
author = "Asimov", author = "Asimov",
series = "Foundation - 1", series = "Foundation - 1",
isNew = true, isNew = true,
) ),
onClick = { },
) )
} }
} }
@ -248,6 +239,7 @@ private fun MicroBookThumbnailEmptyPreview() {
BibLibTheme { BibLibTheme {
MicroBookThumbnail( MicroBookThumbnail(
thumbnail = null, thumbnail = null,
onClick = { },
) )
} }
} }

View file

@ -2,17 +2,14 @@ package com.pixelized.biblib.ui.screen.home.common.item
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.res.Configuration import android.content.res.Configuration
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.* import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.Card import androidx.compose.material.Card
import androidx.compose.material.MaterialTheme import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text import androidx.compose.material.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.Stable import androidx.compose.runtime.Stable
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
@ -28,6 +25,7 @@ import com.pixelized.biblib.ui.theme.BibLibTheme
import com.pixelized.biblib.utils.extention.bibLib import com.pixelized.biblib.utils.extention.bibLib
import com.pixelized.biblib.utils.extention.default import com.pixelized.biblib.utils.extention.default
import com.pixelized.biblib.utils.extention.modifier.drawDiagonalLabel import com.pixelized.biblib.utils.extention.modifier.drawDiagonalLabel
import com.pixelized.biblib.utils.extention.placeholder
import com.skydoves.landscapist.glide.GlideImage import com.skydoves.landscapist.glide.GlideImage
@Stable @Stable
@ -66,7 +64,6 @@ private fun SmallBookThumbnailContent(
thumbnail: SmallBookThumbnailUio, thumbnail: SmallBookThumbnailUio,
onClick: (SmallBookThumbnailUio) -> Unit = default<SmallBookThumbnailUio>(), onClick: (SmallBookThumbnailUio) -> Unit = default<SmallBookThumbnailUio>(),
) { ) {
val dimen = MaterialTheme.bibLib.dimen
Card( Card(
modifier = modifier modifier = modifier
.clickable { onClick(thumbnail) } .clickable { onClick(thumbnail) }
@ -95,9 +92,9 @@ private fun SmallBookThumbnailContent(
Text( Text(
modifier = Modifier.constrainAs(title) { modifier = Modifier.constrainAs(title) {
top.linkTo(parent.top, margin = dimen.dp8) top.linkTo(parent.top, margin = 8.dp)
start.linkTo(cover.end, margin = dimen.dp8) start.linkTo(cover.end, margin = 8.dp)
end.linkTo(parent.end, margin = dimen.dp8) end.linkTo(parent.end, margin = 8.dp)
width = Dimension.fillToConstraints width = Dimension.fillToConstraints
}, },
style = MaterialTheme.typography.h6, style = MaterialTheme.typography.h6,
@ -109,15 +106,15 @@ private fun SmallBookThumbnailContent(
Text( Text(
modifier = Modifier.constrainAs(author) { modifier = Modifier.constrainAs(author) {
top.linkTo(title.bottom, margin = dimen.dp4) top.linkTo(title.bottom, margin = 4.dp)
bottom.linkTo(genre.top, margin = dimen.dp4) bottom.linkTo(genre.top, margin = 4.dp)
start.linkTo(cover.end, margin = dimen.dp8) start.linkTo(cover.end, margin = 8.dp)
end.linkTo(parent.end, margin = dimen.dp8) end.linkTo(parent.end, margin = 8.dp)
width = Dimension.fillToConstraints width = Dimension.fillToConstraints
height = Dimension.fillToConstraints height = Dimension.fillToConstraints
}, },
style = MaterialTheme.typography.body1, style = MaterialTheme.typography.body1,
color = MaterialTheme.bibLib.colors.typography.easy, color = MaterialTheme.bibLib.colors.typography.light,
maxLines = 1, maxLines = 1,
overflow = TextOverflow.Ellipsis, overflow = TextOverflow.Ellipsis,
text = thumbnail.author text = thumbnail.author
@ -125,25 +122,25 @@ private fun SmallBookThumbnailContent(
Text( Text(
modifier = Modifier.constrainAs(genre) { modifier = Modifier.constrainAs(genre) {
bottom.linkTo(parent.bottom, margin = dimen.dp8) bottom.linkTo(parent.bottom, margin = 8.dp)
start.linkTo(cover.end, margin = dimen.dp8) start.linkTo(cover.end, margin = 8.dp)
end.linkTo(date.start, margin = dimen.dp8) end.linkTo(date.start, margin = 8.dp)
width = Dimension.fillToConstraints width = Dimension.fillToConstraints
}, },
maxLines = 1, maxLines = 1,
overflow = TextOverflow.Ellipsis, overflow = TextOverflow.Ellipsis,
style = MaterialTheme.typography.caption, style = MaterialTheme.typography.caption,
color = MaterialTheme.bibLib.colors.typography.easy, color = MaterialTheme.bibLib.colors.typography.light,
text = thumbnail.genre text = thumbnail.genre
) )
Text( Text(
modifier = Modifier.constrainAs(date) { modifier = Modifier.constrainAs(date) {
bottom.linkTo(parent.bottom, margin = dimen.dp8) bottom.linkTo(parent.bottom, margin = 8.dp)
end.linkTo(parent.end, margin = dimen.dp8) end.linkTo(parent.end, margin = 8.dp)
}, },
style = MaterialTheme.typography.caption, style = MaterialTheme.typography.caption,
color = MaterialTheme.bibLib.colors.typography.easy, color = MaterialTheme.bibLib.colors.typography.light,
text = thumbnail.date ?: "" text = thumbnail.date ?: ""
) )
} }
@ -154,7 +151,6 @@ private fun SmallBookThumbnailContent(
private fun SmallBookThumbnailPlaceHolder( private fun SmallBookThumbnailPlaceHolder(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
) { ) {
val dimen = MaterialTheme.bibLib.dimen
Card( Card(
modifier = modifier modifier = modifier
.fillMaxWidth() .fillMaxWidth()
@ -174,62 +170,50 @@ private fun SmallBookThumbnailPlaceHolder(
start.linkTo(parent.start) start.linkTo(parent.start)
} }
.size(size = MaterialTheme.bibLib.dimen.thumbnail.cover) .size(size = MaterialTheme.bibLib.dimen.thumbnail.cover)
.background( .placeholder(
color = MaterialTheme.bibLib.colors.placeHolder,
shape = MaterialTheme.bibLib.shapes.bookThumbnailCoverSmall, shape = MaterialTheme.bibLib.shapes.bookThumbnailCoverSmall,
visible = { true },
), ),
) )
Box( Box(
modifier = Modifier modifier = Modifier
.constrainAs(title) { .constrainAs(title) {
top.linkTo(parent.top, margin = dimen.dp8) top.linkTo(parent.top, margin = 8.dp)
start.linkTo(cover.end, margin = dimen.dp8) start.linkTo(cover.end, margin = 8.dp)
} }
.size(width = 120.dp, height = 16.dp) .size(width = 120.dp, height = 16.dp)
.background( .placeholder { true },
color = MaterialTheme.bibLib.colors.placeHolder,
shape = CircleShape,
),
) )
Box( Box(
modifier = Modifier modifier = Modifier
.constrainAs(author) { .constrainAs(author) {
top.linkTo(title.bottom, margin = dimen.dp4) top.linkTo(title.bottom, margin = 4.dp)
start.linkTo(cover.end, margin = dimen.dp8) start.linkTo(cover.end, margin = 8.dp)
} }
.size(width = 100.dp, height = 16.dp) .size(width = 100.dp, height = 16.dp)
.background( .placeholder { true },
color = MaterialTheme.bibLib.colors.placeHolder,
shape = CircleShape,
),
) )
Box( Box(
modifier = Modifier modifier = Modifier
.constrainAs(genre) { .constrainAs(genre) {
bottom.linkTo(parent.bottom, margin = dimen.dp8) bottom.linkTo(parent.bottom, margin = 8.dp)
start.linkTo(cover.end, margin = dimen.dp8) start.linkTo(cover.end, margin = 8.dp)
} }
.size(width = 80.dp, height = 16.dp) .size(width = 80.dp, height = 16.dp)
.background( .placeholder { true },
color = MaterialTheme.bibLib.colors.placeHolder,
shape = CircleShape,
),
) )
Box( Box(
modifier = Modifier modifier = Modifier
.constrainAs(date) { .constrainAs(date) {
bottom.linkTo(parent.bottom, margin = dimen.dp8) bottom.linkTo(parent.bottom, margin = 8.dp)
end.linkTo(parent.end, margin = dimen.dp8) end.linkTo(parent.end, margin = 8.dp)
} }
.size(width = 40.dp, height = 16.dp) .size(width = 40.dp, height = 16.dp)
.background( .placeholder { true },
color = MaterialTheme.bibLib.colors.placeHolder,
shape = CircleShape,
),
) )
} }
} }

View file

@ -11,6 +11,7 @@ import androidx.compose.runtime.*
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalUriHandler import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
import com.pixelized.biblib.R import com.pixelized.biblib.R
import com.pixelized.biblib.ui.LocalSnackHostState import com.pixelized.biblib.ui.LocalSnackHostState
@ -75,7 +76,7 @@ fun DetailScreen(
DetailScreenSendOption( DetailScreenSendOption(
modifier = Modifier modifier = Modifier
.navigationBarsPadding() .navigationBarsPadding()
.padding(bottom = MaterialTheme.bibLib.dimen.dp16), .padding(bottom = 16.dp),
emails = profileViewModel.mails, emails = profileViewModel.mails,
onHelp = { uri -> onHelp = { uri ->
uriHandler.openUri(uri) uriHandler.openUri(uri)
@ -92,7 +93,7 @@ fun DetailScreen(
modifier = Modifier modifier = Modifier
.fillMaxSize() .fillMaxSize()
.verticalScroll(rememberScrollState()) .verticalScroll(rememberScrollState())
.padding(all = MaterialTheme.bibLib.dimen.dp16) .padding(all = 16.dp)
.systemBarsPadding(), .systemBarsPadding(),
book = detail, book = detail,
onSend = { onSend = {

View file

@ -36,6 +36,7 @@ import com.pixelized.biblib.ui.composable.animation.AnimatedOffset
import com.pixelized.biblib.ui.theme.BibLibTheme import com.pixelized.biblib.ui.theme.BibLibTheme
import com.pixelized.biblib.utils.extention.bibLib import com.pixelized.biblib.utils.extention.bibLib
import com.pixelized.biblib.utils.extention.default import com.pixelized.biblib.utils.extention.default
import com.pixelized.biblib.utils.extention.placeholder
import com.skydoves.landscapist.CircularReveal import com.skydoves.landscapist.CircularReveal
import com.skydoves.landscapist.glide.GlideImage import com.skydoves.landscapist.glide.GlideImage
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@ -90,7 +91,7 @@ fun DetailScreenContent(
GlideImage( GlideImage(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.padding(vertical = MaterialTheme.bibLib.dimen.dp16) .padding(vertical = 16.dp)
.height(MaterialTheme.bibLib.dimen.detail.cover), .height(MaterialTheme.bibLib.dimen.detail.cover),
previewPlaceholder = R.drawable.ic_fondatoin_cover, previewPlaceholder = R.drawable.ic_fondatoin_cover,
circularReveal = CircularReveal(duration = 1000), circularReveal = CircularReveal(duration = 1000),
@ -98,7 +99,7 @@ fun DetailScreenContent(
imageModel = book.cover, imageModel = book.cover,
) )
Row(modifier = Modifier.padding(vertical = MaterialTheme.bibLib.dimen.dp16)) { Row(modifier = Modifier.padding(vertical = 16.dp)) {
AnimatedOffset( AnimatedOffset(
modifier = Modifier.weight(1f), modifier = Modifier.weight(1f),
) { ) {
@ -107,12 +108,12 @@ fun DetailScreenContent(
onClick = onMobi, onClick = onMobi,
) { ) {
Icon(imageVector = Icons.Default.Download, contentDescription = null) Icon(imageVector = Icons.Default.Download, contentDescription = null)
Spacer(modifier = Modifier.width(MaterialTheme.bibLib.dimen.dp4)) Spacer(modifier = Modifier.width(4.dp))
Text(text = stringResource(id = R.string.action_mobi)) Text(text = stringResource(id = R.string.action_mobi))
} }
} }
Spacer(modifier = Modifier.padding(all = MaterialTheme.bibLib.dimen.dp4)) Spacer(modifier = Modifier.padding(all = 4.dp))
AnimatedOffset( AnimatedOffset(
modifier = Modifier.weight(1f), modifier = Modifier.weight(1f),
@ -122,12 +123,12 @@ fun DetailScreenContent(
onClick = onEpub, onClick = onEpub,
) { ) {
Icon(imageVector = Icons.Default.Download, contentDescription = null) Icon(imageVector = Icons.Default.Download, contentDescription = null)
Spacer(modifier = Modifier.width(MaterialTheme.bibLib.dimen.dp4)) Spacer(modifier = Modifier.width(4.dp))
Text(text = stringResource(id = R.string.action_epub)) Text(text = stringResource(id = R.string.action_epub))
} }
} }
Spacer(modifier = Modifier.padding(all = MaterialTheme.bibLib.dimen.dp4)) Spacer(modifier = Modifier.padding(all = 4.dp))
AnimatedOffset( AnimatedOffset(
modifier = Modifier.weight(1f), modifier = Modifier.weight(1f),
@ -137,7 +138,7 @@ fun DetailScreenContent(
onClick = { scope.launch { onSend() } }, onClick = { scope.launch { onSend() } },
) { ) {
Icon(imageVector = Icons.Default.Send, contentDescription = "") Icon(imageVector = Icons.Default.Send, contentDescription = "")
Spacer(modifier = Modifier.width(MaterialTheme.bibLib.dimen.dp4)) Spacer(modifier = Modifier.width(4.dp))
Text(text = stringResource(id = R.string.action_send)) Text(text = stringResource(id = R.string.action_send))
} }
} }
@ -158,7 +159,7 @@ fun DetailScreenContent(
AnimatedOffset( AnimatedOffset(
modifier = Modifier modifier = Modifier
.align(alignment = Alignment.CenterHorizontally) .align(alignment = Alignment.CenterHorizontally)
.padding(bottom = MaterialTheme.bibLib.dimen.dp16), .padding(bottom = 16.dp),
) { ) {
Text( Text(
fontWeight = FontWeight.Bold, fontWeight = FontWeight.Bold,
@ -169,7 +170,7 @@ fun DetailScreenContent(
} }
Row( Row(
modifier = Modifier.padding(bottom = MaterialTheme.bibLib.dimen.dp8), modifier = Modifier.padding(bottom = 8.dp),
) { ) {
AnimatedOffset(modifier = Modifier.weight(1f)) { AnimatedOffset(modifier = Modifier.weight(1f)) {
TitleLabel( TitleLabel(
@ -197,7 +198,7 @@ fun DetailScreenContent(
} }
AnimatedOffset( AnimatedOffset(
modifier = Modifier.padding(bottom = MaterialTheme.bibLib.dimen.dp16), modifier = Modifier.padding(bottom = 16.dp),
) { ) {
TitleLabel( TitleLabel(
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
@ -211,12 +212,8 @@ fun DetailScreenContent(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.placeholder( .placeholder(
visible = book.placeHolder,
shape = MaterialTheme.bibLib.shapes.base.medium, shape = MaterialTheme.bibLib.shapes.base.medium,
color = MaterialTheme.bibLib.colors.placeHolder, visible = { book.placeHolder },
highlight = PlaceholderHighlight.shimmer(
highlightColor = MaterialTheme.bibLib.colors.shimmer,
),
), ),
style = MaterialTheme.typography.body1, style = MaterialTheme.typography.body1,
color = MaterialTheme.colors.onSurface, color = MaterialTheme.colors.onSurface,
@ -263,7 +260,7 @@ private fun DetailScreenContentPreview() {
DetailScreenContent( DetailScreenContent(
modifier = Modifier modifier = Modifier
.verticalScroll(state = rememberScrollState()) .verticalScroll(state = rememberScrollState())
.padding(all = MaterialTheme.bibLib.dimen.dp16), .padding(all = 16.dp),
book = BookDetailUio.preview(), book = BookDetailUio.preview(),
) )
} }

View file

@ -17,6 +17,7 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.pixelized.biblib.R import com.pixelized.biblib.R
import com.pixelized.biblib.ui.theme.BibLibTheme import com.pixelized.biblib.ui.theme.BibLibTheme
import com.pixelized.biblib.ui.theme.color.BibLibColorPalette import com.pixelized.biblib.ui.theme.color.BibLibColorPalette
@ -55,7 +56,7 @@ fun DetailScreenSendLoaderContent(
modifier = Modifier modifier = Modifier
.fillMaxSize() .fillMaxSize()
.background(color = ShadowPalette.scrim) .background(color = ShadowPalette.scrim)
.padding(all = MaterialTheme.bibLib.dimen.dp16), .padding(all = 16.dp),
) )
} }
@ -66,7 +67,7 @@ fun DetailScreenSendLoaderContent(
exit = fadeOut() + slideOutVertically { it }, exit = fadeOut() + slideOutVertically { it },
) { ) {
CircularProgressIndicator( CircularProgressIndicator(
modifier = Modifier.size(MaterialTheme.bibLib.dimen.dialog.iconSize), modifier = Modifier.size(MaterialTheme.bibLib.dimen.progress.iconSize),
) )
} }
@ -80,16 +81,16 @@ fun DetailScreenSendLoaderContent(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.navigationBarsPadding() .navigationBarsPadding()
.padding(all = MaterialTheme.bibLib.dimen.dp16) .padding(all = 16.dp)
.background( .background(
color = BibLibColorPalette.LightGreen, color = BibLibColorPalette.LightGreen,
shape = MaterialTheme.shapes.small, shape = MaterialTheme.shapes.small,
) )
.padding( .padding(
vertical = MaterialTheme.bibLib.dimen.dp16, vertical = 16.dp,
horizontal = MaterialTheme.bibLib.dimen.dp24, horizontal = 24.dp,
), ),
horizontalArrangement = Arrangement.spacedBy(MaterialTheme.bibLib.dimen.dp16) horizontalArrangement = Arrangement.spacedBy(16.dp)
) { ) {
Icon( Icon(
painter = painterResource(id = R.drawable.ic_baseline_auto_stories_24), painter = painterResource(id = R.drawable.ic_baseline_auto_stories_24),

View file

@ -25,6 +25,7 @@ import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
import com.pixelized.biblib.R import com.pixelized.biblib.R
import com.pixelized.biblib.ui.theme.BibLibTheme import com.pixelized.biblib.ui.theme.BibLibTheme
@ -86,30 +87,30 @@ fun DetailScreenSendOption(
item { item {
Column( Column(
modifier = Modifier modifier = Modifier
.padding(top = MaterialTheme.bibLib.dimen.dp16) .padding(top = 16.dp)
.padding(horizontal = MaterialTheme.bibLib.dimen.dp16), .padding(horizontal = 16.dp),
) { ) {
Text( Text(
modifier = Modifier.padding(bottom = MaterialTheme.bibLib.dimen.dp16), modifier = Modifier.padding(bottom = 16.dp),
style = MaterialTheme.typography.h6, style = MaterialTheme.typography.h6,
color = MaterialTheme.bibLib.colors.typography.medium, color = MaterialTheme.bibLib.colors.typography.medium,
text = stringResource(R.string.detail_send_confirm_title) text = stringResource(R.string.detail_send_confirm_title)
) )
Text( Text(
modifier = Modifier.padding(bottom = MaterialTheme.bibLib.dimen.dp8), modifier = Modifier.padding(bottom = 8.dp),
style = MaterialTheme.typography.caption, style = MaterialTheme.typography.caption,
color = MaterialTheme.bibLib.colors.typography.easy, color = MaterialTheme.bibLib.colors.typography.light,
text = rememberDescription() text = rememberDescription()
) )
Text( Text(
modifier = Modifier modifier = Modifier
.clickable(onClick = { onHelp(amazonHelpUri) }) .clickable(onClick = { onHelp(amazonHelpUri) })
.padding(vertical = MaterialTheme.bibLib.dimen.dp8), .padding(vertical = 8.dp),
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
style = MaterialTheme.typography.caption, style = MaterialTheme.typography.caption,
color = MaterialTheme.bibLib.colors.typography.strong, color = MaterialTheme.bibLib.colors.typography.dark,
overflow = TextOverflow.Ellipsis, overflow = TextOverflow.Ellipsis,
maxLines = 1, maxLines = 1,
text = stringResource(R.string.detail_send_confirm_help), text = stringResource(R.string.detail_send_confirm_help),
@ -120,9 +121,9 @@ fun DetailScreenSendOption(
item { item {
Text( Text(
modifier = Modifier modifier = Modifier
.padding(vertical = MaterialTheme.bibLib.dimen.dp8) .padding(vertical = 8.dp)
.padding(horizontal = MaterialTheme.bibLib.dimen.dp16), .padding(horizontal = 16.dp),
color = MaterialTheme.bibLib.colors.typography.easy, color = MaterialTheme.bibLib.colors.typography.light,
style = MaterialTheme.typography.caption, style = MaterialTheme.typography.caption,
text = stringResource(id = R.string.detail_option_mail), text = stringResource(id = R.string.detail_option_mail),
) )
@ -132,16 +133,16 @@ fun DetailScreenSendOption(
modifier = Modifier modifier = Modifier
.clickable { onEmail(email) } .clickable { onEmail(email) }
.fillMaxWidth() .fillMaxWidth()
.padding(all = MaterialTheme.bibLib.dimen.dp16), .padding(all = 16.dp),
uio = email, uio = email,
) )
} }
item { item {
Text( Text(
modifier = Modifier modifier = Modifier
.padding(vertical = MaterialTheme.bibLib.dimen.dp8) .padding(vertical = 8.dp)
.padding(horizontal = MaterialTheme.bibLib.dimen.dp16), .padding(horizontal = 16.dp),
color = MaterialTheme.bibLib.colors.typography.easy, color = MaterialTheme.bibLib.colors.typography.light,
style = MaterialTheme.typography.caption, style = MaterialTheme.typography.caption,
text = stringResource(id = R.string.detail_option_format), text = stringResource(id = R.string.detail_option_format),
) )
@ -151,7 +152,7 @@ fun DetailScreenSendOption(
modifier = Modifier modifier = Modifier
.clickable { onFormat(format) } .clickable { onFormat(format) }
.fillMaxWidth() .fillMaxWidth()
.padding(all = MaterialTheme.bibLib.dimen.dp16), .padding(all = 16.dp),
uio = format, uio = format,
) )
} }
@ -159,7 +160,7 @@ fun DetailScreenSendOption(
Button( Button(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = MaterialTheme.bibLib.dimen.dp16), .padding(horizontal = 16.dp),
onClick = { onClick = {
val format = formats.first { it.selected } val format = formats.first { it.selected }
val email = emails.first { it.selected } val email = emails.first { it.selected }
@ -190,8 +191,8 @@ private fun OptionItem(
Text( Text(
modifier = Modifier modifier = Modifier
.padding( .padding(
start = MaterialTheme.bibLib.dimen.dp16, start = 16.dp,
end = MaterialTheme.bibLib.dimen.dp8, end = 8.dp,
) )
.weight(1f), .weight(1f),
style = MaterialTheme.typography.body1, style = MaterialTheme.typography.body1,

View file

@ -1,6 +1,7 @@
package com.pixelized.biblib.ui.screen.home.header package com.pixelized.biblib.ui.screen.home.header
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Box
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface import androidx.compose.material.Surface
import androidx.compose.runtime.* import androidx.compose.runtime.*
import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.saveable.rememberSaveable
@ -39,7 +40,9 @@ fun LazyGridCollapsingHeaderLayout(
} }
} }
Surface { Surface(
color = MaterialTheme.colors.background,
) {
Layout( Layout(
modifier = modifier.nestedScroll(nestedScrollConnection), modifier = modifier.nestedScroll(nestedScrollConnection),
content = { content = {

View file

@ -46,7 +46,7 @@ fun ProfilePage(
ProfileScreenContent( ProfileScreenContent(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.padding(MaterialTheme.bibLib.dimen.dp16), .padding(16.dp),
user = viewModel.user, user = viewModel.user,
onEditClick = { onEditClick = {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(IBibLibClient.EDIT_PROFILE)) val intent = Intent(Intent.ACTION_VIEW, Uri.parse(IBibLibClient.EDIT_PROFILE))
@ -107,7 +107,7 @@ private fun ProfileScreenContent(
} }
Text( Text(
modifier = Modifier.padding(top = MaterialTheme.bibLib.dimen.dp16), modifier = Modifier.padding(top = 16.dp),
style = MaterialTheme.typography.body1, style = MaterialTheme.typography.body1,
color = MaterialTheme.colors.onSurface, color = MaterialTheme.colors.onSurface,
text = stringResource(id = R.string.profile_emails) text = stringResource(id = R.string.profile_emails)
@ -138,7 +138,7 @@ private fun ProfileScreenContent(
Row( Row(
modifier = Modifier modifier = Modifier
.padding(top = MaterialTheme.bibLib.dimen.dp16) .padding(top = 16.dp)
.align(Alignment.End), .align(Alignment.End),
horizontalArrangement = Arrangement.spacedBy(4.dp), horizontalArrangement = Arrangement.spacedBy(4.dp),
) { ) {
@ -174,7 +174,7 @@ private fun ProfileScreenContentPreview(
ProfileScreenContent( ProfileScreenContent(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.padding(all = MaterialTheme.bibLib.dimen.dp16), .padding(all = 16.dp),
user = preview, user = preview,
onEditClick = { }, onEditClick = { },
onLogoutClick = { }, onLogoutClick = { },

View file

@ -77,7 +77,7 @@ private fun BookSortPageContent(
modifier = Modifier.padding(horizontal = 16.dp), modifier = Modifier.padding(horizontal = 16.dp),
style = MaterialTheme.typography.h6, style = MaterialTheme.typography.h6,
color = MaterialTheme.bibLib.colors.typography.medium, color = MaterialTheme.bibLib.colors.typography.medium,
text = "Sort by:" text = stringResource(id = R.string.search_sort_by)
) )
LazyColumn( LazyColumn(
@ -114,7 +114,7 @@ private fun BookSortPageContent(
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
onClick = onConfirm onClick = onConfirm
) { ) {
Text(text = "Sort") Text(text = stringResource(id = R.string.search_sort_action))
} }
} }
} }

View file

@ -13,17 +13,21 @@ import javax.annotation.concurrent.Immutable
data class BibLibColor( data class BibLibColor(
val base: Colors, val base: Colors,
val typography: Typography, val typography: Typography,
val placeHolder: Color, val placeHolder: PlaceHolder,
val shimmer: Color,
val dialogBackground: Color,
) { ) {
@Stable @Stable
@Immutable @Immutable
data class Typography( data class Typography(
val easy: Color, val light: Color,
val medium: Color, val medium: Color,
val strong: Color, val dark: Color,
)
@Stable
@Immutable
data class PlaceHolder(
val color: Color,
val shimmer: Color,
) )
} }
@ -37,19 +41,18 @@ fun bibLibDarkColors(
onError = Color.White, onError = Color.White,
), ),
typography: BibLibColor.Typography = BibLibColor.Typography( typography: BibLibColor.Typography = BibLibColor.Typography(
easy = base.onSurface.copy(alpha = 0.67f), light = base.onSurface.copy(alpha = 0.67f),
medium = base.onSurface, medium = base.onSurface,
strong = base.primary, dark = base.primary,
),
placeHolder: BibLibColor.PlaceHolder = BibLibColor.PlaceHolder(
color = BibLibColorPalette.DarkGrey,
shimmer = BibLibColorPalette.Grey,
), ),
placeHolder: Color = BibLibColorPalette.DarkGrey,
shimmer: Color = BibLibColorPalette.Grey,
dialogBackground: Color = BibLibColorPalette.VeryDarkGrey,
) = BibLibColor( ) = BibLibColor(
base = base, base = base,
typography = typography, typography = typography,
placeHolder = placeHolder, placeHolder = placeHolder,
shimmer = shimmer,
dialogBackground = dialogBackground,
) )
fun bibLibLightColors( fun bibLibLightColors(
@ -60,19 +63,22 @@ fun bibLibLightColors(
onSecondary = Color.White, onSecondary = Color.White,
error = BibLibColorPalette.Red, error = BibLibColorPalette.Red,
onError = Color.White, onError = Color.White,
background = BibLibColorPalette.VeryLightGrey,
onBackground = BibLibColorPalette.VeryDarkGrey,
surface = Color.White,
onSurface = BibLibColorPalette.VeryDarkGrey,
), ),
typography: BibLibColor.Typography = BibLibColor.Typography( typography: BibLibColor.Typography = BibLibColor.Typography(
easy = base.onSurface.copy(alpha = 0.67f), light = base.onSurface.copy(alpha = 0.67f),
medium = base.onSurface, medium = base.onSurface,
strong = base.primary, dark = base.primary,
),
placeHolder: BibLibColor.PlaceHolder = BibLibColor.PlaceHolder(
color = BibLibColorPalette.LightGrey,
shimmer = BibLibColorPalette.Grey,
), ),
placeHolder: Color = BibLibColorPalette.LightGrey,
shimmer: Color = BibLibColorPalette.Grey,
dialogBackground: Color = Color.White,
) = BibLibColor( ) = BibLibColor(
base = base, base = base,
typography = typography, typography = typography,
placeHolder = placeHolder, placeHolder = placeHolder,
shimmer = shimmer,
dialogBackground = dialogBackground,
) )

View file

@ -9,44 +9,28 @@ import androidx.compose.ui.unit.dp
@Stable @Stable
@Immutable @Immutable
data class BibLibDimen( data class BibLibDimen(
@Deprecated("")
val default: Dp = 0.dp,
@Deprecated("")
val dp2: Dp = 2.dp,
@Deprecated("")
val dp4: Dp = 4.dp,
@Deprecated("")
val dp8: Dp = 8.dp,
@Deprecated("")
val dp12: Dp = 12.dp,
@Deprecated("")
val dp16: Dp = 16.dp,
@Deprecated("")
val dp24: Dp = 24.dp,
@Deprecated("")
val dp32: Dp = 32.dp,
@Deprecated("")
val dp48: Dp = 48.dp,
@Deprecated("")
val dp52: Dp = 52.dp,
@Deprecated("")
val dp64: Dp = 64.dp,
@Deprecated("")
val dialog: Dialog = Dialog(),
val avatar: Avatar = Avatar(), val avatar: Avatar = Avatar(),
val thumbnail: BookThumbnail = BookThumbnail(), val progress: Progress = Progress(),
val detail: BookDetail = BookDetail(), val detail: BookDetail = BookDetail(),
val thumbnail: BookThumbnail = BookThumbnail(),
) { ) {
@Stable @Stable
@Immutable @Immutable
data class Dialog( data class Avatar(
val medium: Dp = 32.dp,
)
@Stable
@Immutable
data class Progress(
val iconSize: Dp = 52.dp, val iconSize: Dp = 52.dp,
) )
@Stable @Stable
@Immutable @Immutable
data class Avatar( data class BookDetail(
val medium: Dp = 32.dp, val placeHolder: Dp = 64.dp,
val cover: Dp = 384.dp,
) )
@Stable @Stable
@ -58,11 +42,4 @@ data class BibLibDimen(
val cover: DpSize = 72.dp.let { DpSize(width = it, height = it * ratio) }, val cover: DpSize = 72.dp.let { DpSize(width = it, height = it * ratio) },
val micro: DpSize = 50.dp.let { DpSize(width = it, height = it * ratio) }, val micro: DpSize = 50.dp.let { DpSize(width = it, height = it * ratio) },
) )
@Stable
@Immutable
data class BookDetail(
val placeHolder: Dp = 64.dp,
val cover: Dp = 384.dp,
)
} }

View file

@ -47,8 +47,8 @@ fun Modifier.autofill(
@SuppressLint("ComposableModifierFactory") @SuppressLint("ComposableModifierFactory")
@Composable @Composable
fun Modifier.placeholder( fun Modifier.placeholder(
color: Color = MaterialTheme.bibLib.colors.placeHolder, color: Color = MaterialTheme.bibLib.colors.placeHolder.color,
shimmer: Color = MaterialTheme.bibLib.colors.shimmer, shimmer: Color = MaterialTheme.bibLib.colors.placeHolder.shimmer,
shape: Shape = CircleShape, shape: Shape = CircleShape,
visible: () -> Boolean, visible: () -> Boolean,
) = this.placeholder( ) = this.placeholder(

View file

@ -69,7 +69,11 @@
<string name="search_filter_genre">Genre</string> <string name="search_filter_genre">Genre</string>
<string name="search_filter_language">Langue</string> <string name="search_filter_language">Langue</string>
<string name="search_sort_by">Trié par : %1$s</string> <string name="search_sort_by">Trier par :</string>
<string name="search_sort_action">Trier</string>
<string name="search_sort_new">Dernier ajout</string>
<string name="search_sort_title">Titre des livres </string>
<string name="search_sort_series">Ordre dans la série</string>
<string name="profile_title">Bonjour</string> <string name="profile_title">Bonjour</string>
<string name="profile_emails">Emails associés :</string> <string name="profile_emails">Emails associés :</string>

View file

@ -84,7 +84,8 @@
<string name="search_filter_genre">Genres</string> <string name="search_filter_genre">Genres</string>
<string name="search_filter_language">Languages</string> <string name="search_filter_language">Languages</string>
<string name="search_sort_by">Sort by: %1$s</string> <string name="search_sort_by">Sort by</string>
<string name="search_sort_action">Sort</string>
<string name="search_sort_new">Last addition</string> <string name="search_sort_new">Last addition</string>
<string name="search_sort_title">Book title</string> <string name="search_sort_title">Book title</string>
<string name="search_sort_series">Series order</string> <string name="search_sort_series">Series order</string>

View file

@ -16,6 +16,6 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# https://developer.android.com/topic/libraries/support-library/androidx-rn # https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX # Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true android.enableJetifier=false
# Kotlin code style for this project: "official" or "obsolete": # Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official kotlin.code.style=official