New Credits item.
This commit is contained in:
parent
b4e058dd4d
commit
eabd08affb
6 changed files with 36 additions and 21 deletions
|
|
@ -6,7 +6,7 @@ import ua.acclorite.book_story.domain.util.UIText
|
||||||
@Immutable
|
@Immutable
|
||||||
data class Credit(
|
data class Credit(
|
||||||
val name: String,
|
val name: String,
|
||||||
val source: String,
|
val source: String?,
|
||||||
val credits: List<UIText>,
|
val credits: List<UIText>,
|
||||||
val website: String
|
val website: String?
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,15 @@ object Constants {
|
||||||
),
|
),
|
||||||
website = "https://github.com/Drumber/Kitsune"
|
website = "https://github.com/Drumber/Kitsune"
|
||||||
),
|
),
|
||||||
|
Credit(
|
||||||
|
name = "Crocus",
|
||||||
|
source = null,
|
||||||
|
credits = listOf(
|
||||||
|
UIText.StringResource(R.string.credits_motivation),
|
||||||
|
UIText.StringValue("UwU")
|
||||||
|
),
|
||||||
|
website = null
|
||||||
|
),
|
||||||
Credit(
|
Credit(
|
||||||
name = "Freepik",
|
name = "Freepik",
|
||||||
source = "Flaticon",
|
source = "Flaticon",
|
||||||
|
|
|
||||||
|
|
@ -80,9 +80,10 @@ private fun CreditsScreen(
|
||||||
) {
|
) {
|
||||||
customItems(Constants.CREDITS, key = { it.name }) {
|
customItems(Constants.CREDITS, key = { it.name }) {
|
||||||
CreditItem(credit = it) {
|
CreditItem(credit = it) {
|
||||||
|
it.website?.let { website ->
|
||||||
onAboutNavigateEvent(
|
onAboutNavigateEvent(
|
||||||
AboutEvent.OnNavigateToBrowserPage(
|
AboutEvent.OnNavigateToBrowserPage(
|
||||||
page = it.website,
|
page = website,
|
||||||
context = context,
|
context = context,
|
||||||
noAppsFound = {
|
noAppsFound = {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
|
|
@ -97,6 +98,7 @@ private fun CreditsScreen(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ fun CreditItem(
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clickable { onClick.invoke() }
|
.clickable(enabled = credit.website != null) { onClick.invoke() }
|
||||||
.padding(vertical = verticalPadding, horizontal = horizontalPadding)
|
.padding(vertical = verticalPadding, horizontal = horizontalPadding)
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
|
|
@ -51,11 +51,13 @@ fun CreditItem(
|
||||||
overflow = TextOverflow.Ellipsis
|
overflow = TextOverflow.Ellipsis
|
||||||
)
|
)
|
||||||
|
|
||||||
|
credit.source?.let {
|
||||||
Text(
|
Text(
|
||||||
text = credit.source,
|
text = it,
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
if (credit.credits.isNotEmpty()) {
|
if (credit.credits.isNotEmpty()) {
|
||||||
Spacer(modifier = Modifier.height(6.dp))
|
Spacer(modifier = Modifier.height(6.dp))
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@
|
||||||
Немає опису.
|
Немає опису.
|
||||||
</string>
|
</string>
|
||||||
<string name="error_something_went_wrong">
|
<string name="error_something_went_wrong">
|
||||||
Щось пішло не так.
|
Який жах! Щось пішло не так.
|
||||||
</string>
|
</string>
|
||||||
<string name="error_something_went_wrong_with_file">
|
<string name="error_something_went_wrong_with_file">
|
||||||
Щось пішло не так. Будь ласка, перевірте чи файл цієї книги не пошкоджений.
|
Щось пішло не так. Будь ласка, перевірте чи файл цієї книги не пошкоджений.
|
||||||
|
|
@ -351,6 +351,7 @@
|
||||||
<string name="credits_design">Дизайн</string>
|
<string name="credits_design">Дизайн</string>
|
||||||
<string name="credits_icon">Іконки</string>
|
<string name="credits_icon">Іконки</string>
|
||||||
<string name="credits_updates">Керування новими оновленнями</string>
|
<string name="credits_updates">Керування новими оновленнями</string>
|
||||||
|
<string name="credits_motivation">Мотивація</string>
|
||||||
|
|
||||||
<!-- Help -->
|
<!-- Help -->
|
||||||
<string name="help_clickable_note_1">Будь ласка, зверніть увагу, що на</string>
|
<string name="help_clickable_note_1">Будь ласка, зверніть увагу, що на</string>
|
||||||
|
|
|
||||||
|
|
@ -371,6 +371,7 @@
|
||||||
<string name="credits_design">Design</string>
|
<string name="credits_design">Design</string>
|
||||||
<string name="credits_icon">Icons</string>
|
<string name="credits_icon">Icons</string>
|
||||||
<string name="credits_updates">New updates managing</string>
|
<string name="credits_updates">New updates managing</string>
|
||||||
|
<string name="credits_motivation">Motivation</string>
|
||||||
|
|
||||||
<!-- Help -->
|
<!-- Help -->
|
||||||
<string name="help_clickable_note_1">Please note, that</string>
|
<string name="help_clickable_note_1">Please note, that</string>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue