casting: undo android studio auto formatting

This commit is contained in:
Marcus Hanestad 2025-09-04 14:10:56 +02:00
commit 9504c31b36
2 changed files with 19 additions and 19 deletions

View file

@ -987,11 +987,11 @@ class VideoDetailView : ConstraintLayout {
} }
}, },
_chapters?.let { _chapters?.let {
if(it != null && it.size > 0) if(it != null && it.size > 0)
RoundButton(context, R.drawable.ic_list, "Chapters", TAG_CHAPTERS) { RoundButton(context, R.drawable.ic_list, "Chapters", TAG_CHAPTERS) {
showChaptersUI(); showChaptersUI();
} }
else null else null
}, },
if(video?.isLive ?: false) if(video?.isLive ?: false)
RoundButton(context, R.drawable.ic_chat, context.getString(R.string.live_chat), TAG_LIVECHAT) { RoundButton(context, R.drawable.ic_chat, context.getString(R.string.live_chat), TAG_LIVECHAT) {
@ -1036,14 +1036,14 @@ class VideoDetailView : ConstraintLayout {
}; };
} }
else null, else null,
RoundButton(context, R.drawable.ic_share, context.getString(R.string.share), TAG_SHARE) { RoundButton(context, R.drawable.ic_share, context.getString(R.string.share), TAG_SHARE) {
video?.let { video?.let {
Logger.i(TAG, "Share preventPictureInPicture = true"); Logger.i(TAG, "Share preventPictureInPicture = true");
preventPictureInPicture = true; preventPictureInPicture = true;
shareVideo(); shareVideo();
}; };
_slideUpOverlay?.hide(); _slideUpOverlay?.hide();
}, },
if(!isLimitedVersion) if(!isLimitedVersion)
RoundButton(context, R.drawable.ic_screen_share, context.getString(R.string.overlay), TAG_OVERLAY) { RoundButton(context, R.drawable.ic_screen_share, context.getString(R.string.overlay), TAG_OVERLAY) {
this.startPictureInPicture(); this.startPictureInPicture();
@ -2045,8 +2045,8 @@ class VideoDetailView : ConstraintLayout {
private suspend fun castIfAvailable(contentResolver: ContentResolver, video: IPlatformVideoDetails, videoSource: IVideoSource?, audioSource: IAudioSource?, subtitleSource: ISubtitleSource?, resumePositionMs: Long, speed: Double?) { private suspend fun castIfAvailable(contentResolver: ContentResolver, video: IPlatformVideoDetails, videoSource: IVideoSource?, audioSource: IAudioSource?, subtitleSource: ISubtitleSource?, resumePositionMs: Long, speed: Double?) {
try { try {
val plugin = if (videoSource is JSSource) videoSource.getUnderlyingPlugin() val plugin = if (videoSource is JSSource) videoSource.getUnderlyingPlugin()
else if (audioSource is JSSource) audioSource.getUnderlyingPlugin() else if (audioSource is JSSource) audioSource.getUnderlyingPlugin()
else null else null
val startId = plugin?.getUnderlyingPlugin()?.runtimeId val startId = plugin?.getUnderlyingPlugin()?.runtimeId
try { try {
@ -2371,7 +2371,7 @@ class VideoDetailView : ConstraintLayout {
val currentPlaybackRate = if (_isCasting) StateCasting.instance.activeDevice?.speed else _player.getPlaybackRate() val currentPlaybackRate = if (_isCasting) StateCasting.instance.activeDevice?.speed else _player.getPlaybackRate()
val qualityPlaybackSpeedTitle = if (canSetSpeed) SlideUpMenuTitle(this.context).apply { setTitle(context.getString(R.string.playback_rate) + " (${String.format("%.2f", currentPlaybackRate)})"); } else null; val qualityPlaybackSpeedTitle = if (canSetSpeed) SlideUpMenuTitle(this.context).apply { setTitle(context.getString(R.string.playback_rate) + " (${String.format("%.2f", currentPlaybackRate)})"); } else null;
_overlay_quality_selector = SlideUpMenuOverlay(this.context, _overlay_quality_container, context.getString( _overlay_quality_selector = SlideUpMenuOverlay(this.context, _overlay_quality_container, context.getString(
R.string.quality), null, true, R.string.quality), null, true,
qualityPlaybackSpeedTitle, qualityPlaybackSpeedTitle,
if (canSetSpeed) SlideUpMenuButtonList(this.context, null, "playback_rate").apply { if (canSetSpeed) SlideUpMenuButtonList(this.context, null, "playback_rate").apply {
val playbackSpeeds = Settings.instance.playback.getPlaybackSpeeds(); val playbackSpeeds = Settings.instance.playback.getPlaybackSpeeds();
@ -3311,7 +3311,7 @@ class VideoDetailView : ConstraintLayout {
UIDialogs.showGeneralRetryErrorDialog(context, context.getString(R.string.failed_to_load_video_scriptimplementationexception), it, ::fetchVideo, null, fragment); UIDialogs.showGeneralRetryErrorDialog(context, context.getString(R.string.failed_to_load_video_scriptimplementationexception), it, ::fetchVideo, null, fragment);
} else { } else {
StateAnnouncement.instance.registerAnnouncement(video?.id?.value + "_Q_INVALIDVIDEO", context.getString(R.string.invalid_video), context.getString( StateAnnouncement.instance.registerAnnouncement(video?.id?.value + "_Q_INVALIDVIDEO", context.getString(R.string.invalid_video), context.getString(
R.string.there_was_an_invalid_video_in_your_queue_videoname_by_authorname_playback_was_skipped).replace("{videoName}", video?.name ?: "").replace("{authorName}", video?.author?.name ?: ""), AnnouncementType.SESSION) R.string.there_was_an_invalid_video_in_your_queue_videoname_by_authorname_playback_was_skipped).replace("{videoName}", video?.name ?: "").replace("{authorName}", video?.author?.name ?: ""), AnnouncementType.SESSION)
} }
} }
.exception<ScriptAgeException> { .exception<ScriptAgeException> {

View file

@ -40,9 +40,9 @@ class CastButton : androidx.appcompat.widget.AppCompatImageButton {
if (d != null) { if (d != null) {
when (d.connectionState) { when (d.connectionState) {
CastConnectionState.DISCONNECTED -> setColorFilter(activeColor)
CastConnectionState.CONNECTING -> setColorFilter(connectingColor)
CastConnectionState.CONNECTED -> setColorFilter(activeColor) CastConnectionState.CONNECTED -> setColorFilter(activeColor)
CastConnectionState.CONNECTING -> setColorFilter(connectingColor)
CastConnectionState.DISCONNECTED -> setColorFilter(activeColor)
} }
} else { } else {
setColorFilter(inactiveColor); setColorFilter(inactiveColor);