@@ -1036,7 +1036,7 @@ class VideoDetailView : ConstraintLayout {
10361036 }
10371037 else null
10381038 },
1039- if (video?.isLive ? : false )
1039+ if (! Settings .instance.other.hideLiveChat && video?.isLive ? : false )
10401040 RoundButton (context, R .drawable.ic_chat, context.getString(R .string.live_chat), TAG_LIVECHAT ) {
10411041 video?.let {
10421042 try {
@@ -1645,10 +1645,29 @@ class VideoDetailView : ConstraintLayout {
16451645 if (Settings .instance.comments.recommendationsDefault && ! Settings .instance.comments.hideRecommendations) {
16461646 setTabIndex(2 , true )
16471647 } else {
1648- when (Settings .instance.comments.defaultCommentSection) {
1649- 0 -> if (Settings .instance.other.polycentricEnabled) setTabIndex(0 , true ) else setTabIndex(1 , true )
1650- 1 -> setTabIndex(1 , true )
1651- 2 -> setTabIndex(StateMeta .instance.getLastCommentSection(), true )
1648+ val index = when (Settings .instance.comments.defaultCommentSection) {
1649+ 2 -> StateMeta .instance.getLastCommentSection()
1650+ else -> Settings .instance.comments.defaultCommentSection
1651+ }
1652+ when (index) {
1653+ 0 -> {
1654+ if (Settings .instance.other.polycentricEnabled && ! Settings .instance.comments.hidePolycentricComments) {
1655+ setTabIndex(0 , true )
1656+ } else {
1657+ if (Settings .instance.comments.hidePlatformComments) {
1658+ setTabIndex(null , true )
1659+ } else {
1660+ setTabIndex(1 , true )
1661+ }
1662+ }
1663+ }
1664+ 1 -> {
1665+ if (Settings .instance.comments.hidePlatformComments) {
1666+ setTabIndex(null , true )
1667+ } else {
1668+ setTabIndex(1 , true )
1669+ }
1670+ }
16521671 }
16531672 }
16541673 }
@@ -1714,7 +1733,7 @@ class VideoDetailView : ConstraintLayout {
17141733
17151734 _rating .visibility = View .GONE ;
17161735
1717- if (StatePolycentric .instance.enabled && ! (video is LocalVideoDetails )) {
1736+ if (StatePolycentric .instance.enabled && ! (video is LocalVideoDetails ) && ! Settings .instance.other.hidePolycentricLikes ) {
17181737 fragment.lifecycleScope.launch(Dispatchers .IO ) {
17191738 try {
17201739 val queryReferencesResponse = ApiMethods .getQueryReferences(
@@ -1781,34 +1800,40 @@ class VideoDetailView : ConstraintLayout {
17811800 }
17821801 }
17831802
1784- when (video.rating) {
1785- is RatingLikeDislikes -> {
1786- val r = video.rating as RatingLikeDislikes ;
1787- _layoutRating .visibility = View .VISIBLE ;
1803+ if (Settings .instance.other.hidePlatformLikes) {
1804+ _layoutRating .visibility = View .GONE ;
1805+ _imageLikeIcon .visibility = View .GONE ;
1806+ _imageDislikeIcon .visibility = View .GONE ;
1807+ } else {
1808+ when (video.rating) {
1809+ is RatingLikeDislikes -> {
1810+ val r = video.rating as RatingLikeDislikes ;
1811+ _layoutRating .visibility = View .VISIBLE ;
17881812
1789- _textLikes .visibility = View .VISIBLE ;
1790- _imageLikeIcon .visibility = View .VISIBLE ;
1791- _textLikes .text = r.likes.toHumanNumber();
1813+ _textLikes .visibility = View .VISIBLE ;
1814+ _imageLikeIcon .visibility = View .VISIBLE ;
1815+ _textLikes .text = r.likes.toHumanNumber();
17921816
1793- _imageDislikeIcon .visibility = View .VISIBLE ;
1794- _textDislikes .visibility = View .VISIBLE ;
1795- _textDislikes .text = r.dislikes.toHumanNumber();
1796- }
1817+ _imageDislikeIcon .visibility = View .VISIBLE ;
1818+ _textDislikes .visibility = View .VISIBLE ;
1819+ _textDislikes .text = r.dislikes.toHumanNumber();
1820+ }
17971821
1798- is RatingLikes -> {
1799- val r = video.rating as RatingLikes ;
1800- _layoutRating .visibility = View .VISIBLE ;
1822+ is RatingLikes -> {
1823+ val r = video.rating as RatingLikes ;
1824+ _layoutRating .visibility = View .VISIBLE ;
18011825
1802- _textLikes .visibility = View .VISIBLE ;
1803- _imageLikeIcon .visibility = View .VISIBLE ;
1804- _textLikes .text = r.likes.toHumanNumber();
1826+ _textLikes .visibility = View .VISIBLE ;
1827+ _imageLikeIcon .visibility = View .VISIBLE ;
1828+ _textLikes .text = r.likes.toHumanNumber();
18051829
1806- _imageDislikeIcon .visibility = View .GONE ;
1807- _textDislikes .visibility = View .GONE ;
1808- }
1830+ _imageDislikeIcon .visibility = View .GONE ;
1831+ _textDislikes .visibility = View .GONE ;
1832+ }
18091833
1810- else -> {
1811- _layoutRating .visibility = View .GONE ;
1834+ else -> {
1835+ _layoutRating .visibility = View .GONE ;
1836+ }
18121837 }
18131838 }
18141839
@@ -1860,17 +1885,19 @@ class VideoDetailView : ConstraintLayout {
18601885 _liveChat ?.stop();
18611886 _liveChat = null ;
18621887 var gotLive = false ;
1863- if (video.isLive && video.live != null ) {
1864- loadLiveChat(video);
1865- gotLive = true ;
1866- }
1867- if (video.isLive && video.live == null && ! video.video.videoSources.any()) {
1868- startLiveTry(video);
1869- gotLive = true ;
1870- }
1871- if (! gotLive && video is JSVideoDetails && video.hasVODEvents()) {
1872- Logger .i(TAG , " Loading VOD chat" );
1873- loadVODChat(video);
1888+ if (! Settings .instance.other.hideLiveChat) {
1889+ if (video.isLive && video.live != null ) {
1890+ loadLiveChat(video);
1891+ gotLive = true ;
1892+ }
1893+ if (video.isLive && video.live == null && ! video.video.videoSources.any()) {
1894+ startLiveTry(video);
1895+ gotLive = true ;
1896+ }
1897+ if (! gotLive && video is JSVideoDetails && video.hasVODEvents()) {
1898+ Logger .i(TAG , " Loading VOD chat" );
1899+ loadVODChat(video);
1900+ }
18741901 }
18751902
18761903 _player .updateNextPrevious();
@@ -1887,8 +1914,6 @@ class VideoDetailView : ConstraintLayout {
18871914 _buttonSubscribe .visibility = View .VISIBLE
18881915 _buttonMore .visibility = View .VISIBLE
18891916 _buttonPins .visibility = View .VISIBLE
1890- _layoutRating .visibility = View .VISIBLE
1891- _rating .visibility = View .VISIBLE ;
18921917 _layoutChangeBottomSection .visibility = View .VISIBLE
18931918 }
18941919
@@ -3043,6 +3068,12 @@ class VideoDetailView : ConstraintLayout {
30433068 return
30443069 }
30453070
3071+ val polycentricCommentsHidden = Settings .instance.comments.hidePolycentricComments || ! Settings .instance.other.polycentricEnabled
3072+ _buttonPolycentric .visibility = if (polycentricCommentsHidden) View .GONE else View .VISIBLE
3073+
3074+ val platformCommentsHidden = Settings .instance.comments.hidePlatformComments
3075+ _buttonPlatform .visibility = if (platformCommentsHidden) View .GONE else View .VISIBLE
3076+
30463077 val recommendationsHidden = Settings .instance.comments.hideRecommendations
30473078 _buttonRecommended .visibility = if (recommendationsHidden) View .GONE else View .VISIBLE
30483079
@@ -3633,4 +3664,4 @@ class VideoDetailView : ConstraintLayout {
36333664 private val _buttonPinStore = FragmentedStorage .get<StringArrayStorage >(" videoPinnedButtons" );
36343665 private var _lastOfflinePlaybackToastTime : Long = 0
36353666 }
3636- }
3667+ }
0 commit comments