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
|
||||
data class Credit(
|
||||
val name: String,
|
||||
val source: String,
|
||||
val source: String?,
|
||||
val credits: List<UIText>,
|
||||
val website: String
|
||||
val website: String?
|
||||
)
|
||||
|
|
|
|||
|
|
@ -91,6 +91,15 @@ object Constants {
|
|||
),
|
||||
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(
|
||||
name = "Freepik",
|
||||
source = "Flaticon",
|
||||
|
|
|
|||
|
|
@ -80,19 +80,21 @@ private fun CreditsScreen(
|
|||
) {
|
||||
customItems(Constants.CREDITS, key = { it.name }) {
|
||||
CreditItem(credit = it) {
|
||||
onAboutNavigateEvent(
|
||||
AboutEvent.OnNavigateToBrowserPage(
|
||||
page = it.website,
|
||||
context = context,
|
||||
noAppsFound = {
|
||||
Toast.makeText(
|
||||
context,
|
||||
context.getString(R.string.error_no_browser),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
it.website?.let { website ->
|
||||
onAboutNavigateEvent(
|
||||
AboutEvent.OnNavigateToBrowserPage(
|
||||
page = website,
|
||||
context = context,
|
||||
noAppsFound = {
|
||||
Toast.makeText(
|
||||
context,
|
||||
context.getString(R.string.error_no_browser),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ fun CreditItem(
|
|||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.clickable { onClick.invoke() }
|
||||
.clickable(enabled = credit.website != null) { onClick.invoke() }
|
||||
.padding(vertical = verticalPadding, horizontal = horizontalPadding)
|
||||
) {
|
||||
Text(
|
||||
|
|
@ -51,11 +51,13 @@ fun CreditItem(
|
|||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
|
||||
Text(
|
||||
text = credit.source,
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
credit.source?.let {
|
||||
Text(
|
||||
text = it,
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
}
|
||||
|
||||
if (credit.credits.isNotEmpty()) {
|
||||
Spacer(modifier = Modifier.height(6.dp))
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@
|
|||
Немає опису.
|
||||
</string>
|
||||
<string name="error_something_went_wrong">
|
||||
Щось пішло не так.
|
||||
Який жах! Щось пішло не так.
|
||||
</string>
|
||||
<string name="error_something_went_wrong_with_file">
|
||||
Щось пішло не так. Будь ласка, перевірте чи файл цієї книги не пошкоджений.
|
||||
|
|
@ -351,6 +351,7 @@
|
|||
<string name="credits_design">Дизайн</string>
|
||||
<string name="credits_icon">Іконки</string>
|
||||
<string name="credits_updates">Керування новими оновленнями</string>
|
||||
<string name="credits_motivation">Мотивація</string>
|
||||
|
||||
<!-- Help -->
|
||||
<string name="help_clickable_note_1">Будь ласка, зверніть увагу, що на</string>
|
||||
|
|
|
|||
|
|
@ -371,6 +371,7 @@
|
|||
<string name="credits_design">Design</string>
|
||||
<string name="credits_icon">Icons</string>
|
||||
<string name="credits_updates">New updates managing</string>
|
||||
<string name="credits_motivation">Motivation</string>
|
||||
|
||||
<!-- Help -->
|
||||
<string name="help_clickable_note_1">Please note, that</string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue