Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
T8RIN committed Apr 17, 2023
1 parent 42063df commit dec2734
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,10 @@ import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.max
import androidx.compose.ui.unit.min
import androidx.compose.ui.unit.sp
import androidx.compose.ui.window.DialogProperties
Expand Down Expand Up @@ -512,6 +514,7 @@ fun MainScreen(
)
}
Text(
maxLines = 1,
text = "Dp",
color = MaterialTheme.colorScheme.onSurface.copy(
alpha = 0.5f
Expand Down Expand Up @@ -946,8 +949,7 @@ fun MainScreen(
val updateButtonColors = if (viewModel.updateAvailable) {
ButtonDefaults.outlinedButtonColors(
containerColor = MaterialTheme.colorScheme.primaryContainer.copy(
alpha = if (LocalNightMode.current.isNightMode()) 0.5f
else 1f
alpha = 0.9f
),
contentColor = MaterialTheme.colorScheme.onPrimaryContainer.copy(
alpha = 0.5f
Expand All @@ -956,8 +958,7 @@ fun MainScreen(
} else {
ButtonDefaults.outlinedButtonColors(
containerColor = MaterialTheme.colorScheme.secondaryContainer.copy(
alpha = if (LocalNightMode.current.isNightMode()) 0.5f
else 1f
alpha = 0.9f
),
contentColor = MaterialTheme.colorScheme.onSecondaryContainer.copy(
alpha = 0.5f
Expand Down Expand Up @@ -1008,7 +1009,11 @@ fun MainScreen(
modifier = Modifier
.fabBorder()
.requiredSize(size = 56.dp),
containerColor = MaterialTheme.colorScheme.primaryContainer,
containerColor = if (viewModel.updateAvailable) {
MaterialTheme.colorScheme.secondaryContainer
} else {
MaterialTheme.colorScheme.primaryContainer
},
elevation = FloatingActionButtonDefaults.bottomAppBarFabElevation(),
content = { Icon(Icons.Rounded.Github, null) }
)
Expand Down Expand Up @@ -1114,12 +1119,14 @@ fun MainScreen(
Box {
Divider(Modifier.align(Alignment.TopCenter))
AnimatedContent(
data, transitionSpec = { fadeIn() with fadeOut() }
targetState = data,
transitionSpec = { fadeIn() with fadeOut() },
modifier = Modifier.verticalScroll(rememberScrollState())
) { list ->
FlowRow(
Modifier
.align(Alignment.Center)
.padding(8.dp)
.padding(start = 14.dp, top = 8.dp, bottom = 8.dp)
) {
list.forEach {
OutlinedIconButton(
Expand All @@ -1130,7 +1137,8 @@ fun MainScreen(
}
},
border = BorderStroke(
1.dp, MaterialTheme.colorScheme.outlineVariant
max(LocalBorderWidth.current, 1.dp),
MaterialTheme.colorScheme.outlineVariant
),
colors = IconButtonDefaults.outlinedIconButtonColors(
containerColor = MaterialTheme.colorScheme.secondaryContainer.copy(
Expand All @@ -1149,7 +1157,8 @@ fun MainScreen(
expanded = true
},
border = BorderStroke(
1.dp, MaterialTheme.colorScheme.outlineVariant
max(LocalBorderWidth.current, 1.dp),
MaterialTheme.colorScheme.outlineVariant
),
colors = IconButtonDefaults.outlinedIconButtonColors(
containerColor = MaterialTheme.colorScheme.secondaryContainer.copy(
Expand All @@ -1171,6 +1180,7 @@ fun MainScreen(
.alertDialog(),
expanded = expanded,
onDismissRequest = { expanded = false },
offset = DpOffset(6.dp, 0.dp)
) {
var value by remember { mutableStateOf(50f) }
Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.max
import ru.tech.imageresizershrinker.R
import ru.tech.imageresizershrinker.main_screen.components.LocalBorderWidth
import ru.tech.imageresizershrinker.main_screen.components.LocalPresetsProvider
import ru.tech.imageresizershrinker.main_screen.components.block
import ru.tech.imageresizershrinker.theme.mixedColor
Expand Down Expand Up @@ -74,7 +76,7 @@ fun PresetWidget(
)
},
border = BorderStroke(
1.dp, animateColorAsState(
max(LocalBorderWidth.current, 1.dp), animateColorAsState(
if (selected) MaterialTheme.colorScheme.outlineVariant
else Color.Transparent
).value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import androidx.compose.material3.OutlinedIconButton
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.max
import ru.tech.imageresizershrinker.main_screen.components.LocalBorderWidth
import ru.tech.imageresizershrinker.theme.Telegram
import ru.tech.imageresizershrinker.theme.mixedColor
import ru.tech.imageresizershrinker.theme.onMixedColor
Expand All @@ -37,7 +39,7 @@ fun TelegramButton(
disabledContainerColor = Color.Transparent
),
border = BorderStroke(
1.dp, animateColorAsState(
max(LocalBorderWidth.current, 1.dp), animateColorAsState(
if (isTelegramSpecs) MaterialTheme.colorScheme.outlineVariant
else Color.Transparent
).value
Expand Down

0 comments on commit dec2734

Please sign in to comment.