From b42a476116b4d6748629d921277cbeae20c1b822 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 12:57:45 -0600 Subject: [PATCH 01/50] Hide DeviceType from IDE auto completion --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt index aeb15944fc1..c14a1865394 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt @@ -6,6 +6,11 @@ internal expect object DeviceInfo { fun getLayoutPreference(): Int } -enum class DeviceType { +// HIDDEN prevents this from showing up in auto completion at all. +@Deprecated( + message = "Use DeviceLayout.isLayout() instead", + level = DeprecationLevel.HIDDEN, +) +internal enum class DeviceType { PHONE, TV, EMULATOR, COMPUTER } From edf8249d0fb75f4223ad46a615cec21fa6f17f31 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:00:17 -0600 Subject: [PATCH 02/50] Update --- .../lagradost/cloudstream4/utils/DeviceInfo.kt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt index c14a1865394..706c8f9f67e 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt @@ -1,12 +1,7 @@ package com.lagradost.cloudstream4.utils -internal expect object DeviceInfo { - fun getDeviceType(): DeviceType - fun isLandscape(): Boolean - fun getLayoutPreference(): Int -} - -// HIDDEN prevents this from showing up in auto completion at all. +// DeviceType is intentionally hidden from IDE autocomplete and external callers. +// Use DeviceLayout.isLayout() with DeviceLayout.PHONE, DeviceLayout.TV etc. instead. @Deprecated( message = "Use DeviceLayout.isLayout() instead", level = DeprecationLevel.HIDDEN, @@ -14,3 +9,9 @@ internal expect object DeviceInfo { internal enum class DeviceType { PHONE, TV, EMULATOR, COMPUTER } + +internal expect object DeviceInfo { + fun getDeviceType(): DeviceType + fun isLandscape(): Boolean + fun getLayoutPreference(): Int +} From 36f37cc4c93887380b9aecc34257bd7477b959dd Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:08:54 -0600 Subject: [PATCH 03/50] Try --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt index 706c8f9f67e..c3c4943c6f1 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt @@ -11,6 +11,7 @@ internal enum class DeviceType { } internal expect object DeviceInfo { + @Suppress("DEPRECATION", "DEPRECATION_ERROR") fun getDeviceType(): DeviceType fun isLandscape(): Boolean fun getLayoutPreference(): Int From 380d18f5cf9cb3871092bb306639b295c1623621 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:11:29 -0600 Subject: [PATCH 04/50] Update --- .../com/lagradost/cloudstream4/utils/DeviceInfo.android.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt b/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt index 345bc645ebe..701065f8d30 100644 --- a/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt +++ b/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt @@ -10,6 +10,7 @@ import com.lagradost.cloudstream4.preferences.PreferenceDefaults import com.lagradost.cloudstream4.preferences.PreferenceKeys internal actual object DeviceInfo { + @Suppress("DEPRECATION", "DEPRECATION_ERROR") actual fun getDeviceType(): DeviceType { val context = getContext() as? Context ?: return DeviceType.PHONE val uiModeManager = context.getSystemService(Context.UI_MODE_SERVICE) as UiModeManager? From c57d64f4d2ae82e82f223db199ec3beda9593aca Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:11:47 -0600 Subject: [PATCH 05/50] Update --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt b/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt index 93ffcdd0255..25237685079 100644 --- a/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt +++ b/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt @@ -3,6 +3,7 @@ package com.lagradost.cloudstream4.utils import java.awt.Toolkit internal actual object DeviceInfo { + @Suppress("DEPRECATION", "DEPRECATION_ERROR") actual fun getDeviceType(): DeviceType = DeviceType.COMPUTER actual fun isLandscape(): Boolean { From e258f99d54dc066e71513ce12deed3204b475179 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:12:38 -0600 Subject: [PATCH 06/50] Update --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt index 6d82b904780..b16abcb5286 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt @@ -36,6 +36,7 @@ object DeviceLayout { layoutId = resolveLayout() } + @Suppress("DEPRECATION", "DEPRECATION_ERROR") private fun resolveLayout(): Int { return when (DeviceInfo.getLayoutPreference()) { -1 -> when (DeviceInfo.getDeviceType()) { From 1b14d38fa029e7354447e1f5e7283f292827d4ae Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:18:59 -0600 Subject: [PATCH 07/50] Try --- .../lagradost/cloudstream4/utils/DeviceInfo.kt | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt index c3c4943c6f1..630a3a38d7a 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt @@ -1,17 +1,10 @@ package com.lagradost.cloudstream4.utils -// DeviceType is intentionally hidden from IDE autocomplete and external callers. -// Use DeviceLayout.isLayout() with DeviceLayout.PHONE, DeviceLayout.TV etc. instead. -@Deprecated( - message = "Use DeviceLayout.isLayout() instead", - level = DeprecationLevel.HIDDEN, -) -internal enum class DeviceType { - PHONE, TV, EMULATOR, COMPUTER -} - internal expect object DeviceInfo { - @Suppress("DEPRECATION", "DEPRECATION_ERROR") + private enum class DeviceType { + PHONE, TV, EMULATOR, COMPUTER + } + fun getDeviceType(): DeviceType fun isLandscape(): Boolean fun getLayoutPreference(): Int From 3509c081e02cc3937f6627d8ac5c0f789dfd9c51 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:20:54 -0600 Subject: [PATCH 08/50] Rm --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt index 630a3a38d7a..953ed112020 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt @@ -1,11 +1,7 @@ package com.lagradost.cloudstream4.utils internal expect object DeviceInfo { - private enum class DeviceType { - PHONE, TV, EMULATOR, COMPUTER - } - - fun getDeviceType(): DeviceType + fun getDeviceType(): Int fun isLandscape(): Boolean fun getLayoutPreference(): Int } From f8c9feb0376d3c784bb6c10b49929c701ba6dee8 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:21:31 -0600 Subject: [PATCH 09/50] - --- .../com/lagradost/cloudstream4/utils/DeviceLayout.kt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt index b16abcb5286..f11c03d4522 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt @@ -36,15 +36,9 @@ object DeviceLayout { layoutId = resolveLayout() } - @Suppress("DEPRECATION", "DEPRECATION_ERROR") private fun resolveLayout(): Int { return when (DeviceInfo.getLayoutPreference()) { - -1 -> when (DeviceInfo.getDeviceType()) { - DeviceType.COMPUTER -> COMPUTER - DeviceType.EMULATOR -> EMULATOR - DeviceType.PHONE -> PHONE - DeviceType.TV -> TV - } + -1 -> DeviceInfo.getDeviceType() 0 -> PHONE 1 -> TV 2 -> EMULATOR From 8ed00e3329703c43cab2c63e8f56d8621ec7b44e Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:22:01 -0600 Subject: [PATCH 10/50] - --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt b/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt index 25237685079..4ef07b1f1b1 100644 --- a/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt +++ b/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt @@ -3,8 +3,7 @@ package com.lagradost.cloudstream4.utils import java.awt.Toolkit internal actual object DeviceInfo { - @Suppress("DEPRECATION", "DEPRECATION_ERROR") - actual fun getDeviceType(): DeviceType = DeviceType.COMPUTER + actual fun getDeviceType(): Int = DeviceLayout.COMPUTER actual fun isLandscape(): Boolean { return try { From b66d3812ab8f5d776fdc616826780a57f5f14097 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:22:58 -0600 Subject: [PATCH 11/50] Update --- .../lagradost/cloudstream4/utils/DeviceInfo.android.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt b/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt index 701065f8d30..11dd5496405 100644 --- a/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt +++ b/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt @@ -11,8 +11,8 @@ import com.lagradost.cloudstream4.preferences.PreferenceKeys internal actual object DeviceInfo { @Suppress("DEPRECATION", "DEPRECATION_ERROR") - actual fun getDeviceType(): DeviceType { - val context = getContext() as? Context ?: return DeviceType.PHONE + actual fun getDeviceType(): Int { + val context = getContext() as? Context ?: return DeviceLayout.PHONE val uiModeManager = context.getSystemService(Context.UI_MODE_SERVICE) as UiModeManager? val isTelevisionMode = uiModeManager?.currentModeType == Configuration.UI_MODE_TYPE_TELEVISION val model = Build.MODEL.lowercase() @@ -21,8 +21,8 @@ internal actual object DeviceInfo { || Build.MODEL.contains("AFT") // AFT = Fire TV || model.contains("firestick") || model.contains("fire tv") - || model.contains("chromecast") -> DeviceType.TV - else -> DeviceType.PHONE + || model.contains("chromecast") -> DeviceLayout.TV + else -> DeviceLayout.PHONE } } From 8a28fbc98bcc35b8476d36b8d400de5180210276 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:23:29 -0600 Subject: [PATCH 12/50] - --- .../com/lagradost/cloudstream4/utils/DeviceInfo.android.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt b/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt index 11dd5496405..7d458b71b30 100644 --- a/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt +++ b/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt @@ -10,7 +10,6 @@ import com.lagradost.cloudstream4.preferences.PreferenceDefaults import com.lagradost.cloudstream4.preferences.PreferenceKeys internal actual object DeviceInfo { - @Suppress("DEPRECATION", "DEPRECATION_ERROR") actual fun getDeviceType(): Int { val context = getContext() as? Context ?: return DeviceLayout.PHONE val uiModeManager = context.getSystemService(Context.UI_MODE_SERVICE) as UiModeManager? From 05ea0df10460a2a1f62b9062cbf32f25e75ee102 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:25:20 -0600 Subject: [PATCH 13/50] rename --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt b/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt index 4ef07b1f1b1..4ed606c3d22 100644 --- a/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt +++ b/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt @@ -3,7 +3,7 @@ package com.lagradost.cloudstream4.utils import java.awt.Toolkit internal actual object DeviceInfo { - actual fun getDeviceType(): Int = DeviceLayout.COMPUTER + actual fun getDeviceLayout(): Int = DeviceLayout.COMPUTER actual fun isLandscape(): Boolean { return try { From e5637edc5d05588e4201e26acd84b02d3f6b39b0 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:25:44 -0600 Subject: [PATCH 14/50] - --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt index f11c03d4522..fc991a41c2f 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt @@ -38,7 +38,7 @@ object DeviceLayout { private fun resolveLayout(): Int { return when (DeviceInfo.getLayoutPreference()) { - -1 -> DeviceInfo.getDeviceType() + -1 -> DeviceInfo.getDeviceLayout() 0 -> PHONE 1 -> TV 2 -> EMULATOR From 9e360788c27d2864dec80a8e38b9c244deb941c3 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:26:06 -0600 Subject: [PATCH 15/50] - --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt index 953ed112020..6a344bcb693 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt @@ -1,7 +1,7 @@ package com.lagradost.cloudstream4.utils internal expect object DeviceInfo { - fun getDeviceType(): Int + fun getDeviceLayout(): Int fun isLandscape(): Boolean fun getLayoutPreference(): Int } From 2fec244e093141fe8cef690d677e2be486bb2945 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:26:31 -0600 Subject: [PATCH 16/50] - --- .../com/lagradost/cloudstream4/utils/DeviceInfo.android.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt b/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt index 7d458b71b30..aebdfec92ac 100644 --- a/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt +++ b/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt @@ -10,7 +10,7 @@ import com.lagradost.cloudstream4.preferences.PreferenceDefaults import com.lagradost.cloudstream4.preferences.PreferenceKeys internal actual object DeviceInfo { - actual fun getDeviceType(): Int { + actual fun getDeviceLayout(): Int { val context = getContext() as? Context ?: return DeviceLayout.PHONE val uiModeManager = context.getSystemService(Context.UI_MODE_SERVICE) as UiModeManager? val isTelevisionMode = uiModeManager?.currentModeType == Configuration.UI_MODE_TYPE_TELEVISION From e3aaaeae64802b7d2b83808daae801f200daa820 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:33:13 -0600 Subject: [PATCH 17/50] Update --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt index fc991a41c2f..a66aa5d245b 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt @@ -1,5 +1,7 @@ package com.lagradost.cloudstream4.utils +import com.lagradost.cloudstream4.preferences.PreferenceDefaults + object DeviceLayout { const val PHONE: Int = 0b00001 const val TV: Int = 0b00010 @@ -38,7 +40,7 @@ object DeviceLayout { private fun resolveLayout(): Int { return when (DeviceInfo.getLayoutPreference()) { - -1 -> DeviceInfo.getDeviceLayout() + PreferenceDefaults.APP_LAYOUT -> DeviceInfo.getDeviceLayout() 0 -> PHONE 1 -> TV 2 -> EMULATOR From 44810bc02918c2cf12aacfd131fef564acc6c506 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:34:18 -0600 Subject: [PATCH 18/50] Update --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt b/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt index 4ed606c3d22..15e77f9c8ef 100644 --- a/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt +++ b/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt @@ -1,5 +1,6 @@ package com.lagradost.cloudstream4.utils +import com.lagradost.cloudstream4.preferences.PreferenceDefaults import java.awt.Toolkit internal actual object DeviceInfo { @@ -14,5 +15,5 @@ internal actual object DeviceInfo { } } - actual fun getLayoutPreference(): Int = -1 + actual fun getLayoutPreference(): Int = PreferenceDefaults.APP_LAYOUT } From 1f95b3cdbabb120a193b2faaa8c732088f6c7779 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:40:02 -0600 Subject: [PATCH 19/50] Try --- .../lagradost/cloudstream4/utils/DeviceLayout.kt | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt index a66aa5d245b..eb152831879 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt @@ -3,10 +3,16 @@ package com.lagradost.cloudstream4.utils import com.lagradost.cloudstream4.preferences.PreferenceDefaults object DeviceLayout { - const val PHONE: Int = 0b00001 - const val TV: Int = 0b00010 - const val EMULATOR: Int = 0b00100 - const val COMPUTER: Int = 0b01000 + value class Layout(val value: Int) { + companion object { + val PHONE = Layout(0b00001) + val TV = Layout(0b00010) + val EMULATOR = Layout(0b00100) + val COMPUTER = Layout(0b01000) + } + + infix fun or(other: Layout) = Layout(value or other.value) + } private var layoutId = -1 // TODO when fully on Compose @@ -21,7 +27,7 @@ object DeviceLayout { * * Valid flags are: PHONE, TV, EMULATOR, or COMPUTER */ - fun isLayout(flags: Int): Boolean = (layoutId and flags) != 0 + fun isLayout(flags: Layout): Boolean = (layoutId and flags.value) != 0 /** Returns true if the current orientation is landscape. */ fun isLandscape(): Boolean = From 0f065e1b1a14f4df307745be882fd0563edb1e37 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:40:38 -0600 Subject: [PATCH 20/50] Update --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt b/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt index 15e77f9c8ef..278dd64028b 100644 --- a/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt +++ b/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt @@ -4,7 +4,7 @@ import com.lagradost.cloudstream4.preferences.PreferenceDefaults import java.awt.Toolkit internal actual object DeviceInfo { - actual fun getDeviceLayout(): Int = DeviceLayout.COMPUTER + actual fun getDeviceLayout(): DeviceLayout.Layout = DeviceLayout.COMPUTER actual fun isLandscape(): Boolean { return try { From 9f05a17872d20e696a8c29617f1aca42da7b77c1 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:41:00 -0600 Subject: [PATCH 21/50] Update --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt index 6a344bcb693..a37b059b2cd 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt @@ -1,7 +1,7 @@ package com.lagradost.cloudstream4.utils internal expect object DeviceInfo { - fun getDeviceLayout(): Int + fun getDeviceLayout(): DeviceLayout.Layout fun isLandscape(): Boolean fun getLayoutPreference(): Int } From a732d13cb1ee74c94ec7c51a3731f320d9dc8ae7 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:41:24 -0600 Subject: [PATCH 22/50] Update --- .../com/lagradost/cloudstream4/utils/DeviceInfo.android.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt b/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt index aebdfec92ac..e0b6bd4f065 100644 --- a/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt +++ b/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt @@ -10,7 +10,7 @@ import com.lagradost.cloudstream4.preferences.PreferenceDefaults import com.lagradost.cloudstream4.preferences.PreferenceKeys internal actual object DeviceInfo { - actual fun getDeviceLayout(): Int { + actual fun getDeviceLayout(): DeviceLayout.Layout { val context = getContext() as? Context ?: return DeviceLayout.PHONE val uiModeManager = context.getSystemService(Context.UI_MODE_SERVICE) as UiModeManager? val isTelevisionMode = uiModeManager?.currentModeType == Configuration.UI_MODE_TYPE_TELEVISION From 4042abaf1b4b9aa419c06db5fbec63f67d4a9536 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:43:05 -0600 Subject: [PATCH 23/50] Update --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt index eb152831879..5c9f16995d2 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt @@ -14,7 +14,7 @@ object DeviceLayout { infix fun or(other: Layout) = Layout(value or other.value) } - private var layoutId = -1 + private var layoutId = Layout(-1) // TODO when fully on Compose // private val layoutId: Int get() = resolveLayout() @@ -27,7 +27,7 @@ object DeviceLayout { * * Valid flags are: PHONE, TV, EMULATOR, or COMPUTER */ - fun isLayout(flags: Layout): Boolean = (layoutId and flags.value) != 0 + fun isLayout(flags: Layout): Boolean = (layoutId.value and flags.value) != 0 /** Returns true if the current orientation is landscape. */ fun isLandscape(): Boolean = @@ -44,7 +44,7 @@ object DeviceLayout { layoutId = resolveLayout() } - private fun resolveLayout(): Int { + private fun resolveLayout(): Layout { return when (DeviceInfo.getLayoutPreference()) { PreferenceDefaults.APP_LAYOUT -> DeviceInfo.getDeviceLayout() 0 -> PHONE From 5ca7456da7f9e3b6a3726c3b2356ab09f6163cda Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:45:03 -0600 Subject: [PATCH 24/50] Update --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt index 5c9f16995d2..dfd859bb162 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt @@ -14,6 +14,11 @@ object DeviceLayout { infix fun or(other: Layout) = Layout(value or other.value) } + val PHONE = Layout.PHONE + val TV = Layout.TV + val EMULATOR = Layout.EMULATOR + val COMPUTER = Layout.COMPUTER + private var layoutId = Layout(-1) // TODO when fully on Compose // private val layoutId: Int get() = resolveLayout() From 052580c41084ce6ad6b3e171dfa833bbd2ffe9c7 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:46:11 -0600 Subject: [PATCH 25/50] Update --- .../com/lagradost/cloudstream3/ui/settings/Globals.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/Globals.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/Globals.kt index 84bc29ee703..27aa6523f50 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/Globals.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/Globals.kt @@ -6,9 +6,9 @@ import com.lagradost.cloudstream4.utils.DeviceLayout object Globals { var beneneCount = 0 - const val PHONE: Int = DeviceLayout.PHONE - const val TV: Int = DeviceLayout.TV - const val EMULATOR: Int = DeviceLayout.EMULATOR + val PHONE = DeviceLayout.PHONE + val TV = DeviceLayout.TV + val EMULATOR = DeviceLayout.EMULATOR fun Context.updateTv() { DeviceLayout.update() @@ -16,5 +16,5 @@ object Globals { fun isLandscape(): Boolean = DeviceLayout.isLandscape() - fun isLayout(flags: Int): Boolean = DeviceLayout.isLayout(flags) + fun isLayout(flags: DeviceLayout.Layout): Boolean = DeviceLayout.isLayout(flags) } From 0261d36e6192539759e84792ccf031a07f2ef0d8 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 13:47:15 -0600 Subject: [PATCH 26/50] Update --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt index dfd859bb162..409389364bf 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt @@ -3,6 +3,7 @@ package com.lagradost.cloudstream4.utils import com.lagradost.cloudstream4.preferences.PreferenceDefaults object DeviceLayout { + @JvmInline value class Layout(val value: Int) { companion object { val PHONE = Layout(0b00001) From dea04ef3f97bfe15b81b981cf45cc1f3e17e4f4a Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 14:00:41 -0600 Subject: [PATCH 27/50] Update SettingsFragment.kt --- .../lagradost/cloudstream3/ui/settings/SettingsFragment.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt index 8db49cf77b8..ea1d7767194 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt @@ -20,6 +20,7 @@ import com.lagradost.cloudstream3.ui.settings.Globals.isLandscape import com.lagradost.cloudstream3.ui.settings.Globals.isLayout import com.lagradost.cloudstream3.utils.UIHelper.fixSystemBarsPadding import com.lagradost.cloudstream3.utils.UIHelper.toPx +import com.lagradost.cloudstream4.utils.DeviceLayout import java.io.File // Moved to com.lagradost.cloudstream3.ui.compose.settings.SettingsFragment @@ -39,7 +40,7 @@ class SettingsFragment { /** * Hide many Preferences on selected layouts. **/ - fun PreferenceFragmentCompat?.hidePrefs(ids: List, layoutFlags: Int) { + fun PreferenceFragmentCompat?.hidePrefs(ids: List, layoutFlags: DeviceLayout.Layout) { if (this == null) return try { @@ -58,7 +59,7 @@ class SettingsFragment { * [hideOn] is usually followed by some actions on the preference which are mostly * unnecessary when the preference is disabled for the said layout thus returning null. **/ - fun Preference?.hideOn(layoutFlags: Int): Preference? { + fun Preference?.hideOn(layoutFlags: DeviceLayout.Layout): Preference? { if (this == null) return null this.isVisible = !isLayout(layoutFlags) return if(this.isVisible) this else null From df0c17610d2a29784e83270f64dff3d4b9fa0b3b Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 15:25:03 -0600 Subject: [PATCH 28/50] Add import --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt index 409389364bf..e06d226cc88 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt @@ -1,6 +1,7 @@ package com.lagradost.cloudstream4.utils import com.lagradost.cloudstream4.preferences.PreferenceDefaults +import kotlin.jvm.JvmInline object DeviceLayout { @JvmInline From 3978245c19e7a3735cf0da327d26e027d68fd798 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 15:41:18 -0600 Subject: [PATCH 29/50] Add --- composeApp/build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index e962c78e21f..b1a75ea38f5 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -19,6 +19,7 @@ kotlin { } jvm() + mingwX64() compilerOptions { freeCompilerArgs.add("-Xexpect-actual-classes") From 4f35e95cbf9543671c53e57f6b13455618075ca6 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 15:51:25 -0600 Subject: [PATCH 30/50] - --- composeApp/build.gradle.kts | 1 - 1 file changed, 1 deletion(-) diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index b1a75ea38f5..e962c78e21f 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -19,7 +19,6 @@ kotlin { } jvm() - mingwX64() compilerOptions { freeCompilerArgs.add("-Xexpect-actual-classes") From 050daf6d21079b016b249c6a66ddf7aa76744d25 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 15:58:21 -0600 Subject: [PATCH 31/50] Add comment --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt index e06d226cc88..79e0d283c2c 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt @@ -4,7 +4,7 @@ import com.lagradost.cloudstream4.preferences.PreferenceDefaults import kotlin.jvm.JvmInline object DeviceLayout { - @JvmInline + @JvmInline // This still works but bas no affect on non-JVM targets value class Layout(val value: Int) { companion object { val PHONE = Layout(0b00001) From 534ddfd0affaea023c8067aa7ba4ad7d2939a884 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 15:59:52 -0600 Subject: [PATCH 32/50] Update --- .../com/lagradost/cloudstream4/utils/DeviceLayout.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt index 79e0d283c2c..ab8a4c634f0 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt @@ -4,6 +4,11 @@ import com.lagradost.cloudstream4.preferences.PreferenceDefaults import kotlin.jvm.JvmInline object DeviceLayout { + val PHONE = Layout.PHONE + val TV = Layout.TV + val EMULATOR = Layout.EMULATOR + val COMPUTER = Layout.COMPUTER + @JvmInline // This still works but bas no affect on non-JVM targets value class Layout(val value: Int) { companion object { @@ -16,12 +21,7 @@ object DeviceLayout { infix fun or(other: Layout) = Layout(value or other.value) } - val PHONE = Layout.PHONE - val TV = Layout.TV - val EMULATOR = Layout.EMULATOR - val COMPUTER = Layout.COMPUTER - - private var layoutId = Layout(-1) + private var layoutId = Layout(PreferenceDefaults.APP_LAYOUT) // TODO when fully on Compose // private val layoutId: Int get() = resolveLayout() From e40c6e3bee2604ec42263750aa882e70c855ac5a Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 16:07:51 -0600 Subject: [PATCH 33/50] Update --- .../cloudstream4/utils/DeviceLayout.kt | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt index ab8a4c634f0..e9f97e3b2c4 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt @@ -4,23 +4,16 @@ import com.lagradost.cloudstream4.preferences.PreferenceDefaults import kotlin.jvm.JvmInline object DeviceLayout { - val PHONE = Layout.PHONE - val TV = Layout.TV - val EMULATOR = Layout.EMULATOR - val COMPUTER = Layout.COMPUTER - @JvmInline // This still works but bas no affect on non-JVM targets value class Layout(val value: Int) { - companion object { - val PHONE = Layout(0b00001) - val TV = Layout(0b00010) - val EMULATOR = Layout(0b00100) - val COMPUTER = Layout(0b01000) - } - infix fun or(other: Layout) = Layout(value or other.value) } + val PHONE = Layout(0b00001) + val TV = Layout(0b00010) + val EMULATOR = Layout(0b00100) + val COMPUTER = Layout(0b01000) + private var layoutId = Layout(PreferenceDefaults.APP_LAYOUT) // TODO when fully on Compose // private val layoutId: Int get() = resolveLayout() From 572d47de995eda91216f567356afca939601b414 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 16:11:30 -0600 Subject: [PATCH 34/50] Order --- .../com/lagradost/cloudstream4/utils/DeviceLayout.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt index e9f97e3b2c4..50a3f37adb5 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt @@ -4,11 +4,6 @@ import com.lagradost.cloudstream4.preferences.PreferenceDefaults import kotlin.jvm.JvmInline object DeviceLayout { - @JvmInline // This still works but bas no affect on non-JVM targets - value class Layout(val value: Int) { - infix fun or(other: Layout) = Layout(value or other.value) - } - val PHONE = Layout(0b00001) val TV = Layout(0b00010) val EMULATOR = Layout(0b00100) @@ -18,6 +13,11 @@ object DeviceLayout { // TODO when fully on Compose // private val layoutId: Int get() = resolveLayout() + @JvmInline // This still works but bas no affect on non-JVM targets + value class Layout(val value: Int) { + infix fun or(other: Layout) = Layout(value or other.value) + } + /** * Returns true if the layout is any of the flags, so * so isLayout(TV or EMULATOR) is a valid statement From 0455d469b28d268cd602384460db497baee55142 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 16:15:15 -0600 Subject: [PATCH 35/50] Update --- .../com/lagradost/cloudstream4/utils/DeviceLayout.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt index 50a3f37adb5..e9f97e3b2c4 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt @@ -4,6 +4,11 @@ import com.lagradost.cloudstream4.preferences.PreferenceDefaults import kotlin.jvm.JvmInline object DeviceLayout { + @JvmInline // This still works but bas no affect on non-JVM targets + value class Layout(val value: Int) { + infix fun or(other: Layout) = Layout(value or other.value) + } + val PHONE = Layout(0b00001) val TV = Layout(0b00010) val EMULATOR = Layout(0b00100) @@ -13,11 +18,6 @@ object DeviceLayout { // TODO when fully on Compose // private val layoutId: Int get() = resolveLayout() - @JvmInline // This still works but bas no affect on non-JVM targets - value class Layout(val value: Int) { - infix fun or(other: Layout) = Layout(value or other.value) - } - /** * Returns true if the layout is any of the flags, so * so isLayout(TV or EMULATOR) is a valid statement From 47b8d7ccbbe985a54ef6caf20ab3d3d2c1f169af Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 16:21:52 -0600 Subject: [PATCH 36/50] Typo --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt index e9f97e3b2c4..636865ec2d5 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt @@ -4,7 +4,7 @@ import com.lagradost.cloudstream4.preferences.PreferenceDefaults import kotlin.jvm.JvmInline object DeviceLayout { - @JvmInline // This still works but bas no affect on non-JVM targets + @JvmInline // This still works but has no affect on non-JVM targets value class Layout(val value: Int) { infix fun or(other: Layout) = Layout(value or other.value) } From 1ca1693ecef356a142409ae0ac01ca99eaecddf1 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 16:26:30 -0600 Subject: [PATCH 37/50] back compat --- .../com/lagradost/cloudstream3/ui/settings/Globals.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/Globals.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/Globals.kt index 27aa6523f50..27faa891307 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/Globals.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/Globals.kt @@ -6,9 +6,9 @@ import com.lagradost.cloudstream4.utils.DeviceLayout object Globals { var beneneCount = 0 - val PHONE = DeviceLayout.PHONE - val TV = DeviceLayout.TV - val EMULATOR = DeviceLayout.EMULATOR + val PHONE = DeviceLayout.PHONE.value + val TV = DeviceLayout.TV.value + val EMULATOR = DeviceLayout.EMULATOR.value fun Context.updateTv() { DeviceLayout.update() @@ -16,5 +16,5 @@ object Globals { fun isLandscape(): Boolean = DeviceLayout.isLandscape() - fun isLayout(flags: DeviceLayout.Layout): Boolean = DeviceLayout.isLayout(flags) + fun isLayout(flags: Int): Boolean = DeviceLayout.isLayout(DeviceLayout.Layout(flags)) } From 6bb49330a9278387890e239e5098e48f09f74be1 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 16:27:09 -0600 Subject: [PATCH 38/50] - --- .../lagradost/cloudstream3/ui/settings/SettingsFragment.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt index ea1d7767194..8db49cf77b8 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt @@ -20,7 +20,6 @@ import com.lagradost.cloudstream3.ui.settings.Globals.isLandscape import com.lagradost.cloudstream3.ui.settings.Globals.isLayout import com.lagradost.cloudstream3.utils.UIHelper.fixSystemBarsPadding import com.lagradost.cloudstream3.utils.UIHelper.toPx -import com.lagradost.cloudstream4.utils.DeviceLayout import java.io.File // Moved to com.lagradost.cloudstream3.ui.compose.settings.SettingsFragment @@ -40,7 +39,7 @@ class SettingsFragment { /** * Hide many Preferences on selected layouts. **/ - fun PreferenceFragmentCompat?.hidePrefs(ids: List, layoutFlags: DeviceLayout.Layout) { + fun PreferenceFragmentCompat?.hidePrefs(ids: List, layoutFlags: Int) { if (this == null) return try { @@ -59,7 +58,7 @@ class SettingsFragment { * [hideOn] is usually followed by some actions on the preference which are mostly * unnecessary when the preference is disabled for the said layout thus returning null. **/ - fun Preference?.hideOn(layoutFlags: DeviceLayout.Layout): Preference? { + fun Preference?.hideOn(layoutFlags: Int): Preference? { if (this == null) return null this.isVisible = !isLayout(layoutFlags) return if(this.isVisible) this else null From 94f19dd7cbe227654c3bb20594018513314c5197 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 16:27:41 -0600 Subject: [PATCH 39/50] Update --- .../java/com/lagradost/cloudstream3/ui/settings/Globals.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/Globals.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/Globals.kt index 27faa891307..6dbea4f003e 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/Globals.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/Globals.kt @@ -6,9 +6,9 @@ import com.lagradost.cloudstream4.utils.DeviceLayout object Globals { var beneneCount = 0 - val PHONE = DeviceLayout.PHONE.value - val TV = DeviceLayout.TV.value - val EMULATOR = DeviceLayout.EMULATOR.value + val PHONE: Int = DeviceLayout.PHONE.value + val TV: Int = DeviceLayout.TV.value + val EMULATOR: Int = DeviceLayout.EMULATOR.value fun Context.updateTv() { DeviceLayout.update() From 1df9f154096be94c3738b988878f499ff4238a68 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 16:33:41 -0600 Subject: [PATCH 40/50] Comment --- .../java/com/lagradost/cloudstream3/ui/settings/Globals.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/Globals.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/Globals.kt index 6dbea4f003e..69f397e96c6 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/Globals.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/Globals.kt @@ -3,6 +3,9 @@ package com.lagradost.cloudstream3.ui.settings import android.content.Context import com.lagradost.cloudstream4.utils.DeviceLayout +// TODO: remove and use DeviceLayout directly. +// this currently just acts as a wrapper to +// avoid changing so much at once. object Globals { var beneneCount = 0 From b95ac99ebd1e1a51bec30eaac77ce79bfe7916ae Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 16:39:01 -0600 Subject: [PATCH 41/50] Update --- .../com/lagradost/cloudstream4/utils/DeviceInfo.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt index a37b059b2cd..a4bd9802d5c 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt @@ -1,7 +1,14 @@ package com.lagradost.cloudstream4.utils +import kotlin.jvm.JvmInline + internal expect object DeviceInfo { - fun getDeviceLayout(): DeviceLayout.Layout + fun getDeviceType(): DeviceType fun isLandscape(): Boolean fun getLayoutPreference(): Int } + +@JvmInline // This still works but has no affect on non-JVM targets +value class DeviceType(val value: Int) { + infix fun or(other: DeviceType) = DeviceType(value or other.value) +} From efce523f8822efb83787c465332c3b865cd9b075 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 16:41:59 -0600 Subject: [PATCH 42/50] use DeviceType --- .../cloudstream4/utils/DeviceLayout.kt | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt index 636865ec2d5..ef47ab3f9be 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt @@ -1,20 +1,14 @@ package com.lagradost.cloudstream4.utils import com.lagradost.cloudstream4.preferences.PreferenceDefaults -import kotlin.jvm.JvmInline object DeviceLayout { - @JvmInline // This still works but has no affect on non-JVM targets - value class Layout(val value: Int) { - infix fun or(other: Layout) = Layout(value or other.value) - } - - val PHONE = Layout(0b00001) - val TV = Layout(0b00010) - val EMULATOR = Layout(0b00100) - val COMPUTER = Layout(0b01000) + val PHONE = DeviceType(0b00001) + val TV = DeviceType(0b00010) + val EMULATOR = DeviceType(0b00100) + val COMPUTER = DeviceType(0b01000) - private var layoutId = Layout(PreferenceDefaults.APP_LAYOUT) + private var layoutId = DeviceType(PreferenceDefaults.APP_LAYOUT) // TODO when fully on Compose // private val layoutId: Int get() = resolveLayout() @@ -44,9 +38,9 @@ object DeviceLayout { layoutId = resolveLayout() } - private fun resolveLayout(): Layout { + private fun resolveLayout(): DeviceType { return when (DeviceInfo.getLayoutPreference()) { - PreferenceDefaults.APP_LAYOUT -> DeviceInfo.getDeviceLayout() + PreferenceDefaults.APP_LAYOUT -> DeviceInfo.getDeviceType() 0 -> PHONE 1 -> TV 2 -> EMULATOR From 2f19b3f9613aed805797c7257ffebfbd21a4b1b1 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 16:44:58 -0600 Subject: [PATCH 43/50] Update --- .../cloudstream4/utils/DeviceLayout.kt | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt index ef47ab3f9be..c40e911d6c1 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt @@ -1,14 +1,20 @@ package com.lagradost.cloudstream4.utils import com.lagradost.cloudstream4.preferences.PreferenceDefaults +import kotlin.jvm.JvmInline object DeviceLayout { - val PHONE = DeviceType(0b00001) - val TV = DeviceType(0b00010) - val EMULATOR = DeviceType(0b00100) - val COMPUTER = DeviceType(0b01000) + @JvmInline // This still works but has no affect on non-JVM targets + value class Layout(val value: Int) { + infix fun or(other: Layout) = Layout(value or other.value) + } + + val PHONE = Layout(0b00001) + val TV = Layout(0b00010) + val EMULATOR = Layout(0b00100) + val COMPUTER = Layout(0b01000) - private var layoutId = DeviceType(PreferenceDefaults.APP_LAYOUT) + private var layoutId = Layout(PreferenceDefaults.APP_LAYOUT) // TODO when fully on Compose // private val layoutId: Int get() = resolveLayout() @@ -38,9 +44,9 @@ object DeviceLayout { layoutId = resolveLayout() } - private fun resolveLayout(): DeviceType { + private fun resolveLayout(): Layout { return when (DeviceInfo.getLayoutPreference()) { - PreferenceDefaults.APP_LAYOUT -> DeviceInfo.getDeviceType() + PreferenceDefaults.APP_LAYOUT -> DeviceInfo.getDetectedLayout() 0 -> PHONE 1 -> TV 2 -> EMULATOR From a5cbaef4f33bd4bd093c79f3255bce581fb029be Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 16:45:50 -0600 Subject: [PATCH 44/50] Update --- .../com/lagradost/cloudstream4/utils/DeviceInfo.kt | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt index a4bd9802d5c..095b580ff90 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.kt @@ -1,14 +1,7 @@ package com.lagradost.cloudstream4.utils -import kotlin.jvm.JvmInline - internal expect object DeviceInfo { - fun getDeviceType(): DeviceType + fun getDetectedLayout(): DeviceLayout.Layout fun isLandscape(): Boolean fun getLayoutPreference(): Int } - -@JvmInline // This still works but has no affect on non-JVM targets -value class DeviceType(val value: Int) { - infix fun or(other: DeviceType) = DeviceType(value or other.value) -} From 95e8fae3eddc4a7090ebc2c2412e3d2de7351ef1 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 16:46:23 -0600 Subject: [PATCH 45/50] Update --- .../com/lagradost/cloudstream4/utils/DeviceInfo.android.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt b/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt index e0b6bd4f065..15c9186c5e4 100644 --- a/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt +++ b/composeApp/src/androidMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.android.kt @@ -10,7 +10,7 @@ import com.lagradost.cloudstream4.preferences.PreferenceDefaults import com.lagradost.cloudstream4.preferences.PreferenceKeys internal actual object DeviceInfo { - actual fun getDeviceLayout(): DeviceLayout.Layout { + actual fun getDetectedLayout(): DeviceLayout.Layout { val context = getContext() as? Context ?: return DeviceLayout.PHONE val uiModeManager = context.getSystemService(Context.UI_MODE_SERVICE) as UiModeManager? val isTelevisionMode = uiModeManager?.currentModeType == Configuration.UI_MODE_TYPE_TELEVISION From f2c43bddb222dd8e1aad51803cd72b2b12413987 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 16:46:55 -0600 Subject: [PATCH 46/50] Update --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt b/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt index 278dd64028b..c07067cca76 100644 --- a/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt +++ b/composeApp/src/jvmMain/kotlin/com/lagradost/cloudstream4/utils/DeviceInfo.jvm.kt @@ -4,7 +4,7 @@ import com.lagradost.cloudstream4.preferences.PreferenceDefaults import java.awt.Toolkit internal actual object DeviceInfo { - actual fun getDeviceLayout(): DeviceLayout.Layout = DeviceLayout.COMPUTER + actual fun getDetectedLayout(): DeviceLayout.Layout = DeviceLayout.COMPUTER actual fun isLandscape(): Boolean { return try { From 4c7b8488f76617a1200542f52ea8294989b275bb Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 16:56:38 -0600 Subject: [PATCH 47/50] internal --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt index c40e911d6c1..213ff4acf9a 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt @@ -5,7 +5,7 @@ import kotlin.jvm.JvmInline object DeviceLayout { @JvmInline // This still works but has no affect on non-JVM targets - value class Layout(val value: Int) { + internal value class Layout(val value: Int) { infix fun or(other: Layout) = Layout(value or other.value) } From 63d6b74a66ff24c1ea59e30145fcb8d493667688 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 17:02:14 -0600 Subject: [PATCH 48/50] try --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt index 213ff4acf9a..716c9ab8dd3 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt @@ -5,8 +5,9 @@ import kotlin.jvm.JvmInline object DeviceLayout { @JvmInline // This still works but has no affect on non-JVM targets - internal value class Layout(val value: Int) { + value class Layout private constructor(private val value: Int) { infix fun or(other: Layout) = Layout(value or other.value) + internal fun and(other: Layout) = (value and other.value) != 0 } val PHONE = Layout(0b00001) @@ -27,7 +28,7 @@ object DeviceLayout { * * Valid flags are: PHONE, TV, EMULATOR, or COMPUTER */ - fun isLayout(flags: Layout): Boolean = (layoutId.value and flags.value) != 0 + fun isLayout(flags: Layout): Boolean = layoutId.and(flags) /** Returns true if the current orientation is landscape. */ fun isLandscape(): Boolean = From 2435c4c72a95a30ca2e3fddd511ad0dc17687836 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 17:05:02 -0600 Subject: [PATCH 49/50] Update --- .../kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt index 716c9ab8dd3..a89fb292639 100644 --- a/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt +++ b/composeApp/src/commonMain/kotlin/com/lagradost/cloudstream4/utils/DeviceLayout.kt @@ -5,7 +5,7 @@ import kotlin.jvm.JvmInline object DeviceLayout { @JvmInline // This still works but has no affect on non-JVM targets - value class Layout private constructor(private val value: Int) { + value class Layout(private val value: Int) { infix fun or(other: Layout) = Layout(value or other.value) internal fun and(other: Layout) = (value and other.value) != 0 } From 4de647bfecb7f062d592e9a7f34f89cf8e29f03a Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Tue, 26 May 2026 17:08:21 -0600 Subject: [PATCH 50/50] Update --- .../java/com/lagradost/cloudstream3/ui/settings/Globals.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/Globals.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/Globals.kt index 69f397e96c6..24e249b9a86 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/Globals.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/Globals.kt @@ -9,9 +9,9 @@ import com.lagradost.cloudstream4.utils.DeviceLayout object Globals { var beneneCount = 0 - val PHONE: Int = DeviceLayout.PHONE.value - val TV: Int = DeviceLayout.TV.value - val EMULATOR: Int = DeviceLayout.EMULATOR.value + const val PHONE: Int = 0b00001 + const val TV: Int = 0b00010 + const val EMULATOR: Int = 0b00100 fun Context.updateTv() { DeviceLayout.update()