Skip to content

Commit

Permalink
refactor(ProfileScreen): redesign of logged user card
Browse files Browse the repository at this point in the history
  • Loading branch information
urFate committed Jul 4, 2024
1 parent f307df1 commit 7a15fa0
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@ package org.shirabox.app.ui.screen.profile
import android.content.Intent
import android.net.Uri
import android.widget.Toast
import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.HelpOutline
import androidx.compose.material.icons.automirrored.rounded.Login
import androidx.compose.material.icons.filled.History
import androidx.compose.material.icons.outlined.Savings
import androidx.compose.material.icons.outlined.Settings
Expand All @@ -24,12 +25,13 @@ import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.ListItem
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedCard
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.navigation.NavController
Expand All @@ -48,35 +50,32 @@ fun ProfileScreen(navController: NavController){
val donationUri = Uri.parse("$site/donate")
val helpUri = Uri.parse("$site/faq")


ShiraBoxTheme {
Column(
modifier = Modifier.fillMaxSize(),
) {
OutlinedCard(
shape = RoundedCornerShape(10.dp),
modifier = Modifier
.fillMaxWidth(1f)
.padding(16.dp)
.height(72.dp)
.clickable {
Toast.makeText(context, "В разработке...", Toast.LENGTH_SHORT).show()
}

Box(
modifier = Modifier.fillMaxWidth().padding(0.dp, 4.dp).clickable {
Toast.makeText(context, "В разработке...", Toast.LENGTH_SHORT).show()
}
) {
Row(
modifier = Modifier.padding(16.dp),
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.padding(16.dp)
) {
Icon(
imageVector = Icons.AutoMirrored.Rounded.Login,
contentDescription = "Login Icon",
tint = MaterialTheme.colorScheme.onSurfaceVariant
Image(
modifier = Modifier
.size(60.dp)
.clip(RoundedCornerShape(100)),
painter = painterResource(id = R.drawable.ic_profile_guest),
contentDescription = "Login Icon"
)
Spacer(modifier = Modifier.width(16.dp))
Column {
Text(
text = stringResource(id = R.string.unauthorized),
style = MaterialTheme.typography.labelLarge
text = stringResource(id = R.string.guest),
style = MaterialTheme.typography.titleMedium,
)
Text(
text = stringResource(id = R.string.unauthorized_suggestion),
Expand All @@ -85,6 +84,7 @@ fun ProfileScreen(navController: NavController){
}
}
}

Column {
HorizontalDivider(
modifier = Modifier
Expand Down
53 changes: 53 additions & 0 deletions app/src/main/res/drawable/ic_profile_guest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="516.3dp"
android:height="516.3dp"
android:viewportWidth="136.6"
android:viewportHeight="136.6">
<path
android:pathData="M1.63,0.57L134.98,0.57A1.06,1.06 0,0 1,136.04 1.63L136.04,134.98A1.06,1.06 0,0 1,134.98 136.04L1.63,136.04A1.06,1.06 0,0 1,0.57 134.98L0.57,1.63A1.06,1.06 0,0 1,1.63 0.57z"
android:strokeLineJoin="round"
android:strokeWidth="1.14"
android:fillColor="#eaeaea"
android:strokeColor="#f4f4f4"
android:strokeLineCap="round"/>
<path
android:pathData="m43.51,75.42a14.86,11.94 55.86,0 1,-11.39 -13.9,14.86 11.94,55.86 0,1 7.37,-13.08 14.86,11.94 55.86,0 1,15.3 6.97l-9.9,6.67z"
android:strokeWidth="0.47"
android:fillColor="#c9c9c9"/>
<path
android:pathData="m44.74,78a12.6,8.58 74.35,0 1,-7.87 -12.27,12.6 8.58,74.35 0,1 5.09,-11.54 12.6,8.58 74.35,0 1,10.57 6.15l-6.84,5.89z"
android:strokeWidth="0.118128"
android:fillColor="#b4b4b4"/>
<path
android:pathData="m93.09,75.42a14.86,11.94 124.14,0 0,11.39 -13.9,14.86 11.94,124.14 0,0 -7.37,-13.08 14.86,11.94 124.14,0 0,-15.3 6.97l9.9,6.67z"
android:strokeWidth="0.47"
android:fillColor="#c9c9c9"/>
<path
android:pathData="m91.72,77.85a12.6,8.58 105.65,0 0,7.87 -12.27,12.6 8.58,105.65 0,0 -5.09,-11.54 12.6,8.58 105.65,0 0,-10.57 6.15l6.84,5.89z"
android:strokeWidth="0.118128"
android:fillColor="#b4b4b4"/>
<path
android:pathData="m105.5,81.47c-1.57,-8.97 -6.08,-17.1 -12.75,-22.99 -2.84,-2.5 -8.15,-5.71 -11.69,-7.03 -8.2,-3.06 -17.18,-3.06 -25.39,-0.02 -3.57,1.33 -8.92,4.55 -11.77,7.07 -6.82,6.03 -11.37,14.41 -12.83,23.63 -0.55,3.5 2.37,6.39 5.92,6.39l24.93,-0 37.09,-0c3.92,-0 7.16,-3.2 6.48,-7.06z"
android:strokeWidth="0.68"
android:fillColor="#c9c9c9"/>
<path
android:pathData="M75.93,71.47a7.32,5.86 90,1 1,11.71 -0a7.32,5.86 90,1 1,-11.71 -0z"
android:strokeWidth="0.37"
android:fillColor="#eaeaea"/>
<path
android:pathData="M48.96,71.47a7.32,5.86 90,1 1,11.71 -0a7.32,5.86 90,1 1,-11.71 -0z"
android:strokeWidth="0.37"
android:fillColor="#eaeaea"/>
<path
android:pathData="m68.85,78.95c-1.57,1.55 -3.13,3.1 -4.7,4.65 -0.31,0.3 -0.79,0.3 -1.1,-0.01 -0.3,-0.31 -0.3,-0.79 0.01,-1.1 1.57,-1.55 3.13,-3.1 4.7,-4.65 0.31,-0.3 0.79,-0.3 1.1,0.01 0.3,0.31 0.3,0.79 -0.01,1.1z"
android:strokeLineJoin="round"
android:strokeWidth="0.83"
android:fillColor="#eaeaea"
android:strokeColor="#eaeaea"/>
<path
android:pathData="m67.76,78.95c1.56,1.55 3.12,3.11 4.69,4.66 0.3,0.3 0.79,0.3 1.1,-0 0.3,-0.3 0.3,-0.79 -0,-1.1 -1.56,-1.55 -3.12,-3.11 -4.69,-4.66 -0.3,-0.3 -0.79,-0.3 -1.1,0 -0.3,0.3 -0.3,0.79 0,1.1z"
android:strokeLineJoin="round"
android:strokeWidth="0.83"
android:fillColor="#eaeaea"
android:strokeColor="#eaeaea"/>
</vector>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<!--
Login Card
-->
<string name="unauthorized">Вход не выполнен</string>
<string name="guest">Гость</string>
<string name="unauthorized_suggestion">Войти в аккаунт ShiraBox</string>
<string name="title_activity_resource">ResourceActivity</string>

Expand Down

0 comments on commit 7a15fa0

Please sign in to comment.