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