Skip to content

Commit

Permalink
Merge pull request #301 from team-haribo/feature/298-save-device-toke…
Browse files Browse the repository at this point in the history
…n-as-datastore

🔀 :: (#300) - create a preview custom annotation
  • Loading branch information
diejdkll authored Jul 26, 2024
2 parents c894e84 + e8eeba9 commit 3d8fd38
Show file tree
Hide file tree
Showing 39 changed files with 103 additions and 123 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.goms.design_system.component.bottomsheet

import android.content.res.Configuration
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
Expand All @@ -10,7 +9,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.goms.design_system.component.clickable.gomsClickable
import com.goms.design_system.component.spacer.GomsSpacer
Expand All @@ -20,6 +18,7 @@ import com.goms.design_system.theme.GomsTheme
import com.goms.design_system.theme.GomsTheme.colors
import com.goms.design_system.theme.GomsTheme.typography
import com.goms.design_system.theme.ThemeType
import com.goms.design_system.util.ThemePreviews

@Composable
fun BottomSheetHeader(
Expand Down Expand Up @@ -48,8 +47,7 @@ fun BottomSheetHeader(
GomsSpacer(size = SpacerSize.Small)
}

@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
@ThemePreviews
@Composable
private fun BottomSheetHeaderPreview() {
GomsTheme(ThemeType.SYSTEM.value) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.goms.design_system.component.bottomsheet

import android.content.res.Configuration
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
Expand All @@ -17,12 +16,12 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.goms.design_system.R
import com.goms.design_system.theme.GomsTheme
import com.goms.design_system.theme.GomsTheme.colors
import com.goms.design_system.theme.ThemeType
import com.goms.design_system.util.ThemePreviews

@OptIn(ExperimentalMaterial3Api::class)
@Composable
Expand Down Expand Up @@ -72,8 +71,7 @@ fun DatePickerBottomSheet(
}

@OptIn(ExperimentalMaterial3Api::class)
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
@ThemePreviews
@Composable
private fun DatePickerBottomSheetPreview() {
GomsTheme(ThemeType.SYSTEM.value) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.goms.design_system.component.bottomsheet

import android.content.res.Configuration
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
Expand Down Expand Up @@ -28,7 +27,6 @@ import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.goms.design_system.R
Expand All @@ -40,6 +38,7 @@ import com.goms.design_system.theme.GomsTheme
import com.goms.design_system.theme.GomsTheme.colors
import com.goms.design_system.theme.GomsTheme.typography
import com.goms.design_system.theme.ThemeType
import com.goms.design_system.util.ThemePreviews
import kotlinx.collections.immutable.PersistentList
import kotlinx.collections.immutable.persistentListOf
import kotlinx.collections.immutable.toPersistentList
Expand Down Expand Up @@ -167,8 +166,7 @@ fun MultipleSelectorBottomSheetItem(
GomsSpacer(size = SpacerSize.Large)
}

@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
@ThemePreviews
@Composable
private fun MultipleSelectorBottomSheetPreview() {
GomsTheme(ThemeType.SYSTEM.value) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.goms.design_system.component.bottomsheet

import android.content.res.Configuration
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
Expand All @@ -21,7 +20,6 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.goms.design_system.R
import com.goms.design_system.component.clickable.gomsClickable
Expand All @@ -33,6 +31,7 @@ import com.goms.design_system.theme.GomsTheme
import com.goms.design_system.theme.GomsTheme.colors
import com.goms.design_system.theme.GomsTheme.typography
import com.goms.design_system.theme.ThemeType
import com.goms.design_system.util.ThemePreviews

@OptIn(ExperimentalMaterial3Api::class)
@Composable
Expand Down Expand Up @@ -107,8 +106,7 @@ fun ProfileBottomSheetComponent(
}
}

@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
@ThemePreviews
@Composable
private fun ProfileBottomSheetPreview() {
GomsTheme(ThemeType.SYSTEM.value) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.goms.design_system.component.bottomsheet

import android.content.res.Configuration
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
Expand All @@ -20,12 +19,12 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.goms.design_system.component.button.BottomSheetButton
import com.goms.design_system.theme.GomsTheme
import com.goms.design_system.theme.GomsTheme.colors
import com.goms.design_system.theme.ThemeType
import com.goms.design_system.util.ThemePreviews
import kotlinx.collections.immutable.PersistentList
import kotlinx.collections.immutable.toPersistentList

Expand Down Expand Up @@ -88,8 +87,7 @@ fun SelectorBottomSheet(
}
}

@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
@ThemePreviews
@Composable
private fun SelectorBottomSheetPreview() {
GomsTheme(ThemeType.SYSTEM.value) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.goms.design_system.component.button

import android.content.res.Configuration
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
Expand All @@ -19,7 +18,6 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.goms.design_system.R
import com.goms.design_system.component.clickable.gomsClickable
Expand All @@ -28,6 +26,7 @@ import com.goms.design_system.theme.GomsTheme
import com.goms.design_system.theme.GomsTheme.colors
import com.goms.design_system.theme.GomsTheme.typography
import com.goms.design_system.theme.ThemeType
import com.goms.design_system.util.ThemePreviews

@Composable
fun GomsButton(
Expand Down Expand Up @@ -176,8 +175,7 @@ fun InitBottomSheetButton(
}
}

@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
@ThemePreviews
@Composable
private fun GomsButtonPreview() {
GomsTheme(ThemeType.SYSTEM.value) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.goms.design_system.component.button

import android.content.res.Configuration
import androidx.compose.foundation.background
import androidx.compose.foundation.gestures.Orientation
import androidx.compose.foundation.layout.Arrangement
Expand All @@ -25,7 +24,6 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.dp
Expand All @@ -37,6 +35,7 @@ import com.goms.design_system.component.clickable.gomsClickable
import com.goms.design_system.theme.GomsTheme
import com.goms.design_system.theme.GomsTheme.colors
import com.goms.design_system.theme.ThemeType
import com.goms.design_system.util.ThemePreviews
import kotlinx.coroutines.launch
import kotlin.math.roundToInt

Expand Down Expand Up @@ -128,8 +127,7 @@ fun GomsSwitchButton(
}
}

@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
@ThemePreviews
@Composable
private fun GomsSwitchButtonPreview() {
GomsTheme(ThemeType.SYSTEM.value) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package com.goms.design_system.component.dialog

import android.content.res.Configuration
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
Expand All @@ -22,7 +20,6 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog
import com.goms.design_system.component.spacer.GomsSpacer
Expand All @@ -31,6 +28,7 @@ import com.goms.design_system.theme.GomsTheme
import com.goms.design_system.theme.GomsTheme.colors
import com.goms.design_system.theme.GomsTheme.typography
import com.goms.design_system.theme.ThemeType
import com.goms.design_system.util.ThemePreviews

@Composable
fun GomsOneButtonDialog(
Expand Down Expand Up @@ -105,8 +103,7 @@ fun GomsOneButtonDialog(
}
}

@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
@ThemePreviews
@Composable
private fun GomsOneButtonDialogPreview() {
GomsTheme(ThemeType.SYSTEM.value) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.goms.design_system.component.dialog

import android.content.res.Configuration
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
Expand All @@ -22,7 +21,6 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog
import com.goms.design_system.component.spacer.GomsSpacer
Expand All @@ -31,6 +29,7 @@ import com.goms.design_system.theme.GomsTheme
import com.goms.design_system.theme.GomsTheme.colors
import com.goms.design_system.theme.GomsTheme.typography
import com.goms.design_system.theme.ThemeType
import com.goms.design_system.util.ThemePreviews

@Composable
fun GomsTwoButtonDialog(
Expand Down Expand Up @@ -123,8 +122,7 @@ fun GomsTwoButtonDialog(
}
}

@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
@ThemePreviews
@Composable
private fun GomsTwoButtonDialogPreview() {
GomsTheme(ThemeType.SYSTEM.value) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.goms.design_system.component.dropdown

import android.content.res.Configuration
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.background
import androidx.compose.foundation.border
Expand All @@ -26,7 +25,6 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Popup
Expand All @@ -39,6 +37,7 @@ import com.goms.design_system.theme.GomsTheme
import com.goms.design_system.theme.GomsTheme.colors
import com.goms.design_system.theme.GomsTheme.typography
import com.goms.design_system.theme.ThemeType
import com.goms.design_system.util.ThemePreviews
import kotlinx.collections.immutable.PersistentList
import kotlinx.collections.immutable.toPersistentList

Expand Down Expand Up @@ -193,8 +192,7 @@ fun GomsDropdown(
}
}

@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
@ThemePreviews
@Composable
private fun GomsDropdownPreview() {
GomsTheme(ThemeType.SYSTEM.value) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.goms.design_system.component.shimmer

import android.content.res.Configuration
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
Expand All @@ -10,10 +9,10 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.goms.design_system.theme.GomsTheme
import com.goms.design_system.theme.ThemeType
import com.goms.design_system.util.ThemePreviews

fun Modifier.shimmerEffect(
color: Color = Color.LightGray,
Expand All @@ -27,8 +26,7 @@ fun Modifier.shimmerEffect(
this.then(background(brush, shape))
}

@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
@ThemePreviews
@Composable
private fun GomsCircularProgressIndicatorPreview() {
GomsTheme(ThemeType.SYSTEM.value) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.goms.design_system.component.text

import android.content.res.Configuration
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
Expand All @@ -15,14 +14,14 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.goms.design_system.R
import com.goms.design_system.component.clickable.gomsClickable
import com.goms.design_system.theme.GomsTheme
import com.goms.design_system.theme.GomsTheme.colors
import com.goms.design_system.theme.GomsTheme.typography
import com.goms.design_system.theme.ThemeType
import com.goms.design_system.util.ThemePreviews

@Composable
fun LinkText(
Expand Down Expand Up @@ -75,8 +74,7 @@ fun LinkText(
}
}

@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
@ThemePreviews
@Composable
private fun LinkTextPreview() {
GomsTheme(ThemeType.SYSTEM.value) {
Expand Down
Loading

0 comments on commit 3d8fd38

Please sign in to comment.