mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-23 19:26:17 +00:00
Design tweaks for app icon switching.
This commit is contained in:
committed by
Greyson Parrelli
parent
77ccbdd322
commit
f8529adfcf
@@ -6,7 +6,9 @@
|
||||
package org.thoughtcrime.securesms.components.settings.app.appearance.appicon
|
||||
|
||||
import android.content.Context
|
||||
import androidx.compose.animation.core.CubicBezierEasing
|
||||
import androidx.compose.animation.core.animateFloatAsState
|
||||
import androidx.compose.animation.core.tween
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.clickable
|
||||
@@ -240,7 +242,11 @@ fun IconGridElement(preset: AppIconPreset, isSelected: Boolean, onClickHandler:
|
||||
*/
|
||||
@Composable
|
||||
fun AppIcon(preset: AppIconPreset, isSelected: Boolean, onClick: () -> Unit, modifier: Modifier = Modifier) {
|
||||
val bitmapSize by animateFloatAsState(if (isSelected) 48f else 64f, label = "Icon Size")
|
||||
val bitmapSize by animateFloatAsState(
|
||||
targetValue = if (isSelected) 48f else 64f,
|
||||
label = "Icon Size",
|
||||
animationSpec = tween(durationMillis = 150, easing = CubicBezierEasing(0.17f, 0.17f, 0f, 1f))
|
||||
)
|
||||
val imageModifier = modifier
|
||||
.size(bitmapSize.dp)
|
||||
.graphicsLayer(
|
||||
|
||||
@@ -25,6 +25,7 @@ import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.navigation.fragment.findNavController
|
||||
@@ -65,7 +66,10 @@ class AppIconTutorialFragment : ComposeFragment() {
|
||||
text = stringResource(R.string.preferences__app_icon_warning),
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.padding(vertical = 20.dp)
|
||||
textAlign = TextAlign.Start,
|
||||
modifier = Modifier
|
||||
.padding(vertical = 20.dp)
|
||||
.fillMaxWidth()
|
||||
)
|
||||
Box(
|
||||
contentAlignment = Alignment.Center,
|
||||
@@ -86,7 +90,10 @@ class AppIconTutorialFragment : ComposeFragment() {
|
||||
text = stringResource(id = R.string.preferences__app_icon_notification_warning),
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.padding(vertical = 20.dp)
|
||||
textAlign = TextAlign.Start,
|
||||
modifier = Modifier
|
||||
.padding(vertical = 20.dp)
|
||||
.fillMaxWidth()
|
||||
)
|
||||
Box(
|
||||
contentAlignment = Alignment.Center,
|
||||
|
||||
Reference in New Issue
Block a user