diff --git a/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt b/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt
index 06f576f87..992d2c709 100644
--- a/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt
+++ b/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt
@@ -92,7 +92,7 @@ class ExploreAdapter(context: Context, private val scope: CoroutineScope, val ca
}
} else {
iv_status.setImageResource(R.drawable.ic_add)
- rotate_loading.hide()
+ rotate_loading.hide(View.GONE)
gl_child.gone()
}
}
diff --git a/app/src/main/java/io/legado/app/ui/widget/anima/RotateLoading.kt b/app/src/main/java/io/legado/app/ui/widget/anima/RotateLoading.kt
index 230911c20..a985b4719 100644
--- a/app/src/main/java/io/legado/app/ui/widget/anima/RotateLoading.kt
+++ b/app/src/main/java/io/legado/app/ui/widget/anima/RotateLoading.kt
@@ -34,6 +34,8 @@ class RotateLoading : View {
private var shadowPosition: Int = 0
+ var hideMode = GONE
+
var isStarted = false
private set
@@ -49,7 +51,7 @@ class RotateLoading : View {
private val shown = Runnable { this.startInternal() }
- private val hidden = Runnable { this.stopInternal(GONE) }
+ private val hidden = Runnable { this.stopInternal() }
constructor(context: Context) : super(context) {
initView(context, null)
@@ -78,6 +80,7 @@ class RotateLoading : View {
)
shadowPosition = typedArray.getInt(R.styleable.RotateLoading_shadow_position, DEFAULT_SHADOW_POSITION)
speedOfDegree = typedArray.getInt(R.styleable.RotateLoading_loading_speed, DEFAULT_SPEED_OF_DEGREE)
+ hideMode = typedArray.getInt(R.styleable.RotateLoading_hide_mode, GONE)
typedArray.recycle()
}
speedOfArc = (speedOfDegree / 4).toFloat()
@@ -176,10 +179,10 @@ class RotateLoading : View {
post(shown)
}
- fun hide(visibility: Int = INVISIBLE) {
+ fun hide() {
removeCallbacks(shown)
removeCallbacks(hidden)
- stopInternal(visibility)
+ stopInternal()
}
private fun startInternal() {
@@ -188,8 +191,8 @@ class RotateLoading : View {
invalidate()
}
- private fun stopInternal(visibility: Int = INVISIBLE) {
- stopAnimator(visibility)
+ private fun stopInternal() {
+ stopAnimator()
invalidate()
}
@@ -205,10 +208,10 @@ class RotateLoading : View {
.start()
}
- private fun stopAnimator(visibility: Int = INVISIBLE) {
+ private fun stopAnimator() {
animate().cancel()
isStarted = false
- this.visibility = visibility
+ this.visibility = hideMode
}
companion object {
diff --git a/app/src/main/res/layout/item_find_book.xml b/app/src/main/res/layout/item_find_book.xml
index 6a2b53f3a..266e69e8d 100644
--- a/app/src/main/res/layout/item_find_book.xml
+++ b/app/src/main/res/layout/item_find_book.xml
@@ -64,6 +64,7 @@
android:layout_height="36dp"
android:visibility="gone"
android:layout_gravity="center"
+ app:hide_mode="gone"
app:loading_width="2dp" />
diff --git a/app/src/main/res/layout/view_load_more.xml b/app/src/main/res/layout/view_load_more.xml
index 4b2656a1d..21b0491c9 100644
--- a/app/src/main/res/layout/view_load_more.xml
+++ b/app/src/main/res/layout/view_load_more.xml
@@ -12,6 +12,7 @@
android:layout_margin="6dp"
android:layout_gravity="center"
android:visibility="invisible"
+ app:hide_mode="invisible"
app:loading_width="2dp" />
+
+
+
+
+
+