mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-09 10:38:56 +01:00
More consistent usage of visibility extensions
This commit is contained in:
@@ -3,12 +3,13 @@ package eu.kanade.tachiyomi.widget
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.widget.FrameLayout
|
||||
import androidx.annotation.IdRes
|
||||
import androidx.annotation.MenuRes
|
||||
import androidx.appcompat.view.ActionMode
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.util.view.gone
|
||||
import eu.kanade.tachiyomi.util.view.visible
|
||||
import kotlinx.android.synthetic.main.common_action_toolbar.view.common_action_menu
|
||||
import kotlinx.android.synthetic.main.common_action_toolbar.view.common_action_toolbar
|
||||
|
||||
@@ -47,13 +48,13 @@ class ActionToolbar @JvmOverloads constructor(context: Context, attrs: Attribute
|
||||
common_action_menu.setOnMenuItemClickListener { listener(it) }
|
||||
}
|
||||
|
||||
common_action_toolbar.visibility = View.VISIBLE
|
||||
common_action_toolbar.visible()
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide the menu toolbar.
|
||||
*/
|
||||
fun hide() {
|
||||
common_action_toolbar.visibility = View.GONE
|
||||
common_action_toolbar.gone()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import android.view.ViewAnimationUtils
|
||||
import eu.kanade.tachiyomi.util.view.invisible
|
||||
import eu.kanade.tachiyomi.util.view.visible
|
||||
|
||||
class RevealAnimationView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
|
||||
View(context, attrs) {
|
||||
@@ -19,7 +21,7 @@ class RevealAnimationView @JvmOverloads constructor(context: Context, attrs: Att
|
||||
*/
|
||||
fun hideRevealEffect(centerX: Int, centerY: Int, initialRadius: Int) {
|
||||
// Make the view visible.
|
||||
this.visibility = View.VISIBLE
|
||||
this.visible()
|
||||
|
||||
// Create the animation (the final radius is zero).
|
||||
val anim = ViewAnimationUtils.createCircularReveal(
|
||||
@@ -32,7 +34,7 @@ class RevealAnimationView @JvmOverloads constructor(context: Context, attrs: Att
|
||||
anim.addListener(object : AnimatorListenerAdapter() {
|
||||
override fun onAnimationEnd(animation: Animator) {
|
||||
super.onAnimationEnd(animation)
|
||||
this@RevealAnimationView.visibility = View.INVISIBLE
|
||||
this@RevealAnimationView.invisible()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -49,7 +51,7 @@ class RevealAnimationView @JvmOverloads constructor(context: Context, attrs: Att
|
||||
* @return sdk version lower then 21
|
||||
*/
|
||||
fun showRevealEffect(centerX: Int, centerY: Int, listener: Animator.AnimatorListener): Boolean {
|
||||
this.visibility = View.VISIBLE
|
||||
this.visible()
|
||||
|
||||
val height = this.height
|
||||
|
||||
|
||||
Reference in New Issue
Block a user