diff --git a/app/src/main/java/com/github/libretube/Subscriptions.kt b/app/src/main/java/com/github/libretube/Subscriptions.kt index 6dba0f985..5db11caac 100644 --- a/app/src/main/java/com/github/libretube/Subscriptions.kt +++ b/app/src/main/java/com/github/libretube/Subscriptions.kt @@ -17,6 +17,7 @@ import androidx.recyclerview.widget.RecyclerView import androidx.swiperefreshlayout.widget.SwipeRefreshLayout import com.github.libretube.adapters.SubscriptionAdapter import com.github.libretube.adapters.SubscriptionChannelAdapter +import org.chromium.base.ThreadUtils.runOnUiThread import retrofit2.HttpException import java.io.IOException @@ -67,10 +68,14 @@ class Subscriptions : Fragment() { var toggleSubs = view.findViewById(R.id.toggle_subs) toggleSubs.visibility = View.VISIBLE + var loadedSubbedChannels = false toggleSubs.setOnClickListener { if (!channelRecView.isVisible) { - channelRecView?.layoutManager = GridLayoutManager(context, 4) - fetchChannels(channelRecView) + if (!loadedSubbedChannels) { + channelRecView?.layoutManager = GridLayoutManager(context, 4) + fetchChannels(channelRecView) + loadedSubbedChannels = true + } channelRecView.visibility = View.VISIBLE feedRecView.visibility = View.GONE } diff --git a/app/src/main/res/layout/fragment_subscriptions.xml b/app/src/main/res/layout/fragment_subscriptions.xml index ec0bd7bc6..90f827f8e 100644 --- a/app/src/main/res/layout/fragment_subscriptions.xml +++ b/app/src/main/res/layout/fragment_subscriptions.xml @@ -58,7 +58,7 @@ android:id="@+id/toggle_subs" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_margin="10dp" + android:layout_margin="12dp" android:visibility="gone">