Compare commits
4 Commits
5.0.3
...
5.0.3-hotf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
998433479b | ||
|
|
c7e75aacf0 | ||
|
|
690338273a | ||
|
|
4207ea494d |
@@ -21,7 +21,7 @@ android {
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 30
|
||||
versionCode 59
|
||||
versionName "5.0.3"
|
||||
versionName "5.0.3-hotfix2"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"filters": [],
|
||||
"properties": [],
|
||||
"versionCode": 59,
|
||||
"versionName": "5.0.3",
|
||||
"versionName": "5.0.3-hotfix2",
|
||||
"enabled": true,
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
|
||||
@@ -82,9 +82,12 @@ class FloatingSearchViewDayNight @JvmOverloads constructor(context: Context, att
|
||||
override fun onSuggestionClicked(searchSuggestion: SearchSuggestion?) {
|
||||
when (searchSuggestion) {
|
||||
is TagSuggestion -> {
|
||||
val tag = "${searchSuggestion.n}:${searchSuggestion.s.replace(Regex("\\s"), "_")}"
|
||||
with(searchInputView.text) {
|
||||
delete(if (lastIndexOf(' ') == -1) 0 else lastIndexOf(' ')+1, length)
|
||||
append("${searchSuggestion.n}:${searchSuggestion.s.replace(Regex("\\s"), "_")} ")
|
||||
delete(if (lastIndexOf(' ') == -1) 0 else lastIndexOf(' ') + 1, length)
|
||||
|
||||
if (!this.contains(tag))
|
||||
append("$tag ")
|
||||
}
|
||||
}
|
||||
is Suggestion -> {
|
||||
|
||||
@@ -82,11 +82,6 @@ class ReaderActivity : BaseActivity() {
|
||||
field = value
|
||||
|
||||
(reader_recyclerview.adapter as ReaderAdapter).isFullScreen = value
|
||||
|
||||
reader_progressbar.visibility = when {
|
||||
value -> View.VISIBLE
|
||||
else -> View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
private lateinit var cache: Cache
|
||||
@@ -124,6 +119,7 @@ class ReaderActivity : BaseActivity() {
|
||||
private var cameraEnabled = false
|
||||
private var eyeType: Eye? = null
|
||||
private var eyeCount: Int = 0
|
||||
private var eyeTime: Long = 0L
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
@@ -328,7 +324,6 @@ class ReaderActivity : BaseActivity() {
|
||||
runOnUiThread {
|
||||
reader_download_progressbar.max = reader_recyclerview.adapter?.itemCount ?: 0
|
||||
reader_download_progressbar.progress = downloader.progress[galleryID]?.count { it.isInfinite() } ?: 0
|
||||
reader_progressbar.max = reader_recyclerview.adapter?.itemCount ?: 0
|
||||
|
||||
if (title == getString(R.string.reader_loading)) {
|
||||
val reader = cache.metadata.reader
|
||||
@@ -391,7 +386,7 @@ class ReaderActivity : BaseActivity() {
|
||||
return
|
||||
currentPage = layoutManager.findFirstVisibleItemPosition()+1
|
||||
menu?.findItem(R.id.reader_menu_page_indicator)?.title = "$currentPage/${recyclerView.adapter!!.itemCount}"
|
||||
this@ReaderActivity.reader_progressbar.progress = currentPage
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -492,17 +487,6 @@ class ReaderActivity : BaseActivity() {
|
||||
} else {
|
||||
snapHelper.attachToRecyclerView(reader_recyclerview)
|
||||
reader_recyclerview.layoutManager = LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, Preferences["rtl", false])
|
||||
|
||||
if (Preferences["rtl", false])
|
||||
with(reader_progressbar) {
|
||||
scaleX = -1F
|
||||
translationX = 1F
|
||||
}
|
||||
else
|
||||
with(reader_progressbar) {
|
||||
scaleX = 0F
|
||||
translationX = 0F
|
||||
}
|
||||
}
|
||||
|
||||
(reader_recyclerview.layoutManager as LinearLayoutManager).scrollToPositionWithOffset(currentPage-1, 0)
|
||||
@@ -581,11 +565,13 @@ class ReaderActivity : BaseActivity() {
|
||||
!left.xor(right) -> {
|
||||
eyeType = null
|
||||
eyeCount = 0
|
||||
eyeTime = 0L
|
||||
}
|
||||
!left -> {
|
||||
if (eyeType != Eye.LEFT) {
|
||||
eyeType = Eye.LEFT
|
||||
eyeCount = 0
|
||||
eyeTime = System.currentTimeMillis()
|
||||
}
|
||||
eyeCount++
|
||||
}
|
||||
@@ -593,12 +579,13 @@ class ReaderActivity : BaseActivity() {
|
||||
if (eyeType != Eye.RIGHT) {
|
||||
eyeType = Eye.RIGHT
|
||||
eyeCount = 0
|
||||
eyeTime = System.currentTimeMillis()
|
||||
}
|
||||
eyeCount++
|
||||
}
|
||||
}
|
||||
|
||||
if (eyeCount > 3) {
|
||||
if (eyeCount > 3 && System.currentTimeMillis() - eyeTime > 500) {
|
||||
(this@ReaderActivity.reader_recyclerview.layoutManager as LinearLayoutManager).let {
|
||||
it.scrollToPositionWithOffset(when(eyeType!!) {
|
||||
Eye.RIGHT -> {
|
||||
@@ -612,6 +599,7 @@ class ReaderActivity : BaseActivity() {
|
||||
|
||||
eyeType = null
|
||||
eyeCount = 0
|
||||
eyeTime = 0L
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,8 @@ class SavedSet <T: Any> (private val file: File, private val any: T, private val
|
||||
override fun add(element: T): Boolean {
|
||||
load()
|
||||
|
||||
set.remove(element)
|
||||
|
||||
return set.add(element).also {
|
||||
save()
|
||||
}
|
||||
@@ -67,6 +69,8 @@ class SavedSet <T: Any> (private val file: File, private val any: T, private val
|
||||
override fun addAll(elements: Collection<T>): Boolean {
|
||||
load()
|
||||
|
||||
set.removeAll(elements)
|
||||
|
||||
return set.addAll(elements).also {
|
||||
save()
|
||||
}
|
||||
|
||||
@@ -55,28 +55,11 @@
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_margin="8dp"/>
|
||||
|
||||
<LinearLayout
|
||||
<ProgressBar
|
||||
android:id="@+id/reader_download_progressbar"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/reader_download_progressbar"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="4dp"
|
||||
android:layout_gravity="center"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/reader_progressbar"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="4dp"
|
||||
android:progressTint="@color/material_green_a700"
|
||||
tools:ignore="UnusedAttribute"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</LinearLayout>
|
||||
android:layout_height="4dp"/>
|
||||
|
||||
<com.github.clans.fab.FloatingActionMenu
|
||||
android:id="@+id/reader_fab"
|
||||
|
||||
@@ -162,16 +162,14 @@
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/galleryblock_type"
|
||||
app:layout_constraintBottom_toTopOf="@id/galleryblock_padding"
|
||||
app:layout_constraintLeft_toRightOf="@id/galleryblock_thumbnail" />
|
||||
|
||||
<View
|
||||
android:id="@+id/galleryblock_padding"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/galleryblock_language"
|
||||
app:layout_constraintBottom_toTopOf="@id/galleryblock_tag_group"/>
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/padding"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="bottom"
|
||||
app:constraint_referenced_ids="galleryblock_language"/>
|
||||
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/galleryblock_tag_group"
|
||||
@@ -181,7 +179,7 @@
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:chipSpacing="4dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/galleryblock_padding"
|
||||
app:layout_constraintTop_toBottomOf="@id/padding"
|
||||
app:layout_constraintLeft_toRightOf="@id/galleryblock_thumbnail"
|
||||
app:layout_constraintRight_toRightOf="parent"/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user