Skip to content
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ xcuserdata
.kotlin/
**/.kotlin/
/.kotlin/
gpg_private.asc
public_key.asc
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,12 @@
package zone.ien.hig.example

import App
import RootViewModel
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import koinInitialize
import org.koin.core.context.GlobalContext
import org.koin.core.context.startKoin
import org.koin.core.module.dsl.viewModel
import org.koin.dsl.module

class MainActivity: ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@

@file:OptIn(ExperimentalFoundationApi::class)

import androidx.compose.animation.core.*
import androidx.compose.animation.core.AnimationState
import androidx.compose.animation.core.Spring
import androidx.compose.animation.core.VectorConverter
import androidx.compose.animation.core.animateTo
import androidx.compose.animation.core.spring
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.OverscrollEffect
import androidx.compose.foundation.layout.offset
Expand All @@ -33,15 +37,13 @@ import androidx.compose.ui.draw.clipToBounds
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.input.nestedscroll.NestedScrollSource
import androidx.compose.ui.layout.LayoutCoordinates
import androidx.compose.ui.layout.Measurable
import androidx.compose.ui.layout.MeasureResult
import androidx.compose.ui.layout.MeasureScope
import androidx.compose.ui.layout.OnPlacedModifier
import androidx.compose.ui.layout.onPlaced
import androidx.compose.ui.node.DelegatableNode
import androidx.compose.ui.node.LayoutModifierNode
import androidx.compose.ui.unit.*
import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.Velocity
import androidx.compose.ui.unit.round
import androidx.compose.ui.unit.toOffset
import androidx.compose.ui.unit.toSize
import kotlinx.coroutines.isActive
import kotlin.coroutines.coroutineContext
import kotlin.math.abs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ import RootDetails
import RootRoute
import RootUiState
import androidx.compose.animation.AnimatedContent
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.ScrollState
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.gestures.AnchoredDraggableState
import androidx.compose.foundation.gestures.ScrollableState
Expand Down Expand Up @@ -100,7 +98,6 @@ import androidx.navigation3.runtime.NavKey
import com.kyant.backdrop.Backdrop
import com.kyant.backdrop.backdrops.LayerBackdrop
import com.kyant.backdrop.backdrops.layerBackdrop
import zone.ien.hig.utils.rememberDefaultBackdrop
import kotlinx.coroutines.launch
import kotlinx.datetime.TimeZone
import kotlinx.datetime.toLocalDateTime
Expand Down Expand Up @@ -133,8 +130,6 @@ import zone.ien.hig.CupertinoLiquidButtonDefaults
import zone.ien.hig.CupertinoLiquidIconButton
import zone.ien.hig.CupertinoMenuItemData
import zone.ien.hig.CupertinoMenuSectionData
import zone.ien.hig.CupertinoNavigationBar
import zone.ien.hig.CupertinoNavigationBarItem
import zone.ien.hig.CupertinoNavigationBarItemData
import zone.ien.hig.CupertinoNavigationTitle
import zone.ien.hig.CupertinoPickerState
Expand Down Expand Up @@ -166,8 +161,6 @@ import zone.ien.hig.adaptive.ExperimentalAdaptiveApi
import zone.ien.hig.adaptive.Theme
import zone.ien.hig.adaptive.icons.AdaptiveIcons
import zone.ien.hig.adaptive.icons.Add
import zone.ien.hig.adaptive.icons.Menu
import zone.ien.hig.adaptive.icons.Person
import zone.ien.hig.adaptive.icons.Settings
import zone.ien.hig.adaptive.icons.Share
import zone.ien.hig.cancel
Expand All @@ -179,7 +172,6 @@ import zone.ien.hig.icons.filled.Archivebox
import zone.ien.hig.icons.filled.Banknote
import zone.ien.hig.icons.filled.Pin
import zone.ien.hig.icons.filled.Trash
import zone.ien.hig.icons.outlined.Book
import zone.ien.hig.icons.outlined.Bookmark
import zone.ien.hig.icons.outlined.FaceSmiling
import zone.ien.hig.icons.outlined.Heart
Expand Down Expand Up @@ -224,6 +216,7 @@ import zone.ien.hig.theme.systemOrange
import zone.ien.hig.theme.systemPurple
import zone.ien.hig.theme.systemRed
import zone.ien.hig.theme.systemYellow
import zone.ien.hig.utils.rememberDefaultBackdrop
import kotlin.time.Instant

private enum class PickerTab {
Expand Down
2 changes: 0 additions & 2 deletions example/composeApp/src/commonMain/kotlin/icons/IconsScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ import com.kyant.backdrop.backdrops.layerBackdrop
import zone.ien.hig.CupertinoAlertDialog
import zone.ien.hig.CupertinoIcon
import zone.ien.hig.CupertinoIconButton
import zone.ien.hig.CupertinoLiquidIconButton
import zone.ien.hig.CupertinoNavigateBackButton
import zone.ien.hig.CupertinoNavigateBackLiquidButton
import zone.ien.hig.CupertinoScaffold
import zone.ien.hig.CupertinoSegmentedControl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.unit.dp
import com.kyant.backdrop.backdrops.layerBackdrop
import zone.ien.hig.CupertinoDatePickerState
import zone.ien.hig.CupertinoNavigateBackButton
import zone.ien.hig.CupertinoNavigateBackLiquidButton
import zone.ien.hig.CupertinoScaffold
import zone.ien.hig.CupertinoSegmentedControl
Expand All @@ -56,7 +55,6 @@ import zone.ien.hig.MenuDivider
import zone.ien.hig.MenuPickerAction
import zone.ien.hig.icons.CupertinoIcons
import zone.ien.hig.icons.outlined.Heart
import zone.ien.hig.isTopBarTransparent
import zone.ien.hig.rememberCupertinoDatePickerState
import zone.ien.hig.rememberCupertinoTimePickerState
import zone.ien.hig.section.CupertinoLinkIcon
Expand Down
3 changes: 1 addition & 2 deletions example/composeApp/src/commonMain/kotlin/test/TestScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.kyant.backdrop.backdrops.layerBackdrop
import com.kyant.backdrop.backdrops.rememberLayerBackdrop
import zone.ien.hig.utils.rememberDefaultBackdrop
import kotlinx.coroutines.launch
import org.jetbrains.compose.resources.painterResource
import zone.ien.hig.CupertinoDropdownMenu
Expand All @@ -45,7 +44,6 @@ import zone.ien.hig.CupertinoLiquidButton
import zone.ien.hig.CupertinoLiquidButtonDefaults
import zone.ien.hig.CupertinoLiquidIconButton
import zone.ien.hig.CupertinoMenuItemData
import zone.ien.hig.CupertinoMenuSectionData
import zone.ien.hig.CupertinoNavigationTitle
import zone.ien.hig.CupertinoScaffold
import zone.ien.hig.CupertinoText
Expand All @@ -63,6 +61,7 @@ import zone.ien.hig.icons.outlined.ChevronBackward
import zone.ien.hig.icons.outlined.PersonCropCircle
import zone.ien.hig.icons.outlined.Pin
import zone.ien.hig.icons.outlined.SunMax
import zone.ien.hig.utils.rememberDefaultBackdrop

@OptIn(ExperimentalCupertinoApi::class, ExperimentalAdaptiveApi::class)
@Composable
Expand Down
1 change: 0 additions & 1 deletion example/composeApp/src/iosMain/kotlin/main.ios.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@



import androidx.compose.runtime.ExperimentalComposeApi
import androidx.compose.ui.uikit.OnFocusBehavior
import androidx.compose.ui.window.ComposeUIViewController
import platform.UIKit.UIViewController
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ kotlin.apple.xcodeCompatibility.nowarn=true
#Android
android.useAndroidX=true
android.nonTransitiveRClass=true
android.compileSdk=36
android.targetSdk=36
android.compileSdk=37
android.targetSdk=37
android.minSdk=29

#Jetbrains KMP
Expand Down
24 changes: 12 additions & 12 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
[versions]
agp = "9.0.0"
kotlin = "2.3.21"
lib-version-name = "1.1.0"
agp = "9.1.1"
kotlin = "2.4.10"
lib-version-name = "1.2.0"

# plugin
compose-plugin = "1.11.0-rc01"
compose-plugin = "1.11.1"
compose-plugin-experimental = "1.11.0-alpha07"
compose-navigation3 = "1.1.1"

# ui
activity-compose = "1.13.0"
lifecycle = "2.10.0"
lifecycle = "2.11.0"
backdrop = "2.0.0-alpha06"
capsule = "1.2.0"
capsule = "2.1.4"
haze = "1.7.2"

# functionality
datetime = "0.7.1"
material-kolor = "4.1.1"
datetime = "0.8.0"
material-kolor = "5.0.0"

# backend
serialization = "1.11.0"
vanniktech-mavenPublish = "0.36.0"
atomicfu = "0.23.2"
koin = "4.2.1"
vanniktech-mavenPublish = "0.37.0"
atomicfu = "0.33.0"
koin = "4.2.2"

[libraries]

Expand All @@ -46,7 +46,7 @@ compose-navigation3 = { group = "org.jetbrains.androidx.navigation3", name = "na
backdrop = { group = "zone.ien.backdrop", name = "backdrop", version.ref = "backdrop"}
#backdrop = { group = "io.github.kyant0", name = "backdrop", version.ref = "backdrop"}
#capsule = { group = "io.github.kyant0", name = "shapes", version.ref = "capsule"}
capsule = { group = "zone.ien.shapes", name = "shapes", version.ref = "capsule"}
capsule = { group = "zone.ien.capsule", name = "capsule", version.ref = "capsule"}
haze = { group = "dev.chrisbanes.haze", name = "haze", version.ref = "haze" }

# functionality
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
#Fri Nov 22 12:33:15 PST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
25 changes: 11 additions & 14 deletions hig-adaptive/src/commonMain/kotlin/zone/ien/hig/adaptive/Shapes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ import androidx.compose.foundation.shape.CornerBasedShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Immutable
import androidx.compose.ui.unit.dp
import com.kyant.shapes.RoundedRectangle
import com.kyant.shapes.UnevenRoundedRectangle
import zone.ien.hig.theme.Shapes as CupertinoShapes
import androidx.compose.material3.Shapes as MaterialShapes
import com.kyant.capsule.ContinuousRoundedRectangle

/**
* A class that holds the shapes for different design systems.
Expand All @@ -53,11 +50,11 @@ class Shapes(
val medium: CornerBasedShape = RoundedCornerShape(12.dp),
val large: CornerBasedShape = RoundedCornerShape(16.dp),
val extraLarge: CornerBasedShape = RoundedCornerShape(28.dp),
val higExtraSmall: RoundedRectangle = RoundedRectangle(4.dp),
val higSmall: RoundedRectangle = RoundedRectangle(8.dp),
val higMedium: RoundedRectangle = RoundedRectangle(12.dp),
val higLarge: RoundedRectangle = RoundedRectangle(16.dp),
val higExtraLarge: RoundedRectangle = RoundedRectangle(24.dp)
val higExtraSmall: ContinuousRoundedRectangle = ContinuousRoundedRectangle(4.dp),
val higSmall: ContinuousRoundedRectangle = ContinuousRoundedRectangle(8.dp),
val higMedium: ContinuousRoundedRectangle = ContinuousRoundedRectangle(12.dp),
val higLarge: ContinuousRoundedRectangle = ContinuousRoundedRectangle(16.dp),
val higExtraLarge: ContinuousRoundedRectangle = ContinuousRoundedRectangle(24.dp)
) {
/**
* Creates a copy of this Shapes object with the specified values replaced.
Expand All @@ -80,11 +77,11 @@ class Shapes(
medium: CornerBasedShape = this.medium,
large: CornerBasedShape = this.large,
extraLarge: CornerBasedShape = this.extraLarge,
higExtraSmall: RoundedRectangle = this.higExtraSmall,
higSmall: RoundedRectangle = this.higSmall,
higMedium: RoundedRectangle = this.higMedium,
higLarge: RoundedRectangle = this.higLarge,
higExtraLarge: RoundedRectangle = this.higExtraLarge
higExtraSmall: ContinuousRoundedRectangle = this.higExtraSmall,
higSmall: ContinuousRoundedRectangle = this.higSmall,
higMedium: ContinuousRoundedRectangle = this.higMedium,
higLarge: ContinuousRoundedRectangle = this.higLarge,
higExtraLarge: ContinuousRoundedRectangle = this.higExtraLarge
) = Shapes(
extraSmall = extraSmall,
small = small,
Expand Down
35 changes: 16 additions & 19 deletions hig-core/src/commonMain/kotlin/zone/ien/hig/theme/Shapes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@

package zone.ien.hig.theme

import androidx.compose.foundation.shape.CornerBasedShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.Stable
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.unit.dp
import com.kyant.shapes.RoundedRectangle
import com.kyant.shapes.UnevenRoundedRectangle
import com.kyant.capsule.ContinuousRoundedRectangle
import zone.ien.hig.InternalCupertinoApi

/**
Expand All @@ -41,11 +38,11 @@ import zone.ien.hig.InternalCupertinoApi
*/
@Stable
class Shapes(
val extraSmall: RoundedRectangle = ShapeDefaults.ExtraSmall,
val small: RoundedRectangle = ShapeDefaults.Small,
val medium: RoundedRectangle = ShapeDefaults.Medium,
val large: RoundedRectangle = ShapeDefaults.Large,
val extraLarge: RoundedRectangle = ShapeDefaults.ExtraLarge,
val extraSmall: ContinuousRoundedRectangle = ShapeDefaults.ExtraSmall,
val small: ContinuousRoundedRectangle = ShapeDefaults.Small,
val medium: ContinuousRoundedRectangle = ShapeDefaults.Medium,
val large: ContinuousRoundedRectangle = ShapeDefaults.Large,
val extraLarge: ContinuousRoundedRectangle = ShapeDefaults.ExtraLarge,
) {
/**
* Creates a copy of this Shapes with the specified values replaced.
Expand All @@ -57,11 +54,11 @@ class Shapes(
* @param extraLarge the new extra large corner shape
*/
fun copy(
extraSmall: RoundedRectangle = this.extraSmall,
small: RoundedRectangle = this.small,
medium: RoundedRectangle = this.medium,
large: RoundedRectangle = this.large,
extraLarge: RoundedRectangle = this.extraLarge,
extraSmall: ContinuousRoundedRectangle = this.extraSmall,
small: ContinuousRoundedRectangle = this.small,
medium: ContinuousRoundedRectangle = this.medium,
large: ContinuousRoundedRectangle = this.large,
extraLarge: ContinuousRoundedRectangle = this.extraLarge,
) = Shapes(
extraSmall = extraSmall,
small = small,
Expand All @@ -80,17 +77,17 @@ val LocalShapes = staticCompositionLocalOf { Shapes() }
@Immutable
object ShapeDefaults {
/** Extra small sized corner shape */
val ExtraSmall: RoundedRectangle = RoundedRectangle(4.dp)
val ExtraSmall: ContinuousRoundedRectangle = ContinuousRoundedRectangle(4.dp)

/** Small sized corner shape */
val Small: RoundedRectangle = RoundedRectangle(8.dp)
val Small: ContinuousRoundedRectangle = ContinuousRoundedRectangle(8.dp)

/** Medium sized corner shape */
val Medium: RoundedRectangle = RoundedRectangle(12.dp)
val Medium: ContinuousRoundedRectangle = ContinuousRoundedRectangle(12.dp)

/** Large sized corner shape */
val Large: RoundedRectangle = RoundedRectangle(16.dp)
val Large: ContinuousRoundedRectangle = ContinuousRoundedRectangle(16.dp)

/** Extra large sized corner shape */
val ExtraLarge: RoundedRectangle = RoundedRectangle(24.dp)
val ExtraLarge: ContinuousRoundedRectangle = ContinuousRoundedRectangle(24.dp)
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.PopupProperties
import com.kyant.backdrop.Backdrop

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import platform.UIKit.UIContextMenuInteraction
import platform.UIKit.UIContextMenuInteractionAnimatingProtocol
import platform.UIKit.UIContextMenuInteractionDelegateProtocol
import platform.UIKit.UIControlStateNormal
import platform.UIKit.UIDevice
import platform.UIKit.UIEvent
import platform.UIKit.UIGestureRecognizer
import platform.UIKit.UIMenu
Expand Down
Loading
Loading