Skip to content

Commit

Permalink
Fixed the padding issue
Browse files Browse the repository at this point in the history
  • Loading branch information
aritra-tech committed Mar 14, 2024
1 parent c6fb69b commit 611788a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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 -> {
Expand Down Expand Up @@ -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)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
}

0 comments on commit 611788a

Please sign in to comment.