Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test build latest changes #617

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f3b48d9
move `Suggestions` settings to same place
cuong-tran Nov 14, 2024
4f4af3b
fix vertical chapter navigator overlap bottom bar
cuong-tran Nov 27, 2024
96c50d0
add color to notification
cuong-tran Dec 5, 2024
326446b
revert user-agent to latest desktop
cuong-tran Dec 2, 2024
62e5b51
switch off integrated H to show E-H source & extension
cuong-tran Dec 11, 2024
88a772a
More languages for E-H/ExH, also more popular with rate 5
cuong-tran Dec 13, 2024
e4b224b
Don't hide Multi source when toggle Integrated H
cuong-tran Dec 13, 2024
53b90e5
Avoid crash trying to load ehentaiBrowseDisplayMode
cuong-tran Dec 13, 2024
64d0bbc
change source ID to matching general extension
cuong-tran Dec 11, 2024
656d2ab
migration old source ID to new source ID
cuong-tran Dec 13, 2024
10c3aed
Allow importing of EHentai extension backups
cuong-tran Dec 13, 2024
229b782
limit library update & metadata source to only Multi lang
cuong-tran Dec 16, 2024
20441b4
update app version
cuong-tran Dec 17, 2024
68d8f3c
fix spotless
cuong-tran Dec 31, 2024
14209b4
add app icon to extension update notification
cuong-tran Dec 31, 2024
d746551
Merge remote-tracking branch 'origin/chapter-navigator-overlap' into …
cuong-tran Dec 31, 2024
8ba2146
Merge remote-tracking branch 'origin/eh-ext' into test-build
cuong-tran Dec 31, 2024
5a05430
Merge remote-tracking branch 'origin/notification-color' into test-build
cuong-tran Dec 31, 2024
12c503d
Merge remote-tracking branch 'origin/move-suggestion-settings' into t…
cuong-tran Dec 31, 2024
7e3fe64
Merge remote-tracking branch 'origin/revert-user-agent' into test-build
cuong-tran Dec 31, 2024
c5b6141
add app icon to download error notification
cuong-tran Dec 31, 2024
f508bed
Merge branch 'notification-color' into test-build
cuong-tran Dec 31, 2024
c4be056
also migrate saved search/feed & pinned EH/EXH source ID when restore…
cuong-tran Jan 2, 2025
f92ef5b
Merge branch 'eh-ext' into test-build
cuong-tran Jan 2, 2025
187c7c9
Drag to reorder feeds
cuong-tran Jan 2, 2025
c026711
Merge branch 'drag-reorder-feed' into test-build
cuong-tran Jan 2, 2025
a352872
add large app icon to all the notification
cuong-tran Jan 6, 2025
cce38e2
set large image for chapter update & save image notification
cuong-tran Jan 7, 2025
2d5a574
Merge branch 'master' into test-build
cuong-tran Jan 7, 2025
7e75cf6
Merge branch 'notification-color' into test-build
cuong-tran Jan 7, 2025
505d18d
Restore chapter's bookmark & oldest dateUpload from backup
cuong-tran Jan 3, 2025
7491946
Merge branch 'restore-chapter-bookmark-dateupload' into test-build
cuong-tran Jan 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ android {
defaultConfig {
applicationId = "app.komikku"

versionCode = 71
versionName = "1.12.2"
versionCode = 72
versionName = "1.13.0"

buildConfigField("String", "COMMIT_COUNT", "\"${getCommitCount()}\"")
buildConfigField("String", "COMMIT_SHA", "\"${getGitSha()}\"")
Expand Down
Binary file added app/src/beta/res/drawable/komikku.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions app/src/beta/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher">#c837ab</color>
</resources>
Binary file added app/src/debug/res/drawable/komikku.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions app/src/debug/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher">#ffe680</color>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class SourcePreferences(

fun disabledSources() = preferenceStore.getStringSet("hidden_catalogues", emptySet())

fun pinnedSources() = preferenceStore.getStringSet("pinned_catalogues", emptySet())
fun pinnedSources() = preferenceStore.getStringSet(pinnedSourcesPrefKey, emptySet())

fun lastUsedSource() = preferenceStore.getLong(
Preference.appStateKey("last_catalogue_source"),
Expand Down Expand Up @@ -107,3 +107,5 @@ class SourcePreferences(
fun relatedMangas() = preferenceStore.getBoolean("related_mangas", true)
// KMK <--
}

const val pinnedSourcesPrefKey = "pinned_catalogues"
57 changes: 39 additions & 18 deletions app/src/main/java/eu/kanade/presentation/browse/FeedOrderScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@ package eu.kanade.presentation.browse
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import eu.kanade.presentation.browse.components.FeedOrderListItem
import eu.kanade.tachiyomi.ui.browse.feed.FeedScreenState
import sh.calvin.reorderable.ReorderableItem
import sh.calvin.reorderable.rememberReorderableLazyListState
import tachiyomi.domain.source.model.FeedSavedSearch
import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.material.padding
Expand All @@ -22,39 +29,53 @@ import tachiyomi.presentation.core.util.plus
fun FeedOrderScreen(
state: FeedScreenState,
onClickDelete: (FeedSavedSearch) -> Unit,
onClickMoveUp: (FeedSavedSearch) -> Unit,
onClickMoveDown: (FeedSavedSearch) -> Unit,
changeOrder: (FeedSavedSearch, Int) -> Unit,
) {
when {
state.isLoading -> LoadingScreen()
state.isEmpty -> EmptyScreen(
state.isEmpty || state.items.isNullOrEmpty() -> EmptyScreen(
stringRes = MR.strings.empty_screen,
)

else -> {
val lazyListState = rememberLazyListState()
val feeds = state.items ?: emptyList()
val feeds = state.items

var reorderableList by remember { mutableStateOf(feeds) }
val reorderableLazyColumnState = rememberReorderableLazyListState(lazyListState) { from, to ->
reorderableList = reorderableList.toMutableList().apply {
changeOrder(reorderableList[from.index].feed, to.index - from.index)
add(to.index, removeAt(from.index))
}
}

LaunchedEffect(feeds) {
if (!reorderableLazyColumnState.isAnyItemDragging) {
reorderableList = feeds
}
}

LazyColumn(
state = lazyListState,
contentPadding = topSmallPaddingValues +
PaddingValues(horizontal = MaterialTheme.padding.medium),
verticalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small),
) {
itemsIndexed(
items = feeds,
key = { _, feed -> "feed-${feed.feed.id}" },
) { index, feed ->
FeedOrderListItem(
modifier = Modifier.animateItem(),
title = feed.title,
canMoveUp = index != 0,
canMoveDown = index != feeds.lastIndex,
onMoveUp = { onClickMoveUp(feed.feed) },
onMoveDown = { onClickMoveDown(feed.feed) },
onDelete = { onClickDelete(feed.feed) },
)
items(
items = reorderableList,
key = { it.feed.key },
) { feed ->
ReorderableItem(reorderableLazyColumnState, feed.feed.key) {
FeedOrderListItem(
modifier = Modifier.animateItem(),
title = feed.title,
onDelete = { onClickDelete(feed.feed) },
)
}
}
}
}
}
}

internal val FeedSavedSearch.key get() = "feed-$id"
16 changes: 6 additions & 10 deletions app/src/main/java/eu/kanade/presentation/browse/FeedScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.AlertDialog
Expand Down Expand Up @@ -75,7 +75,7 @@ fun FeedScreen(
onClickSavedSearch: (SavedSearch, CatalogueSource) -> Unit,
onClickSource: (CatalogueSource) -> Unit,
// KMK -->
onLongClickFeed: (FeedItemUI, Boolean, Boolean) -> Unit,
onLongClickFeed: (FeedItemUI) -> Unit,
// KMK <--
onClickManga: (Manga) -> Unit,
// KMK -->
Expand Down Expand Up @@ -113,21 +113,17 @@ fun FeedScreen(
) {
// KMK -->
val feeds = state.items.orEmpty()
itemsIndexed(
items(
items = feeds,
key = { _, it -> "feed-${it.feed.id}" },
) { index, item ->
key = { it.feed.key },
) { item ->
// KMK <--
GlobalSearchResultItem(
title = item.title,
subtitle = item.subtitle,
onLongClick = {
// KMK -->
onLongClickFeed(
item,
index != 0,
index != feeds.lastIndex,
)
onLongClickFeed(item)
// KMK <--
},
onClick = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,25 @@ package eu.kanade.presentation.browse
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.SortByAlpha
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import eu.kanade.presentation.browse.components.FeedOrderListItem
import eu.kanade.presentation.components.AppBar
import eu.kanade.presentation.components.AppBarTitle
import eu.kanade.tachiyomi.ui.browse.source.feed.SourceFeedState
import kotlinx.collections.immutable.persistentListOf
import sh.calvin.reorderable.ReorderableItem
import sh.calvin.reorderable.rememberReorderableLazyListState
import tachiyomi.domain.source.model.FeedSavedSearch
import tachiyomi.i18n.MR
import tachiyomi.i18n.kmk.KMR
Expand All @@ -30,8 +37,7 @@ import tachiyomi.presentation.core.util.plus
fun SourceFeedOrderScreen(
state: SourceFeedState,
onClickDelete: (FeedSavedSearch) -> Unit,
onClickMoveUp: (FeedSavedSearch) -> Unit,
onClickMoveDown: (FeedSavedSearch) -> Unit,
changeOrder: (FeedSavedSearch, Int) -> Unit,
onClickSortAlphabetically: () -> Unit,
navigateUp: (() -> Unit)? = null,
) {
Expand Down Expand Up @@ -68,25 +74,38 @@ fun SourceFeedOrderScreen(
val lazyListState = rememberLazyListState()
val feeds = state.items
.filterIsInstance<SourceFeedUI.SourceSavedSearch>()

var reorderableList by remember { mutableStateOf(feeds) }
val reorderableLazyColumnState = rememberReorderableLazyListState(lazyListState) { from, to ->
reorderableList = reorderableList.toMutableList().apply {
changeOrder(reorderableList[from.index].feed, to.index - from.index)
add(to.index, removeAt(from.index))
}
}

LaunchedEffect(feeds) {
if (!reorderableLazyColumnState.isAnyItemDragging) {
reorderableList = feeds
}
}

LazyColumn(
state = lazyListState,
contentPadding = paddingValues + topSmallPaddingValues +
PaddingValues(horizontal = MaterialTheme.padding.medium),
verticalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small),
) {
itemsIndexed(
items = feeds,
key = { _, feed -> "feed-${feed.feed.id}" },
) { index, feed ->
FeedOrderListItem(
modifier = Modifier.animateItem(),
title = feed.title,
canMoveUp = index != 0,
canMoveDown = index != feeds.lastIndex,
onMoveUp = { onClickMoveUp(feed.feed) },
onMoveDown = { onClickMoveDown(feed.feed) },
onDelete = { onClickDelete(feed.feed) },
)
items(
items = reorderableList,
key = { it.feed.key },
) { feed ->
ReorderableItem(reorderableLazyColumnState, feed.feed.key) {
FeedOrderListItem(
modifier = Modifier.animateItem(),
title = feed.title,
onDelete = { onClickDelete(feed.feed) },
)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package eu.kanade.presentation.browse

import androidx.compose.animation.Crossfade
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.lazy.items
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Public
import androidx.compose.material3.TopAppBarScrollBehavior
Expand Down Expand Up @@ -94,7 +94,7 @@ fun SourceFeedScreen(
onClickSavedSearch: (SavedSearch) -> Unit,
// KMK -->
// onClickDelete: (FeedSavedSearch) -> Unit,
onLongClickFeed: (SourceFeedUI.SourceSavedSearch, Boolean, Boolean) -> Unit,
onLongClickFeed: (SourceFeedUI.SourceSavedSearch) -> Unit,
// KMK <--
onClickManga: (Manga) -> Unit,
onClickSearch: (String) -> Unit,
Expand Down Expand Up @@ -200,7 +200,7 @@ fun SourceFeedList(
onClickSavedSearch: (SavedSearch) -> Unit,
// KMK -->
// onClickDelete: (FeedSavedSearch) -> Unit,
onLongClickFeed: (SourceFeedUI.SourceSavedSearch, Boolean, Boolean) -> Unit,
onLongClickFeed: (SourceFeedUI.SourceSavedSearch) -> Unit,
// KMK <--
onClickManga: (Manga) -> Unit,
// KMK -->
Expand All @@ -212,10 +212,10 @@ fun SourceFeedList(
contentPadding = paddingValues + topSmallPaddingValues,
) {
// KMK -->
itemsIndexed(
items(
items,
key = { _, it -> "source-feed-${it.id}" },
) { index, item ->
key = { "source-feed-${it.id}" },
) { item ->
// KMK <--
GlobalSearchResultItem(
modifier = Modifier.animateItem(),
Expand All @@ -231,11 +231,7 @@ fun SourceFeedList(
onLongClick = if (item is SourceFeedUI.SourceSavedSearch) {
{
// KMK -->
onLongClickFeed(
item,
index != items.size - items.filterIsInstance<SourceFeedUI.SourceSavedSearch>().size,
index != items.lastIndex,
)
onLongClickFeed(item)
// KMK <--
}
} else {
Expand Down
Loading
Loading