Skip to content

Commit

Permalink
Merge pull request #170 from Dark25/akidev
Browse files Browse the repository at this point in the history
Akidev
  • Loading branch information
Dark25 authored Nov 7, 2024
2 parents c2b5c2b + fa94e47 commit 7fef0b5
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 39 deletions.
1 change: 0 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ dependencies {
implementation(libs.swipe)
implementation(libs.compose.webview)
implementation(libs.compose.grid)

implementation(libs.google.api.services.drive)
implementation(libs.google.api.client.oauth)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,35 +71,6 @@ fun ReaderPageActionsDialog(
onDismissRequest()
},
)
ActionButton(
modifier = Modifier.weight(1f),
title = stringResource(MR.strings.action_copy_to_clipboard),
icon = Icons.Outlined.ContentCopy,
onClick = {
onShare(true, false)
onDismissRequest()
},
)
ActionButton(
modifier = Modifier.weight(1f),
title = stringResource(
// SY -->
if (hasExtraPage) {
MR.strings.action_share_first_page
} else {
MR.strings.action_share
},
// SY <--
),
icon = Icons.Outlined.Share,
onClick = {
// SY -->
onShare(false, false)
// SY <--
onDismissRequest()
},
)

ActionButton(
modifier = Modifier.weight(1f),
title = stringResource(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ private fun ChipGroup.setChips(items: List<String>, scope: CoroutineScope) {
}

private fun ChipGroup.getTextStrings(): List<String> = children.mapNotNull {
if (it is Chip && !it.text.toString().contains(
if (it is Chip &&
!it.text.toString().contains(
context.getString(R.string.add_tag),
ignoreCase = true,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ class ReaderActivity : BaseActivity() {
is ReaderViewModel.Event.CopyImage -> {
onCopyImageResult(event.uri)
}
is ReaderViewModel.Event.CopyImage -> {
onCopyImageResult(event.uri)
}
is ReaderViewModel.Event.SetCoverResult -> {
onSetAsCoverResult(event.result)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,11 @@ open class ReaderPageImageView @JvmOverloads constructor(
}

private fun SubsamplingScaleImageView.landscapeZoom(forward: Boolean) {
if (config != null && config!!.landscapeZoom && config!!.minimumScaleType == SCALE_TYPE_CENTER_INSIDE &&
sWidth > sHeight && scale == minScale
if (config != null &&
config!!.landscapeZoom &&
config!!.minimumScaleType == SCALE_TYPE_CENTER_INSIDE &&
sWidth > sHeight &&
scale == minScale
) {
handler?.postDelayed(500) {
val point = when (config!!.zoomStartPosition) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ abstract class PagerViewer(val activity: ReaderActivity) : Viewer {
}
pager.longTapListener = f@{
if (activity.viewModel.state.value.menuVisible || config.longTapEnabled) {
val item = adapter.joinedItems.getOrNull(pager.currentItem)
val item = adapter
.joinedItems.getOrNull(pager.currentItem)
val firstPage = item?.first as? ReaderPage
val secondPage = item?.second as? ReaderPage
if (firstPage is ReaderPage) {
Expand Down Expand Up @@ -290,9 +291,10 @@ abstract class PagerViewer(val activity: ReaderActivity) : Viewer {
* Sets the active [chapters] on this pager.
*/
private fun setChaptersInternal(chapters: ViewerChapters) {
val forceTransition =
config.alwaysShowChapterTransition ||
adapter.joinedItems.getOrNull(pager.currentItem)?.first is ChapterTransition
val forceTransition = config.alwaysShowChapterTransition ||
adapter.items.getOrNull(
pager.currentItem,
) is ChapterTransition
adapter.setChapters(chapters, forceTransition)

// Layout the pager once a chapter is being set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import kotlin.math.max
*/
class PagerViewerAdapter(private val viewer: PagerViewer) : ViewPagerAdapter() {

var items: MutableList<Any> = mutableListOf()
private set

/**
* Paired list of currently set items.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ class GetApplicationRelease(
suspend fun await(arguments: Arguments): Result {
val now = Instant.now()

// Limit checks to once every 1 days at most
// Limit checks to once every 3 days at most
if (!arguments.forceCheck &&
now.isBefore(
Instant.ofEpochMilli(lastChecked.get()).plus(1, ChronoUnit.DAYS),
Instant.ofEpochMilli(lastChecked.get()).plus(3, ChronoUnit.DAYS),
)
) {
return Result.NoNewUpdate
Expand Down

0 comments on commit 7fef0b5

Please sign in to comment.