Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore commonMain to AOSP state (remove getter compilation fix) #1757

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,5 @@ package androidx.compose.material3
import androidx.compose.runtime.Composable
import androidx.compose.runtime.ReadOnlyComposable

// TODO(https://github.com/JetBrains/compose-multiplatform/issues/3373) revert to expect get()
internal val is24HourFormat: Boolean
@Composable
@ReadOnlyComposable get() = is24HourFormat()

@Composable
@ReadOnlyComposable
internal expect fun is24HourFormat(): Boolean
internal expect val is24HourFormat: Boolean
@Composable @ReadOnlyComposable get
Original file line number Diff line number Diff line change
Expand Up @@ -1984,16 +1984,8 @@ private enum class LayoutId {
InnerCircle,
}

// TODO(https://github.com/JetBrains/compose-multiplatform/issues/3373) fix expect composable getter
@OptIn(ExperimentalMaterial3Api::class)
internal val defaultTimePickerLayoutType: TimePickerLayoutType
@Composable
@ReadOnlyComposable get() = defaultTimePickerLayoutType()

@Composable
@ReadOnlyComposable
@OptIn(ExperimentalMaterial3Api::class)
internal expect fun defaultTimePickerLayoutType() : TimePickerLayoutType
internal expect val defaultTimePickerLayoutType: TimePickerLayoutType
@Composable @ReadOnlyComposable get

private const val FullCircle: Float = (PI * 2).toFloat()
private const val HalfCircle: Float = FullCircle / 2f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,5 @@ package androidx.compose.material3.internal
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.runtime.Composable

// TODO(https://github.com/JetBrains/compose-multiplatform/issues/3373) revert to expect get()
internal val WindowInsets.Companion.systemBarsForVisualComponents: WindowInsets
@Composable get() = systemBarsForVisualComponents()

@Composable
internal expect fun WindowInsets.Companion.systemBarsForVisualComponents(): WindowInsets
internal expect val WindowInsets.Companion.systemBarsForVisualComponents: WindowInsets
@Composable get
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import androidx.compose.material3.internal.PlatformDateFormat
import androidx.compose.runtime.Composable
import androidx.compose.runtime.ReadOnlyComposable

@Composable
@ReadOnlyComposable
internal actual fun is24HourFormat(): Boolean =
PlatformDateFormat(defaultLocale()).is24HourFormat()
internal actual val is24HourFormat
@Composable
@ReadOnlyComposable
get(): Boolean = PlatformDateFormat(defaultLocale()).is24HourFormat()
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@ import androidx.compose.runtime.ReadOnlyComposable
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.platform.LocalWindowInfo

@OptIn(ExperimentalMaterial3Api::class, ExperimentalComposeUiApi::class)
@Composable
@ReadOnlyComposable
internal actual fun defaultTimePickerLayoutType(): TimePickerLayoutType {
return with(LocalWindowInfo.current) {
if (containerSize.height < containerSize.width) {
TimePickerLayoutType.Horizontal
} else {
TimePickerLayoutType.Vertical
internal actual val defaultTimePickerLayoutType
@OptIn(ExperimentalMaterial3Api::class, ExperimentalComposeUiApi::class)
@Composable
@ReadOnlyComposable
get(): TimePickerLayoutType {
return with(LocalWindowInfo.current) {
if (containerSize.height < containerSize.width) {
TimePickerLayoutType.Horizontal
} else {
TimePickerLayoutType.Vertical
}
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.systemBars
import androidx.compose.runtime.Composable

// TODO upstream to commonMain
@Composable
internal actual fun WindowInsets.Companion.systemBarsForVisualComponents(): WindowInsets =
WindowInsets.systemBars
internal actual val WindowInsets.Companion.systemBarsForVisualComponents
@Composable
get(): WindowInsets = WindowInsets.systemBars