Compare commits

..

No commits in common. "fb565c1a9d45cce46b47a1e5e3e758a23b998198" and "97f1905179f5f933bc548620e025e75a4d5983ab" have entirely different histories.

14 changed files with 55 additions and 75 deletions

3
app/.gitignore vendored
View file

@ -1,2 +1 @@
/build /build
/release

View file

@ -16,8 +16,8 @@ android {
applicationId = "eu.m724.coincounter" applicationId = "eu.m724.coincounter"
minSdk = 30 minSdk = 30
targetSdk = 35 targetSdk = 35
versionCode = 5 versionCode = 4
versionName = "2.0.2" versionName = "2.0.1"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables { vectorDrawables {
@ -56,10 +56,6 @@ android {
excludes += "/META-INF/{AL2.0,LGPL2.1}" excludes += "/META-INF/{AL2.0,LGPL2.1}"
} }
} }
androidResources {
generateLocaleConfig = true
}
} }
dependencies { dependencies {

BIN
app/release/app-release.apk Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,37 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "eu.m724.coincounter",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 3,
"versionName": "1.1.1",
"outputFile": "app-release.apk"
}
],
"elementType": "File",
"baselineProfiles": [
{
"minApi": 28,
"maxApi": 30,
"baselineProfiles": [
"baselineProfiles/1/app-release.dm"
]
},
{
"minApi": 31,
"maxApi": 2147483647,
"baselineProfiles": [
"baselineProfiles/0/app-release.dm"
]
}
],
"minSdkVersionForDexing": 34
}

View file

@ -46,7 +46,6 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.rotate import androidx.compose.ui.draw.rotate
import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
@ -263,7 +262,7 @@ fun AddWalletButton(
) { ) {
Icon( Icon(
imageVector = Icons.Filled.Add, imageVector = Icons.Filled.Add,
contentDescription = stringResource(R.string.home_add_wallet), contentDescription = "Add wallet",
modifier = Modifier.rotate(angle) modifier = Modifier.rotate(angle)
) )
} }

View file

@ -18,9 +18,7 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import dagger.hilt.android.AndroidEntryPoint import dagger.hilt.android.AndroidEntryPoint
import eu.m724.coincounter.R
import eu.m724.coincounter.ui.theme.CoinCounterTheme import eu.m724.coincounter.ui.theme.CoinCounterTheme
import eu.m724.coincounter.wallet.compose.TransactionDialog import eu.m724.coincounter.wallet.compose.TransactionDialog
import eu.m724.coincounter.wallet.compose.WalletActivityView import eu.m724.coincounter.wallet.compose.WalletActivityView
@ -54,10 +52,7 @@ class WalletActivity : ComponentActivity() {
FloatingActionButton(onClick = { FloatingActionButton(onClick = {
transactionDialogShown = true transactionDialogShown = true
}) { }) {
Icon( Icon(Icons.Filled.Create, "New transaction")
imageVector = Icons.Filled.Create,
contentDescription = stringResource(R.string.wallet_new_transaction)
)
} }
} }
) { innerPadding -> ) { innerPadding ->

View file

@ -34,7 +34,6 @@ import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
@ -88,7 +87,7 @@ fun TransactionDialog(
.weight(1f) .weight(1f)
.focusRequester(firstFocus) .focusRequester(firstFocus)
.focusProperties { next = secondFocus }, .focusProperties { next = secondFocus },
supportingText = { Text(stringResource(R.string.create_transaction_label)) }, supportingText = { Text("Label") },
keyboardOptions = KeyboardOptions.Default.copy( keyboardOptions = KeyboardOptions.Default.copy(
imeAction = ImeAction.Next imeAction = ImeAction.Next
), ),
@ -107,7 +106,7 @@ fun TransactionDialog(
.focusRequester(secondFocus), .focusRequester(secondFocus),
supportingText = { supportingText = {
Text( Text(
text = stringResource(R.string.create_transaction_value), text = "Value",
color = if (!valueValid) MaterialTheme.colorScheme.error else Color.Unspecified color = if (!valueValid) MaterialTheme.colorScheme.error else Color.Unspecified
) )
}, },
@ -118,11 +117,7 @@ fun TransactionDialog(
isError = !valueValid, isError = !valueValid,
trailingIcon = { trailingIcon = {
if (!valueValid) if (!valueValid)
Icon( Icon(painterResource(id = R.drawable.baseline_error_24), "error", tint = MaterialTheme.colorScheme.error)
painter = painterResource(id = R.drawable.baseline_error_24),
contentDescription = stringResource(R.string.create_transaction_value_error),
tint = MaterialTheme.colorScheme.error
)
}, },
singleLine = true singleLine = true
) )
@ -134,7 +129,7 @@ fun TransactionDialog(
checked = absoluteChecked, checked = absoluteChecked,
onCheckedChange = { absoluteChecked = it } onCheckedChange = { absoluteChecked = it }
) )
Text(text = stringResource(R.string.create_transaction_absolute)) Text(text = "Absolute")
} }
} }
Row( Row(
@ -147,7 +142,7 @@ fun TransactionDialog(
onDismiss() onDismiss()
} }
) { ) {
Text(text = stringResource(R.string.create_transaction_cancel)) Text(text = "Cancel")
} }
TextButton( TextButton(
onClick = { onClick = {
@ -155,12 +150,11 @@ fun TransactionDialog(
if (doubleValue != null) { if (doubleValue != null) {
onConfirm(label, (doubleValue * 100).toInt(), absoluteChecked) // TODO handle fixed point onConfirm(label, (doubleValue * 100).toInt(), absoluteChecked) // TODO handle fixed point
} else { } else {
Toast.makeText(context, Toast.makeText(context, "Value is not a number", Toast.LENGTH_SHORT).show()
context.getString(R.string.create_transaction_nan), Toast.LENGTH_SHORT).show()
} }
} }
) { ) {
Text(stringResource(R.string.create_transaction_confirm)) Text("Create transaction")
} }
} }
} }

View file

@ -8,10 +8,8 @@ import androidx.compose.material3.Text
import androidx.compose.material3.TextButton import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog import androidx.compose.ui.window.Dialog
import eu.m724.coincounter.R
/** /**
* A dialog that's shown when you long click on wallet name * A dialog that's shown when you long click on wallet name
@ -39,13 +37,13 @@ fun ActionsDialog(
modifier = Modifier.padding(16.dp) modifier = Modifier.padding(16.dp)
) { ) {
TextButton(onClick = onRename) { TextButton(onClick = onRename) {
Text(stringResource(R.string.wallet_actions_rename)) Text("Rename wallet")
} }
TextButton(onClick = onDelete) { TextButton(onClick = onDelete) {
Text(stringResource(R.string.wallet_actions_delete)) Text("Delete wallet")
} }
TextButton(onClick = onDismiss) { TextButton(onClick = onDismiss) {
Text(stringResource(R.string.wallet_actions_cancel)) Text("Cancel")
} }
} }
} }

View file

@ -19,10 +19,8 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog import androidx.compose.ui.window.Dialog
import eu.m724.coincounter.R
@Composable @Composable
fun RenameDialog( fun RenameDialog(
@ -54,7 +52,7 @@ fun RenameDialog(
.fillMaxWidth() .fillMaxWidth()
.weight(1f) .weight(1f)
.focusRequester(focusRequester), .focusRequester(focusRequester),
supportingText = { Text(stringResource(R.string.wallet_rename_name)) }, supportingText = { Text("New name") },
singleLine = true singleLine = true
) )
} }
@ -68,14 +66,14 @@ fun RenameDialog(
onDismiss() onDismiss()
} }
) { ) {
Text(text = stringResource(R.string.wallet_rename_cancel)) Text(text = "Cancel")
} }
TextButton( TextButton(
onClick = { onClick = {
onRename(value) onRename(value)
} }
) { ) {
Text(stringResource(R.string.wallet_rename_confirm)) Text("Rename")
} }
} }
} }

View file

@ -1 +0,0 @@
unqualifiedResLocale=en

View file

@ -1,20 +0,0 @@
<resources>
<string name="app_name">Coin Counter</string>
<string name="title_activity_main">Coin Counter</string>
<string name="title_activity_wallet">WalletActivity</string>
<string name="create_transaction_confirm">Utwórz transakcję</string>
<string name="create_transaction_nan">Wartość musi być liczbą</string>
<string name="create_transaction_cancel">Anuluj</string>
<string name="create_transaction_absolute">Bezwzględna</string>
<string name="create_transaction_value_error">Błąd</string>
<string name="create_transaction_value">Wartość</string>
<string name="create_transaction_label">Etykieta</string>
<string name="wallet_actions_rename">Zmień nazwę portfela</string>
<string name="wallet_actions_delete">Usuń portfel</string>
<string name="wallet_actions_cancel">Anuluj</string>
<string name="wallet_rename_name">Nowa nazwa</string>
<string name="wallet_rename_cancel">Anuluj</string>
<string name="wallet_rename_confirm">Zmień nazwę</string>
<string name="wallet_new_transaction">Nowa transakcja</string>
<string name="home_add_wallet">Utwórz portfel</string>
</resources>

View file

@ -2,19 +2,4 @@
<string name="app_name">Coin Counter</string> <string name="app_name">Coin Counter</string>
<string name="title_activity_main">Coin Counter</string> <string name="title_activity_main">Coin Counter</string>
<string name="title_activity_wallet">WalletActivity</string> <string name="title_activity_wallet">WalletActivity</string>
<string name="create_transaction_confirm">Create transaction</string>
<string name="create_transaction_nan">Value must be a number</string>
<string name="create_transaction_cancel">Cancel</string>
<string name="create_transaction_absolute">Absolute</string>
<string name="create_transaction_value_error">Error</string>
<string name="create_transaction_value">Value</string>
<string name="create_transaction_label">Label</string>
<string name="wallet_actions_rename">Rename wallet</string>
<string name="wallet_actions_delete">Delete wallet</string>
<string name="wallet_actions_cancel">Cancel</string>
<string name="wallet_rename_name">New name</string>
<string name="wallet_rename_cancel">Cancel</string>
<string name="wallet_rename_confirm">Rename</string>
<string name="wallet_new_transaction">New transaction</string>
<string name="home_add_wallet">Create wallet</string>
</resources> </resources>