-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from Efimj/enhancement/aboud-screen
Enhancement/aboud screen
- Loading branch information
Showing
24 changed files
with
443 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
396 changes: 229 additions & 167 deletions
396
app/src/main/java/com/jobik/shkiper/screens/about/AboutNotepadScreen.kt
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
app/src/main/java/com/jobik/shkiper/ui/components/cards/MediaCard.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
package com.jobik.shkiper.ui.components.cards | ||
|
||
import androidx.annotation.DrawableRes | ||
import androidx.compose.animation.animateColorAsState | ||
import androidx.compose.animation.core.animateFloatAsState | ||
import androidx.compose.animation.core.tween | ||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.clip | ||
import androidx.compose.ui.graphics.ColorFilter | ||
import androidx.compose.ui.graphics.graphicsLayer | ||
import androidx.compose.ui.layout.ContentScale | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.text.style.TextOverflow | ||
import androidx.compose.ui.unit.dp | ||
import com.jobik.shkiper.ui.modifiers.bounceClick | ||
import com.jobik.shkiper.ui.theme.AppTheme | ||
|
||
@Composable | ||
fun MediaCard( | ||
isHighlight: Boolean = false, | ||
@DrawableRes image: Int, | ||
title: String, | ||
description: String, | ||
onClick: () -> Unit | ||
) { | ||
val backgroundColor by | ||
animateColorAsState( | ||
targetValue = if (isHighlight) AppTheme.colors.secondaryContainer else AppTheme.colors.container, | ||
tween(500) | ||
) | ||
|
||
val iconColor by | ||
animateColorAsState( | ||
targetValue = if (isHighlight) AppTheme.colors.onSecondaryContainer else AppTheme.colors.onSecondaryContainer, | ||
tween(500) | ||
) | ||
|
||
val titleColor by | ||
animateColorAsState( | ||
targetValue = if (isHighlight) AppTheme.colors.onSecondaryContainer else AppTheme.colors.text, | ||
tween(500) | ||
) | ||
|
||
val descriptionColor by | ||
animateColorAsState( | ||
targetValue = if (isHighlight) AppTheme.colors.textSecondary else AppTheme.colors.textSecondary, | ||
tween(500) | ||
) | ||
|
||
val scale by animateFloatAsState(if (isHighlight) 1.05f else 1f, tween(500)) | ||
|
||
Row( | ||
modifier = Modifier | ||
.graphicsLayer { | ||
scaleX = scale | ||
scaleY = scale | ||
} | ||
.bounceClick() | ||
.clip(AppTheme.shapes.large) | ||
.background(backgroundColor) | ||
.clickable { onClick() } | ||
.padding(vertical = 10.dp, horizontal = 15.dp), | ||
verticalAlignment = Alignment.CenterVertically, | ||
horizontalArrangement = Arrangement.spacedBy(15.dp) | ||
) { | ||
Image( | ||
modifier = Modifier.size(50.dp), | ||
painter = painterResource(id = image), | ||
contentDescription = null, | ||
contentScale = ContentScale.FillHeight, | ||
colorFilter = ColorFilter.tint(iconColor) | ||
) | ||
Column(verticalArrangement = Arrangement.spacedBy(3.dp)) { | ||
Text( | ||
modifier = Modifier.fillMaxWidth(), | ||
text = title, | ||
style = MaterialTheme.typography.titleLarge, | ||
fontWeight = FontWeight.SemiBold, | ||
color = titleColor, | ||
overflow = TextOverflow.Ellipsis, | ||
) | ||
Text( | ||
modifier = Modifier.fillMaxWidth(), | ||
text = description, | ||
style = MaterialTheme.typography.bodyMedium, | ||
color = descriptionColor, | ||
overflow = TextOverflow.Ellipsis, | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="960" | ||
android:viewportHeight="960"> | ||
<path | ||
android:pathData="M480,840q-65,0 -120.5,-32T272,720h-72q-17,0 -28.5,-11.5T160,680q0,-17 11.5,-28.5T200,640h44q-3,-20 -3.5,-40t-0.5,-40h-40q-17,0 -28.5,-11.5T160,520q0,-17 11.5,-28.5T200,480h40q0,-20 0.5,-40t3.5,-40h-44q-17,0 -28.5,-11.5T160,360q0,-17 11.5,-28.5T200,320h72q14,-23 31.5,-43t40.5,-35l-37,-38q-11,-11 -11,-27.5t12,-28.5q11,-11 28,-11t28,11l58,58q28,-9 57,-9t57,9l60,-59q11,-11 27.5,-11t28.5,12q11,11 11,28t-11,28l-38,38q23,15 41.5,34.5T688,320h72q17,0 28.5,11.5T800,360q0,17 -11.5,28.5T760,400h-44q3,20 3.5,40t0.5,40h40q17,0 28.5,11.5T800,520q0,17 -11.5,28.5T760,560h-40q0,20 -0.5,40t-3.5,40h44q17,0 28.5,11.5T800,680q0,17 -11.5,28.5T760,720h-72q-32,56 -87.5,88T480,840ZM480,760q66,0 113,-47t47,-113v-160q0,-66 -47,-113t-113,-47q-66,0 -113,47t-47,113v160q0,66 47,113t113,47ZM440,640h80q17,0 28.5,-11.5T560,600q0,-17 -11.5,-28.5T520,560h-80q-17,0 -28.5,11.5T400,600q0,17 11.5,28.5T440,640ZM440,480h80q17,0 28.5,-11.5T560,440q0,-17 -11.5,-28.5T520,400h-80q-17,0 -28.5,11.5T400,440q0,17 11.5,28.5T440,480ZM480,520Z" | ||
android:fillColor="#e8eaed"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="960" | ||
android:viewportHeight="960"> | ||
<path | ||
android:pathData="M160,800q-33,0 -56.5,-23.5T80,720v-480q0,-33 23.5,-56.5T160,160h640q33,0 56.5,23.5T880,240v480q0,33 -23.5,56.5T800,800L160,800ZM800,320L501,507q-5,3 -10.5,4.5T480,513q-5,0 -10.5,-1.5T459,507L160,320v400h640v-400ZM480,440l320,-200L160,240l320,200ZM160,320v10,-59 1,-32 32,-0.5 58.5,-10 400,-400Z" | ||
android:fillColor="#e8eaed"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.