mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +05:30
fix animations
This commit is contained in:
parent
276d611a9f
commit
f15a98175c
@ -21,7 +21,6 @@ class SubscriptionChannelAdapter(private val subscriptions: MutableList<Subscrip
|
||||
val TAG = "SubChannelAdapter"
|
||||
|
||||
private var subscribed = true
|
||||
private var isLoading = false
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return subscriptions.size
|
||||
@ -43,17 +42,16 @@ class SubscriptionChannelAdapter(private val subscriptions: MutableList<Subscrip
|
||||
NavigationHelper.navigateChannel(root.context, subscription.url)
|
||||
}
|
||||
subscriptionSubscribe.setOnClickListener {
|
||||
if (!isLoading) {
|
||||
isLoading = true
|
||||
val channelId = subscription.url?.replace("/channel/", "")!!
|
||||
if (subscribed) {
|
||||
unsubscribe(channelId)
|
||||
subscriptionSubscribe.text = root.context.getString(R.string.unsubscribe)
|
||||
} else {
|
||||
subscribe(channelId)
|
||||
subscriptionSubscribe.text =
|
||||
root.context.getString(R.string.subscribe)
|
||||
}
|
||||
val channelId = subscription.url?.replace("/channel/", "")!!
|
||||
if (subscribed) {
|
||||
subscriptionSubscribe.text = root.context.getString(R.string.subscribe)
|
||||
unsubscribe(channelId)
|
||||
subscribed = false
|
||||
} else {
|
||||
subscriptionSubscribe.text =
|
||||
root.context.getString(R.string.unsubscribe)
|
||||
subscribe(channelId)
|
||||
subscribed = true
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -71,8 +69,6 @@ class SubscriptionChannelAdapter(private val subscriptions: MutableList<Subscrip
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, e.toString())
|
||||
}
|
||||
subscribed = true
|
||||
isLoading = false
|
||||
}
|
||||
}
|
||||
run()
|
||||
@ -90,8 +86,6 @@ class SubscriptionChannelAdapter(private val subscriptions: MutableList<Subscrip
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, e.toString())
|
||||
}
|
||||
subscribed = false
|
||||
isLoading = false
|
||||
}
|
||||
}
|
||||
run()
|
||||
|
@ -78,11 +78,11 @@ class SubscriptionsFragment : Fragment() {
|
||||
fetchChannels(binding.subChannels)
|
||||
loadedSubbedChannels = true
|
||||
}
|
||||
binding.subChannels.visibility = View.VISIBLE
|
||||
binding.subFeed.visibility = View.GONE
|
||||
binding.subChannelsContainer.visibility = View.VISIBLE
|
||||
binding.subFeedContainer.visibility = View.GONE
|
||||
} else {
|
||||
binding.subChannels.visibility = View.GONE
|
||||
binding.subFeed.visibility = View.VISIBLE
|
||||
binding.subChannelsContainer.visibility = View.GONE
|
||||
binding.subFeedContainer.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -95,13 +95,13 @@
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/sub_channels_container"
|
||||
android:visibility="gone"
|
||||
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"
|
||||
@ -110,6 +110,7 @@
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/sub_feed_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:descendantFocusability="blocksDescendants">
|
||||
|
Loading…
x
Reference in New Issue
Block a user