-
Notifications
You must be signed in to change notification settings - Fork 5
Migration to Jetpack Compose #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
903e011
Dependencies: Add Jetpack Compose support
2ae9fe1
Dependencies: fix themeadapter dependency path
EmogurovAnton 79a9e32
Base:Fix Broadcast receiver action name
9dba5b5
Deps:Update `common` module dependencies
4176edc
Core:Add 'content' and `settingsContent` composable functions for Plu…
e8a3d9c
Base: Migrate to view binding from 'synthetics'
e27f4eb
AppSettings: Add the ability to open `appsettings` plugin from Jetpac…
73acd38
Flipper:Add the ability to open `flipper` plugin from JetpackCompose
6154a48
Servers: Add the ability to open `servers` plugin from JetpackCompose
68a8498
Account:Migrate account plugin to Jetpack Compose
cfceedb
Account: fix function params
EmogurovAnton f179ffa
Accounts: Add the ability to open `accounts` plugin from JetpackCompose
83788a2
Variable:Add the ability to open `variable` plugin from JetpackCompose
765f9e6
Servers: Add the ability to add a stage with multiple hosts
e810f08
No-op: update no-op module
edd8e41
Servers: Migrate to Jetpack Compose UI
57dabbd
Sample: Update sample project
9435e32
Servers: Add methods to get the selected stage and the default stage
3c45a47
AppSettings: Migrate App-settings plugin to the Jetpack Compose
f45b6aa
Flipper: Migrate Flipper plugin to the Jetpack Compose
8d11f4d
Core: Add ability to open panel without fragment manager
EmogurovAnton 6d2d038
Core: fix DebugBottomSheet deprecated expand state
EmogurovAnton dfee5ad
rebase: rebase fixes
EmogurovAnton 6f49672
build: fix lint & compileTask
EmogurovAnton 4cad8cc
ui: fix inflater error & debug bottom sheet state
EmogurovAnton ce2b6ff
review: review improves
EmogurovAnton 722d8fa
Servers: Refactoring servers screen
725a1fa
Review: Fix review commits
9c86d83
refactoring: move bottom sheet to separate activity
EmogurovAnton c23629e
Accounts: Add settings content
0f28095
Core: Delete old DebugBottomSheet
a3d733b
Core: Delete getFragment from Plugin
f984f49
Accounts: Delete old fragment
9b1778a
Servers: Delete old fragment
af8821e
fix: Delete unused view binding
d9d4e79
review: minor fixes
EmogurovAnton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
22 changes: 0 additions & 22 deletions
22
common/src/main/kotlin/com/redmadrobot/debug/common/base/PluginFragment.kt
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
common/src/main/kotlin/com/redmadrobot/debug/common/base/PluginViewModel.kt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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
46 changes: 46 additions & 0 deletions
46
core/src/main/kotlin/com/redmadrobot/debug/core/extension/ComposeExt.kt
This file contains hidden or 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,46 @@ | ||
package com.redmadrobot.debug.core.extension | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.DisposableEffect | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.rememberUpdatedState | ||
import androidx.compose.ui.platform.LocalLifecycleOwner | ||
import androidx.lifecycle.Lifecycle | ||
import androidx.lifecycle.LifecycleEventObserver | ||
import androidx.lifecycle.ViewModel | ||
import androidx.lifecycle.ViewModelProvider | ||
import androidx.lifecycle.viewmodel.compose.viewModel | ||
import com.redmadrobot.debug.core.annotation.DebugPanelInternal | ||
|
||
@DebugPanelInternal | ||
@Composable | ||
public inline fun <reified T : ViewModel> provideViewModel(crossinline block: () -> T): T { | ||
return viewModel( | ||
factory = object : ViewModelProvider.Factory { | ||
override fun <T : ViewModel> create(modelClass: Class<T>): T { | ||
@Suppress("UNCHECKED_CAST") | ||
return block() as T | ||
} | ||
} | ||
) | ||
} | ||
|
||
|
||
@DebugPanelInternal | ||
@Composable | ||
public fun OnLifecycleEvent(onEvent: (event: Lifecycle.Event) -> Unit) { | ||
val eventHandler by rememberUpdatedState(onEvent) | ||
val lifecycleOwner by rememberUpdatedState(LocalLifecycleOwner.current) | ||
|
||
DisposableEffect(lifecycleOwner) { | ||
val lifecycle = lifecycleOwner.lifecycle | ||
val observer = LifecycleEventObserver { _, event -> | ||
eventHandler(event) | ||
} | ||
|
||
lifecycle.addObserver(observer) | ||
onDispose { | ||
lifecycle.removeObserver(observer) | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...g/common/extension/CoroutinesExtension.kt → ...bug/core/extension/CoroutinesExtension.kt
This file contains hidden or 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
2 changes: 1 addition & 1 deletion
2
...ot/debug/common/extension/LifecicleExt.kt → ...obot/debug/core/extension/LifecicleExt.kt
This file contains hidden or 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 hidden or 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
89 changes: 0 additions & 89 deletions
89
core/src/main/kotlin/com/redmadrobot/debug/core/inapp/DebugBottomSheet.kt
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
core/src/main/kotlin/com/redmadrobot/debug/core/inapp/DebugSheetViewPagerAdapter.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.