Merge branch 'master' of gitlab.futo.org:videostreaming/grayjay

This commit is contained in:
Kelvin 2023-11-09 19:49:51 +01:00
commit fa7f1b11f3
3 changed files with 31 additions and 10 deletions

View file

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

View file

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

View file

@ -643,6 +643,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>