diff --git a/app/src/main/java/com/vanced/manager/ui/core/SlidingLinearLayout.kt b/app/src/main/java/com/vanced/manager/ui/core/SlidingLinearLayout.kt new file mode 100644 index 00000000..9f6a6924 --- /dev/null +++ b/app/src/main/java/com/vanced/manager/ui/core/SlidingLinearLayout.kt @@ -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 + } + +} \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 05c8dd79..3f83154f 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -26,7 +26,7 @@ android:visibility="gone" tools:visibility="visible"/> - - +