From 611788ab5beec5afe20185ca54b791c6ff1f0a1a Mon Sep 17 00:00:00 2001 From: aritra Date: Thu, 14 Mar 2024 12:04:00 +0530 Subject: [PATCH] Fixed the padding issue --- .../presentation/account/AccountScreen.kt | 29 ++++++------------- .../geekymusketeers/uncrack/util/Constants.kt | 3 ++ 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/app/src/main/java/com/geekymusketeers/uncrack/presentation/account/AccountScreen.kt b/app/src/main/java/com/geekymusketeers/uncrack/presentation/account/AccountScreen.kt index b0e62564..afed5d52 100644 --- a/app/src/main/java/com/geekymusketeers/uncrack/presentation/account/AccountScreen.kt +++ b/app/src/main/java/com/geekymusketeers/uncrack/presentation/account/AccountScreen.kt @@ -1,10 +1,7 @@ package com.geekymusketeers.uncrack.presentation.account import android.content.Intent -import android.graphics.Bitmap -import android.graphics.BitmapFactory import android.net.Uri -import android.provider.MediaStore import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row @@ -48,8 +45,8 @@ import com.geekymusketeers.uncrack.ui.theme.medium14 import com.geekymusketeers.uncrack.ui.theme.medium32 import com.geekymusketeers.uncrack.ui.theme.normal14 import com.geekymusketeers.uncrack.ui.theme.normal16 +import com.geekymusketeers.uncrack.util.Constants.INVITE import com.geekymusketeers.uncrack.util.Util -import java.io.ByteArrayOutputStream @Composable fun AccountScreen( @@ -233,22 +230,12 @@ fun AccountScreen( } AccountItems.INVITE_FRIENDS -> { - val send = Util.SEND_APP - val b = BitmapFactory.decodeResource(context.resources, R.drawable.banner_uncrack) - val share = Intent(Intent.ACTION_SEND) - share.type = "image/jpeg" - val bytes = ByteArrayOutputStream() - b.compress(Bitmap.CompressFormat.JPEG, 100, bytes) - share.putExtra(Intent.EXTRA_TEXT, send) - val path = MediaStore.Images.Media.insertImage( - context.contentResolver, - b, - "Invite", - null - ) - val imageUri = Uri.parse(path) - share.putExtra(Intent.EXTRA_STREAM, imageUri) - context.startActivity(Intent.createChooser(share, "Select")) + val sendIntent = Intent(Intent.ACTION_SEND).apply { + putExtra(Intent.EXTRA_TEXT, INVITE) + type = "text/plain" + } + val shareIntent = Intent.createChooser(sendIntent, null) + context.startActivity(shareIntent) } AccountItems.RATE_UNCRACK -> { @@ -293,10 +280,12 @@ fun AccountScreen( item { Text( + modifier = Modifier.padding(top = 20.dp, bottom = 10.dp), text = "Version: ${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})", style = normal14.copy(color = SurfaceTintLight) ) Text( + modifier = Modifier.padding(bottom = 150.dp), text = stringResource(R.string.by_aritra_das), style = normal14.copy(color = SurfaceTintLight) ) diff --git a/app/src/main/java/com/geekymusketeers/uncrack/util/Constants.kt b/app/src/main/java/com/geekymusketeers/uncrack/util/Constants.kt index 7e67821b..7948b6e6 100644 --- a/app/src/main/java/com/geekymusketeers/uncrack/util/Constants.kt +++ b/app/src/main/java/com/geekymusketeers/uncrack/util/Constants.kt @@ -5,4 +5,7 @@ object Constants { val sliderStepRange = 0f..32f const val sliderSteps = 32 const val DEFAULT_PASSWORD_LENGTH = 12.0f + const val INVITE = """ + Hey there! I've been using this amazing app and thought you might like it too! 😊 Check it out: https://play.google.com/store/apps/details?id=com.geekymusketeers.uncrack + """ } \ No newline at end of file