Fixed bottom bar not hiding on device without root

This commit is contained in:
Viktor De Pasquale 2020-09-24 07:53:06 +02:00 committed by John Wu
parent a63d6c03fd
commit 63a9a7d643
2 changed files with 3 additions and 3 deletions

View File

@ -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)
}

View File

@ -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"