Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ indent_size = 4

[*.md]
max_line_length = off
indent_size = 2
trim_trailing_whitespace = false

[*.js]
indent_size = 2

[*.json]
max_line_length = off
indent_size = 2
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# Bitkit Android

Bitkit Android Native app.

## Prerequisites

1. Download `google-services.json` to `./app` from FCM Console
2. Run Polar with the default initial network

## Dev Tips

- To communicate from host to emulator use:
`127.0.0.1` and setup port forwarding via ADB, eg. `adb forward tcp:9777 tcp:9777`
- To communicate from emulator to host use:
`10.0.2.2` instead of `localhost`

## Localization
See repo: https://github.com/synonymdev/bitkit-transifex-sync
15 changes: 15 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ android {
targetSdk = 35
versionCode = 1
versionName = "1.0"
resourceConfigurations += listOf(
"en", // Default (English)
"ar", // Arabic
"ca", // Catalan
"cs", // Czech
"de", // German
"el", // Greek
"es", // Spanish (Spain)
"fr", // French
"it", // Italian
"nl", // Dutch
"pl", // Polish
"pt", // Portuguese (Portugal)
"ru", // Russian
)
testInstrumentationRunner = "to.bitkit.test.HiltTestRunner"
vectorDrawables {
useSupportLibrary = true
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/to/bitkit/ui/components/LabelText.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fun LabelText(
modifier: Modifier = Modifier,
) {
Text(
text = text,
text = text.uppercase(),
style = LocalTextStyle.current.copy(
fontSize = 13.sp,
color = Colors.White64,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package to.bitkit.ui.theme
package to.bitkit.ui.components

import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.toUpperCase
import androidx.compose.ui.unit.TextUnit
import androidx.compose.ui.unit.sp

Expand All @@ -22,7 +24,7 @@ fun Display(
color: Color = MaterialTheme.colorScheme.primary,
) {
Text(
text = text,
text = text.uppercase(),
style = TextStyle(
fontSize = fontSize,
fontWeight = fontWeight,
Expand All @@ -35,6 +37,29 @@ fun Display(
)
}

@Composable
fun Display(
text: AnnotatedString,
modifier: Modifier = Modifier,
fontSize: TextUnit = 44.sp,
fontWeight: FontWeight = FontWeight.Black,
lineHeight: Float = 44f,
color: Color = MaterialTheme.colorScheme.primary,
) {
Text(
text = text.toUpperCase(),
style = TextStyle(
fontSize = fontSize,
fontWeight = fontWeight,
lineHeight = lineHeight.sp,
letterSpacing = (-1).sp,
fontFamily = FontFamily.Default,
color = color
),
modifier = modifier
)
}

@Composable
fun Headline(
text: String,
Expand Down Expand Up @@ -93,6 +118,20 @@ fun Subtitle(
@Composable
fun BodyM(
text: String,
modifier: Modifier = Modifier,
color: Color = MaterialTheme.colorScheme.primary,
) {
BodyM(
text = AnnotatedString(text),
color = color,
modifier = modifier,
)
}

@Composable
fun BodyM(
text: AnnotatedString,
modifier: Modifier = Modifier,
color: Color = MaterialTheme.colorScheme.primary,
) {
Text(
Expand All @@ -105,7 +144,8 @@ fun BodyM(
fontFamily = FontFamily.Default,
color = color
),
textAlign = TextAlign.Start
textAlign = TextAlign.Start,
modifier = modifier,
)
}

Expand Down Expand Up @@ -150,8 +190,8 @@ fun BodyMB(
@Composable
fun BodyS(
text: String,
color: Color = MaterialTheme.colorScheme.primary,
modifier: Modifier = Modifier,
color: Color = MaterialTheme.colorScheme.primary,
) {
Text(
text = text,
Expand All @@ -168,6 +208,40 @@ fun BodyS(
)
}

@Composable
fun BodySSB(
text: String,
modifier: Modifier = Modifier,
color: Color = MaterialTheme.colorScheme.primary,
) {
BodySSB(
text = AnnotatedString(text),
color = color,
modifier = modifier,
)
}

@Composable
fun BodySSB(
text: AnnotatedString,
color: Color = MaterialTheme.colorScheme.primary,
modifier: Modifier = Modifier,
) {
Text(
text = text,
style = TextStyle(
fontSize = 15.sp,
fontWeight = FontWeight.SemiBold,
lineHeight = 20.sp,
letterSpacing = 0.4.sp,
fontFamily = FontFamily.Default,
color = color,
),
textAlign = TextAlign.Start,
modifier = modifier,
)
}

@Composable
fun Text13UP(
text: String,
Expand Down Expand Up @@ -207,6 +281,7 @@ fun Caption(
@Composable
fun Footnote(
text: String,
modifier: Modifier = Modifier,
color: Color = MaterialTheme.colorScheme.onSurface,
) {
Text(
Expand All @@ -218,6 +293,7 @@ fun Footnote(
fontFamily = FontFamily.Default,
color = color
),
textAlign = TextAlign.Start
textAlign = TextAlign.Start,
modifier = modifier,
)
}
48 changes: 24 additions & 24 deletions app/src/main/java/to/bitkit/ui/onboarding/CreateWalletScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ package to.bitkit.ui.onboarding

import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Arrangement
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.fillMaxHeight
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.shape.RoundedCornerShape
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
Expand All @@ -13,15 +22,19 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import to.bitkit.R
import to.bitkit.ui.components.BodyM
import to.bitkit.ui.components.Display
import to.bitkit.ui.theme.AppThemeSurface
import to.bitkit.ui.theme.Colors
import to.bitkit.ui.theme.Display
import to.bitkit.ui.utils.withAccent

@Composable
fun CreateWalletScreen(
Expand All @@ -47,26 +60,13 @@ fun CreateWalletScreen(
.fillMaxHeight(.325f)
.align(Alignment.BottomCenter),
) {
Display(text = "YOUR KEYS,")
Display(
text = "YOUR COINS",
color = Colors.Brand,
modifier = Modifier.offset(y = (-8).dp)
)
Text(
text = "Let's create your wallet. Please be aware that Bitkit is mobile software.",
fontSize = 17.sp,
lineHeight = 22.sp,
color = Colors.White64,
modifier = Modifier.fillMaxWidth()
)
Text(
text = "Don't store all your money in Bitkit.",
fontSize = 17.sp,
lineHeight = 22.sp,
color = Colors.White,
fontWeight = FontWeight.Bold,
modifier = Modifier.fillMaxWidth()
Display(text = stringResource(R.string.onboarding__slide4_header).withAccent())
Spacer(modifier = Modifier.height(8.dp))
BodyM(
text = stringResource(R.string.onboarding__slide4_text).withAccent(
defaultColor = Colors.White64,
accentStyle = SpanStyle(fontWeight = FontWeight.Bold, color = Colors.White),
),
)

Spacer(modifier = Modifier.height(32.dp))
Expand All @@ -83,7 +83,7 @@ fun CreateWalletScreen(
.height(56.dp),
) {
Text(
text = "New Wallet",
text = stringResource(R.string.onboarding__new_wallet),
style = TextStyle(fontSize = 15.sp, fontWeight = FontWeight.SemiBold),
color = Colors.White
)
Expand All @@ -97,7 +97,7 @@ fun CreateWalletScreen(
.height(56.dp),
) {
Text(
text = "Restore",
text = stringResource(R.string.onboarding__restore),
style = TextStyle(fontSize = 15.sp, fontWeight = FontWeight.SemiBold),
color = Colors.White80
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import to.bitkit.R
import to.bitkit.ui.components.BodyM
import to.bitkit.ui.components.Display
import to.bitkit.ui.theme.AppTextFieldDefaults
import to.bitkit.ui.theme.AppThemeSurface
import to.bitkit.ui.theme.Colors
import to.bitkit.ui.theme.Display
import to.bitkit.ui.utils.withAccent

@OptIn(ExperimentalMaterial3Api::class)
@Composable
Expand Down Expand Up @@ -87,24 +89,17 @@ fun CreateWalletWithPassphraseScreen(
modifier = Modifier.fillMaxWidth()
)
Spacer(modifier = Modifier.height(32.dp))
Display(text = "SECURE WITH")
Display(
text = "PASSPHRASE",
color = Colors.Brand,
modifier = Modifier.offset(y = (-8).dp)
)
Text(
text = "You can add a secret passphrase to the 12-word recovery phrase. If you do, make sure you don’t forget.",
fontSize = 17.sp,
lineHeight = 22.sp,
Display(text = stringResource(R.string.onboarding__passphrase_header).withAccent())
Spacer(modifier = Modifier.height(8.dp))
BodyM(
text = stringResource(R.string.onboarding__passphrase_text),
color = Colors.White64,
modifier = Modifier.fillMaxWidth()
)
Spacer(modifier = Modifier.height(32.dp))
OutlinedTextField(
value = bip39Passphrase,
onValueChange = { bip39Passphrase = it },
placeholder = { Text("Passphrase") },
placeholder = { Text(text = stringResource(R.string.onboarding__passphrase)) },
shape = RoundedCornerShape(8.dp),
colors = AppTextFieldDefaults.semiTransparent,
singleLine = true,
Expand Down Expand Up @@ -133,7 +128,7 @@ fun CreateWalletWithPassphraseScreen(
.height(56.dp),
) {
Text(
text = "Create New Wallet",
text = stringResource(R.string.onboarding__create_new_wallet),
style = TextStyle(fontSize = 15.sp, fontWeight = FontWeight.SemiBold),
)
}
Expand Down
Loading