Fixed bottom bar not hiding on device without root
This commit is contained in:
parent
a63d6c03fd
commit
63a9a7d643
@ -10,6 +10,7 @@ import androidx.interpolator.view.animation.FastOutSlowInInterpolator
|
||||
import com.google.android.material.behavior.HideBottomViewOnScrollBehavior
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import com.topjohnwu.magisk.R
|
||||
import com.topjohnwu.magisk.core.Info
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
class HideBottomViewOnScrollBehavior<V : View> : HideBottomViewOnScrollBehavior<V>(),
|
||||
@ -98,7 +99,7 @@ class HideBottomViewOnScrollBehavior<V : View> : HideBottomViewOnScrollBehavior<
|
||||
this.lockState = lockState
|
||||
}
|
||||
|
||||
if (hide) {
|
||||
if (hide || !Info.env.isActive) {
|
||||
// view is not laid out and drawn yet properly, so animation will not be attached
|
||||
// hence we just simply hide the view
|
||||
if (!isLaidOut) {
|
||||
@ -107,7 +108,7 @@ class HideBottomViewOnScrollBehavior<V : View> : HideBottomViewOnScrollBehavior<
|
||||
slideDown(view)
|
||||
}
|
||||
} else {
|
||||
view.isVisible = true
|
||||
view.isVisible = Info.env.isActive
|
||||
slideUp(view)
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,6 @@
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/main_bottom_bar"
|
||||
style="@style/WidgetFoundation.Card.Elevated"
|
||||
gone="@{!Info.env.isActive}"
|
||||
android:layout_width="224dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
|
Loading…
Reference in New Issue
Block a user