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

Rename DevicePreviews to PreviewDevices #7325

Closed
wants to merge 3 commits into from
Closed
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 @@ -2,7 +2,7 @@ package app.k9mail.ui.catalog.ui.atom

import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import app.k9mail.core.ui.compose.common.DevicePreviews
import app.k9mail.core.ui.compose.common.PreviewDevices
import app.k9mail.core.ui.compose.theme.K9Theme
import app.k9mail.core.ui.compose.theme.ThunderbirdTheme
import app.k9mail.ui.catalog.ui.atom.CatalogAtomPage.BUTTON
Expand Down Expand Up @@ -46,7 +46,7 @@ fun CatalogContent(
}
}

@DevicePreviews
@PreviewDevices
@Composable
internal fun CatalogContentK9ThemePreview() {
K9Theme {
Expand All @@ -57,7 +57,7 @@ internal fun CatalogContentK9ThemePreview() {
}
}

@DevicePreviews
@PreviewDevices
@Composable
internal fun CatalogContentThunderbirdThemePreview() {
ThunderbirdTheme {
Expand Down
4 changes: 1 addition & 3 deletions config/detekt/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -664,8 +664,6 @@ style:
active: true
OptionalUnit:
active: true
OptionalWhenBraces:
active: false
PreferToOverPairSyntax:
active: true
ProtectedMemberInFinalClass:
Expand Down Expand Up @@ -811,7 +809,7 @@ Compose:
active: true
ComposableParamOrder:
active: true
PreviewNaming:
PreviewAnnotationNaming:
active: true
PreviewPublic:
active: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ import androidx.compose.ui.tooling.preview.Preview
@Preview(name = "Foldable", device = Devices.FOLDABLE)
@Preview(name = "Tablet", device = Devices.TABLET)
@Preview(name = "Desktop", device = Devices.DESKTOP)
annotation class DevicePreviews
annotation class PreviewDevices
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import app.k9mail.core.ui.compose.common.DevicePreviews
import app.k9mail.core.ui.compose.common.PreviewDevices
import app.k9mail.core.ui.compose.common.window.WindowSizeClass
import app.k9mail.core.ui.compose.common.window.getWindowSizeInfo
import app.k9mail.core.ui.compose.designsystem.atom.Surface
Expand Down Expand Up @@ -114,7 +114,7 @@ private fun ExpandedContent(
}

@Composable
@DevicePreviews
@PreviewDevices
internal fun ResponsiveContentPreview() {
K9Theme {
Surface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import app.k9mail.core.ui.compose.common.DevicePreviews
import app.k9mail.core.ui.compose.common.PreviewDevices
import app.k9mail.core.ui.compose.designsystem.atom.Background
import app.k9mail.core.ui.compose.designsystem.atom.Surface
import app.k9mail.core.ui.compose.theme.K9Theme
Expand All @@ -31,7 +31,7 @@ fun ResponsiveContentWithBackground(
}

@Composable
@DevicePreviews
@PreviewDevices
internal fun ResponsiveContentWithBackgroundPreview() {
K9Theme {
ResponsiveContentWithBackground {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import app.k9mail.core.ui.compose.common.DevicePreviews
import app.k9mail.core.ui.compose.common.PreviewDevices
import app.k9mail.core.ui.compose.common.window.WindowSizeClass
import app.k9mail.core.ui.compose.common.window.WindowSizeClass.Compact
import app.k9mail.core.ui.compose.common.window.WindowSizeClass.Expanded
Expand Down Expand Up @@ -69,7 +69,7 @@ fun ResponsiveWidthContainer(
}

@Composable
@DevicePreviews
@PreviewDevices
internal fun ResponsiveWidthContainerK9Preview() {
K9Theme {
Background {
Expand All @@ -86,7 +86,7 @@ internal fun ResponsiveWidthContainerK9Preview() {
}

@Composable
@DevicePreviews
@PreviewDevices
internal fun ResponsiveWidthContainerThunderbirdPreview() {
K9Theme {
Background {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import androidx.compose.material.rememberScaffoldState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import app.k9mail.core.ui.compose.common.DevicePreviews
import app.k9mail.core.ui.compose.common.PreviewDevices
import app.k9mail.core.ui.compose.designsystem.atom.Surface
import app.k9mail.core.ui.compose.theme.K9Theme
import app.k9mail.core.ui.compose.theme.MainTheme
Expand Down Expand Up @@ -88,7 +88,7 @@ private fun ScaffoldFabPosition.toMaterialFabPosition(): MaterialFabPosition {
private const val DRAWER_TOGGLE_DELAY = 250L

@Composable
@DevicePreviews
@PreviewDevices
internal fun ScaffoldPreview() {
K9Theme {
Scaffold(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import app.k9mail.core.ui.compose.common.DevicePreviews
import app.k9mail.core.ui.compose.common.PreviewDevices
import app.k9mail.core.ui.compose.designsystem.organism.TopAppBar
import app.k9mail.core.ui.compose.theme.MainTheme
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
Expand All @@ -28,7 +28,7 @@ fun AccountTopAppBar(
)
}

@DevicePreviews
@PreviewDevices
@Composable
internal fun AccountTopAppBarPreview() {
PreviewWithThemes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import app.k9mail.core.ui.compose.common.DevicePreviews
import app.k9mail.core.ui.compose.common.PreviewDevices
import app.k9mail.core.ui.compose.designsystem.atom.button.ButtonIcon
import app.k9mail.core.ui.compose.designsystem.organism.TopAppBar
import app.k9mail.core.ui.compose.theme.Icons
Expand Down Expand Up @@ -37,7 +37,7 @@ fun AccountTopAppBarWithBackButton(
)
}

@DevicePreviews
@PreviewDevices
@Composable
internal fun AccountTopAppBarWithBackButtonPreview() {
PreviewWithThemes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import app.k9mail.core.ui.compose.common.DevicePreviews
import app.k9mail.core.ui.compose.common.PreviewDevices
import app.k9mail.core.ui.compose.designsystem.atom.button.Button
import app.k9mail.core.ui.compose.designsystem.atom.button.ButtonOutlined
import app.k9mail.core.ui.compose.designsystem.template.ResponsiveWidthContainer
Expand Down Expand Up @@ -69,7 +69,7 @@ private fun getHorizontalArrangement(state: WizardNavigationBarState): Arrangeme
}
}

@DevicePreviews
@PreviewDevices
@Composable
internal fun WizardNavigationBarK9Preview() {
K9Theme {
Expand All @@ -80,7 +80,7 @@ internal fun WizardNavigationBarK9Preview() {
}
}

@DevicePreviews
@PreviewDevices
@Composable
internal fun WizardNavigationBarPreview() {
PreviewWithThemes {
Expand All @@ -91,7 +91,7 @@ internal fun WizardNavigationBarPreview() {
}
}

@DevicePreviews
@PreviewDevices
@Composable
internal fun WizardNavigationBarDisabledPreview() {
PreviewWithThemes {
Expand All @@ -106,7 +106,7 @@ internal fun WizardNavigationBarDisabledPreview() {
}
}

@DevicePreviews
@PreviewDevices
@Composable
internal fun WizardNavigationBarHideNextPreview() {
PreviewWithThemes {
Expand All @@ -120,7 +120,7 @@ internal fun WizardNavigationBarHideNextPreview() {
}
}

@DevicePreviews
@PreviewDevices
@Composable
internal fun WizardNavigationBarHideBackPreview() {
PreviewWithThemes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import app.k9mail.core.ui.compose.common.DevicePreviews
import app.k9mail.core.ui.compose.common.PreviewDevices
import app.k9mail.core.ui.compose.designsystem.molecule.ErrorView
import app.k9mail.core.ui.compose.designsystem.molecule.LoadingView
import app.k9mail.core.ui.compose.theme.K9Theme
Expand Down Expand Up @@ -53,7 +53,7 @@ internal fun AccountOAuthContent(
}

@Composable
@DevicePreviews
@PreviewDevices
internal fun AccountOAuthContentK9Preview() {
K9Theme {
AccountOAuthContent(
Expand All @@ -64,7 +64,7 @@ internal fun AccountOAuthContentK9Preview() {
}

@Composable
@DevicePreviews
@PreviewDevices
internal fun AccountOAuthContentThunderbirdPreview() {
ThunderbirdTheme {
AccountOAuthContent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import app.k9mail.core.ui.compose.common.DevicePreviews
import app.k9mail.core.ui.compose.common.PreviewDevices
import app.k9mail.core.ui.compose.designsystem.atom.button.Button
import app.k9mail.core.ui.compose.designsystem.atom.text.TextCaption
import app.k9mail.core.ui.compose.theme.MainTheme
Expand Down Expand Up @@ -42,7 +42,7 @@ internal fun SignInView(
}
}

@DevicePreviews
@PreviewDevices
@Composable
internal fun SignInViewPreview() {
SignInView(
Expand All @@ -51,7 +51,7 @@ internal fun SignInViewPreview() {
)
}

@DevicePreviews
@PreviewDevices
@Composable
internal fun SignInViewWithGooglePreview() {
SignInView(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import app.k9mail.core.ui.compose.common.DevicePreviews
import app.k9mail.core.ui.compose.common.PreviewDevices
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
import app.k9mail.feature.account.oauth.R

Expand Down Expand Up @@ -66,7 +66,6 @@ fun SignInWithGoogleButton(
.padding(
end = 8.dp,
),

verticalAlignment = Alignment.CenterVertically,
) {
Surface(
Expand Down Expand Up @@ -126,7 +125,7 @@ private fun getTextColor(isLight: Boolean): Color {
}
}

@DevicePreviews
@PreviewDevices
@Composable
internal fun SignInWithGoogleButtonPreview() {
PreviewWithThemes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import app.k9mail.core.ui.compose.common.DevicePreviews
import app.k9mail.core.ui.compose.common.PreviewDevices
import app.k9mail.core.ui.compose.common.baseline.withBaseline
import app.k9mail.core.ui.compose.common.mvi.observe
import app.k9mail.core.ui.compose.designsystem.atom.Icon
Expand Down Expand Up @@ -127,7 +127,7 @@ fun ServerCertificateErrorScreen(
}

@Composable
@DevicePreviews
@PreviewDevices
internal fun ServerCertificateErrorScreenK9Preview() {
val inputStream = """
-----BEGIN CERTIFICATE-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import app.k9mail.core.ui.compose.common.DevicePreviews
import app.k9mail.core.ui.compose.common.PreviewDevices
import app.k9mail.core.ui.compose.designsystem.template.ResponsiveWidthContainer
import app.k9mail.core.ui.compose.theme.K9Theme
import app.k9mail.core.ui.compose.theme.MainTheme
Expand Down Expand Up @@ -57,7 +57,7 @@ internal fun IncomingServerSettingsContent(
}

@Composable
@DevicePreviews
@PreviewDevices
internal fun IncomingServerSettingsContentK9Preview() {
K9Theme {
IncomingServerSettingsContent(
Expand All @@ -70,7 +70,7 @@ internal fun IncomingServerSettingsContentK9Preview() {
}

@Composable
@DevicePreviews
@PreviewDevices
internal fun IncomingServerSettingsContentThunderbirdPreview() {
ThunderbirdTheme {
IncomingServerSettingsContent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import app.k9mail.core.ui.compose.common.DevicePreviews
import app.k9mail.core.ui.compose.common.PreviewDevices
import app.k9mail.core.ui.compose.common.mvi.observe
import app.k9mail.core.ui.compose.designsystem.template.Scaffold
import app.k9mail.core.ui.compose.theme.K9Theme
Expand Down Expand Up @@ -73,7 +73,7 @@ fun IncomingServerSettingsScreen(
}

@Composable
@DevicePreviews
@PreviewDevices
internal fun IncomingServerSettingsScreenK9Preview() {
K9Theme {
IncomingServerSettingsScreen(
Expand All @@ -89,7 +89,7 @@ internal fun IncomingServerSettingsScreenK9Preview() {
}

@Composable
@DevicePreviews
@PreviewDevices
internal fun IncomingServerSettingsScreenThunderbirdPreview() {
ThunderbirdTheme {
IncomingServerSettingsScreen(
Expand Down
Loading