Added Sub Toggle

This commit is contained in:
Bnyro 2022-05-14 18:14:53 +02:00
parent d9b5c18cac
commit 229fd46675
3 changed files with 31 additions and 3 deletions

View File

@ -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 {

View File

@ -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

View File

@ -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"