Skip to content

Commit

Permalink
Merge pull request #6 from raheemadamboev/1.1.1
Browse files Browse the repository at this point in the history
1.1.1
  • Loading branch information
raheemadamboev authored Sep 7, 2022
2 parents f4634ef + 6310108 commit fa86a27
Show file tree
Hide file tree
Showing 20 changed files with 104 additions and 101 deletions.
18 changes: 9 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ android {
applicationId "xyz.teamgravity.kichkinashahzoda"
minSdk 21
targetSdk 33
versionCode 2
versionName "1.1.0"
versionCode 3
versionName "1.1.1"

ndk {
debugSymbolLevel 'FULL'
Expand Down Expand Up @@ -77,10 +77,10 @@ dependencies {
implementation 'androidx.core:core-ktx:1.8.0'

// compose ui
implementation "androidx.compose.ui:ui:1.3.0-alpha03"
implementation "androidx.compose.ui:ui:1.3.0-beta01"

// compose preview
implementation "androidx.compose.ui:ui-tooling-preview:1.3.0-alpha03"
implementation "androidx.compose.ui:ui-tooling-preview:1.3.0-beta01"

// compose activity
implementation 'androidx.activity:activity-compose:1.5.1'
Expand All @@ -92,13 +92,13 @@ dependencies {
implementation 'androidx.hilt:hilt-navigation-compose:1.0.0'

// compose material3
implementation 'androidx.compose.material3:material3:1.0.0-alpha16'
implementation 'androidx.compose.material3:material3:1.0.0-beta01'

// compose constraint layout
implementation 'androidx.constraintlayout:constraintlayout-compose:1.0.1'

// compose icons
implementation "androidx.compose.material:material-icons-extended:1.3.0-alpha03"
implementation "androidx.compose.material:material-icons-extended:1.3.0-beta01"

// lifecycle
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
Expand All @@ -108,7 +108,7 @@ dependencies {
kapt 'com.google.dagger:hilt-compiler:2.43.2'

// firebase
implementation platform('com.google.firebase:firebase-bom:30.3.2')
implementation platform('com.google.firebase:firebase-bom:30.4.1')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-messaging'
Expand All @@ -123,8 +123,8 @@ dependencies {
implementation 'com.google.android.exoplayer:extension-mediasession:2.18.1'

// compose destinations
implementation 'io.github.raamcosta.compose-destinations:core:1.7.16-beta'
ksp 'io.github.raamcosta.compose-destinations:ksp:1.7.16-beta'
implementation 'io.github.raamcosta.compose-destinations:core:1.7.19-beta'
ksp 'io.github.raamcosta.compose-destinations:ksp:1.7.19-beta'

// timber
implementation 'com.jakewharton.timber:timber:5.0.1'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package xyz.teamgravity.kichkinashahzoda.presentation.component.card

import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.ElevatedCard
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
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.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import xyz.teamgravity.kichkinashahzoda.presentation.theme.White

@Composable
fun CardConnection(
onClick: () -> Unit,
@DrawableRes icon: Int,
@StringRes title: Int,
@StringRes contentDescription: Int,
fillMaxSize: Boolean,
modifier: Modifier,
) {
ElevatedCard(
onClick = onClick,
shape = MaterialTheme.shapes.extraLarge,
modifier = modifier
) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = run {
val rowModifier = if (fillMaxSize) Modifier.fillMaxSize() else Modifier
rowModifier.padding(16.dp)
}
) {
Box(
contentAlignment = Alignment.Center,
modifier = Modifier
.size(64.dp)
.clip(CircleShape)
.background(MaterialTheme.colorScheme.primary)
) {
Icon(
painter = painterResource(id = icon),
contentDescription = stringResource(id = contentDescription),
tint = White,
modifier = Modifier.size(32.dp)
)
}
Text(
text = stringResource(id = title),
textAlign = TextAlign.Center,
fontSize = 24.sp,
fontWeight = FontWeight.Bold,
modifier = Modifier.weight(1F)
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.constraintlayout.compose.Dimension
import xyz.teamgravity.kichkinashahzoda.R
import xyz.teamgravity.kichkinashahzoda.core.util.Helper
import xyz.teamgravity.kichkinashahzoda.presentation.component.button.IconButtonPlain
import xyz.teamgravity.kichkinashahzoda.presentation.component.card.CardConnection
import xyz.teamgravity.kichkinashahzoda.presentation.theme.White

@Composable
Expand Down Expand Up @@ -84,65 +85,31 @@ fun SupportLandscapeScreen(
linkTo(top = connectT.bottom, bottom = telegramB.top)
},
)
ElevatedCard(
shape = MaterialTheme.shapes.extraLarge,
CardConnection(
onClick = { Helper.connectViaTelegram(context) },
icon = R.drawable.ic_telegram,
title = R.string.via_telegram,
contentDescription = R.string.cd_via_telegram,
fillMaxSize = false,
modifier = Modifier.constrainAs(telegramB) {
width = Dimension.fillToConstraints
height = Dimension.preferredWrapContent
linkTo(start = parent.start, end = oneG, startMargin = 16.dp, endMargin = 8.dp)
linkTo(top = bodyT.bottom, bottom = parent.bottom)
}
) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier
.wrapContentSize()
.padding(16.dp)
) {
Image(
painter = painterResource(id = R.drawable.ic_telegram_round),
contentDescription = stringResource(id = R.string.cd_via_telegram),
modifier = Modifier.weight(0.2F)
)
Text(
text = stringResource(id = R.string.via_telegram),
textAlign = TextAlign.Center,
fontSize = 24.sp,
fontWeight = FontWeight.Bold,
modifier = Modifier.weight(0.8F)
)
}
}
ElevatedCard(
shape = MaterialTheme.shapes.extraLarge,
)
CardConnection(
onClick = { Helper.connectViaEmail(context) },
icon = R.drawable.ic_mail,
title = R.string.via_email,
contentDescription = R.string.cd_via_email,
fillMaxSize = false,
modifier = Modifier.constrainAs(emailB) {
width = Dimension.fillToConstraints
height = Dimension.preferredWrapContent
linkTo(start = oneG, end = parent.end, startMargin = 8.dp, endMargin = 16.dp)
linkTo(top = bodyT.bottom, bottom = parent.bottom)
}
) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier
.wrapContentSize()
.padding(16.dp)
) {
Image(
painter = painterResource(id = R.drawable.ic_mail_round),
contentDescription = stringResource(id = R.string.cd_via_email),
modifier = Modifier.weight(0.2F)
)
Text(
text = stringResource(id = R.string.via_email),
textAlign = TextAlign.Center,
fontSize = 24.sp,
fontWeight = FontWeight.Bold,
modifier = Modifier.weight(0.8F)
)
}
}
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import androidx.constraintlayout.compose.Dimension
import xyz.teamgravity.kichkinashahzoda.R
import xyz.teamgravity.kichkinashahzoda.core.util.Helper
import xyz.teamgravity.kichkinashahzoda.presentation.component.button.IconButtonPlain
import xyz.teamgravity.kichkinashahzoda.presentation.component.card.CardConnection
import xyz.teamgravity.kichkinashahzoda.presentation.theme.White

@Composable
Expand Down Expand Up @@ -93,6 +94,7 @@ fun SupportPortraitScreen(
) {
Text(
text = stringResource(id = R.string.connect_us),
textAlign = TextAlign.Center,
fontSize = 24.sp,
fontWeight = FontWeight.Bold,
)
Expand All @@ -102,65 +104,31 @@ fun SupportPortraitScreen(
style = MaterialTheme.typography.bodyMedium,
)
}
ElevatedCard(
CardConnection(
onClick = { Helper.connectViaTelegram(context) },
shape = MaterialTheme.shapes.extraLarge,
icon = R.drawable.ic_telegram,
title = R.string.via_telegram,
contentDescription = R.string.cd_via_telegram,
fillMaxSize = true,
modifier = Modifier.constrainAs(telegramB) {
width = Dimension.matchParent
height = Dimension.fillToConstraints
linkTo(start = parent.start, end = parent.end, startMargin = 16.dp, endMargin = 16.dp)
linkTo(top = twoG, bottom = threeG, topMargin = 20.dp, bottomMargin = 10.dp)
}
) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier
.fillMaxSize()
.padding(16.dp)
) {
Image(
painter = painterResource(id = R.drawable.ic_telegram_round),
contentDescription = stringResource(id = R.string.cd_via_telegram),
modifier = Modifier.weight(0.2F)
)
Text(
text = stringResource(id = R.string.via_telegram),
textAlign = TextAlign.Center,
fontSize = 24.sp,
fontWeight = FontWeight.Bold,
modifier = Modifier.weight(0.8F)
)
}
}
ElevatedCard(
)
CardConnection(
onClick = { Helper.connectViaEmail(context) },
shape = MaterialTheme.shapes.extraLarge,
icon = R.drawable.ic_mail,
title = R.string.via_email,
contentDescription = R.string.cd_via_email,
fillMaxSize = true,
modifier = Modifier.constrainAs(mailB) {
width = Dimension.matchParent
height = Dimension.fillToConstraints
linkTo(start = parent.start, end = parent.end, startMargin = 16.dp, endMargin = 16.dp)
linkTo(top = threeG, bottom = parent.bottom, topMargin = 10.dp, bottomMargin = 20.dp)
}
) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier
.fillMaxSize()
.padding(16.dp)
) {
Image(
painter = painterResource(id = R.drawable.ic_mail_round),
contentDescription = stringResource(id = R.string.cd_via_email),
modifier = Modifier.weight(0.2F)
)
Text(
text = stringResource(id = R.string.via_email),
textAlign = TextAlign.Center,
fontSize = 24.sp,
fontWeight = FontWeight.Bold,
modifier = Modifier.weight(0.8F)
)
}
}
)
}
}
Binary file added app/src/main/res/drawable-hdpi/ic_mail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-hdpi/ic_telegram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-ldpi/ic_mail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-ldpi/ic_telegram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-mdpi/ic_mail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-mdpi/ic_telegram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/src/main/res/drawable-night/ic_mail_round.png
Binary file not shown.
Binary file not shown.
Binary file added app/src/main/res/drawable-xhdpi/ic_mail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xhdpi/ic_telegram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xxhdpi/ic_mail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xxhdpi/ic_telegram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xxxhdpi/ic_mail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xxxhdpi/ic_telegram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/src/main/res/drawable/ic_mail_round.png
Binary file not shown.
Binary file removed app/src/main/res/drawable/ic_telegram_round.png
Binary file not shown.

0 comments on commit fa86a27

Please sign in to comment.