Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Use SecondaryText instead of PreferenceGroupTitle
Browse files Browse the repository at this point in the history
This change fixes text padding.
  • Loading branch information
M3DZIK committed Oct 14, 2023
1 parent 22feac8 commit 7e70216
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import androidx.compose.ui.unit.dp
import androidx.navigation.NavController
import com.google.gson.Gson
import dev.medzik.android.components.LoadingButton
import dev.medzik.android.components.PreferenceGroupTitle
import dev.medzik.android.components.SecondaryText
import dev.medzik.android.components.navigate
import dev.medzik.librepass.android.R
import dev.medzik.librepass.android.data.CipherTable
Expand Down Expand Up @@ -179,7 +179,10 @@ fun CipherAddEditView(
onValueChange = { cipherData = cipherData.copy(name = it) }
)

PreferenceGroupTitle(stringResource(R.string.CipherField_Group_Login))
SecondaryText(
stringResource(R.string.CipherField_Group_Login),
modifier = Modifier.padding(top = 8.dp)
)

TextInputFieldBase(
label = stringResource(R.string.CipherField_Username),
Expand Down Expand Up @@ -216,7 +219,10 @@ fun CipherAddEditView(
}
)

PreferenceGroupTitle(stringResource(R.string.CipherField_Group_Website))
SecondaryText(
stringResource(R.string.CipherField_Group_Website),
modifier = Modifier.padding(top = 8.dp)
)

// show field for each uri
cipherData.uris?.forEachIndexed { index, uri ->
Expand Down Expand Up @@ -263,7 +269,10 @@ fun CipherAddEditView(
Text(stringResource(R.string.Button_AddField))
}

PreferenceGroupTitle(stringResource(R.string.CipherField_Group_Other))
SecondaryText(
stringResource(R.string.CipherField_Group_Other),
modifier = Modifier.padding(top = 8.dp)
)

TextInputFieldBase(
label = stringResource(R.string.CipherField_Notes),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.unit.dp
import androidx.navigation.NavController
import dev.medzik.android.components.BaseDialog
import dev.medzik.android.components.PreferenceGroupTitle
import dev.medzik.android.components.SecondaryText
import dev.medzik.android.components.getString
import dev.medzik.android.components.navigate
import dev.medzik.android.components.rememberDialogState
Expand Down Expand Up @@ -105,7 +105,10 @@ fun CipherViewScreen(navController: NavController) {

if (!cipherData.username.isNullOrEmpty() || !cipherData.password.isNullOrEmpty()) {
item {
PreferenceGroupTitle(stringResource(R.string.CipherField_Group_Login))
SecondaryText(
stringResource(R.string.CipherField_Group_Login),
modifier = Modifier.padding(top = 8.dp)
)

CipherField(
title = stringResource(R.string.CipherField_Username),
Expand Down Expand Up @@ -180,7 +183,10 @@ fun CipherViewScreen(navController: NavController) {

item {
if (!cipherData.uris.isNullOrEmpty()) {
PreferenceGroupTitle(stringResource(R.string.CipherField_Group_Website))
SecondaryText(
stringResource(R.string.CipherField_Group_Website),
modifier = Modifier.padding(top = 8.dp)
)

cipherData.uris?.forEachIndexed { index, it ->
CipherField(
Expand All @@ -194,7 +200,10 @@ fun CipherViewScreen(navController: NavController) {

if (!cipherData.notes.isNullOrEmpty()) {
item {
PreferenceGroupTitle(stringResource(R.string.CipherField_Group_Other))
SecondaryText(
stringResource(R.string.CipherField_Group_Other),
modifier = Modifier.padding(top = 8.dp)
)

CipherField(
title = stringResource(R.string.CipherField_Notes),
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.google.ksp) apply false
alias(libs.plugins.jetbrains.kotlin.android) apply false
alias(libs.plugins.kotlin.android) apply false
}

allprojects {
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ process-phoenix = "2.1.2"
# Plugins
android-application = "8.1.2"
google-ksp = "1.9.10-1.0.13"
jetbrains-kotlin-android = "1.9.10"
kotlin-android = "1.9.10"

[libraries]
androidx-annotation = { group = "androidx.annotation", name = "annotation", version.ref = "androidx-annotation" }
Expand Down Expand Up @@ -62,4 +62,4 @@ process-phoenix = { module = "com.jakewharton:process-phoenix", version.ref = "j
android-application = { id = "com.android.application", version.ref = "android-application" }
android-library = { id = "com.android.library", version.ref = "android-application" }
google-ksp = { id = "com.google.devtools.ksp", version.ref = "google-ksp" }
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "jetbrains-kotlin-android" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin-android" }

0 comments on commit 7e70216

Please sign in to comment.