0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2024-11-23 03:35:11 +00:00

SlidingLinearLayout yEs

This commit is contained in:
X1nto 2020-05-10 18:54:39 +04:00
parent f4e7ac4f25
commit d83c780d88
2 changed files with 35 additions and 2 deletions

View file

@ -0,0 +1,33 @@
package com.vanced.manager.ui.core
import android.content.Context
import android.util.AttributeSet
import android.widget.LinearLayout
open class SlidingLinearLayout: LinearLayout {
constructor(context: Context?) : super(context)
constructor(context: Context?, attrs: AttributeSet?) : super(
context,
attrs
)
var yFraction: Float
get() {
val height = height
return if (height != 0)
y / height
else
y
}
set(yFraction) {
val height = height
val newHeight =
if (height > 0)
yFraction * height
else
(-9999).toFloat()
y = newHeight
}
}

View file

@ -26,7 +26,7 @@
android:visibility="gone"
tools:visibility="visible"/>
<LinearLayout
<com.vanced.manager.ui.core.SlidingLinearLayout
android:id="@+id/home_main_wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -69,7 +69,7 @@
android:layout_marginTop="@dimen/stdp"
android:layout_marginEnd="@dimen/stdp" />
</LinearLayout>
</com.vanced.manager.ui.core.SlidingLinearLayout>
</LinearLayout>