-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
81c810f
commit de435c0
Showing
12 changed files
with
237 additions
and
131 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
...in/io/github/jan/einkaufszettel/ui/screen/app/tabs/components/ContextMenuScope.android.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package io.github.jan.einkaufszettel.ui.screen.app.tabs.components | ||
|
||
import androidx.compose.foundation.interaction.MutableInteractionSource | ||
import androidx.compose.ui.input.pointer.PointerInputScope | ||
|
||
internal actual suspend fun PointerInputScope.handleClicks( | ||
interactionSource: MutableInteractionSource, | ||
onLeftClick: () -> Unit, | ||
onRightClick: (x: Float, y: Float) -> Unit | ||
) { | ||
} |
31 changes: 31 additions & 0 deletions
31
...p/src/commonMain/kotlin/io/github/jan/einkaufszettel/ui/screen/app/tabs/AppStateScreen.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package io.github.jan.einkaufszettel.ui.screen.app.tabs | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import cafe.adriel.voyager.core.screen.Screen | ||
import io.github.jan.einkaufszettel.collectAsStateWithLifecycle | ||
import io.github.jan.einkaufszettel.ui.screen.app.AppState | ||
import io.github.jan.einkaufszettel.ui.screen.app.AppStateErrorHandler | ||
import io.github.jan.einkaufszettel.ui.screen.app.AppStateModel | ||
|
||
interface AppStateScreen<ScreenModel : AppStateModel>: Screen { | ||
|
||
@Composable | ||
override fun Content() { | ||
val screenModel = createScreenModel() | ||
val appState by screenModel.state.collectAsStateWithLifecycle() | ||
Content(screenModel, appState) | ||
|
||
AppStateErrorHandler( | ||
state = appState, | ||
resetState = screenModel::resetState | ||
) | ||
} | ||
|
||
@Composable | ||
fun createScreenModel(): ScreenModel | ||
|
||
@Composable | ||
fun Content(screenModel: ScreenModel, state: AppState) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.