Skip to content

Commit

Permalink
Merge pull request #656 from zsoltk/package-reorg
Browse files Browse the repository at this point in the history
Sample apps package reorg
  • Loading branch information
zsoltk authored Jan 16, 2024
2 parents f4a52d6 + cb97543 commit 0e4fac2
Show file tree
Hide file tree
Showing 111 changed files with 378 additions and 374 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import androidx.compose.ui.unit.dp
import com.bumble.appyx.components.experimental.cards.Cards
import com.bumble.appyx.components.experimental.cards.CardsModel
import com.bumble.appyx.components.experimental.cards.ui.CardsVisualisation
import com.bumble.appyx.demos.common.profile.Profile
import com.bumble.appyx.demos.common.profile.ProfileCard
import com.bumble.appyx.interactions.core.AppyxInteractionsContainer
import com.bumble.appyx.interactions.core.gesture.GestureValidator.Companion.permissiveValidator
import com.bumble.appyx.interactions.core.ui.helper.AppyxComponentSetup
import com.bumble.appyx.interactions.theme.appyx_dark
import com.bumble.appyx.samples.common.profile.Profile
import com.bumble.appyx.samples.common.profile.ProfileCard
import kotlin.math.roundToInt

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ import com.bumble.appyx.components.spotlight.SpotlightModel
import com.bumble.appyx.components.spotlight.operation.next
import com.bumble.appyx.components.spotlight.operation.previous
import com.bumble.appyx.components.spotlight.ui.slider.SpotlightSlider
import com.bumble.appyx.demos.common.widget.CalendarWidget
import com.bumble.appyx.demos.common.widget.TimerWidget
import com.bumble.appyx.demos.common.widget.WeatherWidget
import com.bumble.appyx.interactions.Events
import com.bumble.appyx.interactions.core.AppyxInteractionsContainer
import com.bumble.appyx.interactions.core.ui.gesture.GestureSettleConfig
import com.bumble.appyx.interactions.core.ui.helper.AppyxComponentSetup
import com.bumble.appyx.interactions.core.ui.output.ElementUiModel
import com.bumble.appyx.interactions.widgets.ui.WidgetsStack3D
import com.bumble.appyx.samples.common.widget.CalendarWidget
import com.bumble.appyx.samples.common.widget.TimerWidget
import com.bumble.appyx.samples.common.widget.WeatherWidget
import kotlinx.coroutines.flow.Flow

enum class WidgetsType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
android:supportsRtl="true"
android:theme="@style/Theme.Appyx">
<activity
android:name="com.bumble.appyx.navigation.MainActivity"
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.Appyx.Starting">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bumble.appyx.navigation
package com.bumble.appyx.demos.navigation

import android.content.Intent
import android.net.Uri
Expand All @@ -15,15 +15,16 @@ import androidx.compose.ui.platform.LocalLifecycleOwner
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.ExperimentalUnitApi
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import com.bumble.appyx.demos.navigation.navigator.LocalNavigator
import com.bumble.appyx.demos.navigation.navigator.Navigator
import com.bumble.appyx.demos.navigation.node.root.RootNode
import com.bumble.appyx.demos.navigation.ui.AppyxSampleAppTheme
import com.bumble.appyx.navigation.BuildConfig
import com.bumble.appyx.navigation.integration.NodeActivity
import com.bumble.appyx.navigation.integration.NodeHost
import com.bumble.appyx.navigation.modality.NodeContext
import com.bumble.appyx.navigation.navigator.LocalNavigator
import com.bumble.appyx.navigation.navigator.Navigator
import com.bumble.appyx.navigation.node.root.RootNode
import com.bumble.appyx.navigation.platform.AndroidLifecycle
import com.bumble.appyx.navigation.plugin.NodeReadyObserver
import com.bumble.appyx.navigation.ui.AppyxSampleAppTheme
import com.google.android.material.snackbar.Snackbar

@ExperimentalUnitApi
Expand Down
2 changes: 1 addition & 1 deletion demos/appyx-navigation/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

appyx {
androidNamespace.set("com.bumble.appyx.navigation.demo")
androidNamespace.set("com.bumble.appyx.demos.navigation.common")
}

kotlin {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.bumble.appyx.demos.navigation.platform

actual fun getPlatformName(): String = "Android"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bumble.appyx.navigation.ui
package com.bumble.appyx.demos.navigation.ui

import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.bumble.appyx.demos.navigation

import com.bumble.appyx.demos.navigation.ui.atomic_tangerine
import com.bumble.appyx.demos.navigation.ui.manatee
import com.bumble.appyx.demos.navigation.ui.md_amber_500
import com.bumble.appyx.demos.navigation.ui.md_blue_500
import com.bumble.appyx.demos.navigation.ui.md_blue_grey_500
import com.bumble.appyx.demos.navigation.ui.md_cyan_500
import com.bumble.appyx.demos.navigation.ui.md_grey_500
import com.bumble.appyx.demos.navigation.ui.md_indigo_500
import com.bumble.appyx.demos.navigation.ui.md_light_blue_500
import com.bumble.appyx.demos.navigation.ui.md_light_green_500
import com.bumble.appyx.demos.navigation.ui.md_lime_500
import com.bumble.appyx.demos.navigation.ui.md_pink_500
import com.bumble.appyx.demos.navigation.ui.md_teal_500
import com.bumble.appyx.demos.navigation.ui.silver_sand
import com.bumble.appyx.demos.navigation.ui.sizzling_red

val colors = listOf(
manatee,
sizzling_red,
atomic_tangerine,
silver_sand,
md_pink_500,
md_indigo_500,
md_blue_500,
md_light_blue_500,
md_cyan_500,
md_teal_500,
md_light_green_500,
md_lime_500,
md_amber_500,
md_grey_500,
md_blue_grey_500
)
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.bumble.appyx.navigation.component.spotlighthero
package com.bumble.appyx.demos.navigation.component.spotlighthero


import androidx.compose.animation.core.AnimationSpec
import com.bumble.appyx.interactions.core.model.backpresshandlerstrategies.BaseBackPressHandlerStrategy
import com.bumble.appyx.mapState
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel.Mode.HERO
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel.Mode.LIST
import com.bumble.appyx.navigation.component.spotlighthero.operation.SetHeroMode
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHeroModel.Mode.HERO
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHeroModel.Mode.LIST
import com.bumble.appyx.demos.navigation.component.spotlighthero.operation.SetHeroMode
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.StateFlow

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package com.bumble.appyx.navigation.component.spotlighthero
package com.bumble.appyx.demos.navigation.component.spotlighthero

import androidx.compose.animation.core.AnimationSpec
import androidx.compose.animation.core.spring
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHeroModel.State
import com.bumble.appyx.demos.navigation.component.spotlighthero.visualisation.SpotlightHeroVisualisation
import com.bumble.appyx.interactions.core.model.BaseAppyxComponent
import com.bumble.appyx.interactions.core.ui.Visualisation
import com.bumble.appyx.interactions.core.ui.context.TransitionBounds
import com.bumble.appyx.interactions.core.ui.context.UiContext
import com.bumble.appyx.interactions.core.ui.gesture.GestureFactory
import com.bumble.appyx.interactions.core.ui.gesture.GestureSettleConfig
import com.bumble.appyx.mapState
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel.State
import com.bumble.appyx.navigation.component.spotlighthero.visualisation.SpotlightHeroVisualisation
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.bumble.appyx.navigation.component.spotlighthero
package com.bumble.appyx.demos.navigation.component.spotlighthero

import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHeroModel.State
import com.bumble.appyx.interactions.core.Element
import com.bumble.appyx.interactions.core.asElement
import com.bumble.appyx.interactions.core.model.transition.BaseTransitionModel
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel.State
import com.bumble.appyx.utils.multiplatform.Parcelable
import com.bumble.appyx.utils.multiplatform.Parcelize
import com.bumble.appyx.utils.multiplatform.RawValue
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.bumble.appyx.navigation.component.spotlighthero.operation
package com.bumble.appyx.demos.navigation.component.spotlighthero.operation

import androidx.compose.animation.core.AnimationSpec
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHero
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHeroModel
import com.bumble.appyx.interactions.core.model.transition.BaseOperation
import com.bumble.appyx.interactions.core.model.transition.Operation
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHero
import com.bumble.appyx.utils.multiplatform.Parcelize

@Parcelize
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.bumble.appyx.navigation.component.spotlighthero.operation
package com.bumble.appyx.demos.navigation.component.spotlighthero.operation

import androidx.compose.animation.core.AnimationSpec
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHero
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHeroModel
import com.bumble.appyx.interactions.core.model.transition.BaseOperation
import com.bumble.appyx.interactions.core.model.transition.Operation
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHero
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel
import com.bumble.appyx.utils.multiplatform.Parcelize


Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.bumble.appyx.navigation.component.spotlighthero.operation
package com.bumble.appyx.demos.navigation.component.spotlighthero.operation

import androidx.compose.animation.core.AnimationSpec
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHero
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHeroModel
import com.bumble.appyx.interactions.core.model.transition.BaseOperation
import com.bumble.appyx.interactions.core.model.transition.Operation
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHero
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel
import com.bumble.appyx.utils.multiplatform.Parcelize


Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.bumble.appyx.navigation.component.spotlighthero.operation
package com.bumble.appyx.demos.navigation.component.spotlighthero.operation

import androidx.compose.animation.core.AnimationSpec
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHero
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHeroModel
import com.bumble.appyx.interactions.core.model.transition.BaseOperation
import com.bumble.appyx.interactions.core.model.transition.Operation
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHero
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel
import com.bumble.appyx.utils.multiplatform.Parcelize

@Parcelize
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.bumble.appyx.navigation.component.spotlighthero.operation
package com.bumble.appyx.demos.navigation.component.spotlighthero.operation

import androidx.compose.animation.core.AnimationSpec
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHero
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHeroModel
import com.bumble.appyx.interactions.core.model.transition.BaseOperation
import com.bumble.appyx.interactions.core.model.transition.Operation
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHero
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel
import com.bumble.appyx.utils.multiplatform.Parcelize


Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.bumble.appyx.navigation.component.spotlighthero.operation
package com.bumble.appyx.demos.navigation.component.spotlighthero.operation

import androidx.compose.animation.core.AnimationSpec
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHero
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHeroModel
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHeroModel.State
import com.bumble.appyx.interactions.core.model.transition.BaseOperation
import com.bumble.appyx.interactions.core.model.transition.Operation
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHero
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel.State
import com.bumble.appyx.utils.multiplatform.Parcelize

@Parcelize
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.bumble.appyx.navigation.component.spotlighthero.operation
package com.bumble.appyx.demos.navigation.component.spotlighthero.operation

import androidx.compose.animation.core.AnimationSpec
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHero
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHeroModel.Mode.HERO
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHeroModel.Mode.LIST
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHeroModel.State
import com.bumble.appyx.interactions.core.model.transition.BaseOperation
import com.bumble.appyx.interactions.core.model.transition.Operation
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHero
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel.Mode.HERO
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel.Mode.LIST
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel.State
import com.bumble.appyx.utils.multiplatform.Parcelize

@Parcelize
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package com.bumble.appyx.navigation.component.spotlighthero.visualisation
package com.bumble.appyx.demos.navigation.component.spotlighthero.visualisation

import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.unit.Density
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHeroModel
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHeroModel.Mode.HERO
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHeroModel.Mode.LIST
import com.bumble.appyx.demos.navigation.component.spotlighthero.operation.Next
import com.bumble.appyx.demos.navigation.component.spotlighthero.operation.Previous
import com.bumble.appyx.demos.navigation.component.spotlighthero.operation.SetHeroMode
import com.bumble.appyx.interactions.core.ui.context.TransitionBounds
import com.bumble.appyx.interactions.core.ui.gesture.Drag
import com.bumble.appyx.interactions.core.ui.gesture.Gesture
import com.bumble.appyx.interactions.core.ui.gesture.GestureFactory
import com.bumble.appyx.interactions.core.ui.gesture.dragDirection4
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel.Mode.HERO
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel.Mode.LIST
import com.bumble.appyx.navigation.component.spotlighthero.operation.Next
import com.bumble.appyx.navigation.component.spotlighthero.operation.Previous
import com.bumble.appyx.navigation.component.spotlighthero.operation.SetHeroMode

class SpotlightHeroGestures<NavTarget>(
transitionBounds: TransitionBounds,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.bumble.appyx.demos.navigation.component.spotlighthero.visualisation

import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHeroModel
import com.bumble.appyx.demos.navigation.component.spotlighthero.visualisation.property.HeroProgress
import com.bumble.appyx.interactions.core.ui.Visualisation

interface SpotlightHeroVisualisation<NavTarget : Any> :
Visualisation<NavTarget, SpotlightHeroModel.State<NavTarget>> {

val heroProgress: HeroProgress
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
package com.bumble.appyx.navigation.component.spotlighthero.visualisation.default
package com.bumble.appyx.demos.navigation.component.spotlighthero.visualisation.default

import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.dp
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHeroModel.Mode.HERO
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHeroModel.Mode.LIST
import com.bumble.appyx.demos.navigation.component.spotlighthero.SpotlightHeroModel.State
import com.bumble.appyx.demos.navigation.component.spotlighthero.visualisation.SpotlightHeroVisualisation
import com.bumble.appyx.demos.navigation.component.spotlighthero.visualisation.property.HeroProgress
import com.bumble.appyx.interactions.core.ui.context.UiContext
import com.bumble.appyx.interactions.core.ui.property.impl.AspectRatio
import com.bumble.appyx.interactions.core.ui.property.impl.GenericFloatProperty
Expand All @@ -14,11 +19,6 @@ import com.bumble.appyx.interactions.core.ui.property.impl.position.BiasAlignmen
import com.bumble.appyx.interactions.core.ui.property.impl.position.PositionAlignment
import com.bumble.appyx.interactions.core.ui.property.impl.position.PositionOffset
import com.bumble.appyx.interactions.core.ui.state.MatchedTargetUiState
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel.Mode.HERO
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel.Mode.LIST
import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel.State
import com.bumble.appyx.navigation.component.spotlighthero.visualisation.SpotlightHeroVisualisation
import com.bumble.appyx.navigation.component.spotlighthero.visualisation.property.HeroProgress
import com.bumble.appyx.transitionmodel.BaseVisualisation

class SpotlightHeroDefaultVisualisation<NavTarget : Any>(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bumble.appyx.navigation.component.spotlighthero.visualisation.default
package com.bumble.appyx.demos.navigation.component.spotlighthero.visualisation.default

import androidx.compose.ui.unit.DpOffset
import com.bumble.appyx.interactions.core.ui.context.UiContext
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bumble.appyx.navigation.component.spotlighthero.visualisation.property
package com.bumble.appyx.demos.navigation.component.spotlighthero.visualisation.property

import com.bumble.appyx.interactions.core.ui.property.impl.GenericFloatProperty
import kotlinx.coroutines.CoroutineScope
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.bumble.appyx.navigation.navigator
package com.bumble.appyx.demos.navigation.navigator

import androidx.compose.runtime.compositionLocalOf
import com.bumble.appyx.navigation.node.cakes.Cake
import com.bumble.appyx.navigation.node.profile.User
import com.bumble.appyx.navigation.node.root.RootNode
import com.bumble.appyx.demos.navigation.node.cakes.Cake
import com.bumble.appyx.demos.navigation.node.profile.User
import com.bumble.appyx.demos.navigation.node.root.RootNode
import com.bumble.appyx.navigation.plugin.NodeReadyObserver
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bumble.appyx.navigation.node.cakes
package com.bumble.appyx.demos.navigation.node.cakes

import androidx.compose.runtime.Immutable
import com.bumble.appyx.utils.multiplatform.Parcelable
Expand Down
Loading

0 comments on commit 0e4fac2

Please sign in to comment.