Simplify history item description building
(cherry picked from commit 7c8e8317a8c24261b62645c477028fdd3717e4e8)
This commit is contained in:
parent
5512c6eb79
commit
a88bcb0fa2
@ -39,7 +39,6 @@ import androidx.compose.ui.res.stringResource
|
|||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.core.text.buildSpannedString
|
|
||||||
import androidx.paging.compose.LazyPagingItems
|
import androidx.paging.compose.LazyPagingItems
|
||||||
import androidx.paging.compose.collectAsLazyPagingItems
|
import androidx.paging.compose.collectAsLazyPagingItems
|
||||||
import androidx.paging.compose.items
|
import androidx.paging.compose.items
|
||||||
@ -223,18 +222,16 @@ fun HistoryItem(
|
|||||||
)
|
)
|
||||||
Row {
|
Row {
|
||||||
Text(
|
Text(
|
||||||
text = buildSpannedString {
|
text = if (history.chapterNumber > -1) {
|
||||||
if (history.chapterNumber > -1) {
|
stringResource(
|
||||||
append(
|
R.string.recent_manga_time,
|
||||||
stringResource(
|
chapterFormatter.format(history.chapterNumber),
|
||||||
R.string.history_prefix,
|
history.readAt?.toTimestampString() ?: "",
|
||||||
chapterFormatter.format(history.chapterNumber)
|
)
|
||||||
)
|
} else {
|
||||||
)
|
history.readAt?.toTimestampString() ?: ""
|
||||||
}
|
},
|
||||||
append(history.readAt?.toTimestampString())
|
modifier = Modifier.padding(top = 4.dp),
|
||||||
}.toString(),
|
|
||||||
modifier = Modifier.padding(top = 2.dp),
|
|
||||||
style = textStyle
|
style = textStyle
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,6 @@ class ClearDatabaseController :
|
|||||||
private var menu: Menu? = null
|
private var menu: Menu? = null
|
||||||
|
|
||||||
private var actionFab: ExtendedFloatingActionButton? = null
|
private var actionFab: ExtendedFloatingActionButton? = null
|
||||||
private var actionFabScrollListener: RecyclerView.OnScrollListener? = null
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
setHasOptionsMenu(true)
|
setHasOptionsMenu(true)
|
||||||
@ -143,7 +142,6 @@ class ClearDatabaseController :
|
|||||||
|
|
||||||
override fun cleanupFab(fab: ExtendedFloatingActionButton) {
|
override fun cleanupFab(fab: ExtendedFloatingActionButton) {
|
||||||
actionFab?.setOnClickListener(null)
|
actionFab?.setOnClickListener(null)
|
||||||
actionFabScrollListener?.let { recycler?.removeOnScrollListener(it) }
|
|
||||||
actionFab = null
|
actionFab = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -703,7 +703,6 @@
|
|||||||
<string name="updating_library">Updating library</string>
|
<string name="updating_library">Updating library</string>
|
||||||
|
|
||||||
<!-- History fragment -->
|
<!-- History fragment -->
|
||||||
<string name="history_prefix">Ch. %1$s - </string>
|
|
||||||
<string name="recent_manga_time">Ch. %1$s - %2$s</string>
|
<string name="recent_manga_time">Ch. %1$s - %2$s</string>
|
||||||
<string name="pref_clear_history">Clear history</string>
|
<string name="pref_clear_history">Clear history</string>
|
||||||
<string name="clear_history_completed">History deleted</string>
|
<string name="clear_history_completed">History deleted</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user