Skip to content

Commit 7912964

Browse files
committed
style: Cleanup and organize imports across the project
Refactors import statements to improve code readability and maintainability. - Replaced wildcard imports with explicit imports in several files, including `ThemeDialog.kt`, `ThemePrefs.kt`, and `PreferableMaterialTheme.kt`. - Reordered imports to follow a consistent structure, moving `androidx.compose.ui.tooling.preview.Preview` and other Jetpack Compose imports to their appropriate alphabetical positions. - Removed unused or redundant imports. - Standardized import grouping across `theme-material`, `theme-material3`, and `theme-prefs` modules.
1 parent 233e063 commit 7912964

16 files changed

Lines changed: 53 additions & 20 deletions

File tree

sample/src/commonMain/kotlin/com/softartdev/shared/material/NoteDetailBody.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ import androidx.compose.runtime.saveable.rememberSaveable
2424
import androidx.compose.ui.Alignment
2525
import androidx.compose.ui.Modifier
2626
import androidx.compose.ui.text.style.TextOverflow
27+
import androidx.compose.ui.tooling.preview.Preview
2728
import androidx.compose.ui.unit.dp
2829
import com.softartdev.shared.AppState
2930
import com.softartdev.theme.material.PreferableMaterialTheme
30-
import androidx.compose.ui.tooling.preview.Preview
3131
import kotlin.experimental.ExperimentalObjCRefinement
3232
import kotlin.native.HiddenFromObjC
3333

sample/src/commonMain/kotlin/com/softartdev/shared/material/SettingsBody.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import androidx.compose.material.icons.filled.Style
1111
import androidx.compose.runtime.Composable
1212
import androidx.compose.ui.Modifier
1313
import androidx.compose.ui.platform.LocalUriHandler
14+
import androidx.compose.ui.tooling.preview.Preview
1415
import com.softartdev.shared.AppState
1516
import com.softartdev.theme.material.PreferableMaterialTheme
1617
import com.softartdev.theme.material.PreferenceCategory
@@ -25,7 +26,6 @@ import io.github.softartdev.theme_prefs.generated.resources.pref_subtitle_open_g
2526
import io.github.softartdev.theme_prefs.generated.resources.pref_title_source_code
2627
import io.github.softartdev.theme_prefs.generated.resources.switch_to_material_design_3
2728
import org.jetbrains.compose.resources.stringResource
28-
import androidx.compose.ui.tooling.preview.Preview
2929
import kotlin.experimental.ExperimentalObjCRefinement
3030
import kotlin.native.HiddenFromObjC
3131

sample/src/commonMain/kotlin/com/softartdev/shared/material3/NoteDetailBody.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ import androidx.compose.runtime.saveable.rememberSaveable
2727
import androidx.compose.ui.Alignment
2828
import androidx.compose.ui.Modifier
2929
import androidx.compose.ui.text.style.TextOverflow
30+
import androidx.compose.ui.tooling.preview.Preview
3031
import androidx.compose.ui.unit.dp
3132
import com.softartdev.shared.AppState
3233
import com.softartdev.theme.material.PreferableMaterialTheme
33-
import androidx.compose.ui.tooling.preview.Preview
3434
import kotlin.experimental.ExperimentalObjCRefinement
3535
import kotlin.native.HiddenFromObjC
3636

sample/src/commonMain/kotlin/com/softartdev/shared/material3/SettingsBody.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import androidx.compose.material3.Text
1111
import androidx.compose.runtime.Composable
1212
import androidx.compose.ui.Modifier
1313
import androidx.compose.ui.platform.LocalUriHandler
14+
import androidx.compose.ui.tooling.preview.Preview
1415
import com.softartdev.shared.AppState
1516
import com.softartdev.theme.material3.PreferableMaterialTheme
1617
import com.softartdev.theme.material3.PreferenceCategory
@@ -25,7 +26,6 @@ import io.github.softartdev.theme_prefs.generated.resources.pref_subtitle_open_g
2526
import io.github.softartdev.theme_prefs.generated.resources.pref_title_source_code
2627
import io.github.softartdev.theme_prefs.generated.resources.switch_to_material_design_3
2728
import org.jetbrains.compose.resources.stringResource
28-
import androidx.compose.ui.tooling.preview.Preview
2929
import kotlin.experimental.ExperimentalObjCRefinement
3030
import kotlin.native.HiddenFromObjC
3131

theme/theme-material/src/commonMain/kotlin/com/softartdev/theme/material/MenuPreference.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ import androidx.compose.material.icons.filled.SettingsBrightness
1414
import androidx.compose.runtime.Composable
1515
import androidx.compose.ui.Modifier
1616
import androidx.compose.ui.graphics.vector.ImageVector
17+
import androidx.compose.ui.tooling.preview.Preview
1718
import com.softartdev.theme.pref.LocalThemePrefs
1819
import com.softartdev.theme.pref.ThemePrefs
1920
import io.github.softartdev.theme_prefs.generated.resources.Res
2021
import io.github.softartdev.theme_prefs.generated.resources.choose_theme
2122
import io.github.softartdev.theme_prefs.generated.resources.theme
2223
import org.jetbrains.compose.resources.stringResource
23-
import androidx.compose.ui.tooling.preview.Preview
2424

2525
@Composable
2626
public fun ThemePreferencesCategory(): Unit = PreferenceCategory(

theme/theme-material/src/commonMain/kotlin/com/softartdev/theme/material/PreferableMaterialTheme.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ import androidx.compose.material.darkColors
66
import androidx.compose.material.lightColors
77
import androidx.compose.runtime.Composable
88
import androidx.compose.runtime.CompositionLocalProvider
9-
import com.softartdev.theme.pref.*
9+
import com.softartdev.theme.pref.LocalThemePrefs
10+
import com.softartdev.theme.pref.PreferableMaterialTheme
11+
import com.softartdev.theme.pref.PreferenceHelper
12+
import com.softartdev.theme.pref.rememberPreferenceHelper
1013

1114
@Composable
1215
public fun PreferableMaterialTheme(

theme/theme-material/src/commonMain/kotlin/com/softartdev/theme/material/RadioDialogContent.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import androidx.compose.runtime.mutableStateOf
1616
import androidx.compose.ui.Alignment
1717
import androidx.compose.ui.Modifier
1818
import androidx.compose.ui.semantics.Role
19+
import androidx.compose.ui.tooling.preview.Preview
1920
import androidx.compose.ui.unit.dp
2021
import com.softartdev.theme.pref.ThemeEnum
2122
import org.jetbrains.compose.resources.stringResource
22-
import androidx.compose.ui.tooling.preview.Preview
2323

2424
@Composable
2525
public fun RadioDialogContent(darkThemeState: MutableState<ThemeEnum>) {

theme/theme-material/src/commonMain/kotlin/com/softartdev/theme/material/SettingsScaffold.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import androidx.compose.material.icons.automirrored.filled.ArrowBack
1313
import androidx.compose.runtime.Composable
1414
import androidx.compose.ui.Modifier
1515
import androidx.compose.ui.graphics.vector.ImageVector
16+
import androidx.compose.ui.tooling.preview.Preview
1617
import io.github.softartdev.theme_prefs.generated.resources.Res
1718
import io.github.softartdev.theme_prefs.generated.resources.settings
1819
import org.jetbrains.compose.resources.stringResource
19-
import androidx.compose.ui.tooling.preview.Preview
2020

2121
@Composable
2222
public fun SettingsScaffold(

theme/theme-material/src/commonMain/kotlin/com/softartdev/theme/material/ThemeDialog.kt

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,32 @@
11
package com.softartdev.theme.material
22

3-
import androidx.compose.foundation.layout.*
4-
import androidx.compose.material.*
5-
import androidx.compose.runtime.*
3+
import androidx.compose.foundation.layout.Arrangement
4+
import androidx.compose.foundation.layout.Box
5+
import androidx.compose.foundation.layout.Column
6+
import androidx.compose.foundation.layout.Row
7+
import androidx.compose.foundation.layout.Spacer
8+
import androidx.compose.foundation.layout.fillMaxWidth
9+
import androidx.compose.foundation.layout.padding
10+
import androidx.compose.foundation.layout.width
11+
import androidx.compose.material.AlertDialog
12+
import androidx.compose.material.Button
13+
import androidx.compose.material.ContentAlpha
14+
import androidx.compose.material.LocalContentAlpha
15+
import androidx.compose.material.MaterialTheme
16+
import androidx.compose.material.ProvideTextStyle
17+
import androidx.compose.material.Surface
18+
import androidx.compose.material.Text
19+
import androidx.compose.material.Typography
20+
import androidx.compose.material.contentColorFor
21+
import androidx.compose.runtime.Composable
22+
import androidx.compose.runtime.CompositionLocalProvider
23+
import androidx.compose.runtime.MutableState
24+
import androidx.compose.runtime.remember
625
import androidx.compose.ui.Alignment
726
import androidx.compose.ui.Modifier
827
import androidx.compose.ui.graphics.Color
928
import androidx.compose.ui.graphics.Shape
29+
import androidx.compose.ui.tooling.preview.Preview
1030
import androidx.compose.ui.unit.dp
1131
import com.softartdev.theme.pref.PreferableMaterialTheme.themePrefs
1232
import com.softartdev.theme.pref.ThemeEnum
@@ -15,7 +35,6 @@ import io.github.softartdev.theme_prefs.generated.resources.cancel
1535
import io.github.softartdev.theme_prefs.generated.resources.choose_theme
1636
import io.github.softartdev.theme_prefs.generated.resources.ok
1737
import org.jetbrains.compose.resources.stringResource
18-
import androidx.compose.ui.tooling.preview.Preview
1938

2039
/**
2140
* AlertDialog for selecting a theme.

theme/theme-material3/src/commonMain/kotlin/com/softartdev/theme/material3/Material3ThemePrefs.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import androidx.compose.material3.lightColorScheme
77
import androidx.compose.runtime.Composable
88
import androidx.compose.runtime.ReadOnlyComposable
99
import androidx.compose.runtime.remember
10-
import com.softartdev.theme.pref.*
10+
import com.softartdev.theme.pref.PreferenceHelper
11+
import com.softartdev.theme.pref.ThemeEnum
12+
import com.softartdev.theme.pref.ThemePrefs
13+
import com.softartdev.theme.pref.rememberPreferenceHelper
1114

1215
public class Material3ThemePrefs(
1316
preferenceHelper: PreferenceHelper,

0 commit comments

Comments
 (0)