mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-04-20 03:24:50 +00:00
Fixed support tab falsely showing when a creator does not have a polycentric profile.
This commit is contained in:
parent
290d2ceb50
commit
b822078d4b
3 changed files with 31 additions and 10 deletions
|
@ -1,22 +1,20 @@
|
|||
package com.futo.platformplayer.fragment.channel.tab
|
||||
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.futo.platformplayer.R
|
||||
import com.futo.platformplayer.api.media.models.channels.IPlatformChannel
|
||||
import com.futo.platformplayer.fragment.mainactivity.main.PolycentricProfile
|
||||
import com.futo.platformplayer.logging.Logger
|
||||
import com.futo.platformplayer.views.SupportView
|
||||
import com.futo.platformplayer.views.buttons.BigButton
|
||||
|
||||
|
||||
class ChannelMonetizationFragment : Fragment, IChannelTabFragment {
|
||||
private var _supportView: SupportView? = null
|
||||
private var _textMonetization: TextView? = null
|
||||
|
||||
private var _lastChannel: IPlatformChannel? = null;
|
||||
private var _lastPolycentricProfile: PolycentricProfile? = null;
|
||||
|
@ -26,21 +24,22 @@ class ChannelMonetizationFragment : Fragment, IChannelTabFragment {
|
|||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
val view = inflater.inflate(R.layout.fragment_channel_monetization, container, false);
|
||||
_supportView = view.findViewById(R.id.support);
|
||||
_textMonetization = view.findViewById(R.id.text_monetization);
|
||||
|
||||
_lastChannel?.also {
|
||||
setChannel(it);
|
||||
};
|
||||
|
||||
_lastPolycentricProfile?.also {
|
||||
setPolycentricProfile(it, animate = false);
|
||||
}
|
||||
|
||||
_supportView?.visibility = View.GONE;
|
||||
_textMonetization?.visibility = View.GONE;
|
||||
setPolycentricProfile(_lastPolycentricProfile, animate = false);
|
||||
return view;
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView();
|
||||
_supportView = null;
|
||||
_textMonetization = null;
|
||||
}
|
||||
|
||||
override fun setChannel(channel: IPlatformChannel) {
|
||||
|
@ -49,7 +48,15 @@ class ChannelMonetizationFragment : Fragment, IChannelTabFragment {
|
|||
|
||||
fun setPolycentricProfile(polycentricProfile: PolycentricProfile?, animate: Boolean) {
|
||||
_lastPolycentricProfile = polycentricProfile
|
||||
_supportView?.setPolycentricProfile(polycentricProfile, animate)
|
||||
if (polycentricProfile != null) {
|
||||
_supportView?.setPolycentricProfile(polycentricProfile, animate)
|
||||
_supportView?.visibility = View.VISIBLE
|
||||
_textMonetization?.visibility = View.GONE
|
||||
} else {
|
||||
_supportView?.setPolycentricProfile(null, animate)
|
||||
_supportView?.visibility = View.GONE
|
||||
_textMonetization?.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
@ -6,5 +6,18 @@
|
|||
<com.futo.platformplayer.views.SupportView
|
||||
android:id="@+id/support"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_monetization"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/this_creator_has_not_setup_any_monetization_features"
|
||||
android:fontFamily="@font/inter_light"
|
||||
android:textColor="#ACACAC"
|
||||
android:textSize="12dp"
|
||||
android:visibility="gone" />
|
||||
</FrameLayout>
|
|
@ -639,6 +639,7 @@
|
|||
<string name="this_creator_has_not_set_any_support_options_on_harbor_polycentric">This creator has not set any support options on Harbor (Polycentric)</string>
|
||||
<string name="load_more">Load More</string>
|
||||
<string name="stopped_after_requestcount_to_avoid_rate_limit_click_load_more_to_load_more">Stopped after {requestCount} to avoid rate limit, click load more to load more.</string>
|
||||
<string name="this_creator_has_not_setup_any_monetization_features">This creator has not setup any monetization features</string>
|
||||
<string-array name="home_screen_array">
|
||||
<item>Recommendations</item>
|
||||
<item>Subscriptions</item>
|
||||
|
|
Loading…
Add table
Reference in a new issue