mirror of
https://github.com/YTVanced/VancedManager
synced 2024-11-23 11:45:11 +00:00
SlidingLinearLayout yEs
This commit is contained in:
parent
f4e7ac4f25
commit
d83c780d88
2 changed files with 35 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
||||
}
|
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in a new issue