mirror of
https://github.com/YTVanced/VancedManager
synced 2024-11-16 16:25:11 +00:00
test 2
This commit is contained in:
parent
72d278c57c
commit
d930b04f20
2 changed files with 19 additions and 26 deletions
|
@ -72,23 +72,24 @@ class HomeFragment : Home() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
view.findViewById<LinearLayout>(R.id.viewpager_container).visibility = View.VISIBLE
|
|
||||||
|
|
||||||
view.findViewById<ImageButton>(R.id.changelog_button).setOnClickListener {
|
view.findViewById<ImageButton>(R.id.changelog_button).setOnClickListener {
|
||||||
cardExpandCollapse()
|
cardExpandCollapse()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun cardExpandCollapse() {
|
private fun cardExpandCollapse() {
|
||||||
val viewPagerContainer = view?.findViewById<LinearLayout>(R.id.viewpager_container)
|
val viewPagerContainer = view?.findViewById<ViewPager2>(R.id.viewpager)
|
||||||
|
val tabLayoutContainer = view?.findViewById<TabLayout>(R.id.tablayout)
|
||||||
val arrow = view?.findViewById<ImageButton>(R.id.changelog_button)
|
val arrow = view?.findViewById<ImageButton>(R.id.changelog_button)
|
||||||
val arrowAnimation: RotateAnimation
|
val arrowAnimation: RotateAnimation
|
||||||
if (isExpanded) {
|
if (isExpanded) {
|
||||||
viewPagerContainer?.visibility = View.GONE
|
viewPagerContainer?.visibility = View.GONE
|
||||||
|
tabLayoutContainer?.visibility = View.GONE
|
||||||
isExpanded = false
|
isExpanded = false
|
||||||
arrowAnimation = RotateAnimation(180f, 0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f)
|
arrowAnimation = RotateAnimation(180f, 0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f)
|
||||||
} else {
|
} else {
|
||||||
viewPagerContainer?.visibility = View.VISIBLE
|
viewPagerContainer?.visibility = View.VISIBLE
|
||||||
|
tabLayoutContainer?.visibility = View.VISIBLE
|
||||||
isExpanded = true
|
isExpanded = true
|
||||||
arrowAnimation = RotateAnimation(0f, 180f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f)
|
arrowAnimation = RotateAnimation(0f, 180f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f)
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,17 +28,11 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/arrow_down"
|
android:src="@drawable/arrow_down"
|
||||||
android:backgroundTint="@android:color/transparent"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_alignParentEnd="true" />
|
android:background="@android:color/transparent"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/viewpager_container"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<com.google.android.material.tabs.TabLayout
|
<com.google.android.material.tabs.TabLayout
|
||||||
android:id="@+id/tablayout"
|
android:id="@+id/tablayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -51,12 +45,10 @@
|
||||||
|
|
||||||
<androidx.viewpager2.widget.ViewPager2
|
<androidx.viewpager2.widget.ViewPager2
|
||||||
android:id="@+id/viewpager"
|
android:id="@+id/viewpager"
|
||||||
android:layout_width="0dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1"/>
|
android:layout_weight="1"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
Loading…
Reference in a new issue