mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 06:10:31 +05:30
Added Sub Toggle
This commit is contained in:
parent
d9b5c18cac
commit
229fd46675
@ -52,7 +52,7 @@ class Subscriptions : Fragment() {
|
||||
progressBar.visibility=View.VISIBLE
|
||||
|
||||
var channelRecView = view.findViewById<RecyclerView>(R.id.sub_channels)
|
||||
channelRecView?.layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)
|
||||
channelRecView?.layoutManager = GridLayoutManager(context, 4)
|
||||
fetchChannels(channelRecView)
|
||||
|
||||
var feedRecView = view.findViewById<RecyclerView>(R.id.sub_feed)
|
||||
@ -66,6 +66,12 @@ class Subscriptions : Fragment() {
|
||||
fetchFeed(feedRecView, progressBar, view)
|
||||
}
|
||||
|
||||
var toggleSubs = view.findViewById<RelativeLayout>(R.id.toggle_subs)
|
||||
toggleSubs.setOnClickListener {
|
||||
channelRecView.visibility = if (channelRecView.visibility == View.GONE) View.VISIBLE else View.GONE
|
||||
feedRecView.visibility = if (feedRecView.visibility == View.GONE) View.VISIBLE else View.GONE
|
||||
}
|
||||
|
||||
val scrollView = view.findViewById<ScrollView>(R.id.scrollview_sub)
|
||||
scrollView.viewTreeObserver
|
||||
.addOnScrollChangedListener {
|
||||
|
@ -9,8 +9,8 @@
|
||||
>
|
||||
<de.hdodenhof.circleimageview.CircleImageView
|
||||
android:id="@+id/subscription_channel_image"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="4dp"/>
|
||||
<TextView
|
||||
|
@ -54,12 +54,34 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/toggle_subs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/subscriptions"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:src="@drawable/ic_arrow_down"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:descendantFocusability="blocksDescendants">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:visibility="gone"
|
||||
android:id="@+id/sub_channels"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
Loading…
Reference in New Issue
Block a user