From 6ad619372716bd8b59b14f623c8d681c9c14958f Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Thu, 29 Dec 2022 16:57:49 +0300 Subject: [PATCH 01/42] Flipper: Add StringValue support for Flipper plugin --- .../ui/recycler/FlipperFeaturesAdapter.kt | 10 ++++++---- .../ui/recycler/StringFeatureViewHolder.kt | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/FlipperFeaturesAdapter.kt b/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/FlipperFeaturesAdapter.kt index 8c8fa194..bff55223 100644 --- a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/FlipperFeaturesAdapter.kt +++ b/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/FlipperFeaturesAdapter.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.flipper_plugin.ui.recycler +package com.redmadrobot.debug.flipper.ui.recycler import android.view.LayoutInflater import android.view.ViewGroup @@ -8,9 +8,11 @@ import com.redmadrobot.flipper.config.FlipperValue import com.redmadrobot.flipper_plugin.databinding.ItemFlipperFeatureBooleanBinding import com.redmadrobot.flipper_plugin.databinding.ItemFlipperFeatureGroupBinding import com.redmadrobot.flipper_plugin.databinding.ItemFlipperFeatureStringBinding -import com.redmadrobot.flipper_plugin.ui.data.FlipperItem -import com.redmadrobot.flipper_plugin.ui.data.FlipperItem.Feature -import com.redmadrobot.flipper_plugin.ui.data.FlipperItem.Group +import com.redmadrobot.flipper_plugin.databinding.ItemFlipperFeatureStringBinding +import com.redmadrobot.debug.flipper.ui.data.FlipperItem +import com.redmadrobot.debug.flipper.ui.data.FlipperItem.Feature +import com.redmadrobot.debug.flipper.ui.data.FlipperItem.Group +import com.redmadrobot.debug.flipper.ui.recycler.StringFeatureViewHolder internal class FlipperFeaturesAdapter( private val onGroupClick: (groupName: String) -> Unit, diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/StringFeatureViewHolder.kt b/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/StringFeatureViewHolder.kt index 4477ddfe..b6369b81 100644 --- a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/StringFeatureViewHolder.kt +++ b/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/StringFeatureViewHolder.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.flipper_plugin.ui.recycler +package com.redmadrobot.debug.flipper.ui.recycler import android.view.View import androidx.core.view.isVisible From b992195024beb3fc0be7fb3ede9d32059956bfd6 Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Fri, 30 Sep 2022 18:21:12 +0300 Subject: [PATCH 02/42] Dependencies: Add Jetpack Compose support --- debug-panel-common/build.gradle.kts | 28 +++++++++++++------- debug-panel-core/build.gradle.kts | 5 ++++ plugins/accounts-plugin/build.gradle.kts | 5 ++++ plugins/app-settings-plugin/build.gradle.kts | 5 ++++ plugins/flipper-plugin/build.gradle.kts | 5 ++++ plugins/servers-plugin/build.gradle.kts | 5 ++++ plugins/variable-plugin/build.gradle.kts | 5 ++++ sample/build.gradle.kts | 6 +++++ 8 files changed, 54 insertions(+), 10 deletions(-) diff --git a/debug-panel-common/build.gradle.kts b/debug-panel-common/build.gradle.kts index 252e361a..d337ce72 100644 --- a/debug-panel-common/build.gradle.kts +++ b/debug-panel-common/build.gradle.kts @@ -44,23 +44,31 @@ android { } dependencies { - api(kotlin("stdlib")) + api(androidx.compose.animation) + api(stack.material.compose.themeAdapter) + api(androidx.compose.material) + api(androidx.compose.foundation) + api(androidx.compose.ui) + api(androidx.constraintlayout.compose) + api(androidx.activity.compose) + api(androidx.compose.ui.tooling.preview) + api(androidx.room.runtime) + api(androidx.room) + api(androidx.core) api(stack.okhttp) + api(stack.kotlinx.coroutines.android) + api(stack.timber) + api(rmr.itemsadapter.viewbinding) + api(rmr.flipper) + kapt(androidx.room.compiler) + // legacy api(androidx.appcompat) api(stack.material) api(androidx.constraintlayout) - api(stack.kotlinx.coroutines.android) + api(androidx.lifecycle.viewmodel) api(androidx.lifecycle.runtime) api(androidx.lifecycle.livedata) api(androidx.lifecycle.livedata.core) - api(androidx.lifecycle.viewmodel) - api(androidx.room.runtime) - api(androidx.room) - api(androidx.core) - api(rmr.itemsadapter.viewbinding) - api(rmr.flipper) - api(stack.timber) - kapt(androidx.room.compiler) } tasks.register("prepareKotlinBuildScriptModel") {} diff --git a/debug-panel-core/build.gradle.kts b/debug-panel-core/build.gradle.kts index 9709b339..85bae41b 100644 --- a/debug-panel-core/build.gradle.kts +++ b/debug-panel-core/build.gradle.kts @@ -39,6 +39,11 @@ android { buildFeatures { viewBinding = true + compose = true + } + + composeOptions { + kotlinCompilerExtensionVersion = androidx.versions.compose.compiler.get() } namespace = "com.redmadrobot.panel_core" } diff --git a/plugins/accounts-plugin/build.gradle.kts b/plugins/accounts-plugin/build.gradle.kts index 40c245e0..00781dd7 100644 --- a/plugins/accounts-plugin/build.gradle.kts +++ b/plugins/accounts-plugin/build.gradle.kts @@ -44,6 +44,11 @@ android { buildFeatures { viewBinding = true + compose = true + } + + composeOptions { + kotlinCompilerExtensionVersion = androidx.versions.compose.compiler.get() } namespace = "com.redmadrobot.account_plugin" } diff --git a/plugins/app-settings-plugin/build.gradle.kts b/plugins/app-settings-plugin/build.gradle.kts index cc48e1d9..0b0bf194 100644 --- a/plugins/app-settings-plugin/build.gradle.kts +++ b/plugins/app-settings-plugin/build.gradle.kts @@ -38,6 +38,11 @@ android { buildFeatures { viewBinding = true + compose = true + } + + composeOptions { + kotlinCompilerExtensionVersion = androidx.versions.compose.compiler.get() } namespace = "com.redmadrobot.app_settings_plugin" } diff --git a/plugins/flipper-plugin/build.gradle.kts b/plugins/flipper-plugin/build.gradle.kts index 091730b9..86bd8e3d 100644 --- a/plugins/flipper-plugin/build.gradle.kts +++ b/plugins/flipper-plugin/build.gradle.kts @@ -39,6 +39,11 @@ android { buildFeatures { viewBinding = true + compose = true + } + + composeOptions { + kotlinCompilerExtensionVersion = androidx.versions.compose.compiler.get() } namespace = "com.redmadrobot.flipper_plugin" } diff --git a/plugins/servers-plugin/build.gradle.kts b/plugins/servers-plugin/build.gradle.kts index e4038b5f..f14c89b0 100644 --- a/plugins/servers-plugin/build.gradle.kts +++ b/plugins/servers-plugin/build.gradle.kts @@ -38,6 +38,11 @@ android { buildFeatures { viewBinding = true + compose = true + } + + composeOptions { + kotlinCompilerExtensionVersion = androidx.versions.compose.compiler.get() } namespace = "com.redmadrobot.servers_plugin" } diff --git a/plugins/variable-plugin/build.gradle.kts b/plugins/variable-plugin/build.gradle.kts index 0ea15141..271325cc 100644 --- a/plugins/variable-plugin/build.gradle.kts +++ b/plugins/variable-plugin/build.gradle.kts @@ -39,6 +39,11 @@ android { buildFeatures { viewBinding = true + compose = true + } + + composeOptions { + kotlinCompilerExtensionVersion = androidx.versions.compose.compiler.get() } namespace = "com.redmadrobot.variable_plugin" } diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index cdcfb463..70a06391 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -23,12 +23,18 @@ android { buildFeatures { viewBinding = true + compose = true + } + + composeOptions { + kotlinCompilerExtensionVersion = androidx.versions.compose.compiler.get() } } dependencies { implementation(kotlin("stdlib")) implementation(androidx.appcompat) + implementation(androidx.compose.runtime) implementation(stack.material) implementation(androidx.constraintlayout) implementation(rmr.flipper) From 8a075c38d2b292731c184c26d89296137738e4d7 Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Mon, 3 Oct 2022 21:37:16 +0300 Subject: [PATCH 03/42] Account:Migrate account plugin to Jetpack Compose --- .../account_plugin/ui/AccountsFragment.kt | 104 +------- .../account_plugin/ui/AccountsScreen.kt | 226 ++++++++++++++++++ .../account_plugin/ui/AccountsViewModel.kt | 32 ++- .../account_plugin/ui/AccountsViewState.kt | 11 +- .../ui/item/DebugAccountItems.kt | 11 - .../src/main/res/drawable/icon_account.xml | 2 +- .../src/main/res/layout/fragment_accounts.xml | 27 --- .../res/layout/fragment_accounts_compose.xml | 6 + .../redmadrobot/debug_sample/MainActivity.kt | 11 +- 9 files changed, 275 insertions(+), 155 deletions(-) create mode 100644 plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsScreen.kt delete mode 100644 plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/item/DebugAccountItems.kt delete mode 100644 plugins/accounts-plugin/src/main/res/layout/fragment_accounts.xml create mode 100644 plugins/accounts-plugin/src/main/res/layout/fragment_accounts_compose.xml diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsFragment.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsFragment.kt index fc71b002..24c6bf30 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsFragment.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsFragment.kt @@ -2,37 +2,20 @@ package com.redmadrobot.account_plugin.ui import android.os.Bundle import android.view.View -import android.widget.Toast -import androidx.core.view.isVisible -import androidx.recyclerview.widget.LinearLayoutManager import com.redmadrobot.account_plugin.R -import com.redmadrobot.account_plugin.data.model.DebugAccount -import com.redmadrobot.account_plugin.databinding.FragmentAccountsBinding -import com.redmadrobot.account_plugin.databinding.ItemAccountBinding -import com.redmadrobot.account_plugin.plugin.AccountSelectedEvent +import com.redmadrobot.account_plugin.databinding.FragmentAccountsComposeBinding import com.redmadrobot.account_plugin.plugin.AccountsPlugin import com.redmadrobot.account_plugin.plugin.AccountsPluginContainer -import com.redmadrobot.account_plugin.ui.add.AddAccountDialog -import com.redmadrobot.account_plugin.ui.item.DebugAccountItems import com.redmadrobot.debug_panel_common.base.PluginFragment -import com.redmadrobot.debug_panel_common.databinding.ItemSectionHeaderBinding -import com.redmadrobot.debug_panel_common.extension.observe import com.redmadrobot.debug_panel_common.extension.obtainShareViewModel import com.redmadrobot.debug_panel_core.extension.getPlugin -import com.redmadrobot.itemsadapter.ItemsAdapter -import com.redmadrobot.itemsadapter.bind -import com.redmadrobot.itemsadapter.itemsAdapter -import com.redmadrobot.debug_panel_common.R as CommonR -internal class AccountsFragment : PluginFragment(R.layout.fragment_accounts) { +internal class AccountsFragment : PluginFragment(R.layout.fragment_accounts_compose) { companion object { const val IS_EDIT_MODE_KEY = "IS_EDIT_MODE_KEY" } - private var _binding: FragmentAccountsBinding? = null - private val binding get() = checkNotNull(_binding) - private val isEditMode by lazy { requireNotNull(arguments).getBoolean(IS_EDIT_MODE_KEY) } @@ -45,88 +28,11 @@ internal class AccountsFragment : PluginFragment(R.layout.fragment_accounts) { } } - override fun onActivityCreated(savedInstanceState: Bundle?) { - super.onActivityCreated(savedInstanceState) - observe(viewModel.state, ::render) - viewModel.loadAccounts() - } - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - _binding = FragmentAccountsBinding.bind(view) - binding.setView() - } - - override fun onDestroyView() { - super.onDestroyView() - _binding = null - } - - private fun FragmentAccountsBinding.setView() { - accountList.layoutManager = LinearLayoutManager(requireContext()) - addAccount.setOnClickListener { - AddAccountDialog.show( - requireActivity().supportFragmentManager - ) - } - addAccount.isVisible = isEditMode - } - - private fun render(state: AccountsViewState) { - val adapter = createAdapterByState(state) - binding.accountList.adapter = adapter - } - - private fun createAdapterByState(state: AccountsViewState): ItemsAdapter { - return itemsAdapter(state.preInstalledAccounts.plus(state.addedAccounts)) { item -> - when (item) { - is DebugAccountItems.Header -> { - bind(CommonR.layout.item_section_header) { - itemSectionTitle.text = item.header - } - } - is DebugAccountItems.PreinstalledAccount -> { - bind(R.layout.item_account) { - accountLogin.text = item.account.login - if (!isEditMode) { - root.setOnClickListener { setAccountAsCurrent(item.account) } - } - } - } - is DebugAccountItems.AddedAccount -> { - bind(R.layout.item_account) { - accountLogin.text = item.account.login - accountDelete.isVisible = isEditMode - accountDelete.setOnClickListener { viewModel.removeAccount(item.account) } - root.setOnClickListener { onAddedAccountClicked(item.account) } - } - } - } + val binding = FragmentAccountsComposeBinding.bind(view) + binding.composeRoot.setContent { + AccountsScreen(viewModel, isEditMode) } } - - private fun onAddedAccountClicked(account: DebugAccount) { - if (isEditMode) openAccountDialog(account) else setAccountAsCurrent(account) - } - - private fun openAccountDialog(account: DebugAccount) { - AddAccountDialog.show( - fragmentManager = requireActivity().supportFragmentManager, - account = account - ) - } - - private fun setAccountAsCurrent(account: DebugAccount) { - getPlugin().debugAuthenticator.onAccountSelected(account) - pushEvent(account) - } - - private fun pushEvent(account: DebugAccount) { - Toast.makeText( - requireActivity(), - "Account ${account.login} selected", - Toast.LENGTH_SHORT - ).show() - getPlugin().pushEvent(AccountSelectedEvent(account)) - } } diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsScreen.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsScreen.kt new file mode 100644 index 00000000..332c0392 --- /dev/null +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsScreen.kt @@ -0,0 +1,226 @@ +package com.redmadrobot.account_plugin.ui + +import android.annotation.SuppressLint +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.* +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.* +import androidx.compose.runtime.* +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import androidx.compose.ui.window.Dialog +import androidx.lifecycle.asFlow +import com.google.android.material.composethemeadapter.MdcTheme +import com.redmadrobot.account_plugin.R +import com.redmadrobot.account_plugin.data.model.DebugAccount + +@SuppressLint("UnusedMaterialScaffoldPaddingParameter") +@Composable +internal fun AccountsScreen( + viewModel: AccountsViewModel, + isEditMode: Boolean +) { + val state by viewModel.state.asFlow().collectAsState(AccountsViewState()) + var showDialog by remember { mutableStateOf(false) } + var editableAccount by remember { mutableStateOf(null) } + + MdcTheme { + Scaffold( + floatingActionButton = { + if (isEditMode) { + ExtendedFloatingActionButton( + onClick = { showDialog = true }, + text = { Text("Add") }, + icon = { Icon(painterResource(R.drawable.icon_add_account), contentDescription = null) } + ) + } + } + ) { + AccountScreenLayout( + state = state, + isEditMode = isEditMode, + onSelectedClick = viewModel::setAccountAsCurrent, + onOpenDialogClick = { + showDialog = true + editableAccount = it + }, + onDeleteClick = viewModel::removeAccount, + ) + if (showDialog) { + AccountDetailsDialog( + onDismiss = { + showDialog = false + editableAccount = null + }, + onSaveClick = viewModel::saveAccount, + account = editableAccount + ) + } + } + } + LaunchedEffect(viewModel) { + viewModel.loadAccounts() + } +} + +@Composable +private fun AccountScreenLayout( + state: AccountsViewState, + isEditMode: Boolean, + onSelectedClick: (DebugAccount) -> Unit, + onDeleteClick: (DebugAccount) -> Unit, + onOpenDialogClick: (DebugAccount?) -> Unit, +) { + LazyColumn( + modifier = Modifier.fillMaxSize().padding(horizontal = 16.dp), + verticalArrangement = Arrangement.spacedBy(8.dp) + ) { + state.allItems.forEach { item -> + item { + when (item) { + is DebugAccountItem.Header -> { + Text( + item.header.uppercase(), + modifier = Modifier.fillParentMaxWidth().padding(vertical = 16.dp), + fontSize = 16.sp + ) + } + + is DebugAccountItem.PreinstalledAccount -> { + AccountItem( + item.account, + false, + onItemClick = { if (!isEditMode) onSelectedClick(it) } + ) + } + + is DebugAccountItem.AddedAccount -> { + AccountItem( + account = item.account, + showDelete = isEditMode, + onItemClick = { if (isEditMode) onOpenDialogClick(it) else onSelectedClick(it) }, + onDeleteClick = onDeleteClick, + ) + } + } + } + } + } +} + +@Composable +private fun AccountItem( + account: DebugAccount, + showDelete: Boolean, + onItemClick: (DebugAccount) -> Unit, + onDeleteClick: (DebugAccount) -> Unit = {}, +) { + Card( + modifier = Modifier.fillMaxWidth() + .height(56.dp) + .clickable { onItemClick(account) } + ) { + Box(modifier = Modifier.fillMaxSize().padding(horizontal = 16.dp)) { + Row( + modifier = Modifier.fillMaxSize(), + horizontalArrangement = Arrangement.spacedBy(32.dp), + verticalAlignment = Alignment.CenterVertically + ) { + Icon( + painter = painterResource(R.drawable.icon_account), + contentDescription = null, + tint = MaterialTheme.colors.primary + ) + Text(account.login) + } + if (showDelete) { + IconButton( + modifier = Modifier.align(Alignment.CenterEnd), + onClick = { onDeleteClick(account) }, + ) { + Icon( + painterResource(R.drawable.icon_delete), + contentDescription = null, + tint = Color.Red + ) + } + } + } + } +} + +@Composable +private fun AccountDetailsDialog( + onDismiss: () -> Unit, + onSaveClick: (DebugAccount) -> Unit, + account: DebugAccount? = null, +) { + var login by remember { mutableStateOf(account?.login.orEmpty()) } + var password by remember { mutableStateOf(account?.password.orEmpty()) } + var pin by remember { mutableStateOf(account?.pin.orEmpty()) } + + Dialog(onDismissRequest = onDismiss) { + Surface( + shape = RoundedCornerShape(16.dp), + color = Color.White + ) { + Box(modifier = Modifier.padding(16.dp)) { + Column { + OutlinedTextField( + value = login, + onValueChange = { login = it }, + label = { Text(stringResource(R.string.login_hint)) } + ) + Spacer(modifier = Modifier.height(24.dp)) + OutlinedTextField( + value = password, + onValueChange = { password = it }, + label = { Text(stringResource(R.string.password_hint)) } + ) + Spacer(modifier = Modifier.height(24.dp)) + OutlinedTextField( + value = pin, + onValueChange = { pin = it }, + label = { Text(stringResource(R.string.pin)) } + ) + Spacer(modifier = Modifier.height(24.dp)) + Button( + onClick = { + val account = DebugAccount( + id = account?.id ?: 0, + login = login, + password = password, + pin = pin + ) + onSaveClick(account) + onDismiss() + }, + modifier = Modifier.align(Alignment.End) + ) { + Text(stringResource(R.string.save_account_text).uppercase()) + } + } + } + } + } +} + +internal sealed class DebugAccountItem { + internal data class Header(val header: String) : DebugAccountItem() + internal data class PreinstalledAccount(val account: DebugAccount) : DebugAccountItem() + internal data class AddedAccount(var account: DebugAccount) : DebugAccountItem() +} + + +@Preview +@Composable +private fun DialogPreview() { + AccountDetailsDialog({}, {}) +} \ No newline at end of file diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsViewModel.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsViewModel.kt index 2fc34a0f..4787a99f 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsViewModel.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsViewModel.kt @@ -6,9 +6,11 @@ import androidx.lifecycle.viewModelScope import com.redmadrobot.account_plugin.R import com.redmadrobot.account_plugin.data.DebugAccountRepository import com.redmadrobot.account_plugin.data.model.DebugAccount -import com.redmadrobot.account_plugin.ui.item.DebugAccountItems +import com.redmadrobot.account_plugin.plugin.AccountSelectedEvent +import com.redmadrobot.account_plugin.plugin.AccountsPlugin import com.redmadrobot.debug_panel_common.base.PluginViewModel import com.redmadrobot.debug_panel_common.extension.safeLaunch +import com.redmadrobot.debug_panel_core.extension.getPlugin internal class AccountsViewModel( private val context: Context, @@ -30,14 +32,13 @@ internal class AccountsViewModel( } } - fun saveAccount(login: String, password: String, pin: String) { - val account = DebugAccount( - login = login, - password = password, - pin = pin - ) + fun saveAccount(debugAccount: DebugAccount) { viewModelScope.safeLaunch { - debugAccountsRepository.addAccount(account) + if (debugAccount.id != 0) { + debugAccountsRepository.updateAccount(debugAccount) + } else { + debugAccountsRepository.addAccount(debugAccount) + } loadAddedAccounts() } } @@ -68,14 +69,21 @@ internal class AccountsViewModel( } } + fun setAccountAsCurrent(account: DebugAccount) { + getPlugin().apply { + debugAuthenticator.onAccountSelected(account) + pushEvent(AccountSelectedEvent(account)) + } + } + private suspend fun loadPreInstalledAccounts() { val accounts = debugAccountsRepository.getPreInstalledAccounts() val preInstalledAccounts = if (accounts.isNotEmpty()) { val items = accounts.map { account -> - DebugAccountItems.PreinstalledAccount(account) + DebugAccountItem.PreinstalledAccount(account) } val header = context.getString(R.string.pre_installed_accounts) - listOf(/*Header item*/DebugAccountItems.Header(header)).plus(items) + listOf(/*Header item*/DebugAccountItem.Header(header)).plus(items) } else { emptyList() } @@ -86,10 +94,10 @@ internal class AccountsViewModel( val accounts = debugAccountsRepository.getAccounts() val addedAccountItems = if (accounts.isNotEmpty()) { val items = accounts.map { account -> - DebugAccountItems.AddedAccount(account) + DebugAccountItem.AddedAccount(account) } val header = context.getString(R.string.added_accounts) - listOf(/*Header item*/DebugAccountItems.Header(header)).plus(items) + listOf(/*Header item*/DebugAccountItem.Header(header)).plus(items) } else { emptyList() } diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsViewState.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsViewState.kt index 6a5dd2a4..649f0e4c 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsViewState.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsViewState.kt @@ -1,8 +1,11 @@ package com.redmadrobot.account_plugin.ui -import com.redmadrobot.account_plugin.ui.item.DebugAccountItems +import androidx.compose.runtime.Stable +@Stable internal data class AccountsViewState( - val preInstalledAccounts: List, - val addedAccounts: List -) + val preInstalledAccounts: List = emptyList(), + val addedAccounts: List = emptyList(), +) { + val allItems = preInstalledAccounts.plus(addedAccounts) +} diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/item/DebugAccountItems.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/item/DebugAccountItems.kt deleted file mode 100644 index 1ceea176..00000000 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/item/DebugAccountItems.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.redmadrobot.account_plugin.ui.item - -import com.redmadrobot.account_plugin.data.model.DebugAccount - - -internal sealed class DebugAccountItems { - internal data class Header(val header: String) : DebugAccountItems() - internal data class PreinstalledAccount(val account: DebugAccount) : DebugAccountItems() - internal data class AddedAccount(var account: DebugAccount) : DebugAccountItems() -} - diff --git a/plugins/accounts-plugin/src/main/res/drawable/icon_account.xml b/plugins/accounts-plugin/src/main/res/drawable/icon_account.xml index 7fe80c7b..4649894e 100644 --- a/plugins/accounts-plugin/src/main/res/drawable/icon_account.xml +++ b/plugins/accounts-plugin/src/main/res/drawable/icon_account.xml @@ -1,7 +1,7 @@ - - - - - - - diff --git a/plugins/accounts-plugin/src/main/res/layout/fragment_accounts_compose.xml b/plugins/accounts-plugin/src/main/res/layout/fragment_accounts_compose.xml new file mode 100644 index 00000000..73ae2883 --- /dev/null +++ b/plugins/accounts-plugin/src/main/res/layout/fragment_accounts_compose.xml @@ -0,0 +1,6 @@ + + diff --git a/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt b/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt index c2e632d7..78d17082 100644 --- a/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt +++ b/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt @@ -57,7 +57,7 @@ class MainActivity : AppCompatActivity() { ?.onEach { event -> when (event) { is AccountSelectedEvent -> { - //Обработка выбора аккаунта + showSelectedAccount(event.debugAccount.login) } is ServerSelectedEvent -> { @@ -143,6 +143,15 @@ class MainActivity : AppCompatActivity() { ).show() } + private fun showSelectedAccount(account: String) { + Toast.makeText( + this, + "Account $account selected", + Toast.LENGTH_LONG + ).show() + } + + private fun chooseAccount() { DebugPanel.showPanel(supportFragmentManager) } From 79596f49b4f810177800ee75e85228d6c6c3d647 Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Mon, 3 Oct 2022 21:41:56 +0300 Subject: [PATCH 04/42] Account: Rename package to com.redmadrobot.debug.account --- .../accounts/AccountSelectedEvent.kt | 4 ++-- .../debug_panel_no_op/accounts/AccountsPlugin.kt | 4 ++-- .../debug_panel_no_op/accounts/DebugAccount.kt | 2 +- .../debug_panel_no_op/accounts/DebugAuthenticator.kt | 4 ++-- docs/plugin_development.md | 2 +- .../authenticator/DebugAuthenticator.kt | 7 ------- .../account/authenticator/DebugAuthenticator.kt | 7 +++++++ .../account}/authenticator/DefaultAuthenticator.kt | 4 ++-- .../account}/data/DebugAccountRepository.kt | 4 ++-- .../account}/data/LocalDebugAccountRepository.kt | 6 +++--- .../account}/data/model/DebugAccount.kt | 2 +- .../account}/data/storage/AccountsPluginDatabase.kt | 4 ++-- .../account}/data/storage/DebugAccountDao.kt | 4 ++-- .../account}/plugin/AccountSelectedEvent.kt | 4 ++-- .../account}/plugin/AccountsPlugin.kt | 10 +++++----- .../account}/plugin/AccountsPluginContainer.kt | 10 +++++----- .../account}/ui/AccountsFragment.kt | 10 +++++----- .../account}/ui/AccountsScreen.kt | 6 +++--- .../account}/ui/AccountsViewModel.kt | 12 ++++++------ .../account}/ui/AccountsViewState.kt | 2 +- .../debug_sample/debug_data/DebugAccountsProvider.kt | 2 +- .../main/kotlin/com/redmadrobot/debug_sample/App.kt | 4 ++-- .../com/redmadrobot/debug_sample/MainActivity.kt | 2 +- .../debug_sample/account/DebugUserAuthenticator.kt | 4 ++-- 24 files changed, 60 insertions(+), 60 deletions(-) delete mode 100644 plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/authenticator/DebugAuthenticator.kt create mode 100644 plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DebugAuthenticator.kt rename plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/{account_plugin => debug/account}/authenticator/DefaultAuthenticator.kt (52%) rename plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/{account_plugin => debug/account}/data/DebugAccountRepository.kt (74%) rename plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/{account_plugin => debug/account}/data/LocalDebugAccountRepository.kt (85%) rename plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/{account_plugin => debug/account}/data/model/DebugAccount.kt (90%) rename plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/{account_plugin => debug/account}/data/storage/AccountsPluginDatabase.kt (85%) rename plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/{account_plugin => debug/account}/data/storage/DebugAccountDao.kt (77%) rename plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/{account_plugin => debug/account}/plugin/AccountSelectedEvent.kt (57%) rename plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/{account_plugin => debug/account}/plugin/AccountsPlugin.kt (82%) rename plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/{account_plugin => debug/account}/plugin/AccountsPluginContainer.kt (69%) rename plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/{account_plugin => debug/account}/ui/AccountsFragment.kt (78%) rename plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/{account_plugin => debug/account}/ui/AccountsScreen.kt (98%) rename plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/{account_plugin => debug/account}/ui/AccountsViewModel.kt (90%) rename plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/{account_plugin => debug/account}/ui/AccountsViewState.kt (87%) diff --git a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/AccountSelectedEvent.kt b/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/AccountSelectedEvent.kt index c3815205..51af7bda 100644 --- a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/AccountSelectedEvent.kt +++ b/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/AccountSelectedEvent.kt @@ -1,6 +1,6 @@ -package com.redmadrobot.account_plugin.plugin +package com.redmadrobot.debug.account.plugin -import com.redmadrobot.account_plugin.data.model.DebugAccount +import com.redmadrobot.debug.account.data.model.DebugAccount import com.redmadrobot.debug_panel_core.internal.DebugEvent data class AccountSelectedEvent(val debugAccount: DebugAccount) : DebugEvent diff --git a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/AccountsPlugin.kt b/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/AccountsPlugin.kt index a0c78a46..c70b911d 100644 --- a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/AccountsPlugin.kt +++ b/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/AccountsPlugin.kt @@ -1,6 +1,6 @@ -package com.redmadrobot.account_plugin.plugin +package com.redmadrobot.debug.account.plugin -import com.redmadrobot.account_plugin.data.model.DebugAccount +import com.redmadrobot.debug.account.data.model.DebugAccount import com.redmadrobot.debug_panel_core.data.DebugDataProvider import java.util.Collections.emptyList diff --git a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/DebugAccount.kt b/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/DebugAccount.kt index 80e505d5..83acfcbb 100644 --- a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/DebugAccount.kt +++ b/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/DebugAccount.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.account_plugin.data.model +package com.redmadrobot.debug.account.data.model data class DebugAccount( val id: Int = 0, diff --git a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/DebugAuthenticator.kt b/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/DebugAuthenticator.kt index 9893d800..e1054682 100644 --- a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/DebugAuthenticator.kt +++ b/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/DebugAuthenticator.kt @@ -1,6 +1,6 @@ -package com.redmadrobot.account_plugin.authenticator +package com.redmadrobot.debug.account.authenticator -import com.redmadrobot.account_plugin.data.model.DebugAccount +import com.redmadrobot.debug.account.data.model.DebugAccount interface DebugAuthenticator { fun onAccountSelected(account: DebugAccount) diff --git a/docs/plugin_development.md b/docs/plugin_development.md index 397350f9..f448f58e 100644 --- a/docs/plugin_development.md +++ b/docs/plugin_development.md @@ -114,7 +114,7 @@ public class YourPlugin( Вместо этого, в библиотеке используется подход с **Service Locator**. Для этого необходимо создать свой класс-контейнер, унаследовать его от **PluginDependencyContainer** и внутри него инициировать необходимые зависимости. Если вам для этого понадобится **Context**, его можно получить из **CommonContainer** который прилетает в качестве аргумента в методе `getPluginContainer()` при инициализации плагина. -Пример реализации можно [посмотреть тут](../plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/plugin/AccountsPluginContainer.kt) +Пример реализации можно [посмотреть тут](../plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account/plugin/AccountsPluginContainer.kt) ## Работа с классом плагина diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/authenticator/DebugAuthenticator.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/authenticator/DebugAuthenticator.kt deleted file mode 100644 index 18a3bd5c..00000000 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/authenticator/DebugAuthenticator.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.redmadrobot.account_plugin.authenticator - -import com.redmadrobot.account_plugin.data.model.DebugAccount - -public interface DebugAuthenticator { - public fun onAccountSelected(account: DebugAccount) -} diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DebugAuthenticator.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DebugAuthenticator.kt new file mode 100644 index 00000000..df65cf40 --- /dev/null +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DebugAuthenticator.kt @@ -0,0 +1,7 @@ +package com.redmadrobot.debug.account.authenticator + +import com.redmadrobot.debug.account.data.model.DebugAccount + +public interface DebugAuthenticator { + public fun onAccountSelected(account: DebugAccount) +} diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/authenticator/DefaultAuthenticator.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DefaultAuthenticator.kt similarity index 52% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/authenticator/DefaultAuthenticator.kt rename to plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DefaultAuthenticator.kt index 8676a95d..fa7e9072 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/authenticator/DefaultAuthenticator.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DefaultAuthenticator.kt @@ -1,6 +1,6 @@ -package com.redmadrobot.account_plugin.authenticator +package com.redmadrobot.debug.account.authenticator -import com.redmadrobot.account_plugin.data.model.DebugAccount +import com.redmadrobot.debug.account.data.model.DebugAccount internal class DefaultAuthenticator : DebugAuthenticator { override fun onAccountSelected(account: DebugAccount) = Unit diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/data/DebugAccountRepository.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/DebugAccountRepository.kt similarity index 74% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/data/DebugAccountRepository.kt rename to plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/DebugAccountRepository.kt index 3f41ddc3..314c2454 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/data/DebugAccountRepository.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/DebugAccountRepository.kt @@ -1,6 +1,6 @@ -package com.redmadrobot.account_plugin.data +package com.redmadrobot.debug.account.data -import com.redmadrobot.account_plugin.data.model.DebugAccount +import com.redmadrobot.debug.account.data.model.DebugAccount internal interface DebugAccountRepository { suspend fun addAccount(account: DebugAccount) diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/data/LocalDebugAccountRepository.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/LocalDebugAccountRepository.kt similarity index 85% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/data/LocalDebugAccountRepository.kt rename to plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/LocalDebugAccountRepository.kt index 6519335f..a1b32e38 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/data/LocalDebugAccountRepository.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/LocalDebugAccountRepository.kt @@ -1,7 +1,7 @@ -package com.redmadrobot.account_plugin.data +package com.redmadrobot.debug.account.data -import com.redmadrobot.account_plugin.data.model.DebugAccount -import com.redmadrobot.account_plugin.data.storage.DebugAccountDao +import com.redmadrobot.debug.account.data.model.DebugAccount +import com.redmadrobot.debug.account.data.storage.DebugAccountDao import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/data/model/DebugAccount.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/model/DebugAccount.kt similarity index 90% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/data/model/DebugAccount.kt rename to plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/model/DebugAccount.kt index 1f661184..98977a35 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/data/model/DebugAccount.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/model/DebugAccount.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.account_plugin.data.model +package com.redmadrobot.debug.account.data.model import androidx.room.ColumnInfo import androidx.room.Entity diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/data/storage/AccountsPluginDatabase.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/storage/AccountsPluginDatabase.kt similarity index 85% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/data/storage/AccountsPluginDatabase.kt rename to plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/storage/AccountsPluginDatabase.kt index 23f8e16a..ab95d7d7 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/data/storage/AccountsPluginDatabase.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/storage/AccountsPluginDatabase.kt @@ -1,10 +1,10 @@ -package com.redmadrobot.account_plugin.data.storage +package com.redmadrobot.debug.account.data.storage import android.content.Context import androidx.room.Database import androidx.room.Room import androidx.room.RoomDatabase -import com.redmadrobot.account_plugin.data.model.DebugAccount +import com.redmadrobot.debug.account.data.model.DebugAccount @Database( entities = [DebugAccount::class], diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/data/storage/DebugAccountDao.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/storage/DebugAccountDao.kt similarity index 77% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/data/storage/DebugAccountDao.kt rename to plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/storage/DebugAccountDao.kt index d4b6af97..354c6b8e 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/data/storage/DebugAccountDao.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/storage/DebugAccountDao.kt @@ -1,7 +1,7 @@ -package com.redmadrobot.account_plugin.data.storage +package com.redmadrobot.debug.account.data.storage import androidx.room.* -import com.redmadrobot.account_plugin.data.model.DebugAccount +import com.redmadrobot.debug.account.data.model.DebugAccount @Dao internal interface DebugAccountDao { diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/plugin/AccountSelectedEvent.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountSelectedEvent.kt similarity index 57% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/plugin/AccountSelectedEvent.kt rename to plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountSelectedEvent.kt index 3b355c81..7548ddb1 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/plugin/AccountSelectedEvent.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountSelectedEvent.kt @@ -1,6 +1,6 @@ -package com.redmadrobot.account_plugin.plugin +package com.redmadrobot.debug.account.plugin -import com.redmadrobot.account_plugin.data.model.DebugAccount +import com.redmadrobot.debug.account.data.model.DebugAccount import com.redmadrobot.debug_panel_core.internal.DebugEvent public data class AccountSelectedEvent(val debugAccount: DebugAccount) : DebugEvent diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/plugin/AccountsPlugin.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPlugin.kt similarity index 82% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/plugin/AccountsPlugin.kt rename to plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPlugin.kt index 0ae57c0a..94b6bdba 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/plugin/AccountsPlugin.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPlugin.kt @@ -1,11 +1,11 @@ -package com.redmadrobot.account_plugin.plugin +package com.redmadrobot.debug.account.plugin import androidx.core.os.bundleOf import androidx.fragment.app.Fragment -import com.redmadrobot.account_plugin.authenticator.DebugAuthenticator -import com.redmadrobot.account_plugin.authenticator.DefaultAuthenticator -import com.redmadrobot.account_plugin.data.model.DebugAccount -import com.redmadrobot.account_plugin.ui.AccountsFragment +import com.redmadrobot.debug.account.authenticator.DebugAuthenticator +import com.redmadrobot.debug.account.authenticator.DefaultAuthenticator +import com.redmadrobot.debug.account.data.model.DebugAccount +import com.redmadrobot.debug.account.ui.AccountsFragment import com.redmadrobot.debug_panel_core.CommonContainer import com.redmadrobot.debug_panel_core.data.DebugDataProvider import com.redmadrobot.debug_panel_core.plugin.Plugin diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/plugin/AccountsPluginContainer.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPluginContainer.kt similarity index 69% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/plugin/AccountsPluginContainer.kt rename to plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPluginContainer.kt index ea7b25e2..b296b6f8 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/plugin/AccountsPluginContainer.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPluginContainer.kt @@ -1,9 +1,9 @@ -package com.redmadrobot.account_plugin.plugin +package com.redmadrobot.debug.account.plugin -import com.redmadrobot.account_plugin.data.LocalDebugAccountRepository -import com.redmadrobot.account_plugin.data.model.DebugAccount -import com.redmadrobot.account_plugin.data.storage.AccountsPluginDatabase -import com.redmadrobot.account_plugin.ui.AccountsViewModel +import com.redmadrobot.debug.account.data.LocalDebugAccountRepository +import com.redmadrobot.debug.account.data.model.DebugAccount +import com.redmadrobot.debug.account.data.storage.AccountsPluginDatabase +import com.redmadrobot.debug.account.ui.AccountsViewModel import com.redmadrobot.debug_panel_core.CommonContainer import com.redmadrobot.debug_panel_core.plugin.PluginDependencyContainer diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsFragment.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsFragment.kt similarity index 78% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsFragment.kt rename to plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsFragment.kt index 24c6bf30..27cb9151 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsFragment.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsFragment.kt @@ -1,11 +1,11 @@ -package com.redmadrobot.account_plugin.ui +package com.redmadrobot.debug.account.ui import android.os.Bundle import android.view.View -import com.redmadrobot.account_plugin.R -import com.redmadrobot.account_plugin.databinding.FragmentAccountsComposeBinding -import com.redmadrobot.account_plugin.plugin.AccountsPlugin -import com.redmadrobot.account_plugin.plugin.AccountsPluginContainer +import com.redmadrobot.account.R +import com.redmadrobot.account.databinding.FragmentAccountsComposeBinding +import com.redmadrobot.debug.account.plugin.AccountsPlugin +import com.redmadrobot.debug.account.plugin.AccountsPluginContainer import com.redmadrobot.debug_panel_common.base.PluginFragment import com.redmadrobot.debug_panel_common.extension.obtainShareViewModel import com.redmadrobot.debug_panel_core.extension.getPlugin diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsScreen.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsScreen.kt similarity index 98% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsScreen.kt rename to plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsScreen.kt index 332c0392..ffce60be 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsScreen.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsScreen.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.account_plugin.ui +package com.redmadrobot.debug.account.ui import android.annotation.SuppressLint import androidx.compose.foundation.clickable @@ -18,8 +18,8 @@ import androidx.compose.ui.unit.sp import androidx.compose.ui.window.Dialog import androidx.lifecycle.asFlow import com.google.android.material.composethemeadapter.MdcTheme -import com.redmadrobot.account_plugin.R -import com.redmadrobot.account_plugin.data.model.DebugAccount +import com.redmadrobot.account.R +import com.redmadrobot.debug.account.data.model.DebugAccount @SuppressLint("UnusedMaterialScaffoldPaddingParameter") @Composable diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsViewModel.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewModel.kt similarity index 90% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsViewModel.kt rename to plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewModel.kt index 4787a99f..2c82b943 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsViewModel.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewModel.kt @@ -1,13 +1,13 @@ -package com.redmadrobot.account_plugin.ui +package com.redmadrobot.debug.account.ui import android.content.Context import androidx.lifecycle.MutableLiveData import androidx.lifecycle.viewModelScope -import com.redmadrobot.account_plugin.R -import com.redmadrobot.account_plugin.data.DebugAccountRepository -import com.redmadrobot.account_plugin.data.model.DebugAccount -import com.redmadrobot.account_plugin.plugin.AccountSelectedEvent -import com.redmadrobot.account_plugin.plugin.AccountsPlugin +import com.redmadrobot.account.R +import com.redmadrobot.debug.account.data.DebugAccountRepository +import com.redmadrobot.debug.account.data.model.DebugAccount +import com.redmadrobot.debug.account.plugin.AccountSelectedEvent +import com.redmadrobot.debug.account.plugin.AccountsPlugin import com.redmadrobot.debug_panel_common.base.PluginViewModel import com.redmadrobot.debug_panel_common.extension.safeLaunch import com.redmadrobot.debug_panel_core.extension.getPlugin diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsViewState.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewState.kt similarity index 87% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsViewState.kt rename to plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewState.kt index 649f0e4c..aa0e8e55 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/account_plugin/ui/AccountsViewState.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewState.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.account_plugin.ui +package com.redmadrobot.debug.account.ui import androidx.compose.runtime.Stable diff --git a/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugAccountsProvider.kt b/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugAccountsProvider.kt index e34b49d6..9340aa0a 100644 --- a/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugAccountsProvider.kt +++ b/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugAccountsProvider.kt @@ -1,6 +1,6 @@ package com.redmadrobot.debug_sample.debug_data -import com.redmadrobot.account_plugin.data.model.DebugAccount +import com.redmadrobot.debug.account.data.model.DebugAccount import com.redmadrobot.debug_panel_core.data.DebugDataProvider class DebugAccountsProvider : DebugDataProvider> { diff --git a/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt b/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt index 8bc5f128..b819bba2 100644 --- a/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt +++ b/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt @@ -1,8 +1,8 @@ package com.redmadrobot.debug_sample import android.app.Application -import com.redmadrobot.account_plugin.data.model.DebugAccount -import com.redmadrobot.account_plugin.plugin.AccountsPlugin +import com.redmadrobot.debug.account.data.model.DebugAccount +import com.redmadrobot.debug.account.plugin.AccountsPlugin import com.redmadrobot.app_settings_plugin.plugin.AppSettingsPlugin import com.redmadrobot.debug_panel_core.internal.DebugPanel import com.redmadrobot.debug_panel_core.internal.DebugPanelConfig diff --git a/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt b/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt index 78d17082..b88198dc 100644 --- a/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt +++ b/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt @@ -7,7 +7,7 @@ import android.view.View import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.lifecycle.lifecycleScope -import com.redmadrobot.account_plugin.plugin.AccountSelectedEvent +import com.redmadrobot.debug.account.plugin.AccountSelectedEvent import com.redmadrobot.debug_panel_core.internal.DebugPanel import com.redmadrobot.debug_sample.network.ApiFactory import com.redmadrobot.debugpanel.R diff --git a/sample/src/main/kotlin/com/redmadrobot/debug_sample/account/DebugUserAuthenticator.kt b/sample/src/main/kotlin/com/redmadrobot/debug_sample/account/DebugUserAuthenticator.kt index 7258f537..2ade37ff 100644 --- a/sample/src/main/kotlin/com/redmadrobot/debug_sample/account/DebugUserAuthenticator.kt +++ b/sample/src/main/kotlin/com/redmadrobot/debug_sample/account/DebugUserAuthenticator.kt @@ -1,7 +1,7 @@ package com.redmadrobot.debug_sample.account -import com.redmadrobot.account_plugin.authenticator.DebugAuthenticator -import com.redmadrobot.account_plugin.data.model.DebugAccount +import com.redmadrobot.debug.account.authenticator.DebugAuthenticator +import com.redmadrobot.debug.account.data.model.DebugAccount import timber.log.Timber class DebugUserAuthenticator : DebugAuthenticator { From 99179abb8b2f22d45f2a41fc33105d0b44470b8c Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Tue, 6 Dec 2022 11:32:43 +0300 Subject: [PATCH 05/42] Common:Rename 'debug-panel-common' module package to com.redmadrobot.debug.common --- .../common}/base/PluginFragment.kt | 2 +- .../common}/base/PluginViewModel.kt | 2 +- .../common}/extension/CoroutinesExtension.kt | 2 +- .../common}/extension/LifecicleExt.kt | 2 +- .../com/redmadrobot/debug/account/ui/AccountsFragment.kt | 4 ++-- .../com/redmadrobot/debug/account/ui/AccountsViewModel.kt | 4 ++-- .../app_settings_plugin/ui/ApplicationSettingsFragment.kt | 6 +++--- .../app_settings_plugin/ui/ApplicationSettingsViewModel.kt | 2 +- .../flipper_plugin/ui/FlipperFeaturesFragment.kt | 4 ++-- .../flipper_plugin/ui/FlipperFeaturesViewModel.kt | 2 +- .../ui/dialog/SourceSelectionDialogFragment.kt | 2 +- .../flipper_plugin/ui/dialog/SourceSelectionViewModel.kt | 2 +- .../com/redmadrobot/servers_plugin/ui/ServerHostDialog.kt | 2 +- .../com/redmadrobot/servers_plugin/ui/ServersFragment.kt | 6 +++--- .../com/redmadrobot/servers_plugin/ui/ServersViewModel.kt | 4 ++-- .../com/redmadrobot/variable_plugin/ui/VariableFragment.kt | 2 +- .../com/redmadrobot/variable_plugin/ui/VariableViewModel.kt | 2 +- 17 files changed, 25 insertions(+), 25 deletions(-) rename debug-panel-common/src/main/kotlin/com/redmadrobot/{debug_panel_common => debug/common}/base/PluginFragment.kt (93%) rename debug-panel-common/src/main/kotlin/com/redmadrobot/{debug_panel_common => debug/common}/base/PluginViewModel.kt (64%) rename debug-panel-common/src/main/kotlin/com/redmadrobot/{debug_panel_common => debug/common}/extension/CoroutinesExtension.kt (94%) rename debug-panel-common/src/main/kotlin/com/redmadrobot/{debug_panel_common => debug/common}/extension/LifecicleExt.kt (96%) diff --git a/debug-panel-common/src/main/kotlin/com/redmadrobot/debug_panel_common/base/PluginFragment.kt b/debug-panel-common/src/main/kotlin/com/redmadrobot/debug/common/base/PluginFragment.kt similarity index 93% rename from debug-panel-common/src/main/kotlin/com/redmadrobot/debug_panel_common/base/PluginFragment.kt rename to debug-panel-common/src/main/kotlin/com/redmadrobot/debug/common/base/PluginFragment.kt index 4d73a5f0..5a330d93 100644 --- a/debug-panel-common/src/main/kotlin/com/redmadrobot/debug_panel_common/base/PluginFragment.kt +++ b/debug-panel-common/src/main/kotlin/com/redmadrobot/debug/common/base/PluginFragment.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.debug_panel_common.base +package com.redmadrobot.debug.common.base import android.os.Bundle import android.view.LayoutInflater diff --git a/debug-panel-common/src/main/kotlin/com/redmadrobot/debug_panel_common/base/PluginViewModel.kt b/debug-panel-common/src/main/kotlin/com/redmadrobot/debug/common/base/PluginViewModel.kt similarity index 64% rename from debug-panel-common/src/main/kotlin/com/redmadrobot/debug_panel_common/base/PluginViewModel.kt rename to debug-panel-common/src/main/kotlin/com/redmadrobot/debug/common/base/PluginViewModel.kt index 920da676..b0a8e2a0 100644 --- a/debug-panel-common/src/main/kotlin/com/redmadrobot/debug_panel_common/base/PluginViewModel.kt +++ b/debug-panel-common/src/main/kotlin/com/redmadrobot/debug/common/base/PluginViewModel.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.debug_panel_common.base +package com.redmadrobot.debug.common.base import androidx.lifecycle.ViewModel diff --git a/debug-panel-common/src/main/kotlin/com/redmadrobot/debug_panel_common/extension/CoroutinesExtension.kt b/debug-panel-common/src/main/kotlin/com/redmadrobot/debug/common/extension/CoroutinesExtension.kt similarity index 94% rename from debug-panel-common/src/main/kotlin/com/redmadrobot/debug_panel_common/extension/CoroutinesExtension.kt rename to debug-panel-common/src/main/kotlin/com/redmadrobot/debug/common/extension/CoroutinesExtension.kt index 4205fd0b..a4a4b86f 100644 --- a/debug-panel-common/src/main/kotlin/com/redmadrobot/debug_panel_common/extension/CoroutinesExtension.kt +++ b/debug-panel-common/src/main/kotlin/com/redmadrobot/debug/common/extension/CoroutinesExtension.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.debug_panel_common.extension +package com.redmadrobot.debug.common.extension import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineScope diff --git a/debug-panel-common/src/main/kotlin/com/redmadrobot/debug_panel_common/extension/LifecicleExt.kt b/debug-panel-common/src/main/kotlin/com/redmadrobot/debug/common/extension/LifecicleExt.kt similarity index 96% rename from debug-panel-common/src/main/kotlin/com/redmadrobot/debug_panel_common/extension/LifecicleExt.kt rename to debug-panel-common/src/main/kotlin/com/redmadrobot/debug/common/extension/LifecicleExt.kt index f9c57c90..843b5390 100644 --- a/debug-panel-common/src/main/kotlin/com/redmadrobot/debug_panel_common/extension/LifecicleExt.kt +++ b/debug-panel-common/src/main/kotlin/com/redmadrobot/debug/common/extension/LifecicleExt.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.debug_panel_common.extension +package com.redmadrobot.debug.common.extension import androidx.annotation.MainThread import androidx.fragment.app.Fragment diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsFragment.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsFragment.kt index 27cb9151..022b1ab7 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsFragment.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsFragment.kt @@ -6,8 +6,8 @@ import com.redmadrobot.account.R import com.redmadrobot.account.databinding.FragmentAccountsComposeBinding import com.redmadrobot.debug.account.plugin.AccountsPlugin import com.redmadrobot.debug.account.plugin.AccountsPluginContainer -import com.redmadrobot.debug_panel_common.base.PluginFragment -import com.redmadrobot.debug_panel_common.extension.obtainShareViewModel +import com.redmadrobot.debug.common.base.PluginFragment +import com.redmadrobot.debug.common.extension.obtainShareViewModel import com.redmadrobot.debug_panel_core.extension.getPlugin internal class AccountsFragment : PluginFragment(R.layout.fragment_accounts_compose) { diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewModel.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewModel.kt index 2c82b943..76adebe2 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewModel.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewModel.kt @@ -8,8 +8,8 @@ import com.redmadrobot.debug.account.data.DebugAccountRepository import com.redmadrobot.debug.account.data.model.DebugAccount import com.redmadrobot.debug.account.plugin.AccountSelectedEvent import com.redmadrobot.debug.account.plugin.AccountsPlugin -import com.redmadrobot.debug_panel_common.base.PluginViewModel -import com.redmadrobot.debug_panel_common.extension.safeLaunch +import com.redmadrobot.debug.common.base.PluginViewModel +import com.redmadrobot.debug.common.extension.safeLaunch import com.redmadrobot.debug_panel_core.extension.getPlugin internal class AccountsViewModel( diff --git a/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsFragment.kt b/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsFragment.kt index 497967ef..6ed26a23 100644 --- a/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsFragment.kt +++ b/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsFragment.kt @@ -8,9 +8,9 @@ import com.redmadrobot.app_settings_plugin.databinding.FragmentAppSettingsBindin import com.redmadrobot.app_settings_plugin.plugin.AppSettingsPlugin import com.redmadrobot.app_settings_plugin.plugin.AppSettingsPluginContainer import com.redmadrobot.app_settings_plugin.ui.item.AppSettingItems -import com.redmadrobot.debug_panel_common.base.PluginFragment -import com.redmadrobot.debug_panel_common.extension.observe -import com.redmadrobot.debug_panel_common.extension.obtainViewModel +import com.redmadrobot.debug.common.base.PluginFragment +import com.redmadrobot.debug.common.extension.observe +import com.redmadrobot.debug.common.extension.obtainViewModel import com.redmadrobot.debug_panel_core.extension.getPlugin import com.redmadrobot.itemsadapter.itemsAdapter diff --git a/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsViewModel.kt b/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsViewModel.kt index 70006072..c081818e 100644 --- a/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsViewModel.kt +++ b/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsViewModel.kt @@ -4,7 +4,7 @@ import android.content.SharedPreferences import androidx.lifecycle.MutableLiveData import com.redmadrobot.app_settings_plugin.data.AppSettingsRepository import com.redmadrobot.app_settings_plugin.ui.item.AppSettingItems -import com.redmadrobot.debug_panel_common.base.PluginViewModel +import com.redmadrobot.debug.common.base.PluginViewModel internal class ApplicationSettingsViewModel( private val appSettingsRepository: AppSettingsRepository diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesFragment.kt b/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesFragment.kt index 56f531e0..a67f9b14 100644 --- a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesFragment.kt +++ b/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesFragment.kt @@ -6,8 +6,8 @@ import androidx.core.widget.addTextChangedListener import androidx.lifecycle.Lifecycle import androidx.lifecycle.flowWithLifecycle import androidx.lifecycle.lifecycleScope -import com.redmadrobot.debug_panel_common.base.PluginFragment -import com.redmadrobot.debug_panel_common.extension.obtainShareViewModel +import com.redmadrobot.debug.common.base.PluginFragment +import com.redmadrobot.debug.common.extension.obtainShareViewModel import com.redmadrobot.debug_panel_core.extension.getPlugin import com.redmadrobot.flipper_plugin.R import com.redmadrobot.flipper_plugin.databinding.FragmentFlipperFeaturesBinding diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesViewModel.kt b/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesViewModel.kt index ec8c822b..d463ef54 100644 --- a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesViewModel.kt +++ b/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesViewModel.kt @@ -1,7 +1,7 @@ package com.redmadrobot.flipper_plugin.ui import androidx.lifecycle.viewModelScope -import com.redmadrobot.debug_panel_common.base.PluginViewModel +import com.redmadrobot.debug.common.base.PluginViewModel import com.redmadrobot.flipper.config.FlipperValue import com.redmadrobot.flipper_plugin.data.FeatureTogglesRepository import com.redmadrobot.flipper_plugin.plugin.PluginToggle diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionDialogFragment.kt b/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionDialogFragment.kt index 0d02ad03..d9a3d264 100644 --- a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionDialogFragment.kt +++ b/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionDialogFragment.kt @@ -9,7 +9,7 @@ import androidx.lifecycle.Lifecycle import androidx.lifecycle.flowWithLifecycle import androidx.lifecycle.lifecycleScope import com.google.android.material.bottomsheet.BottomSheetDialogFragment -import com.redmadrobot.debug_panel_common.extension.obtainShareViewModel +import com.redmadrobot.debug.common.extension.obtainShareViewModel import com.redmadrobot.debug_panel_core.extension.getPlugin import com.redmadrobot.flipper_plugin.R import com.redmadrobot.flipper_plugin.databinding.DialogFlipperSourceBinding diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionViewModel.kt b/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionViewModel.kt index ebf488a4..1468cd6c 100644 --- a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionViewModel.kt +++ b/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionViewModel.kt @@ -2,7 +2,7 @@ package com.redmadrobot.flipper_plugin.ui.dialog import android.content.Context import androidx.lifecycle.viewModelScope -import com.redmadrobot.debug_panel_common.base.PluginViewModel +import com.redmadrobot.debug.common.base.PluginViewModel import com.redmadrobot.flipper_plugin.R import com.redmadrobot.flipper_plugin.data.FeatureTogglesRepository import com.redmadrobot.flipper_plugin.data.FeatureTogglesSource diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServerHostDialog.kt b/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServerHostDialog.kt index e8c5ec9f..61b8c668 100644 --- a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServerHostDialog.kt +++ b/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServerHostDialog.kt @@ -8,7 +8,7 @@ import android.view.ViewGroup import android.widget.LinearLayout import androidx.fragment.app.DialogFragment import androidx.fragment.app.FragmentManager -import com.redmadrobot.debug_panel_common.extension.obtainShareViewModel +import com.redmadrobot.debug.common.extension.obtainShareViewModel import com.redmadrobot.debug_panel_core.extension.getPlugin import com.redmadrobot.servers_plugin.R import com.redmadrobot.servers_plugin.databinding.DialogServerBinding diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersFragment.kt b/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersFragment.kt index 27f25a43..4fbfaa10 100644 --- a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersFragment.kt +++ b/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersFragment.kt @@ -4,10 +4,10 @@ import android.os.Bundle import android.view.View import androidx.core.view.isVisible import androidx.recyclerview.widget.LinearLayoutManager -import com.redmadrobot.debug_panel_common.base.PluginFragment +import com.redmadrobot.debug.common.base.PluginFragment import com.redmadrobot.debug_panel_common.databinding.ItemSectionHeaderBinding -import com.redmadrobot.debug_panel_common.extension.observe -import com.redmadrobot.debug_panel_common.extension.obtainShareViewModel +import com.redmadrobot.debug.common.extension.observe +import com.redmadrobot.debug.common.extension.obtainShareViewModel import com.redmadrobot.debug_panel_core.extension.getPlugin import com.redmadrobot.itemsadapter.ItemsAdapter import com.redmadrobot.itemsadapter.bind diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewModel.kt b/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewModel.kt index 0de7980a..009b8c3d 100644 --- a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewModel.kt +++ b/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewModel.kt @@ -3,8 +3,8 @@ package com.redmadrobot.servers_plugin.ui import android.content.Context import androidx.lifecycle.MutableLiveData import androidx.lifecycle.viewModelScope -import com.redmadrobot.debug_panel_common.base.PluginViewModel -import com.redmadrobot.debug_panel_common.extension.safeLaunch +import com.redmadrobot.debug.common.base.PluginViewModel +import com.redmadrobot.debug.common.extension.safeLaunch import com.redmadrobot.debug_panel_core.extension.getPlugin import com.redmadrobot.servers_plugin.R import com.redmadrobot.servers_plugin.data.DebugServerRepository diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableFragment.kt b/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableFragment.kt index ac845deb..ef1b6ddb 100644 --- a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableFragment.kt +++ b/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableFragment.kt @@ -4,7 +4,7 @@ import android.os.Bundle import android.view.View import androidx.fragment.app.Fragment import androidx.lifecycle.lifecycleScope -import com.redmadrobot.debug_panel_common.extension.obtainShareViewModel +import com.redmadrobot.debug.common.extension.obtainShareViewModel import com.redmadrobot.debug_panel_core.extension.getPlugin import com.redmadrobot.variable_plugin.R import com.redmadrobot.variable_plugin.databinding.FragmentVariableBinding diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableViewModel.kt b/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableViewModel.kt index 4d5c67d2..dba76002 100644 --- a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableViewModel.kt +++ b/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableViewModel.kt @@ -1,6 +1,6 @@ package com.redmadrobot.variable_plugin.ui -import com.redmadrobot.debug_panel_common.base.PluginViewModel +import com.redmadrobot.debug.common.base.PluginViewModel import com.redmadrobot.variable_plugin.data.VariableRepository import com.redmadrobot.variable_plugin.plugin.VariableItem import com.redmadrobot.variable_plugin.plugin.VariableWidget From 2814222f2bbd2ab69be884c4fa2b88393a3a7798 Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Tue, 6 Dec 2022 11:42:11 +0300 Subject: [PATCH 06/42] Common: Rename 'debug-panel-common' module to 'common' --- {debug-panel-common => common}/.gitignore | 0 {debug-panel-common => common}/build.gradle.kts | 0 {debug-panel-common => common}/consumer-rules.pro | 0 {debug-panel-common => common}/library.properties | 0 {debug-panel-common => common}/proguard-rules.pro | 0 common/src/main/AndroidManifest.xml | 4 ++++ .../com/redmadrobot/debug/common/base/PluginFragment.kt | 0 .../com/redmadrobot/debug/common/base/PluginViewModel.kt | 0 .../redmadrobot/debug/common/extension/CoroutinesExtension.kt | 0 .../com/redmadrobot/debug/common/extension/LifecicleExt.kt | 0 .../src/main/res/layout/item_section_header.xml | 0 {debug-panel-common => common}/src/main/res/values/colors.xml | 0 {debug-panel-common => common}/src/main/res/values/dimens.xml | 0 {debug-panel-common => common}/src/main/res/values/styles.xml | 0 debug-panel-core/build.gradle.kts | 2 +- plugins/accounts-plugin/build.gradle.kts | 4 ++-- plugins/app-settings-plugin/build.gradle.kts | 4 ++-- plugins/flipper-plugin/build.gradle.kts | 4 ++-- plugins/servers-plugin/build.gradle.kts | 4 ++-- plugins/variable-plugin/build.gradle.kts | 4 ++-- settings.gradle.kts | 2 +- 21 files changed, 16 insertions(+), 12 deletions(-) rename {debug-panel-common => common}/.gitignore (100%) rename {debug-panel-common => common}/build.gradle.kts (100%) rename {debug-panel-common => common}/consumer-rules.pro (100%) rename {debug-panel-common => common}/library.properties (100%) rename {debug-panel-common => common}/proguard-rules.pro (100%) create mode 100644 common/src/main/AndroidManifest.xml rename {debug-panel-common => common}/src/main/kotlin/com/redmadrobot/debug/common/base/PluginFragment.kt (100%) rename {debug-panel-common => common}/src/main/kotlin/com/redmadrobot/debug/common/base/PluginViewModel.kt (100%) rename {debug-panel-common => common}/src/main/kotlin/com/redmadrobot/debug/common/extension/CoroutinesExtension.kt (100%) rename {debug-panel-common => common}/src/main/kotlin/com/redmadrobot/debug/common/extension/LifecicleExt.kt (100%) rename {debug-panel-common => common}/src/main/res/layout/item_section_header.xml (100%) rename {debug-panel-common => common}/src/main/res/values/colors.xml (100%) rename {debug-panel-common => common}/src/main/res/values/dimens.xml (100%) rename {debug-panel-common => common}/src/main/res/values/styles.xml (100%) diff --git a/debug-panel-common/.gitignore b/common/.gitignore similarity index 100% rename from debug-panel-common/.gitignore rename to common/.gitignore diff --git a/debug-panel-common/build.gradle.kts b/common/build.gradle.kts similarity index 100% rename from debug-panel-common/build.gradle.kts rename to common/build.gradle.kts diff --git a/debug-panel-common/consumer-rules.pro b/common/consumer-rules.pro similarity index 100% rename from debug-panel-common/consumer-rules.pro rename to common/consumer-rules.pro diff --git a/debug-panel-common/library.properties b/common/library.properties similarity index 100% rename from debug-panel-common/library.properties rename to common/library.properties diff --git a/debug-panel-common/proguard-rules.pro b/common/proguard-rules.pro similarity index 100% rename from debug-panel-common/proguard-rules.pro rename to common/proguard-rules.pro diff --git a/common/src/main/AndroidManifest.xml b/common/src/main/AndroidManifest.xml new file mode 100644 index 00000000..a74589f8 --- /dev/null +++ b/common/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + diff --git a/debug-panel-common/src/main/kotlin/com/redmadrobot/debug/common/base/PluginFragment.kt b/common/src/main/kotlin/com/redmadrobot/debug/common/base/PluginFragment.kt similarity index 100% rename from debug-panel-common/src/main/kotlin/com/redmadrobot/debug/common/base/PluginFragment.kt rename to common/src/main/kotlin/com/redmadrobot/debug/common/base/PluginFragment.kt diff --git a/debug-panel-common/src/main/kotlin/com/redmadrobot/debug/common/base/PluginViewModel.kt b/common/src/main/kotlin/com/redmadrobot/debug/common/base/PluginViewModel.kt similarity index 100% rename from debug-panel-common/src/main/kotlin/com/redmadrobot/debug/common/base/PluginViewModel.kt rename to common/src/main/kotlin/com/redmadrobot/debug/common/base/PluginViewModel.kt diff --git a/debug-panel-common/src/main/kotlin/com/redmadrobot/debug/common/extension/CoroutinesExtension.kt b/common/src/main/kotlin/com/redmadrobot/debug/common/extension/CoroutinesExtension.kt similarity index 100% rename from debug-panel-common/src/main/kotlin/com/redmadrobot/debug/common/extension/CoroutinesExtension.kt rename to common/src/main/kotlin/com/redmadrobot/debug/common/extension/CoroutinesExtension.kt diff --git a/debug-panel-common/src/main/kotlin/com/redmadrobot/debug/common/extension/LifecicleExt.kt b/common/src/main/kotlin/com/redmadrobot/debug/common/extension/LifecicleExt.kt similarity index 100% rename from debug-panel-common/src/main/kotlin/com/redmadrobot/debug/common/extension/LifecicleExt.kt rename to common/src/main/kotlin/com/redmadrobot/debug/common/extension/LifecicleExt.kt diff --git a/debug-panel-common/src/main/res/layout/item_section_header.xml b/common/src/main/res/layout/item_section_header.xml similarity index 100% rename from debug-panel-common/src/main/res/layout/item_section_header.xml rename to common/src/main/res/layout/item_section_header.xml diff --git a/debug-panel-common/src/main/res/values/colors.xml b/common/src/main/res/values/colors.xml similarity index 100% rename from debug-panel-common/src/main/res/values/colors.xml rename to common/src/main/res/values/colors.xml diff --git a/debug-panel-common/src/main/res/values/dimens.xml b/common/src/main/res/values/dimens.xml similarity index 100% rename from debug-panel-common/src/main/res/values/dimens.xml rename to common/src/main/res/values/dimens.xml diff --git a/debug-panel-common/src/main/res/values/styles.xml b/common/src/main/res/values/styles.xml similarity index 100% rename from debug-panel-common/src/main/res/values/styles.xml rename to common/src/main/res/values/styles.xml diff --git a/debug-panel-core/build.gradle.kts b/debug-panel-core/build.gradle.kts index 85bae41b..17b909c3 100644 --- a/debug-panel-core/build.gradle.kts +++ b/debug-panel-core/build.gradle.kts @@ -53,6 +53,6 @@ kotlin { } dependencies { - implementation(project(":debug-panel-common")) + implementation(project(":common")) kapt(androidx.room.compiler) } diff --git a/plugins/accounts-plugin/build.gradle.kts b/plugins/accounts-plugin/build.gradle.kts index 00781dd7..01374f57 100644 --- a/plugins/accounts-plugin/build.gradle.kts +++ b/plugins/accounts-plugin/build.gradle.kts @@ -58,8 +58,8 @@ kotlin { } dependencies { - implementation(project(":debug-panel-core")) - implementation(project(":debug-panel-common")) + implementation(project(":core")) + implementation(project(":common")) implementation(kotlin("stdlib")) kapt(androidx.room.compiler) } diff --git a/plugins/app-settings-plugin/build.gradle.kts b/plugins/app-settings-plugin/build.gradle.kts index 0b0bf194..8be8c628 100644 --- a/plugins/app-settings-plugin/build.gradle.kts +++ b/plugins/app-settings-plugin/build.gradle.kts @@ -52,8 +52,8 @@ kotlin { } dependencies { - implementation(project(":debug-panel-core")) - implementation(project(":debug-panel-common")) + implementation(project(":core")) + implementation(project(":common")) implementation(kotlin("stdlib")) kapt(androidx.room.compiler) } diff --git a/plugins/flipper-plugin/build.gradle.kts b/plugins/flipper-plugin/build.gradle.kts index 86bd8e3d..c8f06376 100644 --- a/plugins/flipper-plugin/build.gradle.kts +++ b/plugins/flipper-plugin/build.gradle.kts @@ -49,7 +49,7 @@ android { } dependencies { - implementation(project(":debug-panel-core")) - implementation(project(":debug-panel-common")) + implementation(project(":core")) + implementation(project(":common")) implementation(androidx.lifecycle.runtime) } diff --git a/plugins/servers-plugin/build.gradle.kts b/plugins/servers-plugin/build.gradle.kts index f14c89b0..a9cd8676 100644 --- a/plugins/servers-plugin/build.gradle.kts +++ b/plugins/servers-plugin/build.gradle.kts @@ -52,8 +52,8 @@ kotlin { } dependencies { - implementation(project(":debug-panel-core")) - implementation(project(":debug-panel-common")) + implementation(project(":core")) + implementation(project(":common")) implementation(kotlin("stdlib")) kapt(androidx.room.compiler) } diff --git a/plugins/variable-plugin/build.gradle.kts b/plugins/variable-plugin/build.gradle.kts index 271325cc..2bcd02fe 100644 --- a/plugins/variable-plugin/build.gradle.kts +++ b/plugins/variable-plugin/build.gradle.kts @@ -49,7 +49,7 @@ android { } dependencies { - implementation(project(":debug-panel-core")) - implementation(project(":debug-panel-common")) + implementation(project(":core")) + implementation(project(":common")) implementation(kotlin("stdlib")) } diff --git a/settings.gradle.kts b/settings.gradle.kts index a912ed91..75ce64d7 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -31,7 +31,7 @@ dependencyResolutionManagement { // Base modules include( - ":debug-panel-common", + ":common", ":debug-panel-no-op", ":debug-panel-core" ) From e8d35051f06e4f95be4de795049bdd52ba062a24 Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Tue, 6 Dec 2022 11:39:48 +0300 Subject: [PATCH 07/42] Core: Rename 'debug-panel-core' module package to com.redmadrobot.debug.common --- build.gradle.kts | 2 +- debug-panel-core/src/main/AndroidManifest.xml | 4 ++-- .../com/redmadrobot/debug/core/CommonContainer.kt | 8 ++++++++ .../core}/DebugPanelInstance.kt | 8 ++++---- .../core}/annotation/DebugPanelInternal.kt | 4 ++-- .../core}/data/DebugDataProvider.kt | 2 +- .../core}/extension/PluginsExt.kt | 8 ++++---- .../core}/inapp/DebugBottomSheet.kt | 4 ++-- .../core}/inapp/DebugSheetViewPagerAdapter.kt | 4 ++-- .../core}/inapp/ModalLayout.kt | 2 +- .../core}/inapp/shake/ShakeController.kt | 4 ++-- .../core}/inapp/shake/ShakeListener.kt | 2 +- .../com/redmadrobot/debug/core/internal/DebugEvent.kt | 3 +++ .../core}/internal/DebugPanel.kt | 10 +++++----- .../core}/internal/DebugPanelConfig.kt | 4 ++-- .../{debug_panel_core => debug/core}/plugin/Plugin.kt | 8 ++++---- .../debug/core/plugin/PluginDependencyContainer.kt | 6 ++++++ .../core}/plugin/PluginManager.kt | 4 ++-- .../core}/ui/debugpanel/DebugActivity.kt | 4 ++-- .../core}/ui/debugpanel/PluginsSettingItem.kt | 4 ++-- .../core}/util/ActivityLifecycleCallbacksAdapter.kt | 2 +- .../core}/util/ApplicationLifecycleHandler.kt | 4 ++-- .../core}/util/DebugPanelBroadcastReceiver.kt | 4 ++-- .../core}/util/DebugPanelNotification.kt | 4 ++-- .../redmadrobot/debug_panel_core/CommonContainer.kt | 8 -------- .../debug_panel_core/internal/DebugEvent.kt | 3 --- .../plugin/PluginDependencyContainer.kt | 6 ------ .../src/main/res/layout/activity_debug.xml | 2 +- .../src/main/res/layout/bottom_sheet_debug_panel.xml | 4 ++-- .../debug/account/plugin/AccountSelectedEvent.kt | 2 +- .../redmadrobot/debug/account/plugin/AccountsPlugin.kt | 8 ++++---- .../debug/account/plugin/AccountsPluginContainer.kt | 4 ++-- .../redmadrobot/debug/account/ui/AccountsFragment.kt | 2 +- .../redmadrobot/debug/account/ui/AccountsViewModel.kt | 2 +- .../app_settings_plugin/plugin/AppSettingsPlugin.kt | 6 +++--- .../plugin/AppSettingsPluginContainer.kt | 2 +- .../ui/ApplicationSettingsFragment.kt | 2 +- .../redmadrobot/flipper_plugin/plugin/FlipperPlugin.kt | 8 ++++---- .../flipper_plugin/plugin/FlipperPluginContainer.kt | 2 +- .../flipper_plugin/ui/FlipperFeaturesFragment.kt | 2 +- .../ui/dialog/SourceSelectionDialogFragment.kt | 2 +- .../servers_plugin/plugin/ServerSelectedEvent.kt | 2 +- .../redmadrobot/servers_plugin/plugin/ServersPlugin.kt | 10 +++++----- .../servers_plugin/plugin/ServersPluginContainer.kt | 4 ++-- .../redmadrobot/servers_plugin/ui/ServerHostDialog.kt | 2 +- .../redmadrobot/servers_plugin/ui/ServersFragment.kt | 2 +- .../redmadrobot/servers_plugin/ui/ServersViewModel.kt | 2 +- .../servers_plugin/util/DebugServerInterceptor.kt | 4 ++-- .../variable_plugin/plugin/VariablePlugin.kt | 8 ++++---- .../variable_plugin/plugin/VariablePluginContainer.kt | 4 ++-- .../redmadrobot/variable_plugin/ui/VariableFragment.kt | 2 +- .../debug_sample/debug_data/DebugAccountsProvider.kt | 2 +- .../debug_data/DebugFlipperFeaturesProvider.kt | 2 +- .../debug_sample/debug_data/DebugServersProvider.kt | 2 +- .../debug_data/DebugVariableWidgetsProvider.kt | 2 +- .../main/kotlin/com/redmadrobot/debug_sample/App.kt | 4 ++-- .../com/redmadrobot/debug_sample/MainActivity.kt | 2 +- 57 files changed, 114 insertions(+), 114 deletions(-) create mode 100644 debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/CommonContainer.kt rename debug-panel-core/src/main/kotlin/com/redmadrobot/{debug_panel_core => debug/core}/DebugPanelInstance.kt (89%) rename debug-panel-core/src/main/kotlin/com/redmadrobot/{debug_panel_core => debug/core}/annotation/DebugPanelInternal.kt (74%) rename debug-panel-core/src/main/kotlin/com/redmadrobot/{debug_panel_core => debug/core}/data/DebugDataProvider.kt (62%) rename debug-panel-core/src/main/kotlin/com/redmadrobot/{debug_panel_core => debug/core}/extension/PluginsExt.kt (67%) rename debug-panel-core/src/main/kotlin/com/redmadrobot/{debug_panel_core => debug/core}/inapp/DebugBottomSheet.kt (96%) rename debug-panel-core/src/main/kotlin/com/redmadrobot/{debug_panel_core => debug/core}/inapp/DebugSheetViewPagerAdapter.kt (82%) rename debug-panel-core/src/main/kotlin/com/redmadrobot/{debug_panel_core => debug/core}/inapp/ModalLayout.kt (97%) rename debug-panel-core/src/main/kotlin/com/redmadrobot/{debug_panel_core => debug/core}/inapp/shake/ShakeController.kt (88%) rename debug-panel-core/src/main/kotlin/com/redmadrobot/{debug_panel_core => debug/core}/inapp/shake/ShakeListener.kt (96%) create mode 100644 debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugEvent.kt rename debug-panel-core/src/main/kotlin/com/redmadrobot/{debug_panel_core => debug/core}/internal/DebugPanel.kt (81%) rename debug-panel-core/src/main/kotlin/com/redmadrobot/{debug_panel_core => debug/core}/internal/DebugPanelConfig.kt (78%) rename debug-panel-core/src/main/kotlin/com/redmadrobot/{debug_panel_core => debug/core}/plugin/Plugin.kt (76%) create mode 100644 debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/plugin/PluginDependencyContainer.kt rename debug-panel-core/src/main/kotlin/com/redmadrobot/{debug_panel_core => debug/core}/plugin/PluginManager.kt (83%) rename debug-panel-core/src/main/kotlin/com/redmadrobot/{debug_panel_core => debug/core}/ui/debugpanel/DebugActivity.kt (93%) rename debug-panel-core/src/main/kotlin/com/redmadrobot/{debug_panel_core => debug/core}/ui/debugpanel/PluginsSettingItem.kt (62%) rename debug-panel-core/src/main/kotlin/com/redmadrobot/{debug_panel_core => debug/core}/util/ActivityLifecycleCallbacksAdapter.kt (93%) rename debug-panel-core/src/main/kotlin/com/redmadrobot/{debug_panel_core => debug/core}/util/ApplicationLifecycleHandler.kt (96%) rename debug-panel-core/src/main/kotlin/com/redmadrobot/{debug_panel_core => debug/core}/util/DebugPanelBroadcastReceiver.kt (85%) rename debug-panel-core/src/main/kotlin/com/redmadrobot/{debug_panel_core => debug/core}/util/DebugPanelNotification.kt (96%) delete mode 100644 debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/CommonContainer.kt delete mode 100644 debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/internal/DebugEvent.kt delete mode 100644 debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/plugin/PluginDependencyContainer.kt diff --git a/build.gradle.kts b/build.gradle.kts index fa9fae5c..0fea89a4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,7 @@ plugins { subprojects { tasks.withType().configureEach { kotlinOptions.freeCompilerArgs += listOf( - "-opt-in=com.redmadrobot.debug_panel_core.annotation.DebugPanelInternal" + "-opt-in=com.redmadrobot.debug.core.annotation.DebugPanelInternal" ) } } diff --git a/debug-panel-core/src/main/AndroidManifest.xml b/debug-panel-core/src/main/AndroidManifest.xml index 76a080e4..ed5719c9 100644 --- a/debug-panel-core/src/main/AndroidManifest.xml +++ b/debug-panel-core/src/main/AndroidManifest.xml @@ -4,7 +4,7 @@ @@ -14,7 +14,7 @@ android:enabled="true" android:exported="true" android:label="@string/debug_panel" - android:targetActivity="com.redmadrobot.debug_panel_core.ui.debugpanel.DebugActivity" + android:targetActivity="com.redmadrobot.debug.core.ui.debugpanel.DebugActivity" android:taskAffinity="com.redmadrobot.debug_panel.DebugActivity" android:theme="@style/DebugPanelTheme"> diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/CommonContainer.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/CommonContainer.kt new file mode 100644 index 00000000..3ea89f51 --- /dev/null +++ b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/CommonContainer.kt @@ -0,0 +1,8 @@ +package com.redmadrobot.debug.core + +import android.content.Context +import com.redmadrobot.debug.core.annotation.DebugPanelInternal +import com.redmadrobot.debug.core.plugin.PluginDependencyContainer + +@DebugPanelInternal +public class CommonContainer(public val context: Context) : PluginDependencyContainer diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/DebugPanelInstance.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/DebugPanelInstance.kt similarity index 89% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/DebugPanelInstance.kt rename to debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/DebugPanelInstance.kt index 50ac84da..3baf0295 100644 --- a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/DebugPanelInstance.kt +++ b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/DebugPanelInstance.kt @@ -1,12 +1,12 @@ -package com.redmadrobot.debug_panel_core +package com.redmadrobot.debug.core import android.app.Application import android.content.Context import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData -import com.redmadrobot.debug_panel_core.internal.DebugEvent -import com.redmadrobot.debug_panel_core.plugin.Plugin -import com.redmadrobot.debug_panel_core.plugin.PluginManager +import com.redmadrobot.debug.core.internal.DebugEvent +import com.redmadrobot.debug.core.plugin.Plugin +import com.redmadrobot.debug.core.plugin.PluginManager import kotlinx.coroutines.channels.BufferOverflow import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableSharedFlow diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/annotation/DebugPanelInternal.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/annotation/DebugPanelInternal.kt similarity index 74% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/annotation/DebugPanelInternal.kt rename to debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/annotation/DebugPanelInternal.kt index 67a05c24..1a34aa25 100644 --- a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/annotation/DebugPanelInternal.kt +++ b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/annotation/DebugPanelInternal.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.debug_panel_core.annotation +package com.redmadrobot.debug.core.annotation @RequiresOptIn( level = RequiresOptIn.Level.ERROR, @@ -6,4 +6,4 @@ package com.redmadrobot.debug_panel_core.annotation ) @Retention(AnnotationRetention.BINARY) @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) -public annotation class DebugPanelInternal \ No newline at end of file +public annotation class DebugPanelInternal diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/data/DebugDataProvider.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/data/DebugDataProvider.kt similarity index 62% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/data/DebugDataProvider.kt rename to debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/data/DebugDataProvider.kt index 78cf9910..82b0648a 100644 --- a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/data/DebugDataProvider.kt +++ b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/data/DebugDataProvider.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.debug_panel_core.data +package com.redmadrobot.debug.core.data public interface DebugDataProvider { public fun provideData(): T diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/extension/PluginsExt.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/extension/PluginsExt.kt similarity index 67% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/extension/PluginsExt.kt rename to debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/extension/PluginsExt.kt index 21f01b3f..f6573243 100644 --- a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/extension/PluginsExt.kt +++ b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/extension/PluginsExt.kt @@ -1,8 +1,8 @@ -package com.redmadrobot.debug_panel_core.extension +package com.redmadrobot.debug.core.extension -import com.redmadrobot.debug_panel_core.DebugPanelInstance -import com.redmadrobot.debug_panel_core.annotation.DebugPanelInternal -import com.redmadrobot.debug_panel_core.plugin.Plugin +import com.redmadrobot.debug.core.DebugPanelInstance +import com.redmadrobot.debug.core.annotation.DebugPanelInternal +import com.redmadrobot.debug.core.plugin.Plugin @PublishedApi internal fun getPlugin(pluginName: String): Plugin { diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/inapp/DebugBottomSheet.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/DebugBottomSheet.kt similarity index 96% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/inapp/DebugBottomSheet.kt rename to debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/DebugBottomSheet.kt index 33529eaa..96dfc41a 100644 --- a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/inapp/DebugBottomSheet.kt +++ b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/DebugBottomSheet.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.debug_panel_core.inapp +package com.redmadrobot.debug.core.inapp import android.app.Dialog import android.os.Bundle @@ -10,7 +10,7 @@ import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialogFragment import com.google.android.material.tabs.TabLayoutMediator -import com.redmadrobot.debug_panel_core.extension.getAllPlugins +import com.redmadrobot.debug.core.extension.getAllPlugins import com.redmadrobot.panel_core.databinding.BottomSheetDebugPanelBinding import com.redmadrobot.debug_panel_common.R as CommonR diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/inapp/DebugSheetViewPagerAdapter.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/DebugSheetViewPagerAdapter.kt similarity index 82% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/inapp/DebugSheetViewPagerAdapter.kt rename to debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/DebugSheetViewPagerAdapter.kt index c58d44b9..59736bf7 100644 --- a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/inapp/DebugSheetViewPagerAdapter.kt +++ b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/DebugSheetViewPagerAdapter.kt @@ -1,9 +1,9 @@ -package com.redmadrobot.debug_panel_core.inapp +package com.redmadrobot.debug.core.inapp import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity import androidx.viewpager2.adapter.FragmentStateAdapter -import com.redmadrobot.debug_panel_core.plugin.Plugin +import com.redmadrobot.debug.core.plugin.Plugin internal class DebugSheetViewPagerAdapter( fragmentActivity: FragmentActivity, diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/inapp/ModalLayout.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/ModalLayout.kt similarity index 97% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/inapp/ModalLayout.kt rename to debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/ModalLayout.kt index d89fe7e2..32190c26 100644 --- a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/inapp/ModalLayout.kt +++ b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/ModalLayout.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.debug_panel_core.inapp +package com.redmadrobot.debug.core.inapp import android.content.Context import android.graphics.Canvas diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/inapp/shake/ShakeController.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/shake/ShakeController.kt similarity index 88% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/inapp/shake/ShakeController.kt rename to debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/shake/ShakeController.kt index e83b42d3..95fe40fd 100644 --- a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/inapp/shake/ShakeController.kt +++ b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/shake/ShakeController.kt @@ -1,10 +1,10 @@ -package com.redmadrobot.debug_panel_core.inapp.shake +package com.redmadrobot.debug.core.inapp.shake import android.content.Context import android.hardware.Sensor import android.hardware.SensorManager import androidx.fragment.app.FragmentManager -import com.redmadrobot.debug_panel_core.inapp.DebugBottomSheet +import com.redmadrobot.debug.core.inapp.DebugBottomSheet internal class ShakeController(context: Context) { private val sensorManager = context.getSystemService(Context.SENSOR_SERVICE) as SensorManager diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/inapp/shake/ShakeListener.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/shake/ShakeListener.kt similarity index 96% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/inapp/shake/ShakeListener.kt rename to debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/shake/ShakeListener.kt index d3011990..bfb395b0 100644 --- a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/inapp/shake/ShakeListener.kt +++ b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/shake/ShakeListener.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.debug_panel_core.inapp.shake +package com.redmadrobot.debug.core.inapp.shake import android.hardware.Sensor import android.hardware.SensorEvent diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugEvent.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugEvent.kt new file mode 100644 index 00000000..f4057a00 --- /dev/null +++ b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugEvent.kt @@ -0,0 +1,3 @@ +package com.redmadrobot.debug.core.internal + +public interface DebugEvent diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/internal/DebugPanel.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugPanel.kt similarity index 81% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/internal/DebugPanel.kt rename to debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugPanel.kt index f7a5d3c5..06495d8a 100644 --- a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/internal/DebugPanel.kt +++ b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugPanel.kt @@ -1,13 +1,13 @@ -package com.redmadrobot.debug_panel_core.internal +package com.redmadrobot.debug.core.internal import android.app.Application import androidx.fragment.app.FragmentManager import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.Observer -import com.redmadrobot.debug_panel_core.DebugPanelInstance -import com.redmadrobot.debug_panel_core.inapp.DebugBottomSheet -import com.redmadrobot.debug_panel_core.plugin.Plugin -import com.redmadrobot.debug_panel_core.util.ApplicationLifecycleHandler +import com.redmadrobot.debug.core.DebugPanelInstance +import com.redmadrobot.debug.core.inapp.DebugBottomSheet +import com.redmadrobot.debug.core.plugin.Plugin +import com.redmadrobot.debug.core.util.ApplicationLifecycleHandler import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.emptyFlow diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/internal/DebugPanelConfig.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugPanelConfig.kt similarity index 78% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/internal/DebugPanelConfig.kt rename to debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugPanelConfig.kt index 9475c342..509de599 100644 --- a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/internal/DebugPanelConfig.kt +++ b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugPanelConfig.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.debug_panel_core.internal +package com.redmadrobot.debug.core.internal public class DebugPanelConfig( public val shakerMode: Boolean @@ -6,4 +6,4 @@ public class DebugPanelConfig( internal companion object { internal val defaultConfig = DebugPanelConfig(shakerMode = true) } -} \ No newline at end of file +} diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/plugin/Plugin.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/plugin/Plugin.kt similarity index 76% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/plugin/Plugin.kt rename to debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/plugin/Plugin.kt index 617bd6f5..aaba22b0 100644 --- a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/plugin/Plugin.kt +++ b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/plugin/Plugin.kt @@ -1,9 +1,9 @@ -package com.redmadrobot.debug_panel_core.plugin +package com.redmadrobot.debug.core.plugin import androidx.fragment.app.Fragment -import com.redmadrobot.debug_panel_core.CommonContainer -import com.redmadrobot.debug_panel_core.DebugPanelInstance -import com.redmadrobot.debug_panel_core.internal.DebugEvent +import com.redmadrobot.debug.core.CommonContainer +import com.redmadrobot.debug.core.DebugPanelInstance +import com.redmadrobot.debug.core.internal.DebugEvent public abstract class Plugin { diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/plugin/PluginDependencyContainer.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/plugin/PluginDependencyContainer.kt new file mode 100644 index 00000000..e32f4a27 --- /dev/null +++ b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/plugin/PluginDependencyContainer.kt @@ -0,0 +1,6 @@ +package com.redmadrobot.debug.core.plugin + +import com.redmadrobot.debug.core.annotation.DebugPanelInternal + +@DebugPanelInternal +public interface PluginDependencyContainer diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/plugin/PluginManager.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/plugin/PluginManager.kt similarity index 83% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/plugin/PluginManager.kt rename to debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/plugin/PluginManager.kt index 4dc8ab15..4a2a210e 100644 --- a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/plugin/PluginManager.kt +++ b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/plugin/PluginManager.kt @@ -1,6 +1,6 @@ -package com.redmadrobot.debug_panel_core.plugin +package com.redmadrobot.debug.core.plugin -import com.redmadrobot.debug_panel_core.CommonContainer +import com.redmadrobot.debug.core.CommonContainer internal class PluginManager(val plugins: List) { diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/ui/debugpanel/DebugActivity.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/ui/debugpanel/DebugActivity.kt similarity index 93% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/ui/debugpanel/DebugActivity.kt rename to debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/ui/debugpanel/DebugActivity.kt index a1593627..f3ffc4d3 100644 --- a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/ui/debugpanel/DebugActivity.kt +++ b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/ui/debugpanel/DebugActivity.kt @@ -1,10 +1,10 @@ -package com.redmadrobot.debug_panel_core.ui.debugpanel +package com.redmadrobot.debug.core.ui.debugpanel import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment import androidx.recyclerview.widget.LinearLayoutManager -import com.redmadrobot.debug_panel_core.extension.getAllPlugins +import com.redmadrobot.debug.core.extension.getAllPlugins import com.redmadrobot.itemsadapter.bind import com.redmadrobot.itemsadapter.itemsAdapter import com.redmadrobot.panel_core.R diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/ui/debugpanel/PluginsSettingItem.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/ui/debugpanel/PluginsSettingItem.kt similarity index 62% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/ui/debugpanel/PluginsSettingItem.kt rename to debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/ui/debugpanel/PluginsSettingItem.kt index 8c325867..064e86af 100644 --- a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/ui/debugpanel/PluginsSettingItem.kt +++ b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/ui/debugpanel/PluginsSettingItem.kt @@ -1,6 +1,6 @@ -package com.redmadrobot.debug_panel_core.ui.debugpanel +package com.redmadrobot.debug.core.ui.debugpanel internal class PluginsSettingItem( val pluginName: String, val onClicked: () -> Unit -) \ No newline at end of file +) diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/util/ActivityLifecycleCallbacksAdapter.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/util/ActivityLifecycleCallbacksAdapter.kt similarity index 93% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/util/ActivityLifecycleCallbacksAdapter.kt rename to debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/util/ActivityLifecycleCallbacksAdapter.kt index fae21241..c86a485e 100644 --- a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/util/ActivityLifecycleCallbacksAdapter.kt +++ b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/util/ActivityLifecycleCallbacksAdapter.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.debug_panel_core.util +package com.redmadrobot.debug.core.util import android.app.Activity import android.app.Application diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/util/ApplicationLifecycleHandler.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/util/ApplicationLifecycleHandler.kt similarity index 96% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/util/ApplicationLifecycleHandler.kt rename to debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/util/ApplicationLifecycleHandler.kt index ee25b386..e9444742 100644 --- a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/util/ApplicationLifecycleHandler.kt +++ b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/util/ApplicationLifecycleHandler.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.debug_panel_core.util +package com.redmadrobot.debug.core.util import android.app.Activity import android.app.Application @@ -6,7 +6,7 @@ import android.content.BroadcastReceiver import android.content.IntentFilter import androidx.core.content.ContextCompat import androidx.fragment.app.FragmentActivity -import com.redmadrobot.debug_panel_core.inapp.shake.ShakeController +import com.redmadrobot.debug.core.inapp.shake.ShakeController import timber.log.Timber internal class ApplicationLifecycleHandler( diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/util/DebugPanelBroadcastReceiver.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/util/DebugPanelBroadcastReceiver.kt similarity index 85% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/util/DebugPanelBroadcastReceiver.kt rename to debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/util/DebugPanelBroadcastReceiver.kt index 059984bf..1aaeda55 100644 --- a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/util/DebugPanelBroadcastReceiver.kt +++ b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/util/DebugPanelBroadcastReceiver.kt @@ -1,10 +1,10 @@ -package com.redmadrobot.debug_panel_core.util +package com.redmadrobot.debug.core.util import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import androidx.fragment.app.FragmentManager -import com.redmadrobot.debug_panel_core.internal.DebugPanel +import com.redmadrobot.debug.core.internal.DebugPanel internal class DebugPanelBroadcastReceiver( private val supportFragmentManager: FragmentManager diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/util/DebugPanelNotification.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/util/DebugPanelNotification.kt similarity index 96% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/util/DebugPanelNotification.kt rename to debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/util/DebugPanelNotification.kt index 178cc9ed..8473eddd 100644 --- a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/util/DebugPanelNotification.kt +++ b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/util/DebugPanelNotification.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.debug_panel_core.util +package com.redmadrobot.debug.core.util import android.Manifest.permission.POST_NOTIFICATIONS import android.app.NotificationChannel @@ -13,7 +13,7 @@ import androidx.core.app.NotificationCompat import androidx.core.app.NotificationManagerCompat import androidx.core.app.TaskStackBuilder import androidx.core.content.ContextCompat -import com.redmadrobot.debug_panel_core.ui.debugpanel.DebugActivity +import com.redmadrobot.debug.core.ui.debugpanel.DebugActivity import com.redmadrobot.panel_core.R internal class DebugPanelNotification(private val context: Context) { diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/CommonContainer.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/CommonContainer.kt deleted file mode 100644 index c1572cbb..00000000 --- a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/CommonContainer.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.redmadrobot.debug_panel_core - -import android.content.Context -import com.redmadrobot.debug_panel_core.annotation.DebugPanelInternal -import com.redmadrobot.debug_panel_core.plugin.PluginDependencyContainer - -@DebugPanelInternal -public class CommonContainer(public val context: Context) : PluginDependencyContainer diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/internal/DebugEvent.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/internal/DebugEvent.kt deleted file mode 100644 index baac0d25..00000000 --- a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/internal/DebugEvent.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.redmadrobot.debug_panel_core.internal - -public interface DebugEvent diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/plugin/PluginDependencyContainer.kt b/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/plugin/PluginDependencyContainer.kt deleted file mode 100644 index 3b46687b..00000000 --- a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug_panel_core/plugin/PluginDependencyContainer.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.redmadrobot.debug_panel_core.plugin - -import com.redmadrobot.debug_panel_core.annotation.DebugPanelInternal - -@DebugPanelInternal -public interface PluginDependencyContainer diff --git a/debug-panel-core/src/main/res/layout/activity_debug.xml b/debug-panel-core/src/main/res/layout/activity_debug.xml index 0c598968..c3d012fb 100644 --- a/debug-panel-core/src/main/res/layout/activity_debug.xml +++ b/debug-panel-core/src/main/res/layout/activity_debug.xml @@ -4,7 +4,7 @@ android:id="@+id/debug_activity_root" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context="com.redmadrobot.debug_panel_core.ui.debugpanel.DebugActivity"> + tools:context="com.redmadrobot.debug.core.ui.debugpanel.DebugActivity"> - - + diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountSelectedEvent.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountSelectedEvent.kt index 7548ddb1..231a37c8 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountSelectedEvent.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountSelectedEvent.kt @@ -1,6 +1,6 @@ package com.redmadrobot.debug.account.plugin import com.redmadrobot.debug.account.data.model.DebugAccount -import com.redmadrobot.debug_panel_core.internal.DebugEvent +import com.redmadrobot.debug.core.internal.DebugEvent public data class AccountSelectedEvent(val debugAccount: DebugAccount) : DebugEvent diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPlugin.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPlugin.kt index 94b6bdba..b406f62d 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPlugin.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPlugin.kt @@ -6,10 +6,10 @@ import com.redmadrobot.debug.account.authenticator.DebugAuthenticator import com.redmadrobot.debug.account.authenticator.DefaultAuthenticator import com.redmadrobot.debug.account.data.model.DebugAccount import com.redmadrobot.debug.account.ui.AccountsFragment -import com.redmadrobot.debug_panel_core.CommonContainer -import com.redmadrobot.debug_panel_core.data.DebugDataProvider -import com.redmadrobot.debug_panel_core.plugin.Plugin -import com.redmadrobot.debug_panel_core.plugin.PluginDependencyContainer +import com.redmadrobot.debug.core.CommonContainer +import com.redmadrobot.debug.core.data.DebugDataProvider +import com.redmadrobot.debug.core.plugin.Plugin +import com.redmadrobot.debug.core.plugin.PluginDependencyContainer public class AccountsPlugin( private val preInstalledAccounts: List = emptyList(), diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPluginContainer.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPluginContainer.kt index b296b6f8..670983d4 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPluginContainer.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPluginContainer.kt @@ -4,8 +4,8 @@ import com.redmadrobot.debug.account.data.LocalDebugAccountRepository import com.redmadrobot.debug.account.data.model.DebugAccount import com.redmadrobot.debug.account.data.storage.AccountsPluginDatabase import com.redmadrobot.debug.account.ui.AccountsViewModel -import com.redmadrobot.debug_panel_core.CommonContainer -import com.redmadrobot.debug_panel_core.plugin.PluginDependencyContainer +import com.redmadrobot.debug.core.CommonContainer +import com.redmadrobot.debug.core.plugin.PluginDependencyContainer internal class AccountsPluginContainer( private val preInstalledAccounts: List, diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsFragment.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsFragment.kt index 022b1ab7..b74d5226 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsFragment.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsFragment.kt @@ -8,7 +8,7 @@ import com.redmadrobot.debug.account.plugin.AccountsPlugin import com.redmadrobot.debug.account.plugin.AccountsPluginContainer import com.redmadrobot.debug.common.base.PluginFragment import com.redmadrobot.debug.common.extension.obtainShareViewModel -import com.redmadrobot.debug_panel_core.extension.getPlugin +import com.redmadrobot.debug.core.extension.getPlugin internal class AccountsFragment : PluginFragment(R.layout.fragment_accounts_compose) { diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewModel.kt b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewModel.kt index 76adebe2..4260cad9 100644 --- a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewModel.kt +++ b/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewModel.kt @@ -10,7 +10,7 @@ import com.redmadrobot.debug.account.plugin.AccountSelectedEvent import com.redmadrobot.debug.account.plugin.AccountsPlugin import com.redmadrobot.debug.common.base.PluginViewModel import com.redmadrobot.debug.common.extension.safeLaunch -import com.redmadrobot.debug_panel_core.extension.getPlugin +import com.redmadrobot.debug.core.extension.getPlugin internal class AccountsViewModel( private val context: Context, diff --git a/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPlugin.kt b/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPlugin.kt index f97c59e1..d0d60c2a 100644 --- a/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPlugin.kt +++ b/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPlugin.kt @@ -4,9 +4,9 @@ import android.content.SharedPreferences import androidx.fragment.app.Fragment import com.redmadrobot.app_settings_plugin.data.DefaultSharedPreferences import com.redmadrobot.app_settings_plugin.ui.ApplicationSettingsFragment -import com.redmadrobot.debug_panel_core.CommonContainer -import com.redmadrobot.debug_panel_core.plugin.Plugin -import com.redmadrobot.debug_panel_core.plugin.PluginDependencyContainer +import com.redmadrobot.debug.core.CommonContainer +import com.redmadrobot.debug.core.plugin.Plugin +import com.redmadrobot.debug.core.plugin.PluginDependencyContainer public class AppSettingsPlugin( private val sharedPreferences: List = listOf(DefaultSharedPreferences()) diff --git a/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPluginContainer.kt b/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPluginContainer.kt index f102e6d8..7717c331 100644 --- a/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPluginContainer.kt +++ b/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPluginContainer.kt @@ -3,7 +3,7 @@ package com.redmadrobot.app_settings_plugin.plugin import android.content.SharedPreferences import com.redmadrobot.app_settings_plugin.data.AppSettingsRepositoryImpl import com.redmadrobot.app_settings_plugin.ui.ApplicationSettingsViewModel -import com.redmadrobot.debug_panel_core.plugin.PluginDependencyContainer +import com.redmadrobot.debug.core.plugin.PluginDependencyContainer internal class AppSettingsPluginContainer( private val preferencesList: List diff --git a/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsFragment.kt b/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsFragment.kt index 6ed26a23..2f81b2fd 100644 --- a/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsFragment.kt +++ b/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsFragment.kt @@ -11,7 +11,7 @@ import com.redmadrobot.app_settings_plugin.ui.item.AppSettingItems import com.redmadrobot.debug.common.base.PluginFragment import com.redmadrobot.debug.common.extension.observe import com.redmadrobot.debug.common.extension.obtainViewModel -import com.redmadrobot.debug_panel_core.extension.getPlugin +import com.redmadrobot.debug.core.extension.getPlugin import com.redmadrobot.itemsadapter.itemsAdapter internal class ApplicationSettingsFragment : PluginFragment(R.layout.fragment_app_settings) { diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPlugin.kt b/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPlugin.kt index 151e9616..05694fb9 100644 --- a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPlugin.kt +++ b/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPlugin.kt @@ -1,10 +1,10 @@ package com.redmadrobot.flipper_plugin.plugin import androidx.fragment.app.Fragment -import com.redmadrobot.debug_panel_core.CommonContainer -import com.redmadrobot.debug_panel_core.extension.getPlugin -import com.redmadrobot.debug_panel_core.plugin.Plugin -import com.redmadrobot.debug_panel_core.plugin.PluginDependencyContainer +import com.redmadrobot.debug.core.CommonContainer +import com.redmadrobot.debug.core.extension.getPlugin +import com.redmadrobot.debug.core.plugin.Plugin +import com.redmadrobot.debug.core.plugin.PluginDependencyContainer import com.redmadrobot.flipper.config.FlipperValue import com.redmadrobot.flipper_plugin.ui.FlipperFeaturesFragment import kotlinx.coroutines.flow.Flow diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPluginContainer.kt b/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPluginContainer.kt index 86957e14..71ce8e8a 100644 --- a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPluginContainer.kt +++ b/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPluginContainer.kt @@ -1,7 +1,7 @@ package com.redmadrobot.flipper_plugin.plugin import android.content.Context -import com.redmadrobot.debug_panel_core.plugin.PluginDependencyContainer +import com.redmadrobot.debug.core.plugin.PluginDependencyContainer import com.redmadrobot.flipper_plugin.data.FeatureTogglesRepository import com.redmadrobot.flipper_plugin.ui.FlipperFeaturesViewModel import com.redmadrobot.flipper_plugin.ui.dialog.SourceSelectionViewModel diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesFragment.kt b/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesFragment.kt index a67f9b14..1b2874e5 100644 --- a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesFragment.kt +++ b/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesFragment.kt @@ -8,7 +8,7 @@ import androidx.lifecycle.flowWithLifecycle import androidx.lifecycle.lifecycleScope import com.redmadrobot.debug.common.base.PluginFragment import com.redmadrobot.debug.common.extension.obtainShareViewModel -import com.redmadrobot.debug_panel_core.extension.getPlugin +import com.redmadrobot.debug.core.extension.getPlugin import com.redmadrobot.flipper_plugin.R import com.redmadrobot.flipper_plugin.databinding.FragmentFlipperFeaturesBinding import com.redmadrobot.flipper_plugin.plugin.FlipperPlugin diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionDialogFragment.kt b/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionDialogFragment.kt index d9a3d264..0b691691 100644 --- a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionDialogFragment.kt +++ b/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionDialogFragment.kt @@ -10,7 +10,7 @@ import androidx.lifecycle.flowWithLifecycle import androidx.lifecycle.lifecycleScope import com.google.android.material.bottomsheet.BottomSheetDialogFragment import com.redmadrobot.debug.common.extension.obtainShareViewModel -import com.redmadrobot.debug_panel_core.extension.getPlugin +import com.redmadrobot.debug.core.extension.getPlugin import com.redmadrobot.flipper_plugin.R import com.redmadrobot.flipper_plugin.databinding.DialogFlipperSourceBinding import com.redmadrobot.flipper_plugin.plugin.FlipperPlugin diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServerSelectedEvent.kt b/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServerSelectedEvent.kt index f9b04f51..f8dc54d2 100644 --- a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServerSelectedEvent.kt +++ b/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServerSelectedEvent.kt @@ -1,6 +1,6 @@ package com.redmadrobot.servers_plugin.plugin -import com.redmadrobot.debug_panel_core.internal.DebugEvent +import com.redmadrobot.debug.core.internal.DebugEvent import com.redmadrobot.servers_plugin.data.model.DebugServer public data class ServerSelectedEvent(val debugServer: DebugServer) : DebugEvent diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPlugin.kt b/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPlugin.kt index 65fd32f5..d16a1915 100644 --- a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPlugin.kt +++ b/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPlugin.kt @@ -2,11 +2,11 @@ package com.redmadrobot.servers_plugin.plugin import androidx.core.os.bundleOf import androidx.fragment.app.Fragment -import com.redmadrobot.debug_panel_core.CommonContainer -import com.redmadrobot.debug_panel_core.data.DebugDataProvider -import com.redmadrobot.debug_panel_core.extension.getPlugin -import com.redmadrobot.debug_panel_core.plugin.Plugin -import com.redmadrobot.debug_panel_core.plugin.PluginDependencyContainer +import com.redmadrobot.debug.core.CommonContainer +import com.redmadrobot.debug.core.data.DebugDataProvider +import com.redmadrobot.debug.core.extension.getPlugin +import com.redmadrobot.debug.core.plugin.Plugin +import com.redmadrobot.debug.core.plugin.PluginDependencyContainer import com.redmadrobot.servers_plugin.data.model.DebugServer import com.redmadrobot.servers_plugin.ui.ServersFragment import kotlinx.coroutines.runBlocking diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPluginContainer.kt b/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPluginContainer.kt index 4de56c52..377a8341 100644 --- a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPluginContainer.kt +++ b/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPluginContainer.kt @@ -1,7 +1,7 @@ package com.redmadrobot.servers_plugin.plugin -import com.redmadrobot.debug_panel_core.CommonContainer -import com.redmadrobot.debug_panel_core.plugin.PluginDependencyContainer +import com.redmadrobot.debug.core.CommonContainer +import com.redmadrobot.debug.core.plugin.PluginDependencyContainer import com.redmadrobot.servers_plugin.data.LocalDebugServerRepository import com.redmadrobot.servers_plugin.data.model.DebugServer import com.redmadrobot.servers_plugin.data.storage.ServersPluginDatabase diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServerHostDialog.kt b/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServerHostDialog.kt index 61b8c668..ffc98aa2 100644 --- a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServerHostDialog.kt +++ b/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServerHostDialog.kt @@ -9,7 +9,7 @@ import android.widget.LinearLayout import androidx.fragment.app.DialogFragment import androidx.fragment.app.FragmentManager import com.redmadrobot.debug.common.extension.obtainShareViewModel -import com.redmadrobot.debug_panel_core.extension.getPlugin +import com.redmadrobot.debug.core.extension.getPlugin import com.redmadrobot.servers_plugin.R import com.redmadrobot.servers_plugin.databinding.DialogServerBinding import com.redmadrobot.servers_plugin.plugin.ServersPlugin diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersFragment.kt b/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersFragment.kt index 4fbfaa10..ba59ad8e 100644 --- a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersFragment.kt +++ b/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersFragment.kt @@ -8,7 +8,7 @@ import com.redmadrobot.debug.common.base.PluginFragment import com.redmadrobot.debug_panel_common.databinding.ItemSectionHeaderBinding import com.redmadrobot.debug.common.extension.observe import com.redmadrobot.debug.common.extension.obtainShareViewModel -import com.redmadrobot.debug_panel_core.extension.getPlugin +import com.redmadrobot.debug.core.extension.getPlugin import com.redmadrobot.itemsadapter.ItemsAdapter import com.redmadrobot.itemsadapter.bind import com.redmadrobot.itemsadapter.itemsAdapter diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewModel.kt b/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewModel.kt index 009b8c3d..00d0b7cb 100644 --- a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewModel.kt +++ b/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewModel.kt @@ -5,7 +5,7 @@ import androidx.lifecycle.MutableLiveData import androidx.lifecycle.viewModelScope import com.redmadrobot.debug.common.base.PluginViewModel import com.redmadrobot.debug.common.extension.safeLaunch -import com.redmadrobot.debug_panel_core.extension.getPlugin +import com.redmadrobot.debug.core.extension.getPlugin import com.redmadrobot.servers_plugin.R import com.redmadrobot.servers_plugin.data.DebugServerRepository import com.redmadrobot.servers_plugin.data.model.DebugServer diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/util/DebugServerInterceptor.kt b/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/util/DebugServerInterceptor.kt index 29663bc2..a9420af5 100644 --- a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/util/DebugServerInterceptor.kt +++ b/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/util/DebugServerInterceptor.kt @@ -1,7 +1,7 @@ package com.redmadrobot.servers_plugin.util -import com.redmadrobot.debug_panel_core.extension.getPlugin -import com.redmadrobot.debug_panel_core.internal.DebugPanel +import com.redmadrobot.debug.core.extension.getPlugin +import com.redmadrobot.debug.core.internal.DebugPanel import com.redmadrobot.servers_plugin.data.model.DebugServer import com.redmadrobot.servers_plugin.plugin.ServersPlugin import com.redmadrobot.servers_plugin.plugin.ServersPluginContainer diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePlugin.kt b/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePlugin.kt index 4218b00f..3340c027 100644 --- a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePlugin.kt +++ b/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePlugin.kt @@ -3,10 +3,10 @@ package com.redmadrobot.variable_plugin.plugin import android.view.View import android.view.ViewGroup import androidx.fragment.app.Fragment -import com.redmadrobot.debug_panel_core.CommonContainer -import com.redmadrobot.debug_panel_core.extension.getPlugin -import com.redmadrobot.debug_panel_core.plugin.Plugin -import com.redmadrobot.debug_panel_core.plugin.PluginDependencyContainer +import com.redmadrobot.debug.core.CommonContainer +import com.redmadrobot.debug.core.extension.getPlugin +import com.redmadrobot.debug.core.plugin.Plugin +import com.redmadrobot.debug.core.plugin.PluginDependencyContainer import com.redmadrobot.variable_plugin.ui.VariableFragment import kotlin.reflect.KClass diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePluginContainer.kt b/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePluginContainer.kt index 5fed8e10..acaad5d1 100644 --- a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePluginContainer.kt +++ b/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePluginContainer.kt @@ -1,7 +1,7 @@ package com.redmadrobot.variable_plugin.plugin -import com.redmadrobot.debug_panel_core.CommonContainer -import com.redmadrobot.debug_panel_core.plugin.PluginDependencyContainer +import com.redmadrobot.debug.core.CommonContainer +import com.redmadrobot.debug.core.plugin.PluginDependencyContainer import com.redmadrobot.variable_plugin.data.VariableRepository import com.redmadrobot.variable_plugin.ui.VariableViewModel import com.redmadrobot.variable_plugin.ui.widgets.BooleanVariableWidget diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableFragment.kt b/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableFragment.kt index ef1b6ddb..d04734c6 100644 --- a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableFragment.kt +++ b/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableFragment.kt @@ -5,7 +5,7 @@ import android.view.View import androidx.fragment.app.Fragment import androidx.lifecycle.lifecycleScope import com.redmadrobot.debug.common.extension.obtainShareViewModel -import com.redmadrobot.debug_panel_core.extension.getPlugin +import com.redmadrobot.debug.core.extension.getPlugin import com.redmadrobot.variable_plugin.R import com.redmadrobot.variable_plugin.databinding.FragmentVariableBinding import com.redmadrobot.variable_plugin.plugin.VariablePlugin diff --git a/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugAccountsProvider.kt b/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugAccountsProvider.kt index 9340aa0a..5bd924dd 100644 --- a/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugAccountsProvider.kt +++ b/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugAccountsProvider.kt @@ -1,7 +1,7 @@ package com.redmadrobot.debug_sample.debug_data import com.redmadrobot.debug.account.data.model.DebugAccount -import com.redmadrobot.debug_panel_core.data.DebugDataProvider +import com.redmadrobot.debug.core.data.DebugDataProvider class DebugAccountsProvider : DebugDataProvider> { diff --git a/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugFlipperFeaturesProvider.kt b/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugFlipperFeaturesProvider.kt index 09fae5c0..cc3c4a2d 100644 --- a/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugFlipperFeaturesProvider.kt +++ b/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugFlipperFeaturesProvider.kt @@ -1,6 +1,6 @@ package com.redmadrobot.debug_sample.debug_data -import com.redmadrobot.debug_panel_core.data.DebugDataProvider +import com.redmadrobot.debug.core.data.DebugDataProvider import com.redmadrobot.flipper.config.FlipperValue import com.redmadrobot.flipper_plugin.plugin.PluginToggle import kotlin.random.Random diff --git a/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugServersProvider.kt b/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugServersProvider.kt index 85c05063..0ea413d9 100644 --- a/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugServersProvider.kt +++ b/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugServersProvider.kt @@ -1,6 +1,6 @@ package com.redmadrobot.debug_sample.debug_data -import com.redmadrobot.debug_panel_core.data.DebugDataProvider +import com.redmadrobot.debug.core.data.DebugDataProvider import com.redmadrobot.servers_plugin.data.model.DebugServer class DebugServersProvider : DebugDataProvider> { diff --git a/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugVariableWidgetsProvider.kt b/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugVariableWidgetsProvider.kt index f66f633d..b521d3f1 100644 --- a/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugVariableWidgetsProvider.kt +++ b/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugVariableWidgetsProvider.kt @@ -8,7 +8,7 @@ import android.view.View import android.view.ViewGroup import android.widget.EditText import androidx.annotation.RequiresApi -import com.redmadrobot.debug_panel_core.data.DebugDataProvider +import com.redmadrobot.debug.core.data.DebugDataProvider import com.redmadrobot.debugpanel.R import com.redmadrobot.variable_plugin.plugin.* import java.time.LocalDateTime diff --git a/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt b/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt index b819bba2..3373358a 100644 --- a/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt +++ b/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt @@ -4,8 +4,8 @@ import android.app.Application import com.redmadrobot.debug.account.data.model.DebugAccount import com.redmadrobot.debug.account.plugin.AccountsPlugin import com.redmadrobot.app_settings_plugin.plugin.AppSettingsPlugin -import com.redmadrobot.debug_panel_core.internal.DebugPanel -import com.redmadrobot.debug_panel_core.internal.DebugPanelConfig +import com.redmadrobot.debug.core.internal.DebugPanel +import com.redmadrobot.debug.core.internal.DebugPanelConfig import com.redmadrobot.debug_sample.account.DebugUserAuthenticator import com.redmadrobot.debug_sample.debug_data.DebugAccountsProvider import com.redmadrobot.debug_sample.debug_data.DebugFlipperFeaturesProvider diff --git a/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt b/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt index b88198dc..04192a13 100644 --- a/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt +++ b/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt @@ -8,7 +8,7 @@ import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.lifecycle.lifecycleScope import com.redmadrobot.debug.account.plugin.AccountSelectedEvent -import com.redmadrobot.debug_panel_core.internal.DebugPanel +import com.redmadrobot.debug.core.internal.DebugPanel import com.redmadrobot.debug_sample.network.ApiFactory import com.redmadrobot.debugpanel.R import com.redmadrobot.debugpanel.databinding.ActivityMainBinding From 94a9d436832e698b0e95e046845c47910ca27962 Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Tue, 6 Dec 2022 11:41:09 +0300 Subject: [PATCH 08/42] Core:Rename 'debug-panel-core' module to 'core' --- {debug-panel-core => core}/.gitignore | 0 {debug-panel-core => core}/build.gradle.kts | 0 {debug-panel-core => core}/consumer-rules.pro | 0 {debug-panel-core => core}/library.properties | 0 {debug-panel-core => core}/proguard-rules.pro | 0 {debug-panel-core => core}/src/main/AndroidManifest.xml | 0 .../main/kotlin/com/redmadrobot/debug/core/CommonContainer.kt | 0 .../kotlin/com/redmadrobot/debug/core/DebugPanelInstance.kt | 0 .../com/redmadrobot/debug/core/annotation/DebugPanelInternal.kt | 0 .../kotlin/com/redmadrobot/debug/core/data/DebugDataProvider.kt | 0 .../kotlin/com/redmadrobot/debug/core/extension/PluginsExt.kt | 0 .../kotlin/com/redmadrobot/debug/core/inapp/DebugBottomSheet.kt | 0 .../redmadrobot/debug/core/inapp/DebugSheetViewPagerAdapter.kt | 0 .../main/kotlin/com/redmadrobot/debug/core/inapp/ModalLayout.kt | 0 .../com/redmadrobot/debug/core/inapp/shake/ShakeController.kt | 0 .../com/redmadrobot/debug/core/inapp/shake/ShakeListener.kt | 0 .../kotlin/com/redmadrobot/debug/core/internal/DebugEvent.kt | 0 .../kotlin/com/redmadrobot/debug/core/internal/DebugPanel.kt | 0 .../com/redmadrobot/debug/core/internal/DebugPanelConfig.kt | 0 .../src/main/kotlin/com/redmadrobot/debug/core/plugin/Plugin.kt | 0 .../redmadrobot/debug/core/plugin/PluginDependencyContainer.kt | 0 .../kotlin/com/redmadrobot/debug/core/plugin/PluginManager.kt | 0 .../com/redmadrobot/debug/core/ui/debugpanel/DebugActivity.kt | 0 .../redmadrobot/debug/core/ui/debugpanel/PluginsSettingItem.kt | 0 .../debug/core/util/ActivityLifecycleCallbacksAdapter.kt | 0 .../redmadrobot/debug/core/util/ApplicationLifecycleHandler.kt | 0 .../redmadrobot/debug/core/util/DebugPanelBroadcastReceiver.kt | 0 .../com/redmadrobot/debug/core/util/DebugPanelNotification.kt | 0 .../src/main/res/drawable/ic_debug_notification.xml | 0 .../src/main/res/drawable/ic_debug_panel.xml | 0 .../src/main/res/drawable/ic_settings_notification_action.xml | 0 .../src/main/res/drawable/shape_scrollable_sheet.xml | 0 .../src/main/res/layout/activity_debug.xml | 0 .../src/main/res/layout/bottom_sheet_debug_panel.xml | 0 .../src/main/res/layout/fragment_stub.xml | 0 .../src/main/res/layout/item_plugin_setting.xml | 0 {debug-panel-core => core}/src/main/res/values/dimens.xml | 0 {debug-panel-core => core}/src/main/res/values/public.xml | 0 {debug-panel-core => core}/src/main/res/values/strings.xml | 0 sample/build.gradle.kts | 2 +- settings.gradle.kts | 2 +- 41 files changed, 2 insertions(+), 2 deletions(-) rename {debug-panel-core => core}/.gitignore (100%) rename {debug-panel-core => core}/build.gradle.kts (100%) rename {debug-panel-core => core}/consumer-rules.pro (100%) rename {debug-panel-core => core}/library.properties (100%) rename {debug-panel-core => core}/proguard-rules.pro (100%) rename {debug-panel-core => core}/src/main/AndroidManifest.xml (100%) rename {debug-panel-core => core}/src/main/kotlin/com/redmadrobot/debug/core/CommonContainer.kt (100%) rename {debug-panel-core => core}/src/main/kotlin/com/redmadrobot/debug/core/DebugPanelInstance.kt (100%) rename {debug-panel-core => core}/src/main/kotlin/com/redmadrobot/debug/core/annotation/DebugPanelInternal.kt (100%) rename {debug-panel-core => core}/src/main/kotlin/com/redmadrobot/debug/core/data/DebugDataProvider.kt (100%) rename {debug-panel-core => core}/src/main/kotlin/com/redmadrobot/debug/core/extension/PluginsExt.kt (100%) rename {debug-panel-core => core}/src/main/kotlin/com/redmadrobot/debug/core/inapp/DebugBottomSheet.kt (100%) rename {debug-panel-core => core}/src/main/kotlin/com/redmadrobot/debug/core/inapp/DebugSheetViewPagerAdapter.kt (100%) rename {debug-panel-core => core}/src/main/kotlin/com/redmadrobot/debug/core/inapp/ModalLayout.kt (100%) rename {debug-panel-core => core}/src/main/kotlin/com/redmadrobot/debug/core/inapp/shake/ShakeController.kt (100%) rename {debug-panel-core => core}/src/main/kotlin/com/redmadrobot/debug/core/inapp/shake/ShakeListener.kt (100%) rename {debug-panel-core => core}/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugEvent.kt (100%) rename {debug-panel-core => core}/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugPanel.kt (100%) rename {debug-panel-core => core}/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugPanelConfig.kt (100%) rename {debug-panel-core => core}/src/main/kotlin/com/redmadrobot/debug/core/plugin/Plugin.kt (100%) rename {debug-panel-core => core}/src/main/kotlin/com/redmadrobot/debug/core/plugin/PluginDependencyContainer.kt (100%) rename {debug-panel-core => core}/src/main/kotlin/com/redmadrobot/debug/core/plugin/PluginManager.kt (100%) rename {debug-panel-core => core}/src/main/kotlin/com/redmadrobot/debug/core/ui/debugpanel/DebugActivity.kt (100%) rename {debug-panel-core => core}/src/main/kotlin/com/redmadrobot/debug/core/ui/debugpanel/PluginsSettingItem.kt (100%) rename {debug-panel-core => core}/src/main/kotlin/com/redmadrobot/debug/core/util/ActivityLifecycleCallbacksAdapter.kt (100%) rename {debug-panel-core => core}/src/main/kotlin/com/redmadrobot/debug/core/util/ApplicationLifecycleHandler.kt (100%) rename {debug-panel-core => core}/src/main/kotlin/com/redmadrobot/debug/core/util/DebugPanelBroadcastReceiver.kt (100%) rename {debug-panel-core => core}/src/main/kotlin/com/redmadrobot/debug/core/util/DebugPanelNotification.kt (100%) rename {debug-panel-core => core}/src/main/res/drawable/ic_debug_notification.xml (100%) rename {debug-panel-core => core}/src/main/res/drawable/ic_debug_panel.xml (100%) rename {debug-panel-core => core}/src/main/res/drawable/ic_settings_notification_action.xml (100%) rename {debug-panel-core => core}/src/main/res/drawable/shape_scrollable_sheet.xml (100%) rename {debug-panel-core => core}/src/main/res/layout/activity_debug.xml (100%) rename {debug-panel-core => core}/src/main/res/layout/bottom_sheet_debug_panel.xml (100%) rename {debug-panel-core => core}/src/main/res/layout/fragment_stub.xml (100%) rename {debug-panel-core => core}/src/main/res/layout/item_plugin_setting.xml (100%) rename {debug-panel-core => core}/src/main/res/values/dimens.xml (100%) rename {debug-panel-core => core}/src/main/res/values/public.xml (100%) rename {debug-panel-core => core}/src/main/res/values/strings.xml (100%) diff --git a/debug-panel-core/.gitignore b/core/.gitignore similarity index 100% rename from debug-panel-core/.gitignore rename to core/.gitignore diff --git a/debug-panel-core/build.gradle.kts b/core/build.gradle.kts similarity index 100% rename from debug-panel-core/build.gradle.kts rename to core/build.gradle.kts diff --git a/debug-panel-core/consumer-rules.pro b/core/consumer-rules.pro similarity index 100% rename from debug-panel-core/consumer-rules.pro rename to core/consumer-rules.pro diff --git a/debug-panel-core/library.properties b/core/library.properties similarity index 100% rename from debug-panel-core/library.properties rename to core/library.properties diff --git a/debug-panel-core/proguard-rules.pro b/core/proguard-rules.pro similarity index 100% rename from debug-panel-core/proguard-rules.pro rename to core/proguard-rules.pro diff --git a/debug-panel-core/src/main/AndroidManifest.xml b/core/src/main/AndroidManifest.xml similarity index 100% rename from debug-panel-core/src/main/AndroidManifest.xml rename to core/src/main/AndroidManifest.xml diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/CommonContainer.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/CommonContainer.kt similarity index 100% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/CommonContainer.kt rename to core/src/main/kotlin/com/redmadrobot/debug/core/CommonContainer.kt diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/DebugPanelInstance.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/DebugPanelInstance.kt similarity index 100% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/DebugPanelInstance.kt rename to core/src/main/kotlin/com/redmadrobot/debug/core/DebugPanelInstance.kt diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/annotation/DebugPanelInternal.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/annotation/DebugPanelInternal.kt similarity index 100% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/annotation/DebugPanelInternal.kt rename to core/src/main/kotlin/com/redmadrobot/debug/core/annotation/DebugPanelInternal.kt diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/data/DebugDataProvider.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/data/DebugDataProvider.kt similarity index 100% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/data/DebugDataProvider.kt rename to core/src/main/kotlin/com/redmadrobot/debug/core/data/DebugDataProvider.kt diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/extension/PluginsExt.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/extension/PluginsExt.kt similarity index 100% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/extension/PluginsExt.kt rename to core/src/main/kotlin/com/redmadrobot/debug/core/extension/PluginsExt.kt diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/DebugBottomSheet.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/inapp/DebugBottomSheet.kt similarity index 100% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/DebugBottomSheet.kt rename to core/src/main/kotlin/com/redmadrobot/debug/core/inapp/DebugBottomSheet.kt diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/DebugSheetViewPagerAdapter.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/inapp/DebugSheetViewPagerAdapter.kt similarity index 100% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/DebugSheetViewPagerAdapter.kt rename to core/src/main/kotlin/com/redmadrobot/debug/core/inapp/DebugSheetViewPagerAdapter.kt diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/ModalLayout.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/inapp/ModalLayout.kt similarity index 100% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/ModalLayout.kt rename to core/src/main/kotlin/com/redmadrobot/debug/core/inapp/ModalLayout.kt diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/shake/ShakeController.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/inapp/shake/ShakeController.kt similarity index 100% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/shake/ShakeController.kt rename to core/src/main/kotlin/com/redmadrobot/debug/core/inapp/shake/ShakeController.kt diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/shake/ShakeListener.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/inapp/shake/ShakeListener.kt similarity index 100% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/shake/ShakeListener.kt rename to core/src/main/kotlin/com/redmadrobot/debug/core/inapp/shake/ShakeListener.kt diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugEvent.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugEvent.kt similarity index 100% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugEvent.kt rename to core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugEvent.kt diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugPanel.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugPanel.kt similarity index 100% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugPanel.kt rename to core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugPanel.kt diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugPanelConfig.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugPanelConfig.kt similarity index 100% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugPanelConfig.kt rename to core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugPanelConfig.kt diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/plugin/Plugin.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/plugin/Plugin.kt similarity index 100% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/plugin/Plugin.kt rename to core/src/main/kotlin/com/redmadrobot/debug/core/plugin/Plugin.kt diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/plugin/PluginDependencyContainer.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/plugin/PluginDependencyContainer.kt similarity index 100% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/plugin/PluginDependencyContainer.kt rename to core/src/main/kotlin/com/redmadrobot/debug/core/plugin/PluginDependencyContainer.kt diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/plugin/PluginManager.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/plugin/PluginManager.kt similarity index 100% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/plugin/PluginManager.kt rename to core/src/main/kotlin/com/redmadrobot/debug/core/plugin/PluginManager.kt diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/ui/debugpanel/DebugActivity.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/ui/debugpanel/DebugActivity.kt similarity index 100% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/ui/debugpanel/DebugActivity.kt rename to core/src/main/kotlin/com/redmadrobot/debug/core/ui/debugpanel/DebugActivity.kt diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/ui/debugpanel/PluginsSettingItem.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/ui/debugpanel/PluginsSettingItem.kt similarity index 100% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/ui/debugpanel/PluginsSettingItem.kt rename to core/src/main/kotlin/com/redmadrobot/debug/core/ui/debugpanel/PluginsSettingItem.kt diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/util/ActivityLifecycleCallbacksAdapter.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/util/ActivityLifecycleCallbacksAdapter.kt similarity index 100% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/util/ActivityLifecycleCallbacksAdapter.kt rename to core/src/main/kotlin/com/redmadrobot/debug/core/util/ActivityLifecycleCallbacksAdapter.kt diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/util/ApplicationLifecycleHandler.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/util/ApplicationLifecycleHandler.kt similarity index 100% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/util/ApplicationLifecycleHandler.kt rename to core/src/main/kotlin/com/redmadrobot/debug/core/util/ApplicationLifecycleHandler.kt diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/util/DebugPanelBroadcastReceiver.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/util/DebugPanelBroadcastReceiver.kt similarity index 100% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/util/DebugPanelBroadcastReceiver.kt rename to core/src/main/kotlin/com/redmadrobot/debug/core/util/DebugPanelBroadcastReceiver.kt diff --git a/debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/util/DebugPanelNotification.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/util/DebugPanelNotification.kt similarity index 100% rename from debug-panel-core/src/main/kotlin/com/redmadrobot/debug/core/util/DebugPanelNotification.kt rename to core/src/main/kotlin/com/redmadrobot/debug/core/util/DebugPanelNotification.kt diff --git a/debug-panel-core/src/main/res/drawable/ic_debug_notification.xml b/core/src/main/res/drawable/ic_debug_notification.xml similarity index 100% rename from debug-panel-core/src/main/res/drawable/ic_debug_notification.xml rename to core/src/main/res/drawable/ic_debug_notification.xml diff --git a/debug-panel-core/src/main/res/drawable/ic_debug_panel.xml b/core/src/main/res/drawable/ic_debug_panel.xml similarity index 100% rename from debug-panel-core/src/main/res/drawable/ic_debug_panel.xml rename to core/src/main/res/drawable/ic_debug_panel.xml diff --git a/debug-panel-core/src/main/res/drawable/ic_settings_notification_action.xml b/core/src/main/res/drawable/ic_settings_notification_action.xml similarity index 100% rename from debug-panel-core/src/main/res/drawable/ic_settings_notification_action.xml rename to core/src/main/res/drawable/ic_settings_notification_action.xml diff --git a/debug-panel-core/src/main/res/drawable/shape_scrollable_sheet.xml b/core/src/main/res/drawable/shape_scrollable_sheet.xml similarity index 100% rename from debug-panel-core/src/main/res/drawable/shape_scrollable_sheet.xml rename to core/src/main/res/drawable/shape_scrollable_sheet.xml diff --git a/debug-panel-core/src/main/res/layout/activity_debug.xml b/core/src/main/res/layout/activity_debug.xml similarity index 100% rename from debug-panel-core/src/main/res/layout/activity_debug.xml rename to core/src/main/res/layout/activity_debug.xml diff --git a/debug-panel-core/src/main/res/layout/bottom_sheet_debug_panel.xml b/core/src/main/res/layout/bottom_sheet_debug_panel.xml similarity index 100% rename from debug-panel-core/src/main/res/layout/bottom_sheet_debug_panel.xml rename to core/src/main/res/layout/bottom_sheet_debug_panel.xml diff --git a/debug-panel-core/src/main/res/layout/fragment_stub.xml b/core/src/main/res/layout/fragment_stub.xml similarity index 100% rename from debug-panel-core/src/main/res/layout/fragment_stub.xml rename to core/src/main/res/layout/fragment_stub.xml diff --git a/debug-panel-core/src/main/res/layout/item_plugin_setting.xml b/core/src/main/res/layout/item_plugin_setting.xml similarity index 100% rename from debug-panel-core/src/main/res/layout/item_plugin_setting.xml rename to core/src/main/res/layout/item_plugin_setting.xml diff --git a/debug-panel-core/src/main/res/values/dimens.xml b/core/src/main/res/values/dimens.xml similarity index 100% rename from debug-panel-core/src/main/res/values/dimens.xml rename to core/src/main/res/values/dimens.xml diff --git a/debug-panel-core/src/main/res/values/public.xml b/core/src/main/res/values/public.xml similarity index 100% rename from debug-panel-core/src/main/res/values/public.xml rename to core/src/main/res/values/public.xml diff --git a/debug-panel-core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml similarity index 100% rename from debug-panel-core/src/main/res/values/strings.xml rename to core/src/main/res/values/strings.xml diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index 70a06391..1e94dadc 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -41,9 +41,9 @@ dependencies { implementation(stack.timber) implementation(stack.kotlinx.coroutines.android) implementation(androidx.lifecycle.runtime) + debugImplementation(project(":core")) // Debug panel dependencies - debugImplementation(project(":debug-panel-core")) debugImplementation(project(":plugins:servers-plugin")) debugImplementation(project(":plugins:accounts-plugin")) debugImplementation(project(":plugins:app-settings-plugin")) diff --git a/settings.gradle.kts b/settings.gradle.kts index 75ce64d7..f2a00ece 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -33,7 +33,7 @@ dependencyResolutionManagement { include( ":common", ":debug-panel-no-op", - ":debug-panel-core" + ":core" ) // Plugins From 758810cddeec0d78ad0f0507e6e6cb6b2b7c151a Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Tue, 6 Dec 2022 11:43:14 +0300 Subject: [PATCH 09/42] Noop:Rename 'debug-panel-no-op' module to 'no-op' --- {debug-panel-no-op => no-op}/.gitignore | 0 {debug-panel-no-op => no-op}/build.gradle.kts | 0 {debug-panel-no-op => no-op}/consumer-rules.pro | 0 {debug-panel-no-op => no-op}/library.properties | 0 {debug-panel-no-op => no-op}/proguard-rules.pro | 0 no-op/src/main/AndroidManifest.xml | 1 + .../com/redmadrobot/debug_panel_no_op/DebugDataProvider.kt | 0 .../debug_panel_no_op/accounts/AccountSelectedEvent.kt | 0 .../redmadrobot/debug_panel_no_op/accounts/AccountsPlugin.kt | 0 .../com/redmadrobot/debug_panel_no_op/accounts/DebugAccount.kt | 0 .../debug_panel_no_op/accounts/DebugAuthenticator.kt | 0 .../debug_panel_no_op/app_setting/AppSettingsPlugin.kt | 0 .../kotlin/com/redmadrobot/debug_panel_no_op/core/DebugEvent.kt | 0 .../kotlin/com/redmadrobot/debug_panel_no_op/core/DebugPanel.kt | 0 .../com/redmadrobot/debug_panel_no_op/core/DebugPanelConfig.kt | 0 .../com/redmadrobot/debug_panel_no_op/flipper/FlipperPlugin.kt | 0 .../com/redmadrobot/debug_panel_no_op/servers/DebugServer.kt | 0 .../debug_panel_no_op/servers/DebugServerInterceptor.kt | 0 .../debug_panel_no_op/servers/ServerSelectedEvent.kt | 0 .../com/redmadrobot/debug_panel_no_op/servers/ServersPlugin.kt | 0 .../redmadrobot/debug_panel_no_op/variable/VariablePlugin.kt | 0 sample/build.gradle.kts | 2 +- settings.gradle.kts | 2 +- 23 files changed, 3 insertions(+), 2 deletions(-) rename {debug-panel-no-op => no-op}/.gitignore (100%) rename {debug-panel-no-op => no-op}/build.gradle.kts (100%) rename {debug-panel-no-op => no-op}/consumer-rules.pro (100%) rename {debug-panel-no-op => no-op}/library.properties (100%) rename {debug-panel-no-op => no-op}/proguard-rules.pro (100%) create mode 100644 no-op/src/main/AndroidManifest.xml rename {debug-panel-no-op => no-op}/src/main/kotlin/com/redmadrobot/debug_panel_no_op/DebugDataProvider.kt (100%) rename {debug-panel-no-op => no-op}/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/AccountSelectedEvent.kt (100%) rename {debug-panel-no-op => no-op}/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/AccountsPlugin.kt (100%) rename {debug-panel-no-op => no-op}/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/DebugAccount.kt (100%) rename {debug-panel-no-op => no-op}/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/DebugAuthenticator.kt (100%) rename {debug-panel-no-op => no-op}/src/main/kotlin/com/redmadrobot/debug_panel_no_op/app_setting/AppSettingsPlugin.kt (100%) rename {debug-panel-no-op => no-op}/src/main/kotlin/com/redmadrobot/debug_panel_no_op/core/DebugEvent.kt (100%) rename {debug-panel-no-op => no-op}/src/main/kotlin/com/redmadrobot/debug_panel_no_op/core/DebugPanel.kt (100%) rename {debug-panel-no-op => no-op}/src/main/kotlin/com/redmadrobot/debug_panel_no_op/core/DebugPanelConfig.kt (100%) rename {debug-panel-no-op => no-op}/src/main/kotlin/com/redmadrobot/debug_panel_no_op/flipper/FlipperPlugin.kt (100%) rename {debug-panel-no-op => no-op}/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/DebugServer.kt (100%) rename {debug-panel-no-op => no-op}/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/DebugServerInterceptor.kt (100%) rename {debug-panel-no-op => no-op}/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/ServerSelectedEvent.kt (100%) rename {debug-panel-no-op => no-op}/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/ServersPlugin.kt (100%) rename {debug-panel-no-op => no-op}/src/main/kotlin/com/redmadrobot/debug_panel_no_op/variable/VariablePlugin.kt (100%) diff --git a/debug-panel-no-op/.gitignore b/no-op/.gitignore similarity index 100% rename from debug-panel-no-op/.gitignore rename to no-op/.gitignore diff --git a/debug-panel-no-op/build.gradle.kts b/no-op/build.gradle.kts similarity index 100% rename from debug-panel-no-op/build.gradle.kts rename to no-op/build.gradle.kts diff --git a/debug-panel-no-op/consumer-rules.pro b/no-op/consumer-rules.pro similarity index 100% rename from debug-panel-no-op/consumer-rules.pro rename to no-op/consumer-rules.pro diff --git a/debug-panel-no-op/library.properties b/no-op/library.properties similarity index 100% rename from debug-panel-no-op/library.properties rename to no-op/library.properties diff --git a/debug-panel-no-op/proguard-rules.pro b/no-op/proguard-rules.pro similarity index 100% rename from debug-panel-no-op/proguard-rules.pro rename to no-op/proguard-rules.pro diff --git a/no-op/src/main/AndroidManifest.xml b/no-op/src/main/AndroidManifest.xml new file mode 100644 index 00000000..b6a222b8 --- /dev/null +++ b/no-op/src/main/AndroidManifest.xml @@ -0,0 +1 @@ + diff --git a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/DebugDataProvider.kt b/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/DebugDataProvider.kt similarity index 100% rename from debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/DebugDataProvider.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/DebugDataProvider.kt diff --git a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/AccountSelectedEvent.kt b/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/AccountSelectedEvent.kt similarity index 100% rename from debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/AccountSelectedEvent.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/AccountSelectedEvent.kt diff --git a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/AccountsPlugin.kt b/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/AccountsPlugin.kt similarity index 100% rename from debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/AccountsPlugin.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/AccountsPlugin.kt diff --git a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/DebugAccount.kt b/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/DebugAccount.kt similarity index 100% rename from debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/DebugAccount.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/DebugAccount.kt diff --git a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/DebugAuthenticator.kt b/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/DebugAuthenticator.kt similarity index 100% rename from debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/DebugAuthenticator.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/DebugAuthenticator.kt diff --git a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/app_setting/AppSettingsPlugin.kt b/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/app_setting/AppSettingsPlugin.kt similarity index 100% rename from debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/app_setting/AppSettingsPlugin.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/app_setting/AppSettingsPlugin.kt diff --git a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/core/DebugEvent.kt b/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/core/DebugEvent.kt similarity index 100% rename from debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/core/DebugEvent.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/core/DebugEvent.kt diff --git a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/core/DebugPanel.kt b/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/core/DebugPanel.kt similarity index 100% rename from debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/core/DebugPanel.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/core/DebugPanel.kt diff --git a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/core/DebugPanelConfig.kt b/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/core/DebugPanelConfig.kt similarity index 100% rename from debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/core/DebugPanelConfig.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/core/DebugPanelConfig.kt diff --git a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/flipper/FlipperPlugin.kt b/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/flipper/FlipperPlugin.kt similarity index 100% rename from debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/flipper/FlipperPlugin.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/flipper/FlipperPlugin.kt diff --git a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/DebugServer.kt b/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/DebugServer.kt similarity index 100% rename from debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/DebugServer.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/DebugServer.kt diff --git a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/DebugServerInterceptor.kt b/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/DebugServerInterceptor.kt similarity index 100% rename from debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/DebugServerInterceptor.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/DebugServerInterceptor.kt diff --git a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/ServerSelectedEvent.kt b/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/ServerSelectedEvent.kt similarity index 100% rename from debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/ServerSelectedEvent.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/ServerSelectedEvent.kt diff --git a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/ServersPlugin.kt b/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/ServersPlugin.kt similarity index 100% rename from debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/ServersPlugin.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/ServersPlugin.kt diff --git a/debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/variable/VariablePlugin.kt b/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/variable/VariablePlugin.kt similarity index 100% rename from debug-panel-no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/variable/VariablePlugin.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/variable/VariablePlugin.kt diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index 1e94dadc..733bbdf8 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -57,7 +57,7 @@ dependencies { // debugImplementation("com.redmadrobot.debug:variable-plugin:${project.version}") //No-op dependency - releaseImplementation(project(":debug-panel-no-op")) + releaseImplementation(project(":no-op")) // releaseImplementation("com.redmadrobot.debug:panel-no-op:${project.version}") implementation(stack.retrofit) diff --git a/settings.gradle.kts b/settings.gradle.kts index f2a00ece..8d8ce3c3 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -32,7 +32,7 @@ dependencyResolutionManagement { // Base modules include( ":common", - ":debug-panel-no-op", + ":no-op", ":core" ) From 4fe182a6578a30d333194da8559580a49b9e7f4a Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Tue, 6 Dec 2022 11:45:09 +0300 Subject: [PATCH 10/42] Noop:Rename 'no-op' package to to 'com.redmadrobot.debug.noop' --- .../{debug_panel_no_op => debug/noop}/DebugDataProvider.kt | 0 .../noop}/accounts/AccountSelectedEvent.kt | 0 .../{debug_panel_no_op => debug/noop}/accounts/AccountsPlugin.kt | 0 .../{debug_panel_no_op => debug/noop}/accounts/DebugAccount.kt | 0 .../noop}/accounts/DebugAuthenticator.kt | 0 .../noop}/app_setting/AppSettingsPlugin.kt | 0 .../{debug_panel_no_op => debug/noop}/core/DebugEvent.kt | 0 .../{debug_panel_no_op => debug/noop}/core/DebugPanel.kt | 0 .../{debug_panel_no_op => debug/noop}/core/DebugPanelConfig.kt | 0 .../{debug_panel_no_op => debug/noop}/flipper/FlipperPlugin.kt | 0 .../{debug_panel_no_op => debug/noop}/servers/DebugServer.kt | 0 .../noop}/servers/DebugServerInterceptor.kt | 0 .../noop}/servers/ServerSelectedEvent.kt | 0 .../{debug_panel_no_op => debug/noop}/servers/ServersPlugin.kt | 0 .../{debug_panel_no_op => debug/noop}/variable/VariablePlugin.kt | 0 15 files changed, 0 insertions(+), 0 deletions(-) rename no-op/src/main/kotlin/com/redmadrobot/{debug_panel_no_op => debug/noop}/DebugDataProvider.kt (100%) rename no-op/src/main/kotlin/com/redmadrobot/{debug_panel_no_op => debug/noop}/accounts/AccountSelectedEvent.kt (100%) rename no-op/src/main/kotlin/com/redmadrobot/{debug_panel_no_op => debug/noop}/accounts/AccountsPlugin.kt (100%) rename no-op/src/main/kotlin/com/redmadrobot/{debug_panel_no_op => debug/noop}/accounts/DebugAccount.kt (100%) rename no-op/src/main/kotlin/com/redmadrobot/{debug_panel_no_op => debug/noop}/accounts/DebugAuthenticator.kt (100%) rename no-op/src/main/kotlin/com/redmadrobot/{debug_panel_no_op => debug/noop}/app_setting/AppSettingsPlugin.kt (100%) rename no-op/src/main/kotlin/com/redmadrobot/{debug_panel_no_op => debug/noop}/core/DebugEvent.kt (100%) rename no-op/src/main/kotlin/com/redmadrobot/{debug_panel_no_op => debug/noop}/core/DebugPanel.kt (100%) rename no-op/src/main/kotlin/com/redmadrobot/{debug_panel_no_op => debug/noop}/core/DebugPanelConfig.kt (100%) rename no-op/src/main/kotlin/com/redmadrobot/{debug_panel_no_op => debug/noop}/flipper/FlipperPlugin.kt (100%) rename no-op/src/main/kotlin/com/redmadrobot/{debug_panel_no_op => debug/noop}/servers/DebugServer.kt (100%) rename no-op/src/main/kotlin/com/redmadrobot/{debug_panel_no_op => debug/noop}/servers/DebugServerInterceptor.kt (100%) rename no-op/src/main/kotlin/com/redmadrobot/{debug_panel_no_op => debug/noop}/servers/ServerSelectedEvent.kt (100%) rename no-op/src/main/kotlin/com/redmadrobot/{debug_panel_no_op => debug/noop}/servers/ServersPlugin.kt (100%) rename no-op/src/main/kotlin/com/redmadrobot/{debug_panel_no_op => debug/noop}/variable/VariablePlugin.kt (100%) diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/DebugDataProvider.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/DebugDataProvider.kt similarity index 100% rename from no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/DebugDataProvider.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug/noop/DebugDataProvider.kt diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/AccountSelectedEvent.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/AccountSelectedEvent.kt similarity index 100% rename from no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/AccountSelectedEvent.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/AccountSelectedEvent.kt diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/AccountsPlugin.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/AccountsPlugin.kt similarity index 100% rename from no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/AccountsPlugin.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/AccountsPlugin.kt diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/DebugAccount.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/DebugAccount.kt similarity index 100% rename from no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/DebugAccount.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/DebugAccount.kt diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/DebugAuthenticator.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/DebugAuthenticator.kt similarity index 100% rename from no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/accounts/DebugAuthenticator.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/DebugAuthenticator.kt diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/app_setting/AppSettingsPlugin.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/app_setting/AppSettingsPlugin.kt similarity index 100% rename from no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/app_setting/AppSettingsPlugin.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug/noop/app_setting/AppSettingsPlugin.kt diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/core/DebugEvent.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/core/DebugEvent.kt similarity index 100% rename from no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/core/DebugEvent.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug/noop/core/DebugEvent.kt diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/core/DebugPanel.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/core/DebugPanel.kt similarity index 100% rename from no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/core/DebugPanel.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug/noop/core/DebugPanel.kt diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/core/DebugPanelConfig.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/core/DebugPanelConfig.kt similarity index 100% rename from no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/core/DebugPanelConfig.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug/noop/core/DebugPanelConfig.kt diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/flipper/FlipperPlugin.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/flipper/FlipperPlugin.kt similarity index 100% rename from no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/flipper/FlipperPlugin.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug/noop/flipper/FlipperPlugin.kt diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/DebugServer.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugServer.kt similarity index 100% rename from no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/DebugServer.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugServer.kt diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/DebugServerInterceptor.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugServerInterceptor.kt similarity index 100% rename from no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/DebugServerInterceptor.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugServerInterceptor.kt diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/ServerSelectedEvent.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/ServerSelectedEvent.kt similarity index 100% rename from no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/ServerSelectedEvent.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/ServerSelectedEvent.kt diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/ServersPlugin.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/ServersPlugin.kt similarity index 100% rename from no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/servers/ServersPlugin.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/ServersPlugin.kt diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/variable/VariablePlugin.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/variable/VariablePlugin.kt similarity index 100% rename from no-op/src/main/kotlin/com/redmadrobot/debug_panel_no_op/variable/VariablePlugin.kt rename to no-op/src/main/kotlin/com/redmadrobot/debug/noop/variable/VariablePlugin.kt From 4240ba4187132bf205783eaada68dea418192c24 Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Tue, 6 Dec 2022 11:55:31 +0300 Subject: [PATCH 11/42] Accounts:Rename 'accounts-plugin' module to 'accounts' --- plugins/{accounts-plugin => accounts}/.gitignore | 0 plugins/{accounts-plugin => accounts}/build.gradle.kts | 0 plugins/{accounts-plugin => accounts}/consumer-rules.pro | 0 plugins/{accounts-plugin => accounts}/library.properties | 0 plugins/{accounts-plugin => accounts}/proguard-rules.pro | 0 plugins/accounts/src/main/AndroidManifest.xml | 0 .../debug/account/authenticator/DebugAuthenticator.kt | 0 .../debug/account/authenticator/DefaultAuthenticator.kt | 0 .../redmadrobot/debug/account/data/DebugAccountRepository.kt | 0 .../debug/account/data/LocalDebugAccountRepository.kt | 0 .../com/redmadrobot/debug/account/data/model/DebugAccount.kt | 0 .../debug/account/data/storage/AccountsPluginDatabase.kt | 0 .../redmadrobot/debug/account/data/storage/DebugAccountDao.kt | 0 .../redmadrobot/debug/account/plugin/AccountSelectedEvent.kt | 0 .../com/redmadrobot/debug/account/plugin/AccountsPlugin.kt | 0 .../redmadrobot/debug/account/plugin/AccountsPluginContainer.kt | 0 .../kotlin/com/redmadrobot/debug/account/ui/AccountsFragment.kt | 0 .../kotlin/com/redmadrobot/debug/account/ui/AccountsScreen.kt | 0 .../com/redmadrobot/debug/account/ui/AccountsViewModel.kt | 0 .../com/redmadrobot/debug/account/ui/AccountsViewState.kt | 0 .../src/main/res/drawable/icon_account.xml | 0 .../src/main/res/drawable/icon_add_account.xml | 0 .../src/main/res/drawable/icon_delete.xml | 0 .../src/main/res/layout/dialog_add_account.xml | 0 .../src/main/res/layout/dialog_add_pin.xml | 0 .../src/main/res/layout/fragment_accounts_compose.xml | 0 .../src/main/res/layout/item_account.xml | 0 .../{accounts-plugin => accounts}/src/main/res/values/color.xml | 0 .../src/main/res/values/public.xml | 0 .../src/main/res/values/strings.xml | 0 sample/build.gradle.kts | 2 +- settings.gradle.kts | 2 +- 32 files changed, 2 insertions(+), 2 deletions(-) rename plugins/{accounts-plugin => accounts}/.gitignore (100%) rename plugins/{accounts-plugin => accounts}/build.gradle.kts (100%) rename plugins/{accounts-plugin => accounts}/consumer-rules.pro (100%) rename plugins/{accounts-plugin => accounts}/library.properties (100%) rename plugins/{accounts-plugin => accounts}/proguard-rules.pro (100%) create mode 100644 plugins/accounts/src/main/AndroidManifest.xml rename plugins/{accounts-plugin => accounts}/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DebugAuthenticator.kt (100%) rename plugins/{accounts-plugin => accounts}/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DefaultAuthenticator.kt (100%) rename plugins/{accounts-plugin => accounts}/src/main/kotlin/com/redmadrobot/debug/account/data/DebugAccountRepository.kt (100%) rename plugins/{accounts-plugin => accounts}/src/main/kotlin/com/redmadrobot/debug/account/data/LocalDebugAccountRepository.kt (100%) rename plugins/{accounts-plugin => accounts}/src/main/kotlin/com/redmadrobot/debug/account/data/model/DebugAccount.kt (100%) rename plugins/{accounts-plugin => accounts}/src/main/kotlin/com/redmadrobot/debug/account/data/storage/AccountsPluginDatabase.kt (100%) rename plugins/{accounts-plugin => accounts}/src/main/kotlin/com/redmadrobot/debug/account/data/storage/DebugAccountDao.kt (100%) rename plugins/{accounts-plugin => accounts}/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountSelectedEvent.kt (100%) rename plugins/{accounts-plugin => accounts}/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPlugin.kt (100%) rename plugins/{accounts-plugin => accounts}/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPluginContainer.kt (100%) rename plugins/{accounts-plugin => accounts}/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsFragment.kt (100%) rename plugins/{accounts-plugin => accounts}/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsScreen.kt (100%) rename plugins/{accounts-plugin => accounts}/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewModel.kt (100%) rename plugins/{accounts-plugin => accounts}/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewState.kt (100%) rename plugins/{accounts-plugin => accounts}/src/main/res/drawable/icon_account.xml (100%) rename plugins/{accounts-plugin => accounts}/src/main/res/drawable/icon_add_account.xml (100%) rename plugins/{accounts-plugin => accounts}/src/main/res/drawable/icon_delete.xml (100%) rename plugins/{accounts-plugin => accounts}/src/main/res/layout/dialog_add_account.xml (100%) rename plugins/{accounts-plugin => accounts}/src/main/res/layout/dialog_add_pin.xml (100%) rename plugins/{accounts-plugin => accounts}/src/main/res/layout/fragment_accounts_compose.xml (100%) rename plugins/{accounts-plugin => accounts}/src/main/res/layout/item_account.xml (100%) rename plugins/{accounts-plugin => accounts}/src/main/res/values/color.xml (100%) rename plugins/{accounts-plugin => accounts}/src/main/res/values/public.xml (100%) rename plugins/{accounts-plugin => accounts}/src/main/res/values/strings.xml (100%) diff --git a/plugins/accounts-plugin/.gitignore b/plugins/accounts/.gitignore similarity index 100% rename from plugins/accounts-plugin/.gitignore rename to plugins/accounts/.gitignore diff --git a/plugins/accounts-plugin/build.gradle.kts b/plugins/accounts/build.gradle.kts similarity index 100% rename from plugins/accounts-plugin/build.gradle.kts rename to plugins/accounts/build.gradle.kts diff --git a/plugins/accounts-plugin/consumer-rules.pro b/plugins/accounts/consumer-rules.pro similarity index 100% rename from plugins/accounts-plugin/consumer-rules.pro rename to plugins/accounts/consumer-rules.pro diff --git a/plugins/accounts-plugin/library.properties b/plugins/accounts/library.properties similarity index 100% rename from plugins/accounts-plugin/library.properties rename to plugins/accounts/library.properties diff --git a/plugins/accounts-plugin/proguard-rules.pro b/plugins/accounts/proguard-rules.pro similarity index 100% rename from plugins/accounts-plugin/proguard-rules.pro rename to plugins/accounts/proguard-rules.pro diff --git a/plugins/accounts/src/main/AndroidManifest.xml b/plugins/accounts/src/main/AndroidManifest.xml new file mode 100644 index 00000000..e69de29b diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DebugAuthenticator.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DebugAuthenticator.kt similarity index 100% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DebugAuthenticator.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DebugAuthenticator.kt diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DefaultAuthenticator.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DefaultAuthenticator.kt similarity index 100% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DefaultAuthenticator.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DefaultAuthenticator.kt diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/DebugAccountRepository.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/DebugAccountRepository.kt similarity index 100% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/DebugAccountRepository.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/DebugAccountRepository.kt diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/LocalDebugAccountRepository.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/LocalDebugAccountRepository.kt similarity index 100% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/LocalDebugAccountRepository.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/LocalDebugAccountRepository.kt diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/model/DebugAccount.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/model/DebugAccount.kt similarity index 100% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/model/DebugAccount.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/model/DebugAccount.kt diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/storage/AccountsPluginDatabase.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/storage/AccountsPluginDatabase.kt similarity index 100% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/storage/AccountsPluginDatabase.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/storage/AccountsPluginDatabase.kt diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/storage/DebugAccountDao.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/storage/DebugAccountDao.kt similarity index 100% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/data/storage/DebugAccountDao.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/storage/DebugAccountDao.kt diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountSelectedEvent.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountSelectedEvent.kt similarity index 100% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountSelectedEvent.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountSelectedEvent.kt diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPlugin.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPlugin.kt similarity index 100% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPlugin.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPlugin.kt diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPluginContainer.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPluginContainer.kt similarity index 100% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPluginContainer.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPluginContainer.kt diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsFragment.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsFragment.kt similarity index 100% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsFragment.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsFragment.kt diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsScreen.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsScreen.kt similarity index 100% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsScreen.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsScreen.kt diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewModel.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewModel.kt similarity index 100% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewModel.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewModel.kt diff --git a/plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewState.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewState.kt similarity index 100% rename from plugins/accounts-plugin/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewState.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewState.kt diff --git a/plugins/accounts-plugin/src/main/res/drawable/icon_account.xml b/plugins/accounts/src/main/res/drawable/icon_account.xml similarity index 100% rename from plugins/accounts-plugin/src/main/res/drawable/icon_account.xml rename to plugins/accounts/src/main/res/drawable/icon_account.xml diff --git a/plugins/accounts-plugin/src/main/res/drawable/icon_add_account.xml b/plugins/accounts/src/main/res/drawable/icon_add_account.xml similarity index 100% rename from plugins/accounts-plugin/src/main/res/drawable/icon_add_account.xml rename to plugins/accounts/src/main/res/drawable/icon_add_account.xml diff --git a/plugins/accounts-plugin/src/main/res/drawable/icon_delete.xml b/plugins/accounts/src/main/res/drawable/icon_delete.xml similarity index 100% rename from plugins/accounts-plugin/src/main/res/drawable/icon_delete.xml rename to plugins/accounts/src/main/res/drawable/icon_delete.xml diff --git a/plugins/accounts-plugin/src/main/res/layout/dialog_add_account.xml b/plugins/accounts/src/main/res/layout/dialog_add_account.xml similarity index 100% rename from plugins/accounts-plugin/src/main/res/layout/dialog_add_account.xml rename to plugins/accounts/src/main/res/layout/dialog_add_account.xml diff --git a/plugins/accounts-plugin/src/main/res/layout/dialog_add_pin.xml b/plugins/accounts/src/main/res/layout/dialog_add_pin.xml similarity index 100% rename from plugins/accounts-plugin/src/main/res/layout/dialog_add_pin.xml rename to plugins/accounts/src/main/res/layout/dialog_add_pin.xml diff --git a/plugins/accounts-plugin/src/main/res/layout/fragment_accounts_compose.xml b/plugins/accounts/src/main/res/layout/fragment_accounts_compose.xml similarity index 100% rename from plugins/accounts-plugin/src/main/res/layout/fragment_accounts_compose.xml rename to plugins/accounts/src/main/res/layout/fragment_accounts_compose.xml diff --git a/plugins/accounts-plugin/src/main/res/layout/item_account.xml b/plugins/accounts/src/main/res/layout/item_account.xml similarity index 100% rename from plugins/accounts-plugin/src/main/res/layout/item_account.xml rename to plugins/accounts/src/main/res/layout/item_account.xml diff --git a/plugins/accounts-plugin/src/main/res/values/color.xml b/plugins/accounts/src/main/res/values/color.xml similarity index 100% rename from plugins/accounts-plugin/src/main/res/values/color.xml rename to plugins/accounts/src/main/res/values/color.xml diff --git a/plugins/accounts-plugin/src/main/res/values/public.xml b/plugins/accounts/src/main/res/values/public.xml similarity index 100% rename from plugins/accounts-plugin/src/main/res/values/public.xml rename to plugins/accounts/src/main/res/values/public.xml diff --git a/plugins/accounts-plugin/src/main/res/values/strings.xml b/plugins/accounts/src/main/res/values/strings.xml similarity index 100% rename from plugins/accounts-plugin/src/main/res/values/strings.xml rename to plugins/accounts/src/main/res/values/strings.xml diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index 733bbdf8..5e4df8dd 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -45,7 +45,7 @@ dependencies { // Debug panel dependencies debugImplementation(project(":plugins:servers-plugin")) - debugImplementation(project(":plugins:accounts-plugin")) + debugImplementation(project(":plugins:accounts")) debugImplementation(project(":plugins:app-settings-plugin")) debugImplementation(project(":plugins:flipper-plugin")) debugImplementation(project(":plugins:variable-plugin")) diff --git a/settings.gradle.kts b/settings.gradle.kts index 8d8ce3c3..f971f5c1 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -38,7 +38,7 @@ include( // Plugins include( - ":plugins:accounts-plugin", + ":plugins:accounts", ":plugins:servers-plugin", ":plugins:app-settings-plugin", ":plugins:flipper-plugin", From a3cd88f1969bc8fefb0e6172b07bb4b91c68a3e5 Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Tue, 6 Dec 2022 11:59:11 +0300 Subject: [PATCH 12/42] AppSettings:Rename 'app-settings-plugin' module to 'app-settings' --- plugins/{app-settings-plugin => app-settings}/.gitignore | 0 plugins/{app-settings-plugin => app-settings}/build.gradle.kts | 0 .../{app-settings-plugin => app-settings}/consumer-rules.pro | 0 .../{app-settings-plugin => app-settings}/library.properties | 0 .../{app-settings-plugin => app-settings}/proguard-rules.pro | 0 .../app_settings_plugin/data/AppSettingsRepository.kt | 0 .../app_settings_plugin/data/AppSettingsRepositoryImpl.kt | 0 .../app_settings_plugin/data/DefaultSharedPreferences.kt | 0 .../redmadrobot/app_settings_plugin/plugin/AppSettingsPlugin.kt | 0 .../app_settings_plugin/plugin/AppSettingsPluginContainer.kt | 0 .../app_settings_plugin/ui/ApplicationSettingsFragment.kt | 0 .../app_settings_plugin/ui/ApplicationSettingsViewModel.kt | 0 .../redmadrobot/app_settings_plugin/ui/item/AppSettingItems.kt | 0 .../src/main/res/layout/fragment_app_settings.xml | 0 .../src/main/res/layout/item_header.xml | 0 .../src/main/res/layout/item_preference_boolean.xml | 0 .../src/main/res/layout/item_preference_unsupported.xml | 0 .../src/main/res/layout/item_preference_value.xml | 0 .../src/main/res/values/public.xml | 0 .../src/main/res/values/strings.xml | 0 sample/build.gradle.kts | 2 +- settings.gradle.kts | 2 +- 22 files changed, 2 insertions(+), 2 deletions(-) rename plugins/{app-settings-plugin => app-settings}/.gitignore (100%) rename plugins/{app-settings-plugin => app-settings}/build.gradle.kts (100%) rename plugins/{app-settings-plugin => app-settings}/consumer-rules.pro (100%) rename plugins/{app-settings-plugin => app-settings}/library.properties (100%) rename plugins/{app-settings-plugin => app-settings}/proguard-rules.pro (100%) rename plugins/{app-settings-plugin => app-settings}/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/AppSettingsRepository.kt (100%) rename plugins/{app-settings-plugin => app-settings}/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/AppSettingsRepositoryImpl.kt (100%) rename plugins/{app-settings-plugin => app-settings}/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/DefaultSharedPreferences.kt (100%) rename plugins/{app-settings-plugin => app-settings}/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPlugin.kt (100%) rename plugins/{app-settings-plugin => app-settings}/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPluginContainer.kt (100%) rename plugins/{app-settings-plugin => app-settings}/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsFragment.kt (100%) rename plugins/{app-settings-plugin => app-settings}/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsViewModel.kt (100%) rename plugins/{app-settings-plugin => app-settings}/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/item/AppSettingItems.kt (100%) rename plugins/{app-settings-plugin => app-settings}/src/main/res/layout/fragment_app_settings.xml (100%) rename plugins/{app-settings-plugin => app-settings}/src/main/res/layout/item_header.xml (100%) rename plugins/{app-settings-plugin => app-settings}/src/main/res/layout/item_preference_boolean.xml (100%) rename plugins/{app-settings-plugin => app-settings}/src/main/res/layout/item_preference_unsupported.xml (100%) rename plugins/{app-settings-plugin => app-settings}/src/main/res/layout/item_preference_value.xml (100%) rename plugins/{app-settings-plugin => app-settings}/src/main/res/values/public.xml (100%) rename plugins/{app-settings-plugin => app-settings}/src/main/res/values/strings.xml (100%) diff --git a/plugins/app-settings-plugin/.gitignore b/plugins/app-settings/.gitignore similarity index 100% rename from plugins/app-settings-plugin/.gitignore rename to plugins/app-settings/.gitignore diff --git a/plugins/app-settings-plugin/build.gradle.kts b/plugins/app-settings/build.gradle.kts similarity index 100% rename from plugins/app-settings-plugin/build.gradle.kts rename to plugins/app-settings/build.gradle.kts diff --git a/plugins/app-settings-plugin/consumer-rules.pro b/plugins/app-settings/consumer-rules.pro similarity index 100% rename from plugins/app-settings-plugin/consumer-rules.pro rename to plugins/app-settings/consumer-rules.pro diff --git a/plugins/app-settings-plugin/library.properties b/plugins/app-settings/library.properties similarity index 100% rename from plugins/app-settings-plugin/library.properties rename to plugins/app-settings/library.properties diff --git a/plugins/app-settings-plugin/proguard-rules.pro b/plugins/app-settings/proguard-rules.pro similarity index 100% rename from plugins/app-settings-plugin/proguard-rules.pro rename to plugins/app-settings/proguard-rules.pro diff --git a/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/AppSettingsRepository.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/AppSettingsRepository.kt similarity index 100% rename from plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/AppSettingsRepository.kt rename to plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/AppSettingsRepository.kt diff --git a/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/AppSettingsRepositoryImpl.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/AppSettingsRepositoryImpl.kt similarity index 100% rename from plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/AppSettingsRepositoryImpl.kt rename to plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/AppSettingsRepositoryImpl.kt diff --git a/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/DefaultSharedPreferences.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/DefaultSharedPreferences.kt similarity index 100% rename from plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/DefaultSharedPreferences.kt rename to plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/DefaultSharedPreferences.kt diff --git a/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPlugin.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPlugin.kt similarity index 100% rename from plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPlugin.kt rename to plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPlugin.kt diff --git a/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPluginContainer.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPluginContainer.kt similarity index 100% rename from plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPluginContainer.kt rename to plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPluginContainer.kt diff --git a/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsFragment.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsFragment.kt similarity index 100% rename from plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsFragment.kt rename to plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsFragment.kt diff --git a/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsViewModel.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsViewModel.kt similarity index 100% rename from plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsViewModel.kt rename to plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsViewModel.kt diff --git a/plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/item/AppSettingItems.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/item/AppSettingItems.kt similarity index 100% rename from plugins/app-settings-plugin/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/item/AppSettingItems.kt rename to plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/item/AppSettingItems.kt diff --git a/plugins/app-settings-plugin/src/main/res/layout/fragment_app_settings.xml b/plugins/app-settings/src/main/res/layout/fragment_app_settings.xml similarity index 100% rename from plugins/app-settings-plugin/src/main/res/layout/fragment_app_settings.xml rename to plugins/app-settings/src/main/res/layout/fragment_app_settings.xml diff --git a/plugins/app-settings-plugin/src/main/res/layout/item_header.xml b/plugins/app-settings/src/main/res/layout/item_header.xml similarity index 100% rename from plugins/app-settings-plugin/src/main/res/layout/item_header.xml rename to plugins/app-settings/src/main/res/layout/item_header.xml diff --git a/plugins/app-settings-plugin/src/main/res/layout/item_preference_boolean.xml b/plugins/app-settings/src/main/res/layout/item_preference_boolean.xml similarity index 100% rename from plugins/app-settings-plugin/src/main/res/layout/item_preference_boolean.xml rename to plugins/app-settings/src/main/res/layout/item_preference_boolean.xml diff --git a/plugins/app-settings-plugin/src/main/res/layout/item_preference_unsupported.xml b/plugins/app-settings/src/main/res/layout/item_preference_unsupported.xml similarity index 100% rename from plugins/app-settings-plugin/src/main/res/layout/item_preference_unsupported.xml rename to plugins/app-settings/src/main/res/layout/item_preference_unsupported.xml diff --git a/plugins/app-settings-plugin/src/main/res/layout/item_preference_value.xml b/plugins/app-settings/src/main/res/layout/item_preference_value.xml similarity index 100% rename from plugins/app-settings-plugin/src/main/res/layout/item_preference_value.xml rename to plugins/app-settings/src/main/res/layout/item_preference_value.xml diff --git a/plugins/app-settings-plugin/src/main/res/values/public.xml b/plugins/app-settings/src/main/res/values/public.xml similarity index 100% rename from plugins/app-settings-plugin/src/main/res/values/public.xml rename to plugins/app-settings/src/main/res/values/public.xml diff --git a/plugins/app-settings-plugin/src/main/res/values/strings.xml b/plugins/app-settings/src/main/res/values/strings.xml similarity index 100% rename from plugins/app-settings-plugin/src/main/res/values/strings.xml rename to plugins/app-settings/src/main/res/values/strings.xml diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index 5e4df8dd..878f66d1 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -46,7 +46,7 @@ dependencies { // Debug panel dependencies debugImplementation(project(":plugins:servers-plugin")) debugImplementation(project(":plugins:accounts")) - debugImplementation(project(":plugins:app-settings-plugin")) + debugImplementation(project(":plugins:app-settings")) debugImplementation(project(":plugins:flipper-plugin")) debugImplementation(project(":plugins:variable-plugin")) // debugImplementation("com.redmadrobot.debug:panel-core:${project.version}") diff --git a/settings.gradle.kts b/settings.gradle.kts index f971f5c1..21c83c6e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -40,7 +40,7 @@ include( include( ":plugins:accounts", ":plugins:servers-plugin", - ":plugins:app-settings-plugin", + ":plugins:app-settings", ":plugins:flipper-plugin", ":plugins:variable-plugin" ) From 8481123fd64c577009e2619c528360ff90c2aeca Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Tue, 6 Dec 2022 12:02:25 +0300 Subject: [PATCH 13/42] AppSettings: Rename 'app-settings-plugin' package to 'com.redmadrobot.debug.appsettings' --- .../debug/noop/app_setting/AppSettingsPlugin.kt | 3 +-- .../appsettings}/data/AppSettingsRepository.kt | 2 +- .../appsettings}/data/AppSettingsRepositoryImpl.kt | 2 +- .../appsettings}/data/DefaultSharedPreferences.kt | 2 +- .../appsettings}/plugin/AppSettingsPlugin.kt | 6 +++--- .../appsettings}/plugin/AppSettingsPluginContainer.kt | 6 +++--- .../appsettings}/ui/ApplicationSettingsFragment.kt | 8 ++++---- .../appsettings}/ui/ApplicationSettingsViewModel.kt | 6 +++--- .../appsettings}/ui/item/AppSettingItems.kt | 2 +- .../src/main/kotlin/com/redmadrobot/debug_sample/App.kt | 2 +- 10 files changed, 19 insertions(+), 20 deletions(-) rename plugins/app-settings/src/main/kotlin/com/redmadrobot/{app_settings_plugin => debug/appsettings}/data/AppSettingsRepository.kt (78%) rename plugins/app-settings/src/main/kotlin/com/redmadrobot/{app_settings_plugin => debug/appsettings}/data/AppSettingsRepositoryImpl.kt (94%) rename plugins/app-settings/src/main/kotlin/com/redmadrobot/{app_settings_plugin => debug/appsettings}/data/DefaultSharedPreferences.kt (96%) rename plugins/app-settings/src/main/kotlin/com/redmadrobot/{app_settings_plugin => debug/appsettings}/plugin/AppSettingsPlugin.kt (79%) rename plugins/app-settings/src/main/kotlin/com/redmadrobot/{app_settings_plugin => debug/appsettings}/plugin/AppSettingsPluginContainer.kt (71%) rename plugins/app-settings/src/main/kotlin/com/redmadrobot/{app_settings_plugin => debug/appsettings}/ui/ApplicationSettingsFragment.kt (87%) rename plugins/app-settings/src/main/kotlin/com/redmadrobot/{app_settings_plugin => debug/appsettings}/ui/ApplicationSettingsViewModel.kt (89%) rename plugins/app-settings/src/main/kotlin/com/redmadrobot/{app_settings_plugin => debug/appsettings}/ui/item/AppSettingItems.kt (98%) diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/app_setting/AppSettingsPlugin.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/app_setting/AppSettingsPlugin.kt index c86d2c15..4e39c098 100644 --- a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/app_setting/AppSettingsPlugin.kt +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/app_setting/AppSettingsPlugin.kt @@ -1,5 +1,4 @@ -package com.redmadrobot.app_settings_plugin.plugin - +package com.redmadrobot.debug.appsettings.plugin import android.content.SharedPreferences import java.util.Collections.emptyList diff --git a/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/AppSettingsRepository.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/data/AppSettingsRepository.kt similarity index 78% rename from plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/AppSettingsRepository.kt rename to plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/data/AppSettingsRepository.kt index a8e97030..84d2f871 100644 --- a/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/AppSettingsRepository.kt +++ b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/data/AppSettingsRepository.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.app_settings_plugin.data +package com.redmadrobot.debug.appsettings.data import android.content.SharedPreferences diff --git a/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/AppSettingsRepositoryImpl.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/data/AppSettingsRepositoryImpl.kt similarity index 94% rename from plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/AppSettingsRepositoryImpl.kt rename to plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/data/AppSettingsRepositoryImpl.kt index 7d5d5477..22417a97 100644 --- a/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/AppSettingsRepositoryImpl.kt +++ b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/data/AppSettingsRepositoryImpl.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.app_settings_plugin.data +package com.redmadrobot.debug.appsettings.data import android.content.SharedPreferences diff --git a/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/DefaultSharedPreferences.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/data/DefaultSharedPreferences.kt similarity index 96% rename from plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/DefaultSharedPreferences.kt rename to plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/data/DefaultSharedPreferences.kt index 957549db..d5d93230 100644 --- a/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/data/DefaultSharedPreferences.kt +++ b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/data/DefaultSharedPreferences.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.app_settings_plugin.data +package com.redmadrobot.debug.appsettings.data import android.content.SharedPreferences diff --git a/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPlugin.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/plugin/AppSettingsPlugin.kt similarity index 79% rename from plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPlugin.kt rename to plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/plugin/AppSettingsPlugin.kt index d0d60c2a..3c08c567 100644 --- a/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPlugin.kt +++ b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/plugin/AppSettingsPlugin.kt @@ -1,9 +1,9 @@ -package com.redmadrobot.app_settings_plugin.plugin +package com.redmadrobot.debug.appsettings.plugin import android.content.SharedPreferences import androidx.fragment.app.Fragment -import com.redmadrobot.app_settings_plugin.data.DefaultSharedPreferences -import com.redmadrobot.app_settings_plugin.ui.ApplicationSettingsFragment +import com.redmadrobot.debug.appsettings.data.DefaultSharedPreferences +import com.redmadrobot.debug.appsettings.ui.ApplicationSettingsFragment import com.redmadrobot.debug.core.CommonContainer import com.redmadrobot.debug.core.plugin.Plugin import com.redmadrobot.debug.core.plugin.PluginDependencyContainer diff --git a/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPluginContainer.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/plugin/AppSettingsPluginContainer.kt similarity index 71% rename from plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPluginContainer.kt rename to plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/plugin/AppSettingsPluginContainer.kt index 7717c331..338c509b 100644 --- a/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/plugin/AppSettingsPluginContainer.kt +++ b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/plugin/AppSettingsPluginContainer.kt @@ -1,8 +1,8 @@ -package com.redmadrobot.app_settings_plugin.plugin +package com.redmadrobot.debug.appsettings.plugin import android.content.SharedPreferences -import com.redmadrobot.app_settings_plugin.data.AppSettingsRepositoryImpl -import com.redmadrobot.app_settings_plugin.ui.ApplicationSettingsViewModel +import com.redmadrobot.debug.appsettings.data.AppSettingsRepositoryImpl +import com.redmadrobot.debug.appsettings.ui.ApplicationSettingsViewModel import com.redmadrobot.debug.core.plugin.PluginDependencyContainer internal class AppSettingsPluginContainer( diff --git a/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsFragment.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/ApplicationSettingsFragment.kt similarity index 87% rename from plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsFragment.kt rename to plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/ApplicationSettingsFragment.kt index 2f81b2fd..623714a5 100644 --- a/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsFragment.kt +++ b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/ApplicationSettingsFragment.kt @@ -1,13 +1,13 @@ -package com.redmadrobot.app_settings_plugin.ui +package com.redmadrobot.debug.appsettings.ui import android.os.Bundle import android.view.View import androidx.recyclerview.widget.LinearLayoutManager import com.redmadrobot.app_settings_plugin.R import com.redmadrobot.app_settings_plugin.databinding.FragmentAppSettingsBinding -import com.redmadrobot.app_settings_plugin.plugin.AppSettingsPlugin -import com.redmadrobot.app_settings_plugin.plugin.AppSettingsPluginContainer -import com.redmadrobot.app_settings_plugin.ui.item.AppSettingItems +import com.redmadrobot.debug.appsettings.plugin.AppSettingsPlugin +import com.redmadrobot.debug.appsettings.plugin.AppSettingsPluginContainer +import com.redmadrobot.debug.appsettings.ui.item.AppSettingItems import com.redmadrobot.debug.common.base.PluginFragment import com.redmadrobot.debug.common.extension.observe import com.redmadrobot.debug.common.extension.obtainViewModel diff --git a/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsViewModel.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/ApplicationSettingsViewModel.kt similarity index 89% rename from plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsViewModel.kt rename to plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/ApplicationSettingsViewModel.kt index c081818e..5191a60f 100644 --- a/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/ApplicationSettingsViewModel.kt +++ b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/ApplicationSettingsViewModel.kt @@ -1,9 +1,9 @@ -package com.redmadrobot.app_settings_plugin.ui +package com.redmadrobot.debug.appsettings.ui import android.content.SharedPreferences import androidx.lifecycle.MutableLiveData -import com.redmadrobot.app_settings_plugin.data.AppSettingsRepository -import com.redmadrobot.app_settings_plugin.ui.item.AppSettingItems +import com.redmadrobot.debug.appsettings.data.AppSettingsRepository +import com.redmadrobot.debug.appsettings.ui.item.AppSettingItems import com.redmadrobot.debug.common.base.PluginViewModel internal class ApplicationSettingsViewModel( diff --git a/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/item/AppSettingItems.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/item/AppSettingItems.kt similarity index 98% rename from plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/item/AppSettingItems.kt rename to plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/item/AppSettingItems.kt index 5861b2f1..e52a7c2c 100644 --- a/plugins/app-settings/src/main/kotlin/com/redmadrobot/app_settings_plugin/ui/item/AppSettingItems.kt +++ b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/item/AppSettingItems.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.app_settings_plugin.ui.item +package com.redmadrobot.debug.appsettings.ui.item import androidx.core.view.isVisible import com.redmadrobot.app_settings_plugin.R diff --git a/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt b/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt index 3373358a..2ba8176c 100644 --- a/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt +++ b/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt @@ -3,7 +3,7 @@ package com.redmadrobot.debug_sample import android.app.Application import com.redmadrobot.debug.account.data.model.DebugAccount import com.redmadrobot.debug.account.plugin.AccountsPlugin -import com.redmadrobot.app_settings_plugin.plugin.AppSettingsPlugin +import com.redmadrobot.debug.appsettings.plugin.AppSettingsPlugin import com.redmadrobot.debug.core.internal.DebugPanel import com.redmadrobot.debug.core.internal.DebugPanelConfig import com.redmadrobot.debug_sample.account.DebugUserAuthenticator From a1601c7ad46dd2fdba2e127bd928cf4ce14093cf Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Tue, 6 Dec 2022 12:04:57 +0300 Subject: [PATCH 14/42] Noop:Fix package names for no-op module --- .../main/kotlin/com/redmadrobot/debug/noop/DebugDataProvider.kt | 2 +- .../main/kotlin/com/redmadrobot/debug/noop/core/DebugEvent.kt | 2 +- .../main/kotlin/com/redmadrobot/debug/noop/core/DebugPanel.kt | 2 +- .../kotlin/com/redmadrobot/debug/noop/core/DebugPanelConfig.kt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/DebugDataProvider.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/DebugDataProvider.kt index 9e970c4d..9d801333 100644 --- a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/DebugDataProvider.kt +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/DebugDataProvider.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.debug_panel_core.data +package com.redmadrobot.debug.core.data interface DebugDataProvider { fun provideData(): T diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/core/DebugEvent.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/core/DebugEvent.kt index eabf5098..c7651ed9 100644 --- a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/core/DebugEvent.kt +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/core/DebugEvent.kt @@ -1,3 +1,3 @@ -package com.redmadrobot.debug_panel_core.internal +package com.redmadrobot.debug.core.internal interface DebugEvent diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/core/DebugPanel.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/core/DebugPanel.kt index 07003b15..2b97e16a 100644 --- a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/core/DebugPanel.kt +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/core/DebugPanel.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.debug_panel_core.internal +package com.redmadrobot.debug.core.internal import android.app.Application import androidx.fragment.app.FragmentManager diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/core/DebugPanelConfig.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/core/DebugPanelConfig.kt index 4936beaa..c570b898 100644 --- a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/core/DebugPanelConfig.kt +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/core/DebugPanelConfig.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.debug_panel_core.internal +package com.redmadrobot.debug.core.internal public class DebugPanelConfig( public val shakerMode: Boolean From bbe354f70268498ce15dbe69b77022af5038086c Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Tue, 6 Dec 2022 12:06:39 +0300 Subject: [PATCH 15/42] Flipper: Rename 'flipper-plugin' module to 'flipper' --- plugins/{flipper-plugin => flipper}/.gitignore | 0 plugins/{flipper-plugin => flipper}/build.gradle.kts | 0 plugins/{flipper-plugin => flipper}/consumer-rules.pro | 0 plugins/{flipper-plugin => flipper}/library.properties | 0 plugins/{flipper-plugin => flipper}/proguard-rules.pro | 0 .../redmadrobot/flipper_plugin/data/FeatureTogglesRepository.kt | 0 .../com/redmadrobot/flipper_plugin/data/FeatureTogglesSource.kt | 0 .../com/redmadrobot/flipper_plugin/plugin/FlipperPlugin.kt | 0 .../redmadrobot/flipper_plugin/plugin/FlipperPluginContainer.kt | 0 .../redmadrobot/flipper_plugin/ui/FlipperFeaturesFragment.kt | 0 .../redmadrobot/flipper_plugin/ui/FlipperFeaturesViewModel.kt | 0 .../redmadrobot/flipper_plugin/ui/FlipperFeaturesViewState.kt | 0 .../com/redmadrobot/flipper_plugin/ui/data/FlipperItem.kt | 0 .../flipper_plugin/ui/dialog/SourceSelectionDialogFragment.kt | 0 .../flipper_plugin/ui/dialog/SourceSelectionViewModel.kt | 0 .../flipper_plugin/ui/dialog/data/SelectableSource.kt | 0 .../flipper_plugin/ui/dialog/recycler/SourceDiffCallback.kt | 0 .../flipper_plugin/ui/dialog/recycler/SourceSelectionAdapter.kt | 0 .../flipper_plugin/ui/dialog/recycler/SourceViewHolder.kt | 0 .../flipper_plugin/ui/recycler/BooleanFeatureViewHolder.kt | 0 .../flipper_plugin/ui/recycler/FlipperFeaturesAdapter.kt | 0 .../flipper_plugin/ui/recycler/FlipperFeaturesDiffCallback.kt | 0 .../redmadrobot/flipper_plugin/ui/recycler/GroupViewHolder.kt | 0 .../flipper_plugin/ui/recycler/StringFeatureViewHolder.kt | 0 .../src/main/res/layout/dialog_flipper_source.xml | 0 .../src/main/res/layout/fragment_flipper_features.xml | 0 .../src/main/res/layout/item_flipper_feature_boolean.xml | 0 .../src/main/res/layout/item_flipper_feature_group.xml | 0 .../src/main/res/layout/item_flipper_feature_string.xml | 0 .../src/main/res/layout/item_flipper_source.xml | 0 .../{flipper-plugin => flipper}/src/main/res/values/strings.xml | 0 sample/build.gradle.kts | 2 +- settings.gradle.kts | 2 +- 33 files changed, 2 insertions(+), 2 deletions(-) rename plugins/{flipper-plugin => flipper}/.gitignore (100%) rename plugins/{flipper-plugin => flipper}/build.gradle.kts (100%) rename plugins/{flipper-plugin => flipper}/consumer-rules.pro (100%) rename plugins/{flipper-plugin => flipper}/library.properties (100%) rename plugins/{flipper-plugin => flipper}/proguard-rules.pro (100%) rename plugins/{flipper-plugin => flipper}/src/main/kotlin/com/redmadrobot/flipper_plugin/data/FeatureTogglesRepository.kt (100%) rename plugins/{flipper-plugin => flipper}/src/main/kotlin/com/redmadrobot/flipper_plugin/data/FeatureTogglesSource.kt (100%) rename plugins/{flipper-plugin => flipper}/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPlugin.kt (100%) rename plugins/{flipper-plugin => flipper}/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPluginContainer.kt (100%) rename plugins/{flipper-plugin => flipper}/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesFragment.kt (100%) rename plugins/{flipper-plugin => flipper}/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesViewModel.kt (100%) rename plugins/{flipper-plugin => flipper}/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesViewState.kt (100%) rename plugins/{flipper-plugin => flipper}/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/data/FlipperItem.kt (100%) rename plugins/{flipper-plugin => flipper}/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionDialogFragment.kt (100%) rename plugins/{flipper-plugin => flipper}/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionViewModel.kt (100%) rename plugins/{flipper-plugin => flipper}/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/data/SelectableSource.kt (100%) rename plugins/{flipper-plugin => flipper}/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceDiffCallback.kt (100%) rename plugins/{flipper-plugin => flipper}/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceSelectionAdapter.kt (100%) rename plugins/{flipper-plugin => flipper}/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceViewHolder.kt (100%) rename plugins/{flipper-plugin => flipper}/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/BooleanFeatureViewHolder.kt (100%) rename plugins/{flipper-plugin => flipper}/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/FlipperFeaturesAdapter.kt (100%) rename plugins/{flipper-plugin => flipper}/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/FlipperFeaturesDiffCallback.kt (100%) rename plugins/{flipper-plugin => flipper}/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/GroupViewHolder.kt (100%) rename plugins/{flipper-plugin => flipper}/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/StringFeatureViewHolder.kt (100%) rename plugins/{flipper-plugin => flipper}/src/main/res/layout/dialog_flipper_source.xml (100%) rename plugins/{flipper-plugin => flipper}/src/main/res/layout/fragment_flipper_features.xml (100%) rename plugins/{flipper-plugin => flipper}/src/main/res/layout/item_flipper_feature_boolean.xml (100%) rename plugins/{flipper-plugin => flipper}/src/main/res/layout/item_flipper_feature_group.xml (100%) rename plugins/{flipper-plugin => flipper}/src/main/res/layout/item_flipper_feature_string.xml (100%) rename plugins/{flipper-plugin => flipper}/src/main/res/layout/item_flipper_source.xml (100%) rename plugins/{flipper-plugin => flipper}/src/main/res/values/strings.xml (100%) diff --git a/plugins/flipper-plugin/.gitignore b/plugins/flipper/.gitignore similarity index 100% rename from plugins/flipper-plugin/.gitignore rename to plugins/flipper/.gitignore diff --git a/plugins/flipper-plugin/build.gradle.kts b/plugins/flipper/build.gradle.kts similarity index 100% rename from plugins/flipper-plugin/build.gradle.kts rename to plugins/flipper/build.gradle.kts diff --git a/plugins/flipper-plugin/consumer-rules.pro b/plugins/flipper/consumer-rules.pro similarity index 100% rename from plugins/flipper-plugin/consumer-rules.pro rename to plugins/flipper/consumer-rules.pro diff --git a/plugins/flipper-plugin/library.properties b/plugins/flipper/library.properties similarity index 100% rename from plugins/flipper-plugin/library.properties rename to plugins/flipper/library.properties diff --git a/plugins/flipper-plugin/proguard-rules.pro b/plugins/flipper/proguard-rules.pro similarity index 100% rename from plugins/flipper-plugin/proguard-rules.pro rename to plugins/flipper/proguard-rules.pro diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/data/FeatureTogglesRepository.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/data/FeatureTogglesRepository.kt similarity index 100% rename from plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/data/FeatureTogglesRepository.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/data/FeatureTogglesRepository.kt diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/data/FeatureTogglesSource.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/data/FeatureTogglesSource.kt similarity index 100% rename from plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/data/FeatureTogglesSource.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/data/FeatureTogglesSource.kt diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPlugin.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPlugin.kt similarity index 100% rename from plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPlugin.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPlugin.kt diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPluginContainer.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPluginContainer.kt similarity index 100% rename from plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPluginContainer.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPluginContainer.kt diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesFragment.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesFragment.kt similarity index 100% rename from plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesFragment.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesFragment.kt diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesViewModel.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesViewModel.kt similarity index 100% rename from plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesViewModel.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesViewModel.kt diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesViewState.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesViewState.kt similarity index 100% rename from plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesViewState.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesViewState.kt diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/data/FlipperItem.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/data/FlipperItem.kt similarity index 100% rename from plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/data/FlipperItem.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/data/FlipperItem.kt diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionDialogFragment.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionDialogFragment.kt similarity index 100% rename from plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionDialogFragment.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionDialogFragment.kt diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionViewModel.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionViewModel.kt similarity index 100% rename from plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionViewModel.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionViewModel.kt diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/data/SelectableSource.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/data/SelectableSource.kt similarity index 100% rename from plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/data/SelectableSource.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/data/SelectableSource.kt diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceDiffCallback.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceDiffCallback.kt similarity index 100% rename from plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceDiffCallback.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceDiffCallback.kt diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceSelectionAdapter.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceSelectionAdapter.kt similarity index 100% rename from plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceSelectionAdapter.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceSelectionAdapter.kt diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceViewHolder.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceViewHolder.kt similarity index 100% rename from plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceViewHolder.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceViewHolder.kt diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/BooleanFeatureViewHolder.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/BooleanFeatureViewHolder.kt similarity index 100% rename from plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/BooleanFeatureViewHolder.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/BooleanFeatureViewHolder.kt diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/FlipperFeaturesAdapter.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/FlipperFeaturesAdapter.kt similarity index 100% rename from plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/FlipperFeaturesAdapter.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/FlipperFeaturesAdapter.kt diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/FlipperFeaturesDiffCallback.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/FlipperFeaturesDiffCallback.kt similarity index 100% rename from plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/FlipperFeaturesDiffCallback.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/FlipperFeaturesDiffCallback.kt diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/GroupViewHolder.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/GroupViewHolder.kt similarity index 100% rename from plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/GroupViewHolder.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/GroupViewHolder.kt diff --git a/plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/StringFeatureViewHolder.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/StringFeatureViewHolder.kt similarity index 100% rename from plugins/flipper-plugin/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/StringFeatureViewHolder.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/StringFeatureViewHolder.kt diff --git a/plugins/flipper-plugin/src/main/res/layout/dialog_flipper_source.xml b/plugins/flipper/src/main/res/layout/dialog_flipper_source.xml similarity index 100% rename from plugins/flipper-plugin/src/main/res/layout/dialog_flipper_source.xml rename to plugins/flipper/src/main/res/layout/dialog_flipper_source.xml diff --git a/plugins/flipper-plugin/src/main/res/layout/fragment_flipper_features.xml b/plugins/flipper/src/main/res/layout/fragment_flipper_features.xml similarity index 100% rename from plugins/flipper-plugin/src/main/res/layout/fragment_flipper_features.xml rename to plugins/flipper/src/main/res/layout/fragment_flipper_features.xml diff --git a/plugins/flipper-plugin/src/main/res/layout/item_flipper_feature_boolean.xml b/plugins/flipper/src/main/res/layout/item_flipper_feature_boolean.xml similarity index 100% rename from plugins/flipper-plugin/src/main/res/layout/item_flipper_feature_boolean.xml rename to plugins/flipper/src/main/res/layout/item_flipper_feature_boolean.xml diff --git a/plugins/flipper-plugin/src/main/res/layout/item_flipper_feature_group.xml b/plugins/flipper/src/main/res/layout/item_flipper_feature_group.xml similarity index 100% rename from plugins/flipper-plugin/src/main/res/layout/item_flipper_feature_group.xml rename to plugins/flipper/src/main/res/layout/item_flipper_feature_group.xml diff --git a/plugins/flipper-plugin/src/main/res/layout/item_flipper_feature_string.xml b/plugins/flipper/src/main/res/layout/item_flipper_feature_string.xml similarity index 100% rename from plugins/flipper-plugin/src/main/res/layout/item_flipper_feature_string.xml rename to plugins/flipper/src/main/res/layout/item_flipper_feature_string.xml diff --git a/plugins/flipper-plugin/src/main/res/layout/item_flipper_source.xml b/plugins/flipper/src/main/res/layout/item_flipper_source.xml similarity index 100% rename from plugins/flipper-plugin/src/main/res/layout/item_flipper_source.xml rename to plugins/flipper/src/main/res/layout/item_flipper_source.xml diff --git a/plugins/flipper-plugin/src/main/res/values/strings.xml b/plugins/flipper/src/main/res/values/strings.xml similarity index 100% rename from plugins/flipper-plugin/src/main/res/values/strings.xml rename to plugins/flipper/src/main/res/values/strings.xml diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index 878f66d1..9199f536 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -47,7 +47,7 @@ dependencies { debugImplementation(project(":plugins:servers-plugin")) debugImplementation(project(":plugins:accounts")) debugImplementation(project(":plugins:app-settings")) - debugImplementation(project(":plugins:flipper-plugin")) + debugImplementation(project(":plugins:flipper")) debugImplementation(project(":plugins:variable-plugin")) // debugImplementation("com.redmadrobot.debug:panel-core:${project.version}") // debugImplementation("com.redmadrobot.debug:accounts-plugin:${project.version}") diff --git a/settings.gradle.kts b/settings.gradle.kts index 21c83c6e..5a1f0de3 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -41,7 +41,7 @@ include( ":plugins:accounts", ":plugins:servers-plugin", ":plugins:app-settings", - ":plugins:flipper-plugin", + ":plugins:flipper", ":plugins:variable-plugin" ) From c402306e3e9ba024925908721f500506cb030023 Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Tue, 6 Dec 2022 12:08:31 +0300 Subject: [PATCH 16/42] Flipper: Rename 'flipper-plugin' package to 'com.redmadrobot.debug.flipper' --- .../redmadrobot/debug/noop/flipper/FlipperPlugin.kt | 2 +- .../flipper}/data/FeatureTogglesRepository.kt | 4 ++-- .../flipper}/data/FeatureTogglesSource.kt | 2 +- .../flipper}/plugin/FlipperPlugin.kt | 4 ++-- .../flipper}/plugin/FlipperPluginContainer.kt | 8 ++++---- .../flipper}/ui/FlipperFeaturesFragment.kt | 10 +++++----- .../flipper}/ui/FlipperFeaturesViewModel.kt | 8 ++++---- .../debug/flipper/ui/FlipperFeaturesViewState.kt | 7 +++++++ .../flipper}/ui/data/FlipperItem.kt | 2 +- .../ui/dialog/SourceSelectionDialogFragment.kt | 8 ++++---- .../flipper}/ui/dialog/SourceSelectionViewModel.kt | 8 ++++---- .../flipper}/ui/dialog/data/SelectableSource.kt | 2 +- .../flipper}/ui/dialog/recycler/SourceDiffCallback.kt | 4 ++-- .../ui/dialog/recycler/SourceSelectionAdapter.kt | 4 ++-- .../flipper}/ui/dialog/recycler/SourceViewHolder.kt | 4 ++-- .../flipper}/ui/recycler/BooleanFeatureViewHolder.kt | 2 +- .../flipper}/ui/recycler/FlipperFeaturesAdapter.kt | 0 .../ui/recycler/FlipperFeaturesDiffCallback.kt | 8 ++++---- .../flipper}/ui/recycler/GroupViewHolder.kt | 2 +- .../flipper}/ui/recycler/StringFeatureViewHolder.kt | 0 .../flipper_plugin/ui/FlipperFeaturesViewState.kt | 7 ------- .../debug_data/DebugFlipperFeaturesProvider.kt | 2 +- .../main/kotlin/com/redmadrobot/debug_sample/App.kt | 2 +- .../com/redmadrobot/debug_sample/MainActivity.kt | 2 +- 24 files changed, 51 insertions(+), 51 deletions(-) rename plugins/flipper/src/main/kotlin/com/redmadrobot/{flipper_plugin => debug/flipper}/data/FeatureTogglesRepository.kt (98%) rename plugins/flipper/src/main/kotlin/com/redmadrobot/{flipper_plugin => debug/flipper}/data/FeatureTogglesSource.kt (60%) rename plugins/flipper/src/main/kotlin/com/redmadrobot/{flipper_plugin => debug/flipper}/plugin/FlipperPlugin.kt (94%) rename plugins/flipper/src/main/kotlin/com/redmadrobot/{flipper_plugin => debug/flipper}/plugin/FlipperPluginContainer.kt (73%) rename plugins/flipper/src/main/kotlin/com/redmadrobot/{flipper_plugin => debug/flipper}/ui/FlipperFeaturesFragment.kt (87%) rename plugins/flipper/src/main/kotlin/com/redmadrobot/{flipper_plugin => debug/flipper}/ui/FlipperFeaturesViewModel.kt (96%) create mode 100644 plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/FlipperFeaturesViewState.kt rename plugins/flipper/src/main/kotlin/com/redmadrobot/{flipper_plugin => debug/flipper}/ui/data/FlipperItem.kt (89%) rename plugins/flipper/src/main/kotlin/com/redmadrobot/{flipper_plugin => debug/flipper}/ui/dialog/SourceSelectionDialogFragment.kt (91%) rename plugins/flipper/src/main/kotlin/com/redmadrobot/{flipper_plugin => debug/flipper}/ui/dialog/SourceSelectionViewModel.kt (89%) rename plugins/flipper/src/main/kotlin/com/redmadrobot/{flipper_plugin => debug/flipper}/ui/dialog/data/SelectableSource.kt (62%) rename plugins/flipper/src/main/kotlin/com/redmadrobot/{flipper_plugin => debug/flipper}/ui/dialog/recycler/SourceDiffCallback.kt (76%) rename plugins/flipper/src/main/kotlin/com/redmadrobot/{flipper_plugin => debug/flipper}/ui/dialog/recycler/SourceSelectionAdapter.kt (85%) rename plugins/flipper/src/main/kotlin/com/redmadrobot/{flipper_plugin => debug/flipper}/ui/dialog/recycler/SourceViewHolder.kt (84%) rename plugins/flipper/src/main/kotlin/com/redmadrobot/{flipper_plugin => debug/flipper}/ui/recycler/BooleanFeatureViewHolder.kt (95%) rename plugins/flipper/src/main/kotlin/com/redmadrobot/{flipper_plugin => debug/flipper}/ui/recycler/FlipperFeaturesAdapter.kt (100%) rename plugins/flipper/src/main/kotlin/com/redmadrobot/{flipper_plugin => debug/flipper}/ui/recycler/FlipperFeaturesDiffCallback.kt (72%) rename plugins/flipper/src/main/kotlin/com/redmadrobot/{flipper_plugin => debug/flipper}/ui/recycler/GroupViewHolder.kt (95%) rename plugins/flipper/src/main/kotlin/com/redmadrobot/{flipper_plugin => debug/flipper}/ui/recycler/StringFeatureViewHolder.kt (100%) delete mode 100644 plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesViewState.kt diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/flipper/FlipperPlugin.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/flipper/FlipperPlugin.kt index e6e13a6e..069b8b49 100644 --- a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/flipper/FlipperPlugin.kt +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/flipper/FlipperPlugin.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.flipper_plugin.plugin +package com.redmadrobot.debug.flipper.plugin import com.redmadrobot.flipper.config.FlipperValue import kotlinx.coroutines.flow.Flow diff --git a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/data/FeatureTogglesRepository.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/data/FeatureTogglesRepository.kt similarity index 98% rename from plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/data/FeatureTogglesRepository.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/data/FeatureTogglesRepository.kt index 4c295402..72000df7 100644 --- a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/data/FeatureTogglesRepository.kt +++ b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/data/FeatureTogglesRepository.kt @@ -1,9 +1,9 @@ -package com.redmadrobot.flipper_plugin.data +package com.redmadrobot.debug.flipper.data import android.content.Context import com.redmadrobot.flipper.config.FlipperValue import com.redmadrobot.flipper.config.FlipperValue.* -import com.redmadrobot.flipper_plugin.plugin.PluginToggle +import com.redmadrobot.debug.flipper.plugin.PluginToggle import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.* diff --git a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/data/FeatureTogglesSource.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/data/FeatureTogglesSource.kt similarity index 60% rename from plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/data/FeatureTogglesSource.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/data/FeatureTogglesSource.kt index 491001bc..3d54c813 100644 --- a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/data/FeatureTogglesSource.kt +++ b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/data/FeatureTogglesSource.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.flipper_plugin.data +package com.redmadrobot.debug.flipper.data internal data class FeatureTogglesSource( val name: String, diff --git a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPlugin.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/plugin/FlipperPlugin.kt similarity index 94% rename from plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPlugin.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/plugin/FlipperPlugin.kt index 05694fb9..3b079399 100644 --- a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPlugin.kt +++ b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/plugin/FlipperPlugin.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.flipper_plugin.plugin +package com.redmadrobot.debug.flipper.plugin import androidx.fragment.app.Fragment import com.redmadrobot.debug.core.CommonContainer @@ -6,7 +6,7 @@ import com.redmadrobot.debug.core.extension.getPlugin import com.redmadrobot.debug.core.plugin.Plugin import com.redmadrobot.debug.core.plugin.PluginDependencyContainer import com.redmadrobot.flipper.config.FlipperValue -import com.redmadrobot.flipper_plugin.ui.FlipperFeaturesFragment +import com.redmadrobot.debug.flipper.ui.FlipperFeaturesFragment import kotlinx.coroutines.flow.Flow import java.util.* diff --git a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPluginContainer.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/plugin/FlipperPluginContainer.kt similarity index 73% rename from plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPluginContainer.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/plugin/FlipperPluginContainer.kt index 71ce8e8a..66bc848f 100644 --- a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/plugin/FlipperPluginContainer.kt +++ b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/plugin/FlipperPluginContainer.kt @@ -1,10 +1,10 @@ -package com.redmadrobot.flipper_plugin.plugin +package com.redmadrobot.debug.flipper.plugin import android.content.Context import com.redmadrobot.debug.core.plugin.PluginDependencyContainer -import com.redmadrobot.flipper_plugin.data.FeatureTogglesRepository -import com.redmadrobot.flipper_plugin.ui.FlipperFeaturesViewModel -import com.redmadrobot.flipper_plugin.ui.dialog.SourceSelectionViewModel +import com.redmadrobot.debug.flipper.data.FeatureTogglesRepository +import com.redmadrobot.debug.flipper.ui.FlipperFeaturesViewModel +import com.redmadrobot.debug.flipper.ui.dialog.SourceSelectionViewModel internal class FlipperPluginContainer( private val context: Context, diff --git a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesFragment.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/FlipperFeaturesFragment.kt similarity index 87% rename from plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesFragment.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/FlipperFeaturesFragment.kt index 1b2874e5..351bfe4d 100644 --- a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesFragment.kt +++ b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/FlipperFeaturesFragment.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.flipper_plugin.ui +package com.redmadrobot.debug.flipper.ui import android.os.Bundle import android.view.View @@ -11,10 +11,10 @@ import com.redmadrobot.debug.common.extension.obtainShareViewModel import com.redmadrobot.debug.core.extension.getPlugin import com.redmadrobot.flipper_plugin.R import com.redmadrobot.flipper_plugin.databinding.FragmentFlipperFeaturesBinding -import com.redmadrobot.flipper_plugin.plugin.FlipperPlugin -import com.redmadrobot.flipper_plugin.plugin.FlipperPluginContainer -import com.redmadrobot.flipper_plugin.ui.dialog.SourceSelectionDialogFragment -import com.redmadrobot.flipper_plugin.ui.recycler.FlipperFeaturesAdapter +import com.redmadrobot.debug.flipper.plugin.FlipperPlugin +import com.redmadrobot.debug.flipper.plugin.FlipperPluginContainer +import com.redmadrobot.debug.flipper.ui.dialog.SourceSelectionDialogFragment +import com.redmadrobot.debug.flipper.ui.recycler.FlipperFeaturesAdapter import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach diff --git a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesViewModel.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/FlipperFeaturesViewModel.kt similarity index 96% rename from plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesViewModel.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/FlipperFeaturesViewModel.kt index d463ef54..3e9ee535 100644 --- a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesViewModel.kt +++ b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/FlipperFeaturesViewModel.kt @@ -1,11 +1,11 @@ -package com.redmadrobot.flipper_plugin.ui +package com.redmadrobot.debug.flipper.ui import androidx.lifecycle.viewModelScope import com.redmadrobot.debug.common.base.PluginViewModel import com.redmadrobot.flipper.config.FlipperValue -import com.redmadrobot.flipper_plugin.data.FeatureTogglesRepository -import com.redmadrobot.flipper_plugin.plugin.PluginToggle -import com.redmadrobot.flipper_plugin.ui.data.FlipperItem +import com.redmadrobot.debug.flipper.data.FeatureTogglesRepository +import com.redmadrobot.debug.flipper.plugin.PluginToggle +import com.redmadrobot.debug.flipper.ui.data.FlipperItem import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.* import kotlinx.coroutines.launch diff --git a/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/FlipperFeaturesViewState.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/FlipperFeaturesViewState.kt new file mode 100644 index 00000000..ca6408f5 --- /dev/null +++ b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/FlipperFeaturesViewState.kt @@ -0,0 +1,7 @@ +package com.redmadrobot.debug.flipper.ui + +import com.redmadrobot.debug.flipper.ui.data.FlipperItem + +internal data class FlipperFeaturesViewState( + val items: List = emptyList(), +) diff --git a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/data/FlipperItem.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/data/FlipperItem.kt similarity index 89% rename from plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/data/FlipperItem.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/data/FlipperItem.kt index 02b70eea..98094d03 100644 --- a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/data/FlipperItem.kt +++ b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/data/FlipperItem.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.flipper_plugin.ui.data +package com.redmadrobot.debug.flipper.ui.data import com.redmadrobot.flipper.config.FlipperValue diff --git a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionDialogFragment.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/dialog/SourceSelectionDialogFragment.kt similarity index 91% rename from plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionDialogFragment.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/dialog/SourceSelectionDialogFragment.kt index 0b691691..94ce5ac0 100644 --- a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionDialogFragment.kt +++ b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/dialog/SourceSelectionDialogFragment.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.flipper_plugin.ui.dialog +package com.redmadrobot.debug.flipper.ui.dialog import android.app.AlertDialog import android.os.Bundle @@ -13,9 +13,9 @@ import com.redmadrobot.debug.common.extension.obtainShareViewModel import com.redmadrobot.debug.core.extension.getPlugin import com.redmadrobot.flipper_plugin.R import com.redmadrobot.flipper_plugin.databinding.DialogFlipperSourceBinding -import com.redmadrobot.flipper_plugin.plugin.FlipperPlugin -import com.redmadrobot.flipper_plugin.plugin.FlipperPluginContainer -import com.redmadrobot.flipper_plugin.ui.dialog.recycler.SourceSelectionAdapter +import com.redmadrobot.debug.flipper.plugin.FlipperPlugin +import com.redmadrobot.debug.flipper.plugin.FlipperPluginContainer +import com.redmadrobot.debug.flipper.ui.dialog.recycler.SourceSelectionAdapter import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach diff --git a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionViewModel.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/dialog/SourceSelectionViewModel.kt similarity index 89% rename from plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionViewModel.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/dialog/SourceSelectionViewModel.kt index 1468cd6c..bee4520c 100644 --- a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/SourceSelectionViewModel.kt +++ b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/dialog/SourceSelectionViewModel.kt @@ -1,12 +1,12 @@ -package com.redmadrobot.flipper_plugin.ui.dialog +package com.redmadrobot.debug.flipper.ui.dialog import android.content.Context import androidx.lifecycle.viewModelScope import com.redmadrobot.debug.common.base.PluginViewModel import com.redmadrobot.flipper_plugin.R -import com.redmadrobot.flipper_plugin.data.FeatureTogglesRepository -import com.redmadrobot.flipper_plugin.data.FeatureTogglesSource -import com.redmadrobot.flipper_plugin.ui.dialog.data.SelectableSource +import com.redmadrobot.debug.flipper.data.FeatureTogglesRepository +import com.redmadrobot.debug.flipper.data.FeatureTogglesSource +import com.redmadrobot.debug.flipper.ui.dialog.data.SelectableSource import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.channels.BufferOverflow import kotlinx.coroutines.flow.* diff --git a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/data/SelectableSource.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/dialog/data/SelectableSource.kt similarity index 62% rename from plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/data/SelectableSource.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/dialog/data/SelectableSource.kt index 344d3bdf..ead8ae4c 100644 --- a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/data/SelectableSource.kt +++ b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/dialog/data/SelectableSource.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.flipper_plugin.ui.dialog.data +package com.redmadrobot.debug.flipper.ui.dialog.data internal data class SelectableSource( val name: String, diff --git a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceDiffCallback.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/dialog/recycler/SourceDiffCallback.kt similarity index 76% rename from plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceDiffCallback.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/dialog/recycler/SourceDiffCallback.kt index 60598ae0..2648f9a4 100644 --- a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceDiffCallback.kt +++ b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/dialog/recycler/SourceDiffCallback.kt @@ -1,7 +1,7 @@ -package com.redmadrobot.flipper_plugin.ui.dialog.recycler +package com.redmadrobot.debug.flipper.ui.dialog.recycler import androidx.recyclerview.widget.DiffUtil -import com.redmadrobot.flipper_plugin.ui.dialog.data.SelectableSource +import com.redmadrobot.debug.flipper.ui.dialog.data.SelectableSource internal class SourceDiffCallback : DiffUtil.ItemCallback() { override fun areItemsTheSame(oldItem: SelectableSource, newItem: SelectableSource): Boolean { diff --git a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceSelectionAdapter.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/dialog/recycler/SourceSelectionAdapter.kt similarity index 85% rename from plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceSelectionAdapter.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/dialog/recycler/SourceSelectionAdapter.kt index bca4734f..7a6498bf 100644 --- a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceSelectionAdapter.kt +++ b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/dialog/recycler/SourceSelectionAdapter.kt @@ -1,10 +1,10 @@ -package com.redmadrobot.flipper_plugin.ui.dialog.recycler +package com.redmadrobot.debug.flipper.ui.dialog.recycler import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.ListAdapter import com.redmadrobot.flipper_plugin.databinding.ItemFlipperSourceBinding -import com.redmadrobot.flipper_plugin.ui.dialog.data.SelectableSource +import com.redmadrobot.debug.flipper.ui.dialog.data.SelectableSource internal class SourceSelectionAdapter( private val onSourceClick: (name: String) -> Unit, diff --git a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceViewHolder.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/dialog/recycler/SourceViewHolder.kt similarity index 84% rename from plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceViewHolder.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/dialog/recycler/SourceViewHolder.kt index 2ac0fbe0..5a1b0491 100644 --- a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/dialog/recycler/SourceViewHolder.kt +++ b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/dialog/recycler/SourceViewHolder.kt @@ -1,10 +1,10 @@ -package com.redmadrobot.flipper_plugin.ui.dialog.recycler +package com.redmadrobot.debug.flipper.ui.dialog.recycler import android.view.View import androidx.core.view.isVisible import androidx.recyclerview.widget.RecyclerView import com.redmadrobot.flipper_plugin.databinding.ItemFlipperSourceBinding -import com.redmadrobot.flipper_plugin.ui.dialog.data.SelectableSource +import com.redmadrobot.debug.flipper.ui.dialog.data.SelectableSource internal class SourceViewHolder( view: View, diff --git a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/BooleanFeatureViewHolder.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/recycler/BooleanFeatureViewHolder.kt similarity index 95% rename from plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/BooleanFeatureViewHolder.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/recycler/BooleanFeatureViewHolder.kt index 0380eb14..8f922e1f 100644 --- a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/BooleanFeatureViewHolder.kt +++ b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/recycler/BooleanFeatureViewHolder.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.flipper_plugin.ui.recycler +package com.redmadrobot.debug.flipper.ui.recycler import android.view.View import androidx.recyclerview.widget.RecyclerView diff --git a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/FlipperFeaturesAdapter.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/recycler/FlipperFeaturesAdapter.kt similarity index 100% rename from plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/FlipperFeaturesAdapter.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/recycler/FlipperFeaturesAdapter.kt diff --git a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/FlipperFeaturesDiffCallback.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/recycler/FlipperFeaturesDiffCallback.kt similarity index 72% rename from plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/FlipperFeaturesDiffCallback.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/recycler/FlipperFeaturesDiffCallback.kt index 2d9a4ce5..fe7472f7 100644 --- a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/FlipperFeaturesDiffCallback.kt +++ b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/recycler/FlipperFeaturesDiffCallback.kt @@ -1,9 +1,9 @@ -package com.redmadrobot.flipper_plugin.ui.recycler +package com.redmadrobot.debug.flipper.ui.recycler import androidx.recyclerview.widget.DiffUtil -import com.redmadrobot.flipper_plugin.ui.data.FlipperItem -import com.redmadrobot.flipper_plugin.ui.data.FlipperItem.Feature -import com.redmadrobot.flipper_plugin.ui.data.FlipperItem.Group +import com.redmadrobot.debug.flipper.ui.data.FlipperItem +import com.redmadrobot.debug.flipper.ui.data.FlipperItem.Feature +import com.redmadrobot.debug.flipper.ui.data.FlipperItem.Group internal class FlipperFeaturesDiffCallback : DiffUtil.ItemCallback() { override fun areItemsTheSame( diff --git a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/GroupViewHolder.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/recycler/GroupViewHolder.kt similarity index 95% rename from plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/GroupViewHolder.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/recycler/GroupViewHolder.kt index fd2bb1e2..6c1d7d84 100644 --- a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/GroupViewHolder.kt +++ b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/recycler/GroupViewHolder.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.flipper_plugin.ui.recycler +package com.redmadrobot.debug.flipper.ui.recycler import android.view.View import androidx.core.view.isVisible diff --git a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/StringFeatureViewHolder.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/recycler/StringFeatureViewHolder.kt similarity index 100% rename from plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/recycler/StringFeatureViewHolder.kt rename to plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/recycler/StringFeatureViewHolder.kt diff --git a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesViewState.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesViewState.kt deleted file mode 100644 index 8fe5e4c0..00000000 --- a/plugins/flipper/src/main/kotlin/com/redmadrobot/flipper_plugin/ui/FlipperFeaturesViewState.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.redmadrobot.flipper_plugin.ui - -import com.redmadrobot.flipper_plugin.ui.data.FlipperItem - -internal data class FlipperFeaturesViewState( - val items: List = emptyList(), -) diff --git a/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugFlipperFeaturesProvider.kt b/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugFlipperFeaturesProvider.kt index cc3c4a2d..13eec29b 100644 --- a/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugFlipperFeaturesProvider.kt +++ b/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugFlipperFeaturesProvider.kt @@ -2,7 +2,7 @@ package com.redmadrobot.debug_sample.debug_data import com.redmadrobot.debug.core.data.DebugDataProvider import com.redmadrobot.flipper.config.FlipperValue -import com.redmadrobot.flipper_plugin.plugin.PluginToggle +import com.redmadrobot.debug.flipper.plugin.PluginToggle import kotlin.random.Random internal class DebugFlipperFeaturesProvider : DebugDataProvider> { diff --git a/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt b/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt index 2ba8176c..57e976ae 100644 --- a/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt +++ b/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt @@ -12,7 +12,7 @@ import com.redmadrobot.debug_sample.debug_data.DebugFlipperFeaturesProvider import com.redmadrobot.debug_sample.debug_data.DebugServersProvider import com.redmadrobot.debug_sample.debug_data.DebugVariableWidgetsProvider import com.redmadrobot.debug_sample.storage.AppTestSettings -import com.redmadrobot.flipper_plugin.plugin.FlipperPlugin +import com.redmadrobot.debug.flipper.plugin.FlipperPlugin import com.redmadrobot.servers_plugin.data.model.DebugServer import com.redmadrobot.servers_plugin.plugin.ServersPlugin import com.redmadrobot.variable_plugin.plugin.VariablePlugin diff --git a/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt b/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt index 04192a13..102cf970 100644 --- a/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt +++ b/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt @@ -13,7 +13,7 @@ import com.redmadrobot.debug_sample.network.ApiFactory import com.redmadrobot.debugpanel.R import com.redmadrobot.debugpanel.databinding.ActivityMainBinding import com.redmadrobot.flipper.config.FlipperValue -import com.redmadrobot.flipper_plugin.plugin.FlipperPlugin +import com.redmadrobot.debug.flipper.plugin.FlipperPlugin import com.redmadrobot.servers_plugin.plugin.ServerSelectedEvent import com.redmadrobot.variable_plugin.plugin.asDebugVariable import kotlinx.coroutines.DelicateCoroutinesApi From 5c38feb17b78c2d7140974ccf12fbd5039ca737d Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Tue, 6 Dec 2022 12:09:21 +0300 Subject: [PATCH 17/42] Servers: Rename 'servers-plugin' module to 'servers' --- plugins/{servers-plugin => servers}/.gitignore | 0 plugins/{servers-plugin => servers}/build.gradle.kts | 0 plugins/{servers-plugin => servers}/consumer-rules.pro | 0 plugins/{servers-plugin => servers}/library.properties | 0 plugins/{servers-plugin => servers}/proguard-rules.pro | 0 .../redmadrobot/servers_plugin/data/DebugServerRepository.kt | 0 .../servers_plugin/data/LocalDebugServerRepository.kt | 0 .../com/redmadrobot/servers_plugin/data/model/DebugServer.kt | 0 .../redmadrobot/servers_plugin/data/storage/DebugServersDao.kt | 0 .../servers_plugin/data/storage/ServersPluginDatabase.kt | 0 .../servers_plugin/listener/DefaultOnServerChangedListener.kt | 0 .../servers_plugin/listener/OnServerChangedListener.kt | 0 .../redmadrobot/servers_plugin/plugin/ServerSelectedEvent.kt | 0 .../com/redmadrobot/servers_plugin/plugin/ServersPlugin.kt | 0 .../redmadrobot/servers_plugin/plugin/ServersPluginContainer.kt | 0 .../com/redmadrobot/servers_plugin/ui/ServerHostDialog.kt | 0 .../kotlin/com/redmadrobot/servers_plugin/ui/ServersFragment.kt | 0 .../com/redmadrobot/servers_plugin/ui/ServersViewModel.kt | 0 .../com/redmadrobot/servers_plugin/ui/ServersViewState.kt | 0 .../com/redmadrobot/servers_plugin/ui/item/DebugServerItems.kt | 0 .../redmadrobot/servers_plugin/util/DebugServerInterceptor.kt | 0 .../src/main/res/drawable/icon_add_server.xml | 0 .../src/main/res/drawable/icon_delete.xml | 0 .../src/main/res/drawable/icon_router.xml | 0 .../src/main/res/drawable/icon_selected.xml | 0 .../src/main/res/layout/dialog_server.xml | 0 .../src/main/res/layout/fragment_servers.xml | 0 .../src/main/res/layout/item_debug_server.xml | 0 .../{servers-plugin => servers}/src/main/res/values/public.xml | 0 .../{servers-plugin => servers}/src/main/res/values/strings.xml | 0 sample/build.gradle.kts | 2 +- settings.gradle.kts | 2 +- 32 files changed, 2 insertions(+), 2 deletions(-) rename plugins/{servers-plugin => servers}/.gitignore (100%) rename plugins/{servers-plugin => servers}/build.gradle.kts (100%) rename plugins/{servers-plugin => servers}/consumer-rules.pro (100%) rename plugins/{servers-plugin => servers}/library.properties (100%) rename plugins/{servers-plugin => servers}/proguard-rules.pro (100%) rename plugins/{servers-plugin => servers}/src/main/kotlin/com/redmadrobot/servers_plugin/data/DebugServerRepository.kt (100%) rename plugins/{servers-plugin => servers}/src/main/kotlin/com/redmadrobot/servers_plugin/data/LocalDebugServerRepository.kt (100%) rename plugins/{servers-plugin => servers}/src/main/kotlin/com/redmadrobot/servers_plugin/data/model/DebugServer.kt (100%) rename plugins/{servers-plugin => servers}/src/main/kotlin/com/redmadrobot/servers_plugin/data/storage/DebugServersDao.kt (100%) rename plugins/{servers-plugin => servers}/src/main/kotlin/com/redmadrobot/servers_plugin/data/storage/ServersPluginDatabase.kt (100%) rename plugins/{servers-plugin => servers}/src/main/kotlin/com/redmadrobot/servers_plugin/listener/DefaultOnServerChangedListener.kt (100%) rename plugins/{servers-plugin => servers}/src/main/kotlin/com/redmadrobot/servers_plugin/listener/OnServerChangedListener.kt (100%) rename plugins/{servers-plugin => servers}/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServerSelectedEvent.kt (100%) rename plugins/{servers-plugin => servers}/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPlugin.kt (100%) rename plugins/{servers-plugin => servers}/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPluginContainer.kt (100%) rename plugins/{servers-plugin => servers}/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServerHostDialog.kt (100%) rename plugins/{servers-plugin => servers}/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersFragment.kt (100%) rename plugins/{servers-plugin => servers}/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewModel.kt (100%) rename plugins/{servers-plugin => servers}/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewState.kt (100%) rename plugins/{servers-plugin => servers}/src/main/kotlin/com/redmadrobot/servers_plugin/ui/item/DebugServerItems.kt (100%) rename plugins/{servers-plugin => servers}/src/main/kotlin/com/redmadrobot/servers_plugin/util/DebugServerInterceptor.kt (100%) rename plugins/{servers-plugin => servers}/src/main/res/drawable/icon_add_server.xml (100%) rename plugins/{servers-plugin => servers}/src/main/res/drawable/icon_delete.xml (100%) rename plugins/{servers-plugin => servers}/src/main/res/drawable/icon_router.xml (100%) rename plugins/{servers-plugin => servers}/src/main/res/drawable/icon_selected.xml (100%) rename plugins/{servers-plugin => servers}/src/main/res/layout/dialog_server.xml (100%) rename plugins/{servers-plugin => servers}/src/main/res/layout/fragment_servers.xml (100%) rename plugins/{servers-plugin => servers}/src/main/res/layout/item_debug_server.xml (100%) rename plugins/{servers-plugin => servers}/src/main/res/values/public.xml (100%) rename plugins/{servers-plugin => servers}/src/main/res/values/strings.xml (100%) diff --git a/plugins/servers-plugin/.gitignore b/plugins/servers/.gitignore similarity index 100% rename from plugins/servers-plugin/.gitignore rename to plugins/servers/.gitignore diff --git a/plugins/servers-plugin/build.gradle.kts b/plugins/servers/build.gradle.kts similarity index 100% rename from plugins/servers-plugin/build.gradle.kts rename to plugins/servers/build.gradle.kts diff --git a/plugins/servers-plugin/consumer-rules.pro b/plugins/servers/consumer-rules.pro similarity index 100% rename from plugins/servers-plugin/consumer-rules.pro rename to plugins/servers/consumer-rules.pro diff --git a/plugins/servers-plugin/library.properties b/plugins/servers/library.properties similarity index 100% rename from plugins/servers-plugin/library.properties rename to plugins/servers/library.properties diff --git a/plugins/servers-plugin/proguard-rules.pro b/plugins/servers/proguard-rules.pro similarity index 100% rename from plugins/servers-plugin/proguard-rules.pro rename to plugins/servers/proguard-rules.pro diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/data/DebugServerRepository.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/DebugServerRepository.kt similarity index 100% rename from plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/data/DebugServerRepository.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/DebugServerRepository.kt diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/data/LocalDebugServerRepository.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/LocalDebugServerRepository.kt similarity index 100% rename from plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/data/LocalDebugServerRepository.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/LocalDebugServerRepository.kt diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/data/model/DebugServer.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/model/DebugServer.kt similarity index 100% rename from plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/data/model/DebugServer.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/model/DebugServer.kt diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/data/storage/DebugServersDao.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/storage/DebugServersDao.kt similarity index 100% rename from plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/data/storage/DebugServersDao.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/storage/DebugServersDao.kt diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/data/storage/ServersPluginDatabase.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/storage/ServersPluginDatabase.kt similarity index 100% rename from plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/data/storage/ServersPluginDatabase.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/storage/ServersPluginDatabase.kt diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/listener/DefaultOnServerChangedListener.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/listener/DefaultOnServerChangedListener.kt similarity index 100% rename from plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/listener/DefaultOnServerChangedListener.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/listener/DefaultOnServerChangedListener.kt diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/listener/OnServerChangedListener.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/listener/OnServerChangedListener.kt similarity index 100% rename from plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/listener/OnServerChangedListener.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/listener/OnServerChangedListener.kt diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServerSelectedEvent.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServerSelectedEvent.kt similarity index 100% rename from plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServerSelectedEvent.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServerSelectedEvent.kt diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPlugin.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPlugin.kt similarity index 100% rename from plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPlugin.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPlugin.kt diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPluginContainer.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPluginContainer.kt similarity index 100% rename from plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPluginContainer.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPluginContainer.kt diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServerHostDialog.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServerHostDialog.kt similarity index 100% rename from plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServerHostDialog.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServerHostDialog.kt diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersFragment.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersFragment.kt similarity index 100% rename from plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersFragment.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersFragment.kt diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewModel.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewModel.kt similarity index 100% rename from plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewModel.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewModel.kt diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewState.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewState.kt similarity index 100% rename from plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewState.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewState.kt diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/item/DebugServerItems.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/item/DebugServerItems.kt similarity index 100% rename from plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/ui/item/DebugServerItems.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/item/DebugServerItems.kt diff --git a/plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/util/DebugServerInterceptor.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/util/DebugServerInterceptor.kt similarity index 100% rename from plugins/servers-plugin/src/main/kotlin/com/redmadrobot/servers_plugin/util/DebugServerInterceptor.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/util/DebugServerInterceptor.kt diff --git a/plugins/servers-plugin/src/main/res/drawable/icon_add_server.xml b/plugins/servers/src/main/res/drawable/icon_add_server.xml similarity index 100% rename from plugins/servers-plugin/src/main/res/drawable/icon_add_server.xml rename to plugins/servers/src/main/res/drawable/icon_add_server.xml diff --git a/plugins/servers-plugin/src/main/res/drawable/icon_delete.xml b/plugins/servers/src/main/res/drawable/icon_delete.xml similarity index 100% rename from plugins/servers-plugin/src/main/res/drawable/icon_delete.xml rename to plugins/servers/src/main/res/drawable/icon_delete.xml diff --git a/plugins/servers-plugin/src/main/res/drawable/icon_router.xml b/plugins/servers/src/main/res/drawable/icon_router.xml similarity index 100% rename from plugins/servers-plugin/src/main/res/drawable/icon_router.xml rename to plugins/servers/src/main/res/drawable/icon_router.xml diff --git a/plugins/servers-plugin/src/main/res/drawable/icon_selected.xml b/plugins/servers/src/main/res/drawable/icon_selected.xml similarity index 100% rename from plugins/servers-plugin/src/main/res/drawable/icon_selected.xml rename to plugins/servers/src/main/res/drawable/icon_selected.xml diff --git a/plugins/servers-plugin/src/main/res/layout/dialog_server.xml b/plugins/servers/src/main/res/layout/dialog_server.xml similarity index 100% rename from plugins/servers-plugin/src/main/res/layout/dialog_server.xml rename to plugins/servers/src/main/res/layout/dialog_server.xml diff --git a/plugins/servers-plugin/src/main/res/layout/fragment_servers.xml b/plugins/servers/src/main/res/layout/fragment_servers.xml similarity index 100% rename from plugins/servers-plugin/src/main/res/layout/fragment_servers.xml rename to plugins/servers/src/main/res/layout/fragment_servers.xml diff --git a/plugins/servers-plugin/src/main/res/layout/item_debug_server.xml b/plugins/servers/src/main/res/layout/item_debug_server.xml similarity index 100% rename from plugins/servers-plugin/src/main/res/layout/item_debug_server.xml rename to plugins/servers/src/main/res/layout/item_debug_server.xml diff --git a/plugins/servers-plugin/src/main/res/values/public.xml b/plugins/servers/src/main/res/values/public.xml similarity index 100% rename from plugins/servers-plugin/src/main/res/values/public.xml rename to plugins/servers/src/main/res/values/public.xml diff --git a/plugins/servers-plugin/src/main/res/values/strings.xml b/plugins/servers/src/main/res/values/strings.xml similarity index 100% rename from plugins/servers-plugin/src/main/res/values/strings.xml rename to plugins/servers/src/main/res/values/strings.xml diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index 9199f536..5ca06dde 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -42,9 +42,9 @@ dependencies { implementation(stack.kotlinx.coroutines.android) implementation(androidx.lifecycle.runtime) debugImplementation(project(":core")) + debugImplementation(project(":plugins:servers")) // Debug panel dependencies - debugImplementation(project(":plugins:servers-plugin")) debugImplementation(project(":plugins:accounts")) debugImplementation(project(":plugins:app-settings")) debugImplementation(project(":plugins:flipper")) diff --git a/settings.gradle.kts b/settings.gradle.kts index 5a1f0de3..327609da 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -39,7 +39,7 @@ include( // Plugins include( ":plugins:accounts", - ":plugins:servers-plugin", + ":plugins:servers", ":plugins:app-settings", ":plugins:flipper", ":plugins:variable-plugin" From 12a8371c87bee61d512e8721cdbd80adee23c08b Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Tue, 6 Dec 2022 12:13:00 +0300 Subject: [PATCH 18/42] Servers: Rename 'servers-plugin' package to 'com.redmadrobot.debug.servers' --- .../redmadrobot/debug/noop/servers/DebugServer.kt | 2 +- .../debug/noop/servers/DebugServerInterceptor.kt | 4 ++-- .../debug/noop/servers/ServerSelectedEvent.kt | 6 +++--- .../redmadrobot/debug/noop/servers/ServersPlugin.kt | 4 ++-- .../servers}/data/DebugServerRepository.kt | 4 ++-- .../servers}/data/LocalDebugServerRepository.kt | 6 +++--- .../servers}/data/model/DebugServer.kt | 2 +- .../servers}/data/storage/DebugServersDao.kt | 4 ++-- .../servers}/data/storage/ServersPluginDatabase.kt | 4 ++-- .../listener/DefaultOnServerChangedListener.kt | 4 ++-- .../servers/listener/OnServerChangedListener.kt | 7 +++++++ .../servers}/plugin/ServerSelectedEvent.kt | 4 ++-- .../servers}/plugin/ServersPlugin.kt | 6 +++--- .../servers}/plugin/ServersPluginContainer.kt | 10 +++++----- .../servers}/ui/ServerHostDialog.kt | 6 +++--- .../servers}/ui/ServersFragment.kt | 10 +++++----- .../servers}/ui/ServersViewModel.kt | 12 ++++++------ .../servers}/ui/ServersViewState.kt | 4 ++-- .../servers}/ui/item/DebugServerItems.kt | 4 ++-- .../servers}/util/DebugServerInterceptor.kt | 8 ++++---- .../listener/OnServerChangedListener.kt | 7 ------- .../debug_sample/debug_data/DebugServersProvider.kt | 2 +- .../main/kotlin/com/redmadrobot/debug_sample/App.kt | 4 ++-- .../com/redmadrobot/debug_sample/MainActivity.kt | 2 +- .../redmadrobot/debug_sample/network/ApiFactory.kt | 2 +- 25 files changed, 64 insertions(+), 64 deletions(-) rename plugins/servers/src/main/kotlin/com/redmadrobot/{servers_plugin => debug/servers}/data/DebugServerRepository.kt (80%) rename plugins/servers/src/main/kotlin/com/redmadrobot/{servers_plugin => debug/servers}/data/LocalDebugServerRepository.kt (93%) rename plugins/servers/src/main/kotlin/com/redmadrobot/{servers_plugin => debug/servers}/data/model/DebugServer.kt (91%) rename plugins/servers/src/main/kotlin/com/redmadrobot/{servers_plugin => debug/servers}/data/storage/DebugServersDao.kt (82%) rename plugins/servers/src/main/kotlin/com/redmadrobot/{servers_plugin => debug/servers}/data/storage/ServersPluginDatabase.kt (85%) rename plugins/servers/src/main/kotlin/com/redmadrobot/{servers_plugin => debug/servers}/listener/DefaultOnServerChangedListener.kt (56%) create mode 100644 plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/listener/OnServerChangedListener.kt rename plugins/servers/src/main/kotlin/com/redmadrobot/{servers_plugin => debug/servers}/plugin/ServerSelectedEvent.kt (56%) rename plugins/servers/src/main/kotlin/com/redmadrobot/{servers_plugin => debug/servers}/plugin/ServersPlugin.kt (92%) rename plugins/servers/src/main/kotlin/com/redmadrobot/{servers_plugin => debug/servers}/plugin/ServersPluginContainer.kt (70%) rename plugins/servers/src/main/kotlin/com/redmadrobot/{servers_plugin => debug/servers}/ui/ServerHostDialog.kt (95%) rename plugins/servers/src/main/kotlin/com/redmadrobot/{servers_plugin => debug/servers}/ui/ServersFragment.kt (94%) rename plugins/servers/src/main/kotlin/com/redmadrobot/{servers_plugin => debug/servers}/ui/ServersViewModel.kt (92%) rename plugins/servers/src/main/kotlin/com/redmadrobot/{servers_plugin => debug/servers}/ui/ServersViewState.kt (57%) rename plugins/servers/src/main/kotlin/com/redmadrobot/{servers_plugin => debug/servers}/ui/item/DebugServerItems.kt (77%) rename plugins/servers/src/main/kotlin/com/redmadrobot/{servers_plugin => debug/servers}/util/DebugServerInterceptor.kt (87%) delete mode 100644 plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/listener/OnServerChangedListener.kt diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugServer.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugServer.kt index cac2fd98..70e8a556 100644 --- a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugServer.kt +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugServer.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.servers_plugin.data.model +package com.redmadrobot.debug.servers.data.model data class DebugServer( val id: Int = 0, diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugServerInterceptor.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugServerInterceptor.kt index ace38d44..4b68a20d 100644 --- a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugServerInterceptor.kt +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugServerInterceptor.kt @@ -1,6 +1,6 @@ -package com.redmadrobot.servers_plugin.util +package com.redmadrobot.debug.servers.util -import com.redmadrobot.servers_plugin.data.model.DebugServer +import com.redmadrobot.debug.servers.data.model.DebugServer import okhttp3.Interceptor import okhttp3.Request import okhttp3.Response diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/ServerSelectedEvent.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/ServerSelectedEvent.kt index c179ec4d..0fd0f8ed 100644 --- a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/ServerSelectedEvent.kt +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/ServerSelectedEvent.kt @@ -1,6 +1,6 @@ -package com.redmadrobot.servers_plugin.plugin +package com.redmadrobot.debug.servers.plugin -import com.redmadrobot.debug_panel_core.internal.DebugEvent -import com.redmadrobot.servers_plugin.data.model.DebugServer +import com.redmadrobot.debug.core.internal.DebugEvent +import com.redmadrobot.debug.servers.data.model.DebugServer data class ServerSelectedEvent(val debugServer: DebugServer) : DebugEvent diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/ServersPlugin.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/ServersPlugin.kt index b772ac12..6331c5a0 100644 --- a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/ServersPlugin.kt +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/ServersPlugin.kt @@ -1,7 +1,7 @@ -package com.redmadrobot.servers_plugin.plugin +package com.redmadrobot.debug.servers.plugin +import com.redmadrobot.debug.servers.data.model.DebugServer import com.redmadrobot.debug_panel_core.data.DebugDataProvider -import com.redmadrobot.servers_plugin.data.model.DebugServer import java.util.Collections.emptyList class ServersPlugin( diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/DebugServerRepository.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/DebugServerRepository.kt similarity index 80% rename from plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/DebugServerRepository.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/DebugServerRepository.kt index 45520030..ff52189f 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/DebugServerRepository.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/DebugServerRepository.kt @@ -1,6 +1,6 @@ -package com.redmadrobot.servers_plugin.data +package com.redmadrobot.debug.servers.data -import com.redmadrobot.servers_plugin.data.model.DebugServer +import com.redmadrobot.debug.servers.data.model.DebugServer internal interface DebugServerRepository { diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/LocalDebugServerRepository.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/LocalDebugServerRepository.kt similarity index 93% rename from plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/LocalDebugServerRepository.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/LocalDebugServerRepository.kt index 6c74422d..ea938901 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/LocalDebugServerRepository.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/LocalDebugServerRepository.kt @@ -1,8 +1,8 @@ -package com.redmadrobot.servers_plugin.data +package com.redmadrobot.debug.servers.data import android.content.Context -import com.redmadrobot.servers_plugin.data.model.DebugServer -import com.redmadrobot.servers_plugin.data.storage.DebugServersDao +import com.redmadrobot.debug.servers.data.model.DebugServer +import com.redmadrobot.debug.servers.data.storage.DebugServersDao import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/model/DebugServer.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/model/DebugServer.kt similarity index 91% rename from plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/model/DebugServer.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/model/DebugServer.kt index 5956f5fc..060550d0 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/model/DebugServer.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/model/DebugServer.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.servers_plugin.data.model +package com.redmadrobot.debug.servers.data.model import androidx.room.Entity import androidx.room.PrimaryKey diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/storage/DebugServersDao.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/storage/DebugServersDao.kt similarity index 82% rename from plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/storage/DebugServersDao.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/storage/DebugServersDao.kt index ececc71f..11e9681c 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/storage/DebugServersDao.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/storage/DebugServersDao.kt @@ -1,7 +1,7 @@ -package com.redmadrobot.servers_plugin.data.storage +package com.redmadrobot.debug.servers.data.storage import androidx.room.* -import com.redmadrobot.servers_plugin.data.model.DebugServer +import com.redmadrobot.debug.servers.data.model.DebugServer @Dao internal interface DebugServersDao { diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/storage/ServersPluginDatabase.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/storage/ServersPluginDatabase.kt similarity index 85% rename from plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/storage/ServersPluginDatabase.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/storage/ServersPluginDatabase.kt index 6133bd0c..d9a8a82d 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/data/storage/ServersPluginDatabase.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/storage/ServersPluginDatabase.kt @@ -1,10 +1,10 @@ -package com.redmadrobot.servers_plugin.data.storage +package com.redmadrobot.debug.servers.data.storage import android.content.Context import androidx.room.Database import androidx.room.Room import androidx.room.RoomDatabase -import com.redmadrobot.servers_plugin.data.model.DebugServer +import com.redmadrobot.debug.servers.data.model.DebugServer @Database( entities = [DebugServer::class], diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/listener/DefaultOnServerChangedListener.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/listener/DefaultOnServerChangedListener.kt similarity index 56% rename from plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/listener/DefaultOnServerChangedListener.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/listener/DefaultOnServerChangedListener.kt index bb41351e..dae29f71 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/listener/DefaultOnServerChangedListener.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/listener/DefaultOnServerChangedListener.kt @@ -1,6 +1,6 @@ -package com.redmadrobot.servers_plugin.listener +package com.redmadrobot.debug.servers.listener -import com.redmadrobot.servers_plugin.data.model.DebugServer +import com.redmadrobot.debug.servers.data.model.DebugServer internal class DefaultOnServerChangedListener : OnServerChangedListener { override fun onChanged(server: DebugServer?) {/*do nothing*/} diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/listener/OnServerChangedListener.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/listener/OnServerChangedListener.kt new file mode 100644 index 00000000..639c6ce4 --- /dev/null +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/listener/OnServerChangedListener.kt @@ -0,0 +1,7 @@ +package com.redmadrobot.debug.servers.listener + +import com.redmadrobot.debug.servers.data.model.DebugServer + +internal interface OnServerChangedListener { + fun onChanged(server: DebugServer?) +} diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServerSelectedEvent.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServerSelectedEvent.kt similarity index 56% rename from plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServerSelectedEvent.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServerSelectedEvent.kt index f8dc54d2..48136800 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServerSelectedEvent.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServerSelectedEvent.kt @@ -1,6 +1,6 @@ -package com.redmadrobot.servers_plugin.plugin +package com.redmadrobot.debug.servers.plugin import com.redmadrobot.debug.core.internal.DebugEvent -import com.redmadrobot.servers_plugin.data.model.DebugServer +import com.redmadrobot.debug.servers.data.model.DebugServer public data class ServerSelectedEvent(val debugServer: DebugServer) : DebugEvent diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPlugin.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPlugin.kt similarity index 92% rename from plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPlugin.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPlugin.kt index d16a1915..be7e67b0 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPlugin.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPlugin.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.servers_plugin.plugin +package com.redmadrobot.debug.servers.plugin import androidx.core.os.bundleOf import androidx.fragment.app.Fragment @@ -7,8 +7,8 @@ import com.redmadrobot.debug.core.data.DebugDataProvider import com.redmadrobot.debug.core.extension.getPlugin import com.redmadrobot.debug.core.plugin.Plugin import com.redmadrobot.debug.core.plugin.PluginDependencyContainer -import com.redmadrobot.servers_plugin.data.model.DebugServer -import com.redmadrobot.servers_plugin.ui.ServersFragment +import com.redmadrobot.debug.servers.data.model.DebugServer +import com.redmadrobot.debug.servers.ui.ServersFragment import kotlinx.coroutines.runBlocking public class ServersPlugin( diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPluginContainer.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPluginContainer.kt similarity index 70% rename from plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPluginContainer.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPluginContainer.kt index 377a8341..15eea77d 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/plugin/ServersPluginContainer.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPluginContainer.kt @@ -1,11 +1,11 @@ -package com.redmadrobot.servers_plugin.plugin +package com.redmadrobot.debug.servers.plugin import com.redmadrobot.debug.core.CommonContainer import com.redmadrobot.debug.core.plugin.PluginDependencyContainer -import com.redmadrobot.servers_plugin.data.LocalDebugServerRepository -import com.redmadrobot.servers_plugin.data.model.DebugServer -import com.redmadrobot.servers_plugin.data.storage.ServersPluginDatabase -import com.redmadrobot.servers_plugin.ui.ServersViewModel +import com.redmadrobot.debug.servers.data.LocalDebugServerRepository +import com.redmadrobot.debug.servers.data.model.DebugServer +import com.redmadrobot.debug.servers.data.storage.ServersPluginDatabase +import com.redmadrobot.debug.servers.ui.ServersViewModel internal class ServersPluginContainer( private val preInstalledServers: List, diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServerHostDialog.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServerHostDialog.kt similarity index 95% rename from plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServerHostDialog.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServerHostDialog.kt index ffc98aa2..744f381d 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServerHostDialog.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServerHostDialog.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.servers_plugin.ui +package com.redmadrobot.debug.servers.ui import android.os.Bundle import android.util.Patterns @@ -12,8 +12,8 @@ import com.redmadrobot.debug.common.extension.obtainShareViewModel import com.redmadrobot.debug.core.extension.getPlugin import com.redmadrobot.servers_plugin.R import com.redmadrobot.servers_plugin.databinding.DialogServerBinding -import com.redmadrobot.servers_plugin.plugin.ServersPlugin -import com.redmadrobot.servers_plugin.plugin.ServersPluginContainer +import com.redmadrobot.debug.servers.plugin.ServersPlugin +import com.redmadrobot.debug.servers.plugin.ServersPluginContainer internal class ServerHostDialog : DialogFragment() { diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersFragment.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersFragment.kt similarity index 94% rename from plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersFragment.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersFragment.kt index ba59ad8e..db28360d 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersFragment.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersFragment.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.servers_plugin.ui +package com.redmadrobot.debug.servers.ui import android.os.Bundle import android.view.View @@ -13,12 +13,12 @@ import com.redmadrobot.itemsadapter.ItemsAdapter import com.redmadrobot.itemsadapter.bind import com.redmadrobot.itemsadapter.itemsAdapter import com.redmadrobot.servers_plugin.R -import com.redmadrobot.servers_plugin.data.model.DebugServer +import com.redmadrobot.debug.servers.data.model.DebugServer import com.redmadrobot.servers_plugin.databinding.FragmentServersBinding import com.redmadrobot.servers_plugin.databinding.ItemDebugServerBinding -import com.redmadrobot.servers_plugin.plugin.ServersPlugin -import com.redmadrobot.servers_plugin.plugin.ServersPluginContainer -import com.redmadrobot.servers_plugin.ui.item.DebugServerItems +import com.redmadrobot.debug.servers.plugin.ServersPlugin +import com.redmadrobot.debug.servers.plugin.ServersPluginContainer +import com.redmadrobot.debug.servers.ui.item.DebugServerItems import com.redmadrobot.debug_panel_common.R as CommonR internal class ServersFragment : PluginFragment(R.layout.fragment_servers) { diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewModel.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersViewModel.kt similarity index 92% rename from plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewModel.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersViewModel.kt index 00d0b7cb..1d8b98f6 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewModel.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersViewModel.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.servers_plugin.ui +package com.redmadrobot.debug.servers.ui import android.content.Context import androidx.lifecycle.MutableLiveData @@ -7,11 +7,11 @@ import com.redmadrobot.debug.common.base.PluginViewModel import com.redmadrobot.debug.common.extension.safeLaunch import com.redmadrobot.debug.core.extension.getPlugin import com.redmadrobot.servers_plugin.R -import com.redmadrobot.servers_plugin.data.DebugServerRepository -import com.redmadrobot.servers_plugin.data.model.DebugServer -import com.redmadrobot.servers_plugin.plugin.ServerSelectedEvent -import com.redmadrobot.servers_plugin.plugin.ServersPlugin -import com.redmadrobot.servers_plugin.ui.item.DebugServerItems +import com.redmadrobot.debug.servers.data.DebugServerRepository +import com.redmadrobot.debug.servers.data.model.DebugServer +import com.redmadrobot.debug.servers.plugin.ServerSelectedEvent +import com.redmadrobot.debug.servers.plugin.ServersPlugin +import com.redmadrobot.debug.servers.ui.item.DebugServerItems import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewState.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersViewState.kt similarity index 57% rename from plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewState.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersViewState.kt index 984ae28a..2a94dfe1 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/ServersViewState.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersViewState.kt @@ -1,6 +1,6 @@ -package com.redmadrobot.servers_plugin.ui +package com.redmadrobot.debug.servers.ui -import com.redmadrobot.servers_plugin.ui.item.DebugServerItems +import com.redmadrobot.debug.servers.ui.item.DebugServerItems internal data class ServersViewState( val preInstalledServers: List, diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/item/DebugServerItems.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/item/DebugServerItems.kt similarity index 77% rename from plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/item/DebugServerItems.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/item/DebugServerItems.kt index 70a7632c..dd799247 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/ui/item/DebugServerItems.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/item/DebugServerItems.kt @@ -1,6 +1,6 @@ -package com.redmadrobot.servers_plugin.ui.item +package com.redmadrobot.debug.servers.ui.item -import com.redmadrobot.servers_plugin.data.model.DebugServer +import com.redmadrobot.debug.servers.data.model.DebugServer internal sealed class DebugServerItems { diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/util/DebugServerInterceptor.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/util/DebugServerInterceptor.kt similarity index 87% rename from plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/util/DebugServerInterceptor.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/util/DebugServerInterceptor.kt index a9420af5..e10efcb9 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/util/DebugServerInterceptor.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/util/DebugServerInterceptor.kt @@ -1,10 +1,10 @@ -package com.redmadrobot.servers_plugin.util +package com.redmadrobot.debug.servers.util import com.redmadrobot.debug.core.extension.getPlugin import com.redmadrobot.debug.core.internal.DebugPanel -import com.redmadrobot.servers_plugin.data.model.DebugServer -import com.redmadrobot.servers_plugin.plugin.ServersPlugin -import com.redmadrobot.servers_plugin.plugin.ServersPluginContainer +import com.redmadrobot.debug.servers.data.model.DebugServer +import com.redmadrobot.debug.servers.plugin.ServersPlugin +import com.redmadrobot.debug.servers.plugin.ServersPluginContainer import kotlinx.coroutines.runBlocking import okhttp3.HttpUrl import okhttp3.Interceptor diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/listener/OnServerChangedListener.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/listener/OnServerChangedListener.kt deleted file mode 100644 index ea124831..00000000 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/servers_plugin/listener/OnServerChangedListener.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.redmadrobot.servers_plugin.listener - -import com.redmadrobot.servers_plugin.data.model.DebugServer - -internal interface OnServerChangedListener { - fun onChanged(server: DebugServer?) -} diff --git a/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugServersProvider.kt b/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugServersProvider.kt index 0ea413d9..bf750c92 100644 --- a/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugServersProvider.kt +++ b/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugServersProvider.kt @@ -1,7 +1,7 @@ package com.redmadrobot.debug_sample.debug_data import com.redmadrobot.debug.core.data.DebugDataProvider -import com.redmadrobot.servers_plugin.data.model.DebugServer +import com.redmadrobot.debug.servers.data.model.DebugServer class DebugServersProvider : DebugDataProvider> { diff --git a/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt b/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt index 57e976ae..e54e335a 100644 --- a/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt +++ b/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt @@ -13,8 +13,8 @@ import com.redmadrobot.debug_sample.debug_data.DebugServersProvider import com.redmadrobot.debug_sample.debug_data.DebugVariableWidgetsProvider import com.redmadrobot.debug_sample.storage.AppTestSettings import com.redmadrobot.debug.flipper.plugin.FlipperPlugin -import com.redmadrobot.servers_plugin.data.model.DebugServer -import com.redmadrobot.servers_plugin.plugin.ServersPlugin +import com.redmadrobot.debug.servers.data.model.DebugServer +import com.redmadrobot.debug.servers.plugin.ServersPlugin import com.redmadrobot.variable_plugin.plugin.VariablePlugin class App : Application() { diff --git a/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt b/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt index 102cf970..a3f9b286 100644 --- a/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt +++ b/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt @@ -14,7 +14,7 @@ import com.redmadrobot.debugpanel.R import com.redmadrobot.debugpanel.databinding.ActivityMainBinding import com.redmadrobot.flipper.config.FlipperValue import com.redmadrobot.debug.flipper.plugin.FlipperPlugin -import com.redmadrobot.servers_plugin.plugin.ServerSelectedEvent +import com.redmadrobot.debug.servers.plugin.ServerSelectedEvent import com.redmadrobot.variable_plugin.plugin.asDebugVariable import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.Dispatchers diff --git a/sample/src/main/kotlin/com/redmadrobot/debug_sample/network/ApiFactory.kt b/sample/src/main/kotlin/com/redmadrobot/debug_sample/network/ApiFactory.kt index dfc799bf..42a9da99 100644 --- a/sample/src/main/kotlin/com/redmadrobot/debug_sample/network/ApiFactory.kt +++ b/sample/src/main/kotlin/com/redmadrobot/debug_sample/network/ApiFactory.kt @@ -1,6 +1,6 @@ package com.redmadrobot.debug_sample.network -import com.redmadrobot.servers_plugin.util.DebugServerInterceptor +import com.redmadrobot.debug.servers.util.DebugServerInterceptor import okhttp3.Interceptor import okhttp3.OkHttpClient import okhttp3.Response From a5283dc67e2fe786ffe147e150447c45b3b76d55 Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Tue, 6 Dec 2022 12:13:50 +0300 Subject: [PATCH 19/42] Variable: Rename 'variable-plugin' module to 'variable' --- plugins/{variable-plugin => variable}/.gitignore | 0 plugins/{variable-plugin => variable}/build.gradle.kts | 0 plugins/{variable-plugin => variable}/consumer-rules.pro | 0 plugins/{variable-plugin => variable}/library.properties | 0 plugins/{variable-plugin => variable}/proguard-rules.pro | 0 .../com/redmadrobot/variable_plugin/data/VariableRepository.kt | 0 .../kotlin/com/redmadrobot/variable_plugin/extensions/String.kt | 0 .../com/redmadrobot/variable_plugin/plugin/VariablePlugin.kt | 0 .../variable_plugin/plugin/VariablePluginContainer.kt | 0 .../com/redmadrobot/variable_plugin/ui/VariableFragment.kt | 0 .../com/redmadrobot/variable_plugin/ui/VariableViewModel.kt | 0 .../com/redmadrobot/variable_plugin/ui/model/VariableEvent.kt | 0 .../redmadrobot/variable_plugin/ui/recycler/VariableAdapter.kt | 0 .../variable_plugin/ui/recycler/VariableItemDiffCallback.kt | 0 .../variable_plugin/ui/recycler/VariableViewHolder.kt | 0 .../variable_plugin/ui/widgets/BooleanVariableWidget.kt | 0 .../variable_plugin/ui/widgets/StringVariableWidget.kt | 0 .../variable_plugin/ui/widgets/numbers/DoubleVariableWidget.kt | 0 .../variable_plugin/ui/widgets/numbers/FloatVariableWidget.kt | 0 .../variable_plugin/ui/widgets/numbers/IntVariableWidget.kt | 0 .../variable_plugin/ui/widgets/numbers/LongVariableWidget.kt | 0 .../variable_plugin/ui/widgets/numbers/NumberSettings.kt | 0 .../variable_plugin/ui/widgets/numbers/NumberVariableWidget.kt | 0 .../ui/widgets/numbers/NumbersSettingsViewHolder.kt | 0 .../variable_plugin/ui/widgets/numbers/NumbersViewHolder.kt | 0 .../variable_plugin/ui/widgets/numbers/ShortVariableWidget.kt | 0 .../src/main/res/layout/fragment_variable.xml | 0 .../src/main/res/layout/item_variable.xml | 0 .../src/main/res/layout/item_variable_boolean.xml | 0 .../src/main/res/layout/item_variable_number.xml | 0 .../src/main/res/layout/item_variable_number_settings.xml | 0 .../src/main/res/layout/item_variable_string.xml | 0 .../src/main/res/values/strings.xml | 0 sample/build.gradle.kts | 2 +- settings.gradle.kts | 2 +- 35 files changed, 2 insertions(+), 2 deletions(-) rename plugins/{variable-plugin => variable}/.gitignore (100%) rename plugins/{variable-plugin => variable}/build.gradle.kts (100%) rename plugins/{variable-plugin => variable}/consumer-rules.pro (100%) rename plugins/{variable-plugin => variable}/library.properties (100%) rename plugins/{variable-plugin => variable}/proguard-rules.pro (100%) rename plugins/{variable-plugin => variable}/src/main/kotlin/com/redmadrobot/variable_plugin/data/VariableRepository.kt (100%) rename plugins/{variable-plugin => variable}/src/main/kotlin/com/redmadrobot/variable_plugin/extensions/String.kt (100%) rename plugins/{variable-plugin => variable}/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePlugin.kt (100%) rename plugins/{variable-plugin => variable}/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePluginContainer.kt (100%) rename plugins/{variable-plugin => variable}/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableFragment.kt (100%) rename plugins/{variable-plugin => variable}/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableViewModel.kt (100%) rename plugins/{variable-plugin => variable}/src/main/kotlin/com/redmadrobot/variable_plugin/ui/model/VariableEvent.kt (100%) rename plugins/{variable-plugin => variable}/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableAdapter.kt (100%) rename plugins/{variable-plugin => variable}/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableItemDiffCallback.kt (100%) rename plugins/{variable-plugin => variable}/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableViewHolder.kt (100%) rename plugins/{variable-plugin => variable}/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/BooleanVariableWidget.kt (100%) rename plugins/{variable-plugin => variable}/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/StringVariableWidget.kt (100%) rename plugins/{variable-plugin => variable}/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/DoubleVariableWidget.kt (100%) rename plugins/{variable-plugin => variable}/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/FloatVariableWidget.kt (100%) rename plugins/{variable-plugin => variable}/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/IntVariableWidget.kt (100%) rename plugins/{variable-plugin => variable}/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/LongVariableWidget.kt (100%) rename plugins/{variable-plugin => variable}/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumberSettings.kt (100%) rename plugins/{variable-plugin => variable}/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumberVariableWidget.kt (100%) rename plugins/{variable-plugin => variable}/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumbersSettingsViewHolder.kt (100%) rename plugins/{variable-plugin => variable}/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumbersViewHolder.kt (100%) rename plugins/{variable-plugin => variable}/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/ShortVariableWidget.kt (100%) rename plugins/{variable-plugin => variable}/src/main/res/layout/fragment_variable.xml (100%) rename plugins/{variable-plugin => variable}/src/main/res/layout/item_variable.xml (100%) rename plugins/{variable-plugin => variable}/src/main/res/layout/item_variable_boolean.xml (100%) rename plugins/{variable-plugin => variable}/src/main/res/layout/item_variable_number.xml (100%) rename plugins/{variable-plugin => variable}/src/main/res/layout/item_variable_number_settings.xml (100%) rename plugins/{variable-plugin => variable}/src/main/res/layout/item_variable_string.xml (100%) rename plugins/{variable-plugin => variable}/src/main/res/values/strings.xml (100%) diff --git a/plugins/variable-plugin/.gitignore b/plugins/variable/.gitignore similarity index 100% rename from plugins/variable-plugin/.gitignore rename to plugins/variable/.gitignore diff --git a/plugins/variable-plugin/build.gradle.kts b/plugins/variable/build.gradle.kts similarity index 100% rename from plugins/variable-plugin/build.gradle.kts rename to plugins/variable/build.gradle.kts diff --git a/plugins/variable-plugin/consumer-rules.pro b/plugins/variable/consumer-rules.pro similarity index 100% rename from plugins/variable-plugin/consumer-rules.pro rename to plugins/variable/consumer-rules.pro diff --git a/plugins/variable-plugin/library.properties b/plugins/variable/library.properties similarity index 100% rename from plugins/variable-plugin/library.properties rename to plugins/variable/library.properties diff --git a/plugins/variable-plugin/proguard-rules.pro b/plugins/variable/proguard-rules.pro similarity index 100% rename from plugins/variable-plugin/proguard-rules.pro rename to plugins/variable/proguard-rules.pro diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/data/VariableRepository.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/data/VariableRepository.kt similarity index 100% rename from plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/data/VariableRepository.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/data/VariableRepository.kt diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/extensions/String.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/extensions/String.kt similarity index 100% rename from plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/extensions/String.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/extensions/String.kt diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePlugin.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePlugin.kt similarity index 100% rename from plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePlugin.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePlugin.kt diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePluginContainer.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePluginContainer.kt similarity index 100% rename from plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePluginContainer.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePluginContainer.kt diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableFragment.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableFragment.kt similarity index 100% rename from plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableFragment.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableFragment.kt diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableViewModel.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableViewModel.kt similarity index 100% rename from plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableViewModel.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableViewModel.kt diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/model/VariableEvent.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/model/VariableEvent.kt similarity index 100% rename from plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/model/VariableEvent.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/model/VariableEvent.kt diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableAdapter.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableAdapter.kt similarity index 100% rename from plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableAdapter.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableAdapter.kt diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableItemDiffCallback.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableItemDiffCallback.kt similarity index 100% rename from plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableItemDiffCallback.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableItemDiffCallback.kt diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableViewHolder.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableViewHolder.kt similarity index 100% rename from plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableViewHolder.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableViewHolder.kt diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/BooleanVariableWidget.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/BooleanVariableWidget.kt similarity index 100% rename from plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/BooleanVariableWidget.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/BooleanVariableWidget.kt diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/StringVariableWidget.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/StringVariableWidget.kt similarity index 100% rename from plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/StringVariableWidget.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/StringVariableWidget.kt diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/DoubleVariableWidget.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/DoubleVariableWidget.kt similarity index 100% rename from plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/DoubleVariableWidget.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/DoubleVariableWidget.kt diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/FloatVariableWidget.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/FloatVariableWidget.kt similarity index 100% rename from plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/FloatVariableWidget.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/FloatVariableWidget.kt diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/IntVariableWidget.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/IntVariableWidget.kt similarity index 100% rename from plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/IntVariableWidget.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/IntVariableWidget.kt diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/LongVariableWidget.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/LongVariableWidget.kt similarity index 100% rename from plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/LongVariableWidget.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/LongVariableWidget.kt diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumberSettings.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumberSettings.kt similarity index 100% rename from plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumberSettings.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumberSettings.kt diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumberVariableWidget.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumberVariableWidget.kt similarity index 100% rename from plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumberVariableWidget.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumberVariableWidget.kt diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumbersSettingsViewHolder.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumbersSettingsViewHolder.kt similarity index 100% rename from plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumbersSettingsViewHolder.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumbersSettingsViewHolder.kt diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumbersViewHolder.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumbersViewHolder.kt similarity index 100% rename from plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumbersViewHolder.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumbersViewHolder.kt diff --git a/plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/ShortVariableWidget.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/ShortVariableWidget.kt similarity index 100% rename from plugins/variable-plugin/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/ShortVariableWidget.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/ShortVariableWidget.kt diff --git a/plugins/variable-plugin/src/main/res/layout/fragment_variable.xml b/plugins/variable/src/main/res/layout/fragment_variable.xml similarity index 100% rename from plugins/variable-plugin/src/main/res/layout/fragment_variable.xml rename to plugins/variable/src/main/res/layout/fragment_variable.xml diff --git a/plugins/variable-plugin/src/main/res/layout/item_variable.xml b/plugins/variable/src/main/res/layout/item_variable.xml similarity index 100% rename from plugins/variable-plugin/src/main/res/layout/item_variable.xml rename to plugins/variable/src/main/res/layout/item_variable.xml diff --git a/plugins/variable-plugin/src/main/res/layout/item_variable_boolean.xml b/plugins/variable/src/main/res/layout/item_variable_boolean.xml similarity index 100% rename from plugins/variable-plugin/src/main/res/layout/item_variable_boolean.xml rename to plugins/variable/src/main/res/layout/item_variable_boolean.xml diff --git a/plugins/variable-plugin/src/main/res/layout/item_variable_number.xml b/plugins/variable/src/main/res/layout/item_variable_number.xml similarity index 100% rename from plugins/variable-plugin/src/main/res/layout/item_variable_number.xml rename to plugins/variable/src/main/res/layout/item_variable_number.xml diff --git a/plugins/variable-plugin/src/main/res/layout/item_variable_number_settings.xml b/plugins/variable/src/main/res/layout/item_variable_number_settings.xml similarity index 100% rename from plugins/variable-plugin/src/main/res/layout/item_variable_number_settings.xml rename to plugins/variable/src/main/res/layout/item_variable_number_settings.xml diff --git a/plugins/variable-plugin/src/main/res/layout/item_variable_string.xml b/plugins/variable/src/main/res/layout/item_variable_string.xml similarity index 100% rename from plugins/variable-plugin/src/main/res/layout/item_variable_string.xml rename to plugins/variable/src/main/res/layout/item_variable_string.xml diff --git a/plugins/variable-plugin/src/main/res/values/strings.xml b/plugins/variable/src/main/res/values/strings.xml similarity index 100% rename from plugins/variable-plugin/src/main/res/values/strings.xml rename to plugins/variable/src/main/res/values/strings.xml diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index 5ca06dde..0686960c 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -48,7 +48,7 @@ dependencies { debugImplementation(project(":plugins:accounts")) debugImplementation(project(":plugins:app-settings")) debugImplementation(project(":plugins:flipper")) - debugImplementation(project(":plugins:variable-plugin")) + debugImplementation(project(":plugins:variable")) // debugImplementation("com.redmadrobot.debug:panel-core:${project.version}") // debugImplementation("com.redmadrobot.debug:accounts-plugin:${project.version}") // debugImplementation("com.redmadrobot.debug:servers-plugin:${project.version}") diff --git a/settings.gradle.kts b/settings.gradle.kts index 327609da..4756dd6e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -42,7 +42,7 @@ include( ":plugins:servers", ":plugins:app-settings", ":plugins:flipper", - ":plugins:variable-plugin" + ":plugins:variable" ) include(":sample") From 910fa1fb57b2186e7d820e1dcf2a97d68b7fb2b5 Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Tue, 6 Dec 2022 12:16:09 +0300 Subject: [PATCH 20/42] Variable: Rename 'variable-plugin' package to 'com.redmadrobot.debug.variable' --- .../debug/noop/variable/VariablePlugin.kt | 2 +- .../variable}/data/VariableRepository.kt | 8 ++++---- .../variable}/extensions/String.kt | 2 +- .../variable}/plugin/VariablePlugin.kt | 4 ++-- .../plugin/VariablePluginContainer.kt | 18 +++++++++++------- .../variable}/ui/VariableFragment.kt | 8 ++++---- .../variable}/ui/VariableViewModel.kt | 13 ++++++------- .../variable}/ui/model/VariableEvent.kt | 4 ++-- .../variable}/ui/recycler/VariableAdapter.kt | 10 +++++----- .../ui/recycler/VariableItemDiffCallback.kt | 4 ++-- .../ui/recycler/VariableViewHolder.kt | 10 +++++----- .../ui/widgets/BooleanVariableWidget.kt | 8 ++++---- .../ui/widgets/StringVariableWidget.kt | 8 ++++---- .../ui/widgets/numbers/DoubleVariableWidget.kt | 2 +- .../ui/widgets/numbers/FloatVariableWidget.kt | 2 +- .../ui/widgets/numbers/IntVariableWidget.kt | 2 +- .../ui/widgets/numbers/LongVariableWidget.kt | 2 +- .../ui/widgets/numbers/NumberSettings.kt | 6 +++--- .../ui/widgets/numbers/NumberVariableWidget.kt | 10 +++++----- .../numbers/NumbersSettingsViewHolder.kt | 4 ++-- .../ui/widgets/numbers/NumbersViewHolder.kt | 10 +++++----- .../ui/widgets/numbers/ShortVariableWidget.kt | 2 +- .../debug_data/DebugAccountsProvider.kt | 2 +- .../debug_data/DebugVariableWidgetsProvider.kt | 6 +++++- 24 files changed, 77 insertions(+), 70 deletions(-) rename plugins/variable/src/main/kotlin/com/redmadrobot/{variable_plugin => debug/variable}/data/VariableRepository.kt (94%) rename plugins/variable/src/main/kotlin/com/redmadrobot/{variable_plugin => debug/variable}/extensions/String.kt (92%) rename plugins/variable/src/main/kotlin/com/redmadrobot/{variable_plugin => debug/variable}/plugin/VariablePlugin.kt (96%) rename plugins/variable/src/main/kotlin/com/redmadrobot/{variable_plugin => debug/variable}/plugin/VariablePluginContainer.kt (56%) rename plugins/variable/src/main/kotlin/com/redmadrobot/{variable_plugin => debug/variable}/ui/VariableFragment.kt (88%) rename plugins/variable/src/main/kotlin/com/redmadrobot/{variable_plugin => debug/variable}/ui/VariableViewModel.kt (79%) rename plugins/variable/src/main/kotlin/com/redmadrobot/{variable_plugin => debug/variable}/ui/model/VariableEvent.kt (78%) rename plugins/variable/src/main/kotlin/com/redmadrobot/{variable_plugin => debug/variable}/ui/recycler/VariableAdapter.kt (82%) rename plugins/variable/src/main/kotlin/com/redmadrobot/{variable_plugin => debug/variable}/ui/recycler/VariableItemDiffCallback.kt (79%) rename plugins/variable/src/main/kotlin/com/redmadrobot/{variable_plugin => debug/variable}/ui/recycler/VariableViewHolder.kt (88%) rename plugins/variable/src/main/kotlin/com/redmadrobot/{variable_plugin => debug/variable}/ui/widgets/BooleanVariableWidget.kt (81%) rename plugins/variable/src/main/kotlin/com/redmadrobot/{variable_plugin => debug/variable}/ui/widgets/StringVariableWidget.kt (84%) rename plugins/variable/src/main/kotlin/com/redmadrobot/{variable_plugin => debug/variable}/ui/widgets/numbers/DoubleVariableWidget.kt (58%) rename plugins/variable/src/main/kotlin/com/redmadrobot/{variable_plugin => debug/variable}/ui/widgets/numbers/FloatVariableWidget.kt (57%) rename plugins/variable/src/main/kotlin/com/redmadrobot/{variable_plugin => debug/variable}/ui/widgets/numbers/IntVariableWidget.kt (55%) rename plugins/variable/src/main/kotlin/com/redmadrobot/{variable_plugin => debug/variable}/ui/widgets/numbers/LongVariableWidget.kt (56%) rename plugins/variable/src/main/kotlin/com/redmadrobot/{variable_plugin => debug/variable}/ui/widgets/numbers/NumberSettings.kt (82%) rename plugins/variable/src/main/kotlin/com/redmadrobot/{variable_plugin => debug/variable}/ui/widgets/numbers/NumberVariableWidget.kt (79%) rename plugins/variable/src/main/kotlin/com/redmadrobot/{variable_plugin => debug/variable}/ui/widgets/numbers/NumbersSettingsViewHolder.kt (88%) rename plugins/variable/src/main/kotlin/com/redmadrobot/{variable_plugin => debug/variable}/ui/widgets/numbers/NumbersViewHolder.kt (85%) rename plugins/variable/src/main/kotlin/com/redmadrobot/{variable_plugin => debug/variable}/ui/widgets/numbers/ShortVariableWidget.kt (57%) diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/variable/VariablePlugin.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/variable/VariablePlugin.kt index 505b8cfb..817cad58 100644 --- a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/variable/VariablePlugin.kt +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/variable/VariablePlugin.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.variable_plugin.plugin +package com.redmadrobot.debug.variable.plugin import kotlin.reflect.KClass diff --git a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/data/VariableRepository.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/data/VariableRepository.kt similarity index 94% rename from plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/data/VariableRepository.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/data/VariableRepository.kt index 4a5cb7db..3bca6939 100644 --- a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/data/VariableRepository.kt +++ b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/data/VariableRepository.kt @@ -1,9 +1,9 @@ -package com.redmadrobot.variable_plugin.data +package com.redmadrobot.debug.variable.data import androidx.collection.ArrayMap -import com.redmadrobot.variable_plugin.plugin.VariableItem -import com.redmadrobot.variable_plugin.plugin.VariableWidget -import com.redmadrobot.variable_plugin.plugin.VariableWidgetSettings +import com.redmadrobot.debug.variable.plugin.VariableItem +import com.redmadrobot.debug.variable.plugin.VariableWidget +import com.redmadrobot.debug.variable.plugin.VariableWidgetSettings import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow diff --git a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/extensions/String.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/extensions/String.kt similarity index 92% rename from plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/extensions/String.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/extensions/String.kt index 9c99b433..79fa6c5f 100644 --- a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/extensions/String.kt +++ b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/extensions/String.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.variable_plugin.extensions +package com.redmadrobot.debug.variable.extensions import kotlin.reflect.KClass diff --git a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePlugin.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/plugin/VariablePlugin.kt similarity index 96% rename from plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePlugin.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/plugin/VariablePlugin.kt index 3340c027..88113a92 100644 --- a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePlugin.kt +++ b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/plugin/VariablePlugin.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.variable_plugin.plugin +package com.redmadrobot.debug.variable.plugin import android.view.View import android.view.ViewGroup @@ -7,7 +7,7 @@ import com.redmadrobot.debug.core.CommonContainer import com.redmadrobot.debug.core.extension.getPlugin import com.redmadrobot.debug.core.plugin.Plugin import com.redmadrobot.debug.core.plugin.PluginDependencyContainer -import com.redmadrobot.variable_plugin.ui.VariableFragment +import com.redmadrobot.debug.variable.ui.VariableFragment import kotlin.reflect.KClass public class VariablePlugin( diff --git a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePluginContainer.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/plugin/VariablePluginContainer.kt similarity index 56% rename from plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePluginContainer.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/plugin/VariablePluginContainer.kt index acaad5d1..85850c44 100644 --- a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/plugin/VariablePluginContainer.kt +++ b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/plugin/VariablePluginContainer.kt @@ -1,12 +1,16 @@ -package com.redmadrobot.variable_plugin.plugin +package com.redmadrobot.debug.variable.plugin import com.redmadrobot.debug.core.CommonContainer import com.redmadrobot.debug.core.plugin.PluginDependencyContainer -import com.redmadrobot.variable_plugin.data.VariableRepository -import com.redmadrobot.variable_plugin.ui.VariableViewModel -import com.redmadrobot.variable_plugin.ui.widgets.BooleanVariableWidget -import com.redmadrobot.variable_plugin.ui.widgets.StringVariableWidget -import com.redmadrobot.variable_plugin.ui.widgets.numbers.* +import com.redmadrobot.debug.variable.ui.VariableViewModel +import com.redmadrobot.debug.variable.ui.widgets.BooleanVariableWidget +import com.redmadrobot.debug.variable.ui.widgets.StringVariableWidget +import com.redmadrobot.debug.variable.ui.widgets.numbers.DoubleVariableWidget +import com.redmadrobot.debug.variable.ui.widgets.numbers.FloatVariableWidget +import com.redmadrobot.debug.variable.ui.widgets.numbers.IntVariableWidget +import com.redmadrobot.debug.variable.ui.widgets.numbers.LongVariableWidget +import com.redmadrobot.debug.variable.ui.widgets.numbers.ShortVariableWidget + internal class VariablePluginContainer( private val container: CommonContainer, @@ -14,7 +18,7 @@ internal class VariablePluginContainer( ) : PluginDependencyContainer { val variableRepository by lazy(LazyThreadSafetyMode.NONE) { - VariableRepository().apply { + com.redmadrobot.debug.variable.data.VariableRepository().apply { addWidget(IntVariableWidget()) addWidget(LongVariableWidget()) addWidget(ShortVariableWidget()) diff --git a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableFragment.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/VariableFragment.kt similarity index 88% rename from plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableFragment.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/VariableFragment.kt index d04734c6..aae016a5 100644 --- a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableFragment.kt +++ b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/VariableFragment.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.variable_plugin.ui +package com.redmadrobot.debug.variable.ui import android.os.Bundle import android.view.View @@ -6,11 +6,11 @@ import androidx.fragment.app.Fragment import androidx.lifecycle.lifecycleScope import com.redmadrobot.debug.common.extension.obtainShareViewModel import com.redmadrobot.debug.core.extension.getPlugin +import com.redmadrobot.debug.variable.plugin.VariablePlugin +import com.redmadrobot.debug.variable.plugin.VariablePluginContainer +import com.redmadrobot.debug.variable.ui.recycler.VariableAdapter import com.redmadrobot.variable_plugin.R import com.redmadrobot.variable_plugin.databinding.FragmentVariableBinding -import com.redmadrobot.variable_plugin.plugin.VariablePlugin -import com.redmadrobot.variable_plugin.plugin.VariablePluginContainer -import com.redmadrobot.variable_plugin.ui.recycler.VariableAdapter import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach diff --git a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableViewModel.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/VariableViewModel.kt similarity index 79% rename from plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableViewModel.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/VariableViewModel.kt index dba76002..fb5e3e0a 100644 --- a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/VariableViewModel.kt +++ b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/VariableViewModel.kt @@ -1,16 +1,15 @@ -package com.redmadrobot.variable_plugin.ui +package com.redmadrobot.debug.variable.ui import com.redmadrobot.debug.common.base.PluginViewModel -import com.redmadrobot.variable_plugin.data.VariableRepository -import com.redmadrobot.variable_plugin.plugin.VariableItem -import com.redmadrobot.variable_plugin.plugin.VariableWidget -import com.redmadrobot.variable_plugin.plugin.VariableWidgetSettings -import com.redmadrobot.variable_plugin.ui.model.VariableEvent +import com.redmadrobot.debug.variable.plugin.VariableItem +import com.redmadrobot.debug.variable.plugin.VariableWidget +import com.redmadrobot.debug.variable.plugin.VariableWidgetSettings +import com.redmadrobot.debug.variable.ui.model.VariableEvent import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.map internal class VariableViewModel( - private val repository: VariableRepository, + private val repository: com.redmadrobot.debug.variable.data.VariableRepository, ) : PluginViewModel() { val modifiers: Flow>> diff --git a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/model/VariableEvent.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/model/VariableEvent.kt similarity index 78% rename from plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/model/VariableEvent.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/model/VariableEvent.kt index bbcb4b64..1ee3e95a 100644 --- a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/model/VariableEvent.kt +++ b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/model/VariableEvent.kt @@ -1,6 +1,6 @@ -package com.redmadrobot.variable_plugin.ui.model +package com.redmadrobot.debug.variable.ui.model -import com.redmadrobot.variable_plugin.plugin.VariableWidgetSettings +import com.redmadrobot.debug.variable.plugin.VariableWidgetSettings internal sealed interface VariableEvent { diff --git a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableAdapter.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/recycler/VariableAdapter.kt similarity index 82% rename from plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableAdapter.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/recycler/VariableAdapter.kt index d3d3ce13..f5e129c2 100644 --- a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableAdapter.kt +++ b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/recycler/VariableAdapter.kt @@ -1,13 +1,13 @@ -package com.redmadrobot.variable_plugin.ui.recycler +package com.redmadrobot.debug.variable.ui.recycler import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.ListAdapter +import com.redmadrobot.debug.variable.plugin.VariableItem +import com.redmadrobot.debug.variable.plugin.VariableWidget +import com.redmadrobot.debug.variable.plugin.VariableWidgetSettings +import com.redmadrobot.debug.variable.ui.model.VariableEvent import com.redmadrobot.variable_plugin.databinding.ItemVariableBinding -import com.redmadrobot.variable_plugin.plugin.VariableItem -import com.redmadrobot.variable_plugin.plugin.VariableWidget -import com.redmadrobot.variable_plugin.plugin.VariableWidgetSettings -import com.redmadrobot.variable_plugin.ui.model.VariableEvent internal class VariableAdapter( private val onEventAction: (event: VariableEvent) -> Unit, diff --git a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableItemDiffCallback.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/recycler/VariableItemDiffCallback.kt similarity index 79% rename from plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableItemDiffCallback.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/recycler/VariableItemDiffCallback.kt index a1935195..bdd9a290 100644 --- a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableItemDiffCallback.kt +++ b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/recycler/VariableItemDiffCallback.kt @@ -1,7 +1,7 @@ -package com.redmadrobot.variable_plugin.ui.recycler +package com.redmadrobot.debug.variable.ui.recycler import androidx.recyclerview.widget.DiffUtil -import com.redmadrobot.variable_plugin.plugin.VariableItem +import com.redmadrobot.debug.variable.plugin.VariableItem internal class VariableItemDiffCallback : DiffUtil.ItemCallback>() { diff --git a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableViewHolder.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/recycler/VariableViewHolder.kt similarity index 88% rename from plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableViewHolder.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/recycler/VariableViewHolder.kt index a0d212e6..8cb2d824 100644 --- a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/recycler/VariableViewHolder.kt +++ b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/recycler/VariableViewHolder.kt @@ -1,14 +1,14 @@ -package com.redmadrobot.variable_plugin.ui.recycler +package com.redmadrobot.debug.variable.ui.recycler import android.view.View import androidx.core.view.isGone import androidx.core.view.isVisible import androidx.recyclerview.widget.RecyclerView +import com.redmadrobot.debug.variable.plugin.VariableItem +import com.redmadrobot.debug.variable.plugin.VariableWidget +import com.redmadrobot.debug.variable.plugin.VariableWidgetSettings +import com.redmadrobot.debug.variable.ui.model.VariableEvent import com.redmadrobot.variable_plugin.databinding.ItemVariableBinding -import com.redmadrobot.variable_plugin.plugin.VariableItem -import com.redmadrobot.variable_plugin.plugin.VariableWidget -import com.redmadrobot.variable_plugin.plugin.VariableWidgetSettings -import com.redmadrobot.variable_plugin.ui.model.VariableEvent internal class VariableViewHolder( itemView: View, diff --git a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/BooleanVariableWidget.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/BooleanVariableWidget.kt similarity index 81% rename from plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/BooleanVariableWidget.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/BooleanVariableWidget.kt index 7e6ee5a0..f1ba3024 100644 --- a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/BooleanVariableWidget.kt +++ b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/BooleanVariableWidget.kt @@ -1,12 +1,12 @@ -package com.redmadrobot.variable_plugin.ui.widgets +package com.redmadrobot.debug.variable.ui.widgets import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import com.redmadrobot.debug.variable.plugin.VariableItem +import com.redmadrobot.debug.variable.plugin.VariableWidget +import com.redmadrobot.debug.variable.plugin.VariableWidgetViewHolder import com.redmadrobot.variable_plugin.databinding.ItemVariableBooleanBinding -import com.redmadrobot.variable_plugin.plugin.VariableItem -import com.redmadrobot.variable_plugin.plugin.VariableWidget -import com.redmadrobot.variable_plugin.plugin.VariableWidgetViewHolder internal class BooleanVariableWidget : VariableWidget(Boolean::class){ diff --git a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/StringVariableWidget.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/StringVariableWidget.kt similarity index 84% rename from plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/StringVariableWidget.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/StringVariableWidget.kt index 19c82567..a7be38ba 100644 --- a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/StringVariableWidget.kt +++ b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/StringVariableWidget.kt @@ -1,14 +1,14 @@ -package com.redmadrobot.variable_plugin.ui.widgets +package com.redmadrobot.debug.variable.ui.widgets import android.text.TextWatcher import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.core.widget.addTextChangedListener +import com.redmadrobot.debug.variable.plugin.VariableItem +import com.redmadrobot.debug.variable.plugin.VariableWidget +import com.redmadrobot.debug.variable.plugin.VariableWidgetViewHolder import com.redmadrobot.variable_plugin.databinding.ItemVariableStringBinding -import com.redmadrobot.variable_plugin.plugin.VariableItem -import com.redmadrobot.variable_plugin.plugin.VariableWidget -import com.redmadrobot.variable_plugin.plugin.VariableWidgetViewHolder internal class StringVariableWidget : VariableWidget(String::class) { diff --git a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/DoubleVariableWidget.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/DoubleVariableWidget.kt similarity index 58% rename from plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/DoubleVariableWidget.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/DoubleVariableWidget.kt index 4e53ef34..7fe7a431 100644 --- a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/DoubleVariableWidget.kt +++ b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/DoubleVariableWidget.kt @@ -1,3 +1,3 @@ -package com.redmadrobot.variable_plugin.ui.widgets.numbers +package com.redmadrobot.debug.variable.ui.widgets.numbers internal class DoubleVariableWidget : NumberVariableWidget(Double::class) diff --git a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/FloatVariableWidget.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/FloatVariableWidget.kt similarity index 57% rename from plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/FloatVariableWidget.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/FloatVariableWidget.kt index 92584fc4..71afe137 100644 --- a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/FloatVariableWidget.kt +++ b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/FloatVariableWidget.kt @@ -1,3 +1,3 @@ -package com.redmadrobot.variable_plugin.ui.widgets.numbers +package com.redmadrobot.debug.variable.ui.widgets.numbers internal class FloatVariableWidget : NumberVariableWidget(Float::class) diff --git a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/IntVariableWidget.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/IntVariableWidget.kt similarity index 55% rename from plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/IntVariableWidget.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/IntVariableWidget.kt index 2becf391..1d230c69 100644 --- a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/IntVariableWidget.kt +++ b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/IntVariableWidget.kt @@ -1,3 +1,3 @@ -package com.redmadrobot.variable_plugin.ui.widgets.numbers +package com.redmadrobot.debug.variable.ui.widgets.numbers internal class IntVariableWidget : NumberVariableWidget(Int::class) diff --git a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/LongVariableWidget.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/LongVariableWidget.kt similarity index 56% rename from plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/LongVariableWidget.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/LongVariableWidget.kt index 00dd54a5..8d4b2871 100644 --- a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/LongVariableWidget.kt +++ b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/LongVariableWidget.kt @@ -1,3 +1,3 @@ -package com.redmadrobot.variable_plugin.ui.widgets.numbers +package com.redmadrobot.debug.variable.ui.widgets.numbers internal class LongVariableWidget : NumberVariableWidget(Long::class) diff --git a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumberSettings.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/NumberSettings.kt similarity index 82% rename from plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumberSettings.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/NumberSettings.kt index d7103d29..bcac929b 100644 --- a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumberSettings.kt +++ b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/NumberSettings.kt @@ -1,7 +1,7 @@ -package com.redmadrobot.variable_plugin.ui.widgets.numbers +package com.redmadrobot.debug.variable.ui.widgets.numbers -import com.redmadrobot.variable_plugin.plugin.VariableItem -import com.redmadrobot.variable_plugin.plugin.VariableWidgetSettings +import com.redmadrobot.debug.variable.plugin.VariableItem +import com.redmadrobot.debug.variable.plugin.VariableWidgetSettings internal open class NumberSettings( var incrementStep: Double = .0, diff --git a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumberVariableWidget.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/NumberVariableWidget.kt similarity index 79% rename from plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumberVariableWidget.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/NumberVariableWidget.kt index 564ea653..a4648b32 100644 --- a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumberVariableWidget.kt +++ b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/NumberVariableWidget.kt @@ -1,14 +1,14 @@ -package com.redmadrobot.variable_plugin.ui.widgets.numbers +package com.redmadrobot.debug.variable.ui.widgets.numbers import android.text.InputFilter import android.view.LayoutInflater import android.view.ViewGroup +import com.redmadrobot.debug.variable.plugin.VariableWidget +import com.redmadrobot.debug.variable.plugin.VariableWidgetSettings +import com.redmadrobot.debug.variable.plugin.VariableWidgetSettingsViewHolder +import com.redmadrobot.debug.variable.plugin.VariableWidgetViewHolder import com.redmadrobot.variable_plugin.databinding.ItemVariableNumberBinding import com.redmadrobot.variable_plugin.databinding.ItemVariableNumberSettingsBinding -import com.redmadrobot.variable_plugin.plugin.VariableWidget -import com.redmadrobot.variable_plugin.plugin.VariableWidgetSettings -import com.redmadrobot.variable_plugin.plugin.VariableWidgetSettingsViewHolder -import com.redmadrobot.variable_plugin.plugin.VariableWidgetViewHolder import kotlin.reflect.KClass internal abstract class NumberVariableWidget( diff --git a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumbersSettingsViewHolder.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/NumbersSettingsViewHolder.kt similarity index 88% rename from plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumbersSettingsViewHolder.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/NumbersSettingsViewHolder.kt index 7a6012cb..918b34ea 100644 --- a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumbersSettingsViewHolder.kt +++ b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/NumbersSettingsViewHolder.kt @@ -1,10 +1,10 @@ -package com.redmadrobot.variable_plugin.ui.widgets.numbers +package com.redmadrobot.debug.variable.ui.widgets.numbers import android.text.TextWatcher import android.view.View import androidx.core.widget.addTextChangedListener +import com.redmadrobot.debug.variable.plugin.VariableWidgetSettingsViewHolder import com.redmadrobot.variable_plugin.databinding.ItemVariableNumberSettingsBinding -import com.redmadrobot.variable_plugin.plugin.VariableWidgetSettingsViewHolder internal open class NumbersSettingsViewHolder>( itemView: View, diff --git a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumbersViewHolder.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/NumbersViewHolder.kt similarity index 85% rename from plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumbersViewHolder.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/NumbersViewHolder.kt index e6b0b85d..26f70789 100644 --- a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/NumbersViewHolder.kt +++ b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/NumbersViewHolder.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.variable_plugin.ui.widgets.numbers +package com.redmadrobot.debug.variable.ui.widgets.numbers import android.os.Build import android.text.InputFilter @@ -6,11 +6,11 @@ import android.text.TextWatcher import android.text.method.DigitsKeyListener import android.view.View import androidx.core.widget.addTextChangedListener +import com.redmadrobot.debug.variable.extensions.toNumberSafe +import com.redmadrobot.debug.variable.plugin.VariableItem +import com.redmadrobot.debug.variable.plugin.VariableWidgetViewHolder import com.redmadrobot.variable_plugin.databinding.ItemVariableNumberBinding -import com.redmadrobot.variable_plugin.extensions.toNumberSafe -import com.redmadrobot.variable_plugin.plugin.VariableItem -import com.redmadrobot.variable_plugin.plugin.VariableWidgetViewHolder -import java.util.* +import java.util.Locale import kotlin.reflect.KClass internal open class NumbersViewHolder( diff --git a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/ShortVariableWidget.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/ShortVariableWidget.kt similarity index 57% rename from plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/ShortVariableWidget.kt rename to plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/ShortVariableWidget.kt index d1e6db39..ccba1364 100644 --- a/plugins/variable/src/main/kotlin/com/redmadrobot/variable_plugin/ui/widgets/numbers/ShortVariableWidget.kt +++ b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/ui/widgets/numbers/ShortVariableWidget.kt @@ -1,3 +1,3 @@ -package com.redmadrobot.variable_plugin.ui.widgets.numbers +package com.redmadrobot.debug.variable.ui.widgets.numbers internal class ShortVariableWidget : NumberVariableWidget(Short::class) diff --git a/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugAccountsProvider.kt b/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugAccountsProvider.kt index 5bd924dd..e18015f6 100644 --- a/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugAccountsProvider.kt +++ b/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugAccountsProvider.kt @@ -1,6 +1,6 @@ package com.redmadrobot.debug_sample.debug_data -import com.redmadrobot.debug.account.data.model.DebugAccount +import com.redmadrobot.debug.accounts.data.model.DebugAccount import com.redmadrobot.debug.core.data.DebugDataProvider class DebugAccountsProvider : DebugDataProvider> { diff --git a/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugVariableWidgetsProvider.kt b/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugVariableWidgetsProvider.kt index b521d3f1..007a362c 100644 --- a/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugVariableWidgetsProvider.kt +++ b/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugVariableWidgetsProvider.kt @@ -9,8 +9,12 @@ import android.view.ViewGroup import android.widget.EditText import androidx.annotation.RequiresApi import com.redmadrobot.debug.core.data.DebugDataProvider +import com.redmadrobot.debug.variable.plugin.VariableItem +import com.redmadrobot.debug.variable.plugin.VariableWidget +import com.redmadrobot.debug.variable.plugin.VariableWidgetSettings +import com.redmadrobot.debug.variable.plugin.VariableWidgetSettingsViewHolder +import com.redmadrobot.debug.variable.plugin.VariableWidgetViewHolder import com.redmadrobot.debugpanel.R -import com.redmadrobot.variable_plugin.plugin.* import java.time.LocalDateTime import java.time.Year import java.time.format.DateTimeFormatter From e3b10b019af15c5ba5233783535f8eb9e0e11bba Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Tue, 6 Dec 2022 12:27:36 +0300 Subject: [PATCH 21/42] Common: Fix package names for release build --- .../redmadrobot/debug/noop/accounts/AccountSelectedEvent.kt | 2 +- .../com/redmadrobot/debug/noop/accounts/AccountsPlugin.kt | 2 +- .../com/redmadrobot/debug/noop/servers/ServersPlugin.kt | 2 +- sample/build.gradle.kts | 5 +++++ sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt | 2 +- .../main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt | 2 +- .../debug_sample/debug_data/DebugAccountsProvider.kt | 4 ++-- .../debug_sample/debug_data/DebugFlipperFeaturesProvider.kt | 5 ++--- .../debug_sample/debug_data/DebugServersProvider.kt | 5 ++--- .../debug_sample/debug_data/DebugVariableWidgetsProvider.kt | 4 ++-- 10 files changed, 18 insertions(+), 15 deletions(-) diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/AccountSelectedEvent.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/AccountSelectedEvent.kt index 51af7bda..53f8d2b5 100644 --- a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/AccountSelectedEvent.kt +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/AccountSelectedEvent.kt @@ -1,6 +1,6 @@ package com.redmadrobot.debug.account.plugin import com.redmadrobot.debug.account.data.model.DebugAccount -import com.redmadrobot.debug_panel_core.internal.DebugEvent +import com.redmadrobot.debug.core.internal.DebugEvent data class AccountSelectedEvent(val debugAccount: DebugAccount) : DebugEvent diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/AccountsPlugin.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/AccountsPlugin.kt index c70b911d..67027452 100644 --- a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/AccountsPlugin.kt +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/AccountsPlugin.kt @@ -1,7 +1,7 @@ package com.redmadrobot.debug.account.plugin import com.redmadrobot.debug.account.data.model.DebugAccount -import com.redmadrobot.debug_panel_core.data.DebugDataProvider +import com.redmadrobot.debug.core.data.DebugDataProvider import java.util.Collections.emptyList class AccountsPlugin( diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/ServersPlugin.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/ServersPlugin.kt index 6331c5a0..03ad3a6f 100644 --- a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/ServersPlugin.kt +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/ServersPlugin.kt @@ -1,7 +1,7 @@ package com.redmadrobot.debug.servers.plugin import com.redmadrobot.debug.servers.data.model.DebugServer -import com.redmadrobot.debug_panel_core.data.DebugDataProvider +import com.redmadrobot.debug.core.data.DebugDataProvider import java.util.Collections.emptyList class ServersPlugin( diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index 0686960c..c49e3616 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -29,6 +29,11 @@ android { composeOptions { kotlinCompilerExtensionVersion = androidx.versions.compose.compiler.get() } + buildTypes { + getByName("release") { + signingConfig = signingConfigs.getByName("debug") + } + } } dependencies { diff --git a/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt b/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt index e54e335a..a846ad89 100644 --- a/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt +++ b/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt @@ -15,7 +15,7 @@ import com.redmadrobot.debug_sample.storage.AppTestSettings import com.redmadrobot.debug.flipper.plugin.FlipperPlugin import com.redmadrobot.debug.servers.data.model.DebugServer import com.redmadrobot.debug.servers.plugin.ServersPlugin -import com.redmadrobot.variable_plugin.plugin.VariablePlugin +import com.redmadrobot.debug.variable.plugin.VariablePlugin class App : Application() { override fun onCreate() { diff --git a/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt b/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt index a3f9b286..c7f2c61a 100644 --- a/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt +++ b/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt @@ -15,7 +15,7 @@ import com.redmadrobot.debugpanel.databinding.ActivityMainBinding import com.redmadrobot.flipper.config.FlipperValue import com.redmadrobot.debug.flipper.plugin.FlipperPlugin import com.redmadrobot.debug.servers.plugin.ServerSelectedEvent -import com.redmadrobot.variable_plugin.plugin.asDebugVariable +import com.redmadrobot.debug.variable.plugin.asDebugVariable import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope diff --git a/sample/src/release/kotlin/com/redmadrobot/debug_sample/debug_data/DebugAccountsProvider.kt b/sample/src/release/kotlin/com/redmadrobot/debug_sample/debug_data/DebugAccountsProvider.kt index 7b748500..1838cc7e 100644 --- a/sample/src/release/kotlin/com/redmadrobot/debug_sample/debug_data/DebugAccountsProvider.kt +++ b/sample/src/release/kotlin/com/redmadrobot/debug_sample/debug_data/DebugAccountsProvider.kt @@ -1,7 +1,7 @@ package com.redmadrobot.debug_sample.debug_data -import com.redmadrobot.account_plugin.data.model.DebugAccount -import com.redmadrobot.debug_panel_core.data.DebugDataProvider +import com.redmadrobot.debug.account.data.model.DebugAccount +import com.redmadrobot.debug.core.data.DebugDataProvider class DebugAccountsProvider : DebugDataProvider> { diff --git a/sample/src/release/kotlin/com/redmadrobot/debug_sample/debug_data/DebugFlipperFeaturesProvider.kt b/sample/src/release/kotlin/com/redmadrobot/debug_sample/debug_data/DebugFlipperFeaturesProvider.kt index 47dda9d7..597cad05 100644 --- a/sample/src/release/kotlin/com/redmadrobot/debug_sample/debug_data/DebugFlipperFeaturesProvider.kt +++ b/sample/src/release/kotlin/com/redmadrobot/debug_sample/debug_data/DebugFlipperFeaturesProvider.kt @@ -1,8 +1,7 @@ package com.redmadrobot.debug_sample.debug_data -import com.redmadrobot.debug_panel_core.data.DebugDataProvider -import com.redmadrobot.flipper.config.FlipperValue -import com.redmadrobot.flipper_plugin.plugin.PluginToggle +import com.redmadrobot.debug.core.data.DebugDataProvider +import com.redmadrobot.debug.flipper.plugin.PluginToggle internal class DebugFlipperFeaturesProvider : DebugDataProvider> { override fun provideData(): List { diff --git a/sample/src/release/kotlin/com/redmadrobot/debug_sample/debug_data/DebugServersProvider.kt b/sample/src/release/kotlin/com/redmadrobot/debug_sample/debug_data/DebugServersProvider.kt index 8c8cea62..2aae69a9 100644 --- a/sample/src/release/kotlin/com/redmadrobot/debug_sample/debug_data/DebugServersProvider.kt +++ b/sample/src/release/kotlin/com/redmadrobot/debug_sample/debug_data/DebugServersProvider.kt @@ -1,10 +1,9 @@ package com.redmadrobot.debug_sample.debug_data -import com.redmadrobot.debug_panel_core.data.DebugDataProvider -import com.redmadrobot.servers_plugin.data.model.DebugServer +import com.redmadrobot.debug.core.data.DebugDataProvider +import com.redmadrobot.debug.servers.data.model.DebugServer class DebugServersProvider : DebugDataProvider> { - override fun provideData(): List { return emptyList() } diff --git a/sample/src/release/kotlin/com/redmadrobot/debug_sample/debug_data/DebugVariableWidgetsProvider.kt b/sample/src/release/kotlin/com/redmadrobot/debug_sample/debug_data/DebugVariableWidgetsProvider.kt index 3c4f3553..610c2788 100644 --- a/sample/src/release/kotlin/com/redmadrobot/debug_sample/debug_data/DebugVariableWidgetsProvider.kt +++ b/sample/src/release/kotlin/com/redmadrobot/debug_sample/debug_data/DebugVariableWidgetsProvider.kt @@ -1,7 +1,7 @@ package com.redmadrobot.debug_sample.debug_data -import com.redmadrobot.debug_panel_core.data.DebugDataProvider -import com.redmadrobot.variable_plugin.plugin.VariableWidget +import com.redmadrobot.debug.core.data.DebugDataProvider +import com.redmadrobot.debug.variable.plugin.VariableWidget internal class DebugVariableWidgetsProvider : DebugDataProvider>> { override fun provideData(): List> { From dd75af821e808fb899f5fc3a235862ca47cd2a43 Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Tue, 6 Dec 2022 12:29:36 +0300 Subject: [PATCH 22/42] Accounts: Fix package name --- .../debug/noop/accounts/AccountSelectedEvent.kt | 4 ++-- .../redmadrobot/debug/noop/accounts/AccountsPlugin.kt | 4 ++-- .../redmadrobot/debug/noop/accounts/DebugAccount.kt | 2 +- .../debug/noop/accounts/DebugAuthenticator.kt | 4 ++-- .../debug/account/authenticator/DebugAuthenticator.kt | 7 ------- .../debug/accounts/authenticator/DebugAuthenticator.kt | 7 +++++++ .../authenticator/DefaultAuthenticator.kt | 4 ++-- .../data/DebugAccountRepository.kt | 4 ++-- .../data/LocalDebugAccountRepository.kt | 6 +++--- .../{account => accounts}/data/model/DebugAccount.kt | 2 +- .../data/storage/AccountsPluginDatabase.kt | 4 ++-- .../data/storage/DebugAccountDao.kt | 4 ++-- .../plugin/AccountSelectedEvent.kt | 4 ++-- .../{account => accounts}/plugin/AccountsPlugin.kt | 10 +++++----- .../plugin/AccountsPluginContainer.kt | 10 +++++----- .../debug/{account => accounts}/ui/AccountsFragment.kt | 6 +++--- .../debug/{account => accounts}/ui/AccountsScreen.kt | 6 +++--- .../{account => accounts}/ui/AccountsViewModel.kt | 10 +++++----- .../{account => accounts}/ui/AccountsViewState.kt | 2 +- .../main/kotlin/com/redmadrobot/debug_sample/App.kt | 4 ++-- .../com/redmadrobot/debug_sample/MainActivity.kt | 2 +- .../debug_sample/account/DebugUserAuthenticator.kt | 4 ++-- .../debug_sample/debug_data/DebugAccountsProvider.kt | 2 +- 23 files changed, 56 insertions(+), 56 deletions(-) delete mode 100644 plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DebugAuthenticator.kt create mode 100644 plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/authenticator/DebugAuthenticator.kt rename plugins/accounts/src/main/kotlin/com/redmadrobot/debug/{account => accounts}/authenticator/DefaultAuthenticator.kt (52%) rename plugins/accounts/src/main/kotlin/com/redmadrobot/debug/{account => accounts}/data/DebugAccountRepository.kt (74%) rename plugins/accounts/src/main/kotlin/com/redmadrobot/debug/{account => accounts}/data/LocalDebugAccountRepository.kt (85%) rename plugins/accounts/src/main/kotlin/com/redmadrobot/debug/{account => accounts}/data/model/DebugAccount.kt (90%) rename plugins/accounts/src/main/kotlin/com/redmadrobot/debug/{account => accounts}/data/storage/AccountsPluginDatabase.kt (85%) rename plugins/accounts/src/main/kotlin/com/redmadrobot/debug/{account => accounts}/data/storage/DebugAccountDao.kt (77%) rename plugins/accounts/src/main/kotlin/com/redmadrobot/debug/{account => accounts}/plugin/AccountSelectedEvent.kt (56%) rename plugins/accounts/src/main/kotlin/com/redmadrobot/debug/{account => accounts}/plugin/AccountsPlugin.kt (82%) rename plugins/accounts/src/main/kotlin/com/redmadrobot/debug/{account => accounts}/plugin/AccountsPluginContainer.kt (69%) rename plugins/accounts/src/main/kotlin/com/redmadrobot/debug/{account => accounts}/ui/AccountsFragment.kt (86%) rename plugins/accounts/src/main/kotlin/com/redmadrobot/debug/{account => accounts}/ui/AccountsScreen.kt (98%) rename plugins/accounts/src/main/kotlin/com/redmadrobot/debug/{account => accounts}/ui/AccountsViewModel.kt (91%) rename plugins/accounts/src/main/kotlin/com/redmadrobot/debug/{account => accounts}/ui/AccountsViewState.kt (87%) diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/AccountSelectedEvent.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/AccountSelectedEvent.kt index 53f8d2b5..907e0d3f 100644 --- a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/AccountSelectedEvent.kt +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/AccountSelectedEvent.kt @@ -1,6 +1,6 @@ -package com.redmadrobot.debug.account.plugin +package com.redmadrobot.debug.accounts.plugin -import com.redmadrobot.debug.account.data.model.DebugAccount +import com.redmadrobot.debug.accounts.data.model.DebugAccount import com.redmadrobot.debug.core.internal.DebugEvent data class AccountSelectedEvent(val debugAccount: DebugAccount) : DebugEvent diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/AccountsPlugin.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/AccountsPlugin.kt index 67027452..06e8d1c4 100644 --- a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/AccountsPlugin.kt +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/AccountsPlugin.kt @@ -1,6 +1,6 @@ -package com.redmadrobot.debug.account.plugin +package com.redmadrobot.debug.accounts.plugin -import com.redmadrobot.debug.account.data.model.DebugAccount +import com.redmadrobot.debug.accounts.data.model.DebugAccount import com.redmadrobot.debug.core.data.DebugDataProvider import java.util.Collections.emptyList diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/DebugAccount.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/DebugAccount.kt index 83acfcbb..35d9a6ad 100644 --- a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/DebugAccount.kt +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/DebugAccount.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.debug.account.data.model +package com.redmadrobot.debug.accounts.data.model data class DebugAccount( val id: Int = 0, diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/DebugAuthenticator.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/DebugAuthenticator.kt index e1054682..6d343a11 100644 --- a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/DebugAuthenticator.kt +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/accounts/DebugAuthenticator.kt @@ -1,6 +1,6 @@ -package com.redmadrobot.debug.account.authenticator +package com.redmadrobot.debug.accounts.authenticator -import com.redmadrobot.debug.account.data.model.DebugAccount +import com.redmadrobot.debug.accounts.data.model.DebugAccount interface DebugAuthenticator { fun onAccountSelected(account: DebugAccount) diff --git a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DebugAuthenticator.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DebugAuthenticator.kt deleted file mode 100644 index df65cf40..00000000 --- a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DebugAuthenticator.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.redmadrobot.debug.account.authenticator - -import com.redmadrobot.debug.account.data.model.DebugAccount - -public interface DebugAuthenticator { - public fun onAccountSelected(account: DebugAccount) -} diff --git a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/authenticator/DebugAuthenticator.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/authenticator/DebugAuthenticator.kt new file mode 100644 index 00000000..0e6d7ef5 --- /dev/null +++ b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/authenticator/DebugAuthenticator.kt @@ -0,0 +1,7 @@ +package com.redmadrobot.debug.accounts.authenticator + +import com.redmadrobot.debug.accounts.data.model.DebugAccount + +public interface DebugAuthenticator { + public fun onAccountSelected(account: DebugAccount) +} diff --git a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DefaultAuthenticator.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/authenticator/DefaultAuthenticator.kt similarity index 52% rename from plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DefaultAuthenticator.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/authenticator/DefaultAuthenticator.kt index fa7e9072..c088897e 100644 --- a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/authenticator/DefaultAuthenticator.kt +++ b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/authenticator/DefaultAuthenticator.kt @@ -1,6 +1,6 @@ -package com.redmadrobot.debug.account.authenticator +package com.redmadrobot.debug.accounts.authenticator -import com.redmadrobot.debug.account.data.model.DebugAccount +import com.redmadrobot.debug.accounts.data.model.DebugAccount internal class DefaultAuthenticator : DebugAuthenticator { override fun onAccountSelected(account: DebugAccount) = Unit diff --git a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/DebugAccountRepository.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/data/DebugAccountRepository.kt similarity index 74% rename from plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/DebugAccountRepository.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/data/DebugAccountRepository.kt index 314c2454..bc2cb7e8 100644 --- a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/DebugAccountRepository.kt +++ b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/data/DebugAccountRepository.kt @@ -1,6 +1,6 @@ -package com.redmadrobot.debug.account.data +package com.redmadrobot.debug.accounts.data -import com.redmadrobot.debug.account.data.model.DebugAccount +import com.redmadrobot.debug.accounts.data.model.DebugAccount internal interface DebugAccountRepository { suspend fun addAccount(account: DebugAccount) diff --git a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/LocalDebugAccountRepository.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/data/LocalDebugAccountRepository.kt similarity index 85% rename from plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/LocalDebugAccountRepository.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/data/LocalDebugAccountRepository.kt index a1b32e38..8c4ce610 100644 --- a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/LocalDebugAccountRepository.kt +++ b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/data/LocalDebugAccountRepository.kt @@ -1,7 +1,7 @@ -package com.redmadrobot.debug.account.data +package com.redmadrobot.debug.accounts.data -import com.redmadrobot.debug.account.data.model.DebugAccount -import com.redmadrobot.debug.account.data.storage.DebugAccountDao +import com.redmadrobot.debug.accounts.data.model.DebugAccount +import com.redmadrobot.debug.accounts.data.storage.DebugAccountDao import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext diff --git a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/model/DebugAccount.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/data/model/DebugAccount.kt similarity index 90% rename from plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/model/DebugAccount.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/data/model/DebugAccount.kt index 98977a35..22c36c72 100644 --- a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/model/DebugAccount.kt +++ b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/data/model/DebugAccount.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.debug.account.data.model +package com.redmadrobot.debug.accounts.data.model import androidx.room.ColumnInfo import androidx.room.Entity diff --git a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/storage/AccountsPluginDatabase.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/data/storage/AccountsPluginDatabase.kt similarity index 85% rename from plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/storage/AccountsPluginDatabase.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/data/storage/AccountsPluginDatabase.kt index ab95d7d7..aba7c244 100644 --- a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/storage/AccountsPluginDatabase.kt +++ b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/data/storage/AccountsPluginDatabase.kt @@ -1,10 +1,10 @@ -package com.redmadrobot.debug.account.data.storage +package com.redmadrobot.debug.accounts.data.storage import android.content.Context import androidx.room.Database import androidx.room.Room import androidx.room.RoomDatabase -import com.redmadrobot.debug.account.data.model.DebugAccount +import com.redmadrobot.debug.accounts.data.model.DebugAccount @Database( entities = [DebugAccount::class], diff --git a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/storage/DebugAccountDao.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/data/storage/DebugAccountDao.kt similarity index 77% rename from plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/storage/DebugAccountDao.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/data/storage/DebugAccountDao.kt index 354c6b8e..47ee41dd 100644 --- a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/data/storage/DebugAccountDao.kt +++ b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/data/storage/DebugAccountDao.kt @@ -1,7 +1,7 @@ -package com.redmadrobot.debug.account.data.storage +package com.redmadrobot.debug.accounts.data.storage import androidx.room.* -import com.redmadrobot.debug.account.data.model.DebugAccount +import com.redmadrobot.debug.accounts.data.model.DebugAccount @Dao internal interface DebugAccountDao { diff --git a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountSelectedEvent.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/plugin/AccountSelectedEvent.kt similarity index 56% rename from plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountSelectedEvent.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/plugin/AccountSelectedEvent.kt index 231a37c8..67b3fb37 100644 --- a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountSelectedEvent.kt +++ b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/plugin/AccountSelectedEvent.kt @@ -1,6 +1,6 @@ -package com.redmadrobot.debug.account.plugin +package com.redmadrobot.debug.accounts.plugin -import com.redmadrobot.debug.account.data.model.DebugAccount +import com.redmadrobot.debug.accounts.data.model.DebugAccount import com.redmadrobot.debug.core.internal.DebugEvent public data class AccountSelectedEvent(val debugAccount: DebugAccount) : DebugEvent diff --git a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPlugin.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/plugin/AccountsPlugin.kt similarity index 82% rename from plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPlugin.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/plugin/AccountsPlugin.kt index b406f62d..ba490248 100644 --- a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPlugin.kt +++ b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/plugin/AccountsPlugin.kt @@ -1,11 +1,11 @@ -package com.redmadrobot.debug.account.plugin +package com.redmadrobot.debug.accounts.plugin import androidx.core.os.bundleOf import androidx.fragment.app.Fragment -import com.redmadrobot.debug.account.authenticator.DebugAuthenticator -import com.redmadrobot.debug.account.authenticator.DefaultAuthenticator -import com.redmadrobot.debug.account.data.model.DebugAccount -import com.redmadrobot.debug.account.ui.AccountsFragment +import com.redmadrobot.debug.accounts.authenticator.DebugAuthenticator +import com.redmadrobot.debug.accounts.authenticator.DefaultAuthenticator +import com.redmadrobot.debug.accounts.data.model.DebugAccount +import com.redmadrobot.debug.accounts.ui.AccountsFragment import com.redmadrobot.debug.core.CommonContainer import com.redmadrobot.debug.core.data.DebugDataProvider import com.redmadrobot.debug.core.plugin.Plugin diff --git a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPluginContainer.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/plugin/AccountsPluginContainer.kt similarity index 69% rename from plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPluginContainer.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/plugin/AccountsPluginContainer.kt index 670983d4..93638d31 100644 --- a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/plugin/AccountsPluginContainer.kt +++ b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/plugin/AccountsPluginContainer.kt @@ -1,9 +1,9 @@ -package com.redmadrobot.debug.account.plugin +package com.redmadrobot.debug.accounts.plugin -import com.redmadrobot.debug.account.data.LocalDebugAccountRepository -import com.redmadrobot.debug.account.data.model.DebugAccount -import com.redmadrobot.debug.account.data.storage.AccountsPluginDatabase -import com.redmadrobot.debug.account.ui.AccountsViewModel +import com.redmadrobot.debug.accounts.data.LocalDebugAccountRepository +import com.redmadrobot.debug.accounts.data.model.DebugAccount +import com.redmadrobot.debug.accounts.data.storage.AccountsPluginDatabase +import com.redmadrobot.debug.accounts.ui.AccountsViewModel import com.redmadrobot.debug.core.CommonContainer import com.redmadrobot.debug.core.plugin.PluginDependencyContainer diff --git a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsFragment.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/ui/AccountsFragment.kt similarity index 86% rename from plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsFragment.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/ui/AccountsFragment.kt index b74d5226..d20c5000 100644 --- a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsFragment.kt +++ b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/ui/AccountsFragment.kt @@ -1,11 +1,11 @@ -package com.redmadrobot.debug.account.ui +package com.redmadrobot.debug.accounts.ui import android.os.Bundle import android.view.View import com.redmadrobot.account.R import com.redmadrobot.account.databinding.FragmentAccountsComposeBinding -import com.redmadrobot.debug.account.plugin.AccountsPlugin -import com.redmadrobot.debug.account.plugin.AccountsPluginContainer +import com.redmadrobot.debug.accounts.plugin.AccountsPlugin +import com.redmadrobot.debug.accounts.plugin.AccountsPluginContainer import com.redmadrobot.debug.common.base.PluginFragment import com.redmadrobot.debug.common.extension.obtainShareViewModel import com.redmadrobot.debug.core.extension.getPlugin diff --git a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsScreen.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/ui/AccountsScreen.kt similarity index 98% rename from plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsScreen.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/ui/AccountsScreen.kt index ffce60be..67f1b184 100644 --- a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsScreen.kt +++ b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/ui/AccountsScreen.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.debug.account.ui +package com.redmadrobot.debug.accounts.ui import android.annotation.SuppressLint import androidx.compose.foundation.clickable @@ -19,7 +19,7 @@ import androidx.compose.ui.window.Dialog import androidx.lifecycle.asFlow import com.google.android.material.composethemeadapter.MdcTheme import com.redmadrobot.account.R -import com.redmadrobot.debug.account.data.model.DebugAccount +import com.redmadrobot.debug.accounts.data.model.DebugAccount @SuppressLint("UnusedMaterialScaffoldPaddingParameter") @Composable @@ -223,4 +223,4 @@ internal sealed class DebugAccountItem { @Composable private fun DialogPreview() { AccountDetailsDialog({}, {}) -} \ No newline at end of file +} diff --git a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewModel.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/ui/AccountsViewModel.kt similarity index 91% rename from plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewModel.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/ui/AccountsViewModel.kt index 4260cad9..ed5eef86 100644 --- a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewModel.kt +++ b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/ui/AccountsViewModel.kt @@ -1,13 +1,13 @@ -package com.redmadrobot.debug.account.ui +package com.redmadrobot.debug.accounts.ui import android.content.Context import androidx.lifecycle.MutableLiveData import androidx.lifecycle.viewModelScope import com.redmadrobot.account.R -import com.redmadrobot.debug.account.data.DebugAccountRepository -import com.redmadrobot.debug.account.data.model.DebugAccount -import com.redmadrobot.debug.account.plugin.AccountSelectedEvent -import com.redmadrobot.debug.account.plugin.AccountsPlugin +import com.redmadrobot.debug.accounts.data.DebugAccountRepository +import com.redmadrobot.debug.accounts.data.model.DebugAccount +import com.redmadrobot.debug.accounts.plugin.AccountSelectedEvent +import com.redmadrobot.debug.accounts.plugin.AccountsPlugin import com.redmadrobot.debug.common.base.PluginViewModel import com.redmadrobot.debug.common.extension.safeLaunch import com.redmadrobot.debug.core.extension.getPlugin diff --git a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewState.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/ui/AccountsViewState.kt similarity index 87% rename from plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewState.kt rename to plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/ui/AccountsViewState.kt index aa0e8e55..2c64b3b2 100644 --- a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/account/ui/AccountsViewState.kt +++ b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/ui/AccountsViewState.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.debug.account.ui +package com.redmadrobot.debug.accounts.ui import androidx.compose.runtime.Stable diff --git a/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt b/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt index a846ad89..4d134bf5 100644 --- a/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt +++ b/sample/src/main/kotlin/com/redmadrobot/debug_sample/App.kt @@ -1,8 +1,8 @@ package com.redmadrobot.debug_sample import android.app.Application -import com.redmadrobot.debug.account.data.model.DebugAccount -import com.redmadrobot.debug.account.plugin.AccountsPlugin +import com.redmadrobot.debug.accounts.data.model.DebugAccount +import com.redmadrobot.debug.accounts.plugin.AccountsPlugin import com.redmadrobot.debug.appsettings.plugin.AppSettingsPlugin import com.redmadrobot.debug.core.internal.DebugPanel import com.redmadrobot.debug.core.internal.DebugPanelConfig diff --git a/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt b/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt index c7f2c61a..7dd81849 100644 --- a/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt +++ b/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt @@ -7,7 +7,7 @@ import android.view.View import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.lifecycle.lifecycleScope -import com.redmadrobot.debug.account.plugin.AccountSelectedEvent +import com.redmadrobot.debug.accounts.plugin.AccountSelectedEvent import com.redmadrobot.debug.core.internal.DebugPanel import com.redmadrobot.debug_sample.network.ApiFactory import com.redmadrobot.debugpanel.R diff --git a/sample/src/main/kotlin/com/redmadrobot/debug_sample/account/DebugUserAuthenticator.kt b/sample/src/main/kotlin/com/redmadrobot/debug_sample/account/DebugUserAuthenticator.kt index 2ade37ff..254908a3 100644 --- a/sample/src/main/kotlin/com/redmadrobot/debug_sample/account/DebugUserAuthenticator.kt +++ b/sample/src/main/kotlin/com/redmadrobot/debug_sample/account/DebugUserAuthenticator.kt @@ -1,7 +1,7 @@ package com.redmadrobot.debug_sample.account -import com.redmadrobot.debug.account.authenticator.DebugAuthenticator -import com.redmadrobot.debug.account.data.model.DebugAccount +import com.redmadrobot.debug.accounts.authenticator.DebugAuthenticator +import com.redmadrobot.debug.accounts.data.model.DebugAccount import timber.log.Timber class DebugUserAuthenticator : DebugAuthenticator { diff --git a/sample/src/release/kotlin/com/redmadrobot/debug_sample/debug_data/DebugAccountsProvider.kt b/sample/src/release/kotlin/com/redmadrobot/debug_sample/debug_data/DebugAccountsProvider.kt index 1838cc7e..7b3292ee 100644 --- a/sample/src/release/kotlin/com/redmadrobot/debug_sample/debug_data/DebugAccountsProvider.kt +++ b/sample/src/release/kotlin/com/redmadrobot/debug_sample/debug_data/DebugAccountsProvider.kt @@ -1,6 +1,6 @@ package com.redmadrobot.debug_sample.debug_data -import com.redmadrobot.debug.account.data.model.DebugAccount +import com.redmadrobot.debug.accounts.data.model.DebugAccount import com.redmadrobot.debug.core.data.DebugDataProvider class DebugAccountsProvider : DebugDataProvider> { From 9619b0374f8d6a8d2b79b489941138e4a3317171 Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Tue, 6 Dec 2022 12:32:13 +0300 Subject: [PATCH 23/42] Docs:Update changelog.md --- docs/changelog.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index 47f82429..6db8cff0 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,13 @@ # Changelog +## In progress +* Gradle обновлен до 7.5 +* compileSdk и targetSdk повышены до 33 +* Добавлена поддержка Jetpack Compose +* accounts-plugin переведен на Jetpack Compose +* Переименованы модули. +* Breaking changes - Изменены наименования пакетов во всех модулях. Приведены к общему виду. + ## 0.8.1 ### Изменения * Исправлен краш при остановке активити (#13) From 07cc0bfef86919da98bdd98559d439f40215895e Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Tue, 6 Dec 2022 13:41:06 +0300 Subject: [PATCH 24/42] Base:Fix Broadcast receiver action name --- .../redmadrobot/debug/core/util/DebugPanelBroadcastReceiver.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/src/main/kotlin/com/redmadrobot/debug/core/util/DebugPanelBroadcastReceiver.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/util/DebugPanelBroadcastReceiver.kt index 1aaeda55..509a6cc1 100644 --- a/core/src/main/kotlin/com/redmadrobot/debug/core/util/DebugPanelBroadcastReceiver.kt +++ b/core/src/main/kotlin/com/redmadrobot/debug/core/util/DebugPanelBroadcastReceiver.kt @@ -11,8 +11,7 @@ internal class DebugPanelBroadcastReceiver( ) : BroadcastReceiver() { companion object { - const val ACTION_OPEN_DEBUG_PANEL = - "com.redmadrobot.debug_panel_core.ACTION_OPEN_DEBUG_PANEL" + const val ACTION_OPEN_DEBUG_PANEL = "com.redmadrobot.debug.core.ACTION_OPEN_DEBUG_PANEL" } override fun onReceive(context: Context, intent: Intent) { From aee25127f1e28694bdcae25aad23e08ccbd182f9 Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Thu, 8 Dec 2022 16:42:20 +0300 Subject: [PATCH 25/42] Core:Add 'content' and `settingsContent` composable functions for Plugin class --- .../redmadrobot/debug/core/plugin/Plugin.kt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/core/src/main/kotlin/com/redmadrobot/debug/core/plugin/Plugin.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/plugin/Plugin.kt index aaba22b0..1227ac35 100644 --- a/core/src/main/kotlin/com/redmadrobot/debug/core/plugin/Plugin.kt +++ b/core/src/main/kotlin/com/redmadrobot/debug/core/plugin/Plugin.kt @@ -1,5 +1,7 @@ package com.redmadrobot.debug.core.plugin +import androidx.compose.runtime.Composable +import androidx.compose.ui.viewinterop.AndroidViewBinding import androidx.fragment.app.Fragment import com.redmadrobot.debug.core.CommonContainer import com.redmadrobot.debug.core.DebugPanelInstance @@ -20,10 +22,26 @@ public abstract class Plugin { public fun getContainer(): T = pluginContainer as T + @Deprecated( + "You should't use fragments for you plugins. Please use Jetpack Compose", + ReplaceWith("content()", "com.redmadrobot.debug.core.plugin.Plugin") + ) public open fun getFragment(): Fragment? = null + @Deprecated( + "You should't use fragments for you plugins. Please use Jetpack Compose", + ReplaceWith("content()", "com.redmadrobot.debug.core.plugin.Plugin") + ) public open fun getSettingFragment(): Fragment? = null + @Composable + public open fun content() { + } + + @Composable + public open fun settingsContent() { + } + public abstract fun getPluginContainer(commonContainer: CommonContainer): PluginDependencyContainer public abstract fun getName(): String From 4ae86d3ea2e7d21c39473bd2a8897eca38f2c29f Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Thu, 8 Dec 2022 16:44:11 +0300 Subject: [PATCH 26/42] Deps:Update `common` module dependencies --- common/build.gradle.kts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/build.gradle.kts b/common/build.gradle.kts index d337ce72..3506fde7 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -49,6 +49,8 @@ dependencies { api(androidx.compose.material) api(androidx.compose.foundation) api(androidx.compose.ui) + api(androidx.compose.ui.viewbinding) + api(androidx.fragment) api(androidx.constraintlayout.compose) api(androidx.activity.compose) api(androidx.compose.ui.tooling.preview) From 340cf05bf3508fb06424675a48903cfd973f2a02 Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Thu, 8 Dec 2022 17:26:37 +0300 Subject: [PATCH 27/42] Accounts: Add the ability to open `accounts` plugin from JetpackCompose --- .../debug/accounts/plugin/AccountsPlugin.kt | 21 +++++ .../debug/accounts/ui/AccountsFragment.kt | 30 +++---- .../debug/accounts/ui/AccountsScreen.kt | 84 +++++++++++-------- .../res/layout/fragment_accounts_compose.xml | 6 -- .../res/layout/fragment_container_account.xml | 7 ++ 5 files changed, 93 insertions(+), 55 deletions(-) delete mode 100644 plugins/accounts/src/main/res/layout/fragment_accounts_compose.xml create mode 100644 plugins/accounts/src/main/res/layout/fragment_container_account.xml diff --git a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/plugin/AccountsPlugin.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/plugin/AccountsPlugin.kt index ba490248..2e0555c4 100644 --- a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/plugin/AccountsPlugin.kt +++ b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/plugin/AccountsPlugin.kt @@ -1,7 +1,10 @@ package com.redmadrobot.debug.accounts.plugin +import androidx.compose.runtime.Composable +import androidx.compose.ui.viewinterop.AndroidViewBinding import androidx.core.os.bundleOf import androidx.fragment.app.Fragment +import com.redmadrobot.account.databinding.FragmentContainerAccountBinding import com.redmadrobot.debug.accounts.authenticator.DebugAuthenticator import com.redmadrobot.debug.accounts.authenticator.DefaultAuthenticator import com.redmadrobot.debug.accounts.data.model.DebugAccount @@ -40,6 +43,24 @@ public class AccountsPlugin( } } + @Composable + override fun content() { + AndroidViewBinding(factory = FragmentContainerAccountBinding::inflate) { + fragmentContainer.getFragment().apply { + arguments = bundleOf(AccountsFragment.IS_EDIT_MODE_KEY to false) + } + } + } + + @Composable + override fun settingsContent() { + AndroidViewBinding(factory = FragmentContainerAccountBinding::inflate) { + fragmentContainer.getFragment().apply { + arguments = bundleOf(AccountsFragment.IS_EDIT_MODE_KEY to true) + } + } + } + override fun getSettingFragment(): Fragment { return AccountsFragment().apply { arguments = bundleOf(AccountsFragment.IS_EDIT_MODE_KEY to true) diff --git a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/ui/AccountsFragment.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/ui/AccountsFragment.kt index d20c5000..d735b387 100644 --- a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/ui/AccountsFragment.kt +++ b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/ui/AccountsFragment.kt @@ -1,23 +1,23 @@ package com.redmadrobot.debug.accounts.ui import android.os.Bundle -import android.view.View -import com.redmadrobot.account.R -import com.redmadrobot.account.databinding.FragmentAccountsComposeBinding +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.compose.ui.platform.ComposeView +import androidx.fragment.app.Fragment import com.redmadrobot.debug.accounts.plugin.AccountsPlugin import com.redmadrobot.debug.accounts.plugin.AccountsPluginContainer -import com.redmadrobot.debug.common.base.PluginFragment import com.redmadrobot.debug.common.extension.obtainShareViewModel import com.redmadrobot.debug.core.extension.getPlugin -internal class AccountsFragment : PluginFragment(R.layout.fragment_accounts_compose) { +internal class AccountsFragment : Fragment() { - companion object { - const val IS_EDIT_MODE_KEY = "IS_EDIT_MODE_KEY" + private val isSettingMode: Boolean by lazy { + activity?.javaClass?.simpleName == "DebugActivity" } - private val isEditMode by lazy { - requireNotNull(arguments).getBoolean(IS_EDIT_MODE_KEY) + companion object { + const val IS_EDIT_MODE_KEY = "IS_EDIT_MODE_KEY" } private val viewModel by lazy { @@ -28,11 +28,13 @@ internal class AccountsFragment : PluginFragment(R.layout.fragment_accounts_comp } } - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - val binding = FragmentAccountsComposeBinding.bind(view) - binding.composeRoot.setContent { - AccountsScreen(viewModel, isEditMode) + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ) = ComposeView(inflater.context).apply { + setContent { + AccountsScreen(viewModel, isSettingMode) } } } diff --git a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/ui/AccountsScreen.kt b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/ui/AccountsScreen.kt index 67f1b184..78845407 100644 --- a/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/ui/AccountsScreen.kt +++ b/plugins/accounts/src/main/kotlin/com/redmadrobot/debug/accounts/ui/AccountsScreen.kt @@ -17,7 +17,6 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import androidx.compose.ui.window.Dialog import androidx.lifecycle.asFlow -import com.google.android.material.composethemeadapter.MdcTheme import com.redmadrobot.account.R import com.redmadrobot.debug.accounts.data.model.DebugAccount @@ -31,40 +30,44 @@ internal fun AccountsScreen( var showDialog by remember { mutableStateOf(false) } var editableAccount by remember { mutableStateOf(null) } - MdcTheme { - Scaffold( - floatingActionButton = { - if (isEditMode) { - ExtendedFloatingActionButton( - onClick = { showDialog = true }, - text = { Text("Add") }, - icon = { Icon(painterResource(R.drawable.icon_add_account), contentDescription = null) } - ) - } + Scaffold( + floatingActionButton = { + if (isEditMode) { + ExtendedFloatingActionButton( + onClick = { showDialog = true }, + text = { Text("Add") }, + icon = { + Icon( + painterResource(R.drawable.icon_add_account), + contentDescription = null + ) + } + ) } - ) { - AccountScreenLayout( - state = state, - isEditMode = isEditMode, - onSelectedClick = viewModel::setAccountAsCurrent, - onOpenDialogClick = { - showDialog = true - editableAccount = it + } + ) { + AccountScreenLayout( + state = state, + isEditMode = isEditMode, + onSelectedClick = viewModel::setAccountAsCurrent, + onOpenDialogClick = { + showDialog = true + editableAccount = it + }, + onDeleteClick = viewModel::removeAccount, + ) + if (showDialog) { + AccountDetailsDialog( + onDismiss = { + showDialog = false + editableAccount = null }, - onDeleteClick = viewModel::removeAccount, + onSaveClick = viewModel::saveAccount, + account = editableAccount ) - if (showDialog) { - AccountDetailsDialog( - onDismiss = { - showDialog = false - editableAccount = null - }, - onSaveClick = viewModel::saveAccount, - account = editableAccount - ) - } } } + LaunchedEffect(viewModel) { viewModel.loadAccounts() } @@ -79,7 +82,9 @@ private fun AccountScreenLayout( onOpenDialogClick: (DebugAccount?) -> Unit, ) { LazyColumn( - modifier = Modifier.fillMaxSize().padding(horizontal = 16.dp), + modifier = Modifier + .fillMaxSize() + .padding(horizontal = 16.dp), verticalArrangement = Arrangement.spacedBy(8.dp) ) { state.allItems.forEach { item -> @@ -88,7 +93,9 @@ private fun AccountScreenLayout( is DebugAccountItem.Header -> { Text( item.header.uppercase(), - modifier = Modifier.fillParentMaxWidth().padding(vertical = 16.dp), + modifier = Modifier + .fillParentMaxWidth() + .padding(vertical = 16.dp), fontSize = 16.sp ) } @@ -105,7 +112,11 @@ private fun AccountScreenLayout( AccountItem( account = item.account, showDelete = isEditMode, - onItemClick = { if (isEditMode) onOpenDialogClick(it) else onSelectedClick(it) }, + onItemClick = { + if (isEditMode) onOpenDialogClick(it) else onSelectedClick( + it + ) + }, onDeleteClick = onDeleteClick, ) } @@ -123,11 +134,14 @@ private fun AccountItem( onDeleteClick: (DebugAccount) -> Unit = {}, ) { Card( - modifier = Modifier.fillMaxWidth() + modifier = Modifier + .fillMaxWidth() .height(56.dp) .clickable { onItemClick(account) } ) { - Box(modifier = Modifier.fillMaxSize().padding(horizontal = 16.dp)) { + Box(modifier = Modifier + .fillMaxSize() + .padding(horizontal = 16.dp)) { Row( modifier = Modifier.fillMaxSize(), horizontalArrangement = Arrangement.spacedBy(32.dp), diff --git a/plugins/accounts/src/main/res/layout/fragment_accounts_compose.xml b/plugins/accounts/src/main/res/layout/fragment_accounts_compose.xml deleted file mode 100644 index 73ae2883..00000000 --- a/plugins/accounts/src/main/res/layout/fragment_accounts_compose.xml +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/plugins/accounts/src/main/res/layout/fragment_container_account.xml b/plugins/accounts/src/main/res/layout/fragment_container_account.xml new file mode 100644 index 00000000..6a6bbfa7 --- /dev/null +++ b/plugins/accounts/src/main/res/layout/fragment_container_account.xml @@ -0,0 +1,7 @@ + + + From b430ba9be9da6e3cb5169ceed3bdfd2a87f71393 Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Thu, 8 Dec 2022 18:37:28 +0300 Subject: [PATCH 28/42] Servers: Add the ability to open `servers` plugin from JetpackCompose --- .../debug/common/base/PluginFragment.kt | 4 ++ .../debug/servers/plugin/ServersPlugin.kt | 40 ++++++++++++++---- .../debug/servers/ui/ServersFragment.kt | 41 +++++++------------ .../res/layout/fragment_container_servers.xml | 7 ++++ 4 files changed, 59 insertions(+), 33 deletions(-) create mode 100644 plugins/servers/src/main/res/layout/fragment_container_servers.xml diff --git a/common/src/main/kotlin/com/redmadrobot/debug/common/base/PluginFragment.kt b/common/src/main/kotlin/com/redmadrobot/debug/common/base/PluginFragment.kt index 5a330d93..734a4212 100644 --- a/common/src/main/kotlin/com/redmadrobot/debug/common/base/PluginFragment.kt +++ b/common/src/main/kotlin/com/redmadrobot/debug/common/base/PluginFragment.kt @@ -10,6 +10,10 @@ import com.redmadrobot.debug_panel_common.R public open class PluginFragment(private val layoutId: Int) : Fragment() { + protected val isSettingMode: Boolean by lazy { + activity?.javaClass?.simpleName == "DebugActivity" + } + override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPlugin.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPlugin.kt index be7e67b0..1deb60a7 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPlugin.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPlugin.kt @@ -1,5 +1,10 @@ package com.redmadrobot.debug.servers.plugin +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.viewinterop.AndroidViewBinding import androidx.core.os.bundleOf import androidx.fragment.app.Fragment import com.redmadrobot.debug.core.CommonContainer @@ -9,6 +14,7 @@ import com.redmadrobot.debug.core.plugin.Plugin import com.redmadrobot.debug.core.plugin.PluginDependencyContainer import com.redmadrobot.debug.servers.data.model.DebugServer import com.redmadrobot.debug.servers.ui.ServersFragment +import com.redmadrobot.servers_plugin.databinding.FragmentContainerServersBinding import kotlinx.coroutines.runBlocking public class ServersPlugin( @@ -17,7 +23,7 @@ public class ServersPlugin( init { preInstalledServers.find { it.isDefault } - ?: throw IllegalStateException("DebugPanel - ServersPlugin can't be initialized. At least one server must be default") + ?: error("ServersPlugin can't be initialized. At least one server must be default") } public companion object { @@ -50,15 +56,35 @@ public class ServersPlugin( return ServersPluginContainer(preInstalledServers, commonContainer) } + @Deprecated( + "You should't use fragments for you plugins. Please use Jetpack Compose", + replaceWith = ReplaceWith("content()", "com.redmadrobot.debug.core.plugin.Plugin") + ) override fun getFragment(): Fragment { - return ServersFragment().apply { - arguments = bundleOf(ServersFragment.IS_EDIT_MODE_KEY to false) - } + return ServersFragment() } + @Deprecated( + "You should't use fragments for you plugins. Please use Jetpack Compose", + replaceWith = ReplaceWith("content()", "com.redmadrobot.debug.core.plugin.Plugin") + ) override fun getSettingFragment(): Fragment { - return ServersFragment().apply { - arguments = bundleOf(ServersFragment.IS_EDIT_MODE_KEY to true) - } + return ServersFragment() + } + + @Composable + override fun content() { + AndroidViewBinding( + FragmentContainerServersBinding::inflate, + modifier = Modifier.verticalScroll(rememberScrollState()) + ) + } + + @Composable + override fun settingsContent() { + AndroidViewBinding( + FragmentContainerServersBinding::inflate, + modifier = Modifier.verticalScroll(rememberScrollState()) + ) } } diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersFragment.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersFragment.kt index db28360d..69e96b98 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersFragment.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersFragment.kt @@ -5,35 +5,26 @@ import android.view.View import androidx.core.view.isVisible import androidx.recyclerview.widget.LinearLayoutManager import com.redmadrobot.debug.common.base.PluginFragment -import com.redmadrobot.debug_panel_common.databinding.ItemSectionHeaderBinding import com.redmadrobot.debug.common.extension.observe import com.redmadrobot.debug.common.extension.obtainShareViewModel import com.redmadrobot.debug.core.extension.getPlugin +import com.redmadrobot.debug.servers.data.model.DebugServer +import com.redmadrobot.debug.servers.plugin.ServersPlugin +import com.redmadrobot.debug.servers.plugin.ServersPluginContainer +import com.redmadrobot.debug.servers.ui.item.DebugServerItems +import com.redmadrobot.debug_panel_common.databinding.ItemSectionHeaderBinding import com.redmadrobot.itemsadapter.ItemsAdapter import com.redmadrobot.itemsadapter.bind import com.redmadrobot.itemsadapter.itemsAdapter import com.redmadrobot.servers_plugin.R -import com.redmadrobot.debug.servers.data.model.DebugServer import com.redmadrobot.servers_plugin.databinding.FragmentServersBinding import com.redmadrobot.servers_plugin.databinding.ItemDebugServerBinding -import com.redmadrobot.debug.servers.plugin.ServersPlugin -import com.redmadrobot.debug.servers.plugin.ServersPluginContainer -import com.redmadrobot.debug.servers.ui.item.DebugServerItems -import com.redmadrobot.debug_panel_common.R as CommonR internal class ServersFragment : PluginFragment(R.layout.fragment_servers) { - companion object { - const val IS_EDIT_MODE_KEY = "IS_EDIT_MODE_KEY" - } - private var _binding: FragmentServersBinding? = null private val binding get() = checkNotNull(_binding) - private val isEditMode by lazy { - requireNotNull(arguments).getBoolean(IS_EDIT_MODE_KEY) - } - private val viewModel by lazy { obtainShareViewModel { getPlugin() @@ -42,16 +33,12 @@ internal class ServersFragment : PluginFragment(R.layout.fragment_servers) { } } - override fun onActivityCreated(savedInstanceState: Bundle?) { - super.onActivityCreated(savedInstanceState) - observe(viewModel.state, ::render) - viewModel.loadServers() - } - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) _binding = FragmentServersBinding.bind(view) + observe(viewModel.state, ::render) binding.setViews() + viewModel.loadServers() } override fun onDestroyView() { @@ -64,7 +51,7 @@ internal class ServersFragment : PluginFragment(R.layout.fragment_servers) { addServer.setOnClickListener { ServerHostDialog.show(childFragmentManager) } - addServer.isVisible = isEditMode + addServer.isVisible = isSettingMode } private fun render(state: ServersViewState) { @@ -81,26 +68,28 @@ internal class ServersFragment : PluginFragment(R.layout.fragment_servers) { itemSectionTitle.text = item.header } } + is DebugServerItems.PreinstalledServer -> { bind(R.layout.item_debug_server) { itemServerName.text = item.debugServer.name - isSelectedIcon.isVisible = item.isSelected && !isEditMode - if (!isEditMode) { + isSelectedIcon.isVisible = item.isSelected && !isSettingMode + if (!isSettingMode) { root.setOnClickListener { viewModel.onServerSelected(item.debugServer) } } } } + is DebugServerItems.AddedServer -> { bind(R.layout.item_debug_server) { itemServerName.text = item.debugServer.name - isSelectedIcon.isVisible = item.isSelected && !isEditMode - itemServerDelete.isVisible = isEditMode + isSelectedIcon.isVisible = item.isSelected && !isSettingMode + itemServerDelete.isVisible = isSettingMode val server = item.debugServer itemServerDelete.setOnClickListener { viewModel.removeServer(server) } root.setOnClickListener { - if (!isEditMode) { + if (!isSettingMode) { viewModel.onServerSelected(server) } else { editServerData(server) diff --git a/plugins/servers/src/main/res/layout/fragment_container_servers.xml b/plugins/servers/src/main/res/layout/fragment_container_servers.xml new file mode 100644 index 00000000..b2ae4cfc --- /dev/null +++ b/plugins/servers/src/main/res/layout/fragment_container_servers.xml @@ -0,0 +1,7 @@ + + + From 464f02b60d3cbf06682807517d745c0fd4bc5380 Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Thu, 8 Dec 2022 18:46:44 +0300 Subject: [PATCH 29/42] Flipper:Add the ability to open `flipper` plugin from JetpackCompose --- .../debug/flipper/plugin/FlipperPlugin.kt | 14 +++++++++++++- .../flipper/ui/FlipperFeaturesFragment.kt | 19 +++++++++++++++++-- .../fragment_container_flipper_plugin.xml | 7 +++++++ .../res/layout/fragment_flipper_features.xml | 17 ++++++++++------- 4 files changed, 47 insertions(+), 10 deletions(-) create mode 100644 plugins/flipper/src/main/res/layout/fragment_container_flipper_plugin.xml diff --git a/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/plugin/FlipperPlugin.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/plugin/FlipperPlugin.kt index 3b079399..ebf13e04 100644 --- a/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/plugin/FlipperPlugin.kt +++ b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/plugin/FlipperPlugin.kt @@ -1,12 +1,15 @@ package com.redmadrobot.debug.flipper.plugin +import androidx.compose.runtime.Composable +import androidx.compose.ui.viewinterop.AndroidViewBinding import androidx.fragment.app.Fragment import com.redmadrobot.debug.core.CommonContainer import com.redmadrobot.debug.core.extension.getPlugin import com.redmadrobot.debug.core.plugin.Plugin import com.redmadrobot.debug.core.plugin.PluginDependencyContainer -import com.redmadrobot.flipper.config.FlipperValue import com.redmadrobot.debug.flipper.ui.FlipperFeaturesFragment +import com.redmadrobot.flipper.config.FlipperValue +import com.redmadrobot.flipper_plugin.databinding.FragmentContainerFlipperPluginBinding import kotlinx.coroutines.flow.Flow import java.util.* @@ -53,9 +56,18 @@ public class FlipperPlugin( ) } + @Deprecated( + "You should't use fragments for you plugins. Please use Jetpack Compose", + replaceWith = ReplaceWith("content()", "com.redmadrobot.debug.core.plugin.Plugin") + ) override fun getFragment(): Fragment { return FlipperFeaturesFragment() } + + @Composable + override fun content() { + AndroidViewBinding(FragmentContainerFlipperPluginBinding::inflate) + } } public data class PluginToggle( diff --git a/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/FlipperFeaturesFragment.kt b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/FlipperFeaturesFragment.kt index 351bfe4d..1c48be55 100644 --- a/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/FlipperFeaturesFragment.kt +++ b/plugins/flipper/src/main/kotlin/com/redmadrobot/debug/flipper/ui/FlipperFeaturesFragment.kt @@ -1,20 +1,22 @@ package com.redmadrobot.debug.flipper.ui import android.os.Bundle +import android.view.MotionEvent import android.view.View import androidx.core.widget.addTextChangedListener import androidx.lifecycle.Lifecycle import androidx.lifecycle.flowWithLifecycle import androidx.lifecycle.lifecycleScope +import androidx.recyclerview.widget.RecyclerView import com.redmadrobot.debug.common.base.PluginFragment import com.redmadrobot.debug.common.extension.obtainShareViewModel import com.redmadrobot.debug.core.extension.getPlugin -import com.redmadrobot.flipper_plugin.R -import com.redmadrobot.flipper_plugin.databinding.FragmentFlipperFeaturesBinding import com.redmadrobot.debug.flipper.plugin.FlipperPlugin import com.redmadrobot.debug.flipper.plugin.FlipperPluginContainer import com.redmadrobot.debug.flipper.ui.dialog.SourceSelectionDialogFragment import com.redmadrobot.debug.flipper.ui.recycler.FlipperFeaturesAdapter +import com.redmadrobot.flipper_plugin.R +import com.redmadrobot.flipper_plugin.databinding.FragmentFlipperFeaturesBinding import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach @@ -59,6 +61,19 @@ internal class FlipperFeaturesFragment : PluginFragment(R.layout.fragment_flippe featuresAdapter.submitList(state.items) } .launchIn(viewLifecycleOwner.lifecycleScope) + + // Workaround for nested scroll in compose + binding.featureList.addOnItemTouchListener(object : RecyclerView.OnItemTouchListener { + override fun onInterceptTouchEvent(rv: RecyclerView, event: MotionEvent): Boolean { + when (event.action) { + MotionEvent.ACTION_MOVE -> rv.parent.requestDisallowInterceptTouchEvent(true) + } + return false + } + + override fun onTouchEvent(rv: RecyclerView, e: MotionEvent) = Unit + override fun onRequestDisallowInterceptTouchEvent(disallowIntercept: Boolean) = Unit + }) } override fun onDestroyView() { diff --git a/plugins/flipper/src/main/res/layout/fragment_container_flipper_plugin.xml b/plugins/flipper/src/main/res/layout/fragment_container_flipper_plugin.xml new file mode 100644 index 00000000..6cae9cce --- /dev/null +++ b/plugins/flipper/src/main/res/layout/fragment_container_flipper_plugin.xml @@ -0,0 +1,7 @@ + + + diff --git a/plugins/flipper/src/main/res/layout/fragment_flipper_features.xml b/plugins/flipper/src/main/res/layout/fragment_flipper_features.xml index 10878557..0bdc8044 100644 --- a/plugins/flipper/src/main/res/layout/fragment_flipper_features.xml +++ b/plugins/flipper/src/main/res/layout/fragment_flipper_features.xml @@ -1,13 +1,14 @@ - + android:background="@color/white"> @@ -34,17 +35,19 @@ - + From 3e3a3d0fc9a63d6c2986910e233dcafd9876137d Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Thu, 8 Dec 2022 19:11:35 +0300 Subject: [PATCH 30/42] AppSettings: Add the ability to open `appsettings` plugin from JetpackCompose --- .../appsettings/plugin/AppSettingsPlugin.kt | 20 ++++++++++++++++++- .../ui/ApplicationSettingsFragment.kt | 8 ++------ .../fragment_container_app_settings.xml | 6 ++++++ 3 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 plugins/app-settings/src/main/res/layout/fragment_container_app_settings.xml diff --git a/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/plugin/AppSettingsPlugin.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/plugin/AppSettingsPlugin.kt index 3c08c567..b97d6ce2 100644 --- a/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/plugin/AppSettingsPlugin.kt +++ b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/plugin/AppSettingsPlugin.kt @@ -1,7 +1,13 @@ package com.redmadrobot.debug.appsettings.plugin import android.content.SharedPreferences +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.viewinterop.AndroidViewBinding import androidx.fragment.app.Fragment +import com.redmadrobot.app_settings_plugin.databinding.FragmentContainerAppSettingsBinding import com.redmadrobot.debug.appsettings.data.DefaultSharedPreferences import com.redmadrobot.debug.appsettings.ui.ApplicationSettingsFragment import com.redmadrobot.debug.core.CommonContainer @@ -22,7 +28,19 @@ public class AppSettingsPlugin( return AppSettingsPluginContainer(sharedPreferences) } - override fun getFragment(): Fragment? { + @Deprecated( + "You should't use fragments for you plugins. Please use Jetpack Compose", + replaceWith = ReplaceWith("content()", "com.redmadrobot.debug.core.plugin.Plugin") + ) + override fun getFragment(): Fragment { return ApplicationSettingsFragment() } + + @Composable + override fun content() { + AndroidViewBinding( + FragmentContainerAppSettingsBinding::inflate, + modifier = Modifier.verticalScroll(rememberScrollState()) + ) + } } diff --git a/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/ApplicationSettingsFragment.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/ApplicationSettingsFragment.kt index 623714a5..f73ef3d9 100644 --- a/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/ApplicationSettingsFragment.kt +++ b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/ApplicationSettingsFragment.kt @@ -26,17 +26,13 @@ internal class ApplicationSettingsFragment : PluginFragment(R.layout.fragment_ap } } - override fun onActivityCreated(savedInstanceState: Bundle?) { - super.onActivityCreated(savedInstanceState) - observe(settingsViewModel.settingsLiveData, ::setSettingList) - settingsViewModel.loadSettings() - } - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) + observe(settingsViewModel.settingsLiveData, ::setSettingList) binding = FragmentAppSettingsBinding.bind(view).also { it.setViews() } + settingsViewModel.loadSettings() } private fun FragmentAppSettingsBinding.setViews() { diff --git a/plugins/app-settings/src/main/res/layout/fragment_container_app_settings.xml b/plugins/app-settings/src/main/res/layout/fragment_container_app_settings.xml new file mode 100644 index 00000000..2695a975 --- /dev/null +++ b/plugins/app-settings/src/main/res/layout/fragment_container_app_settings.xml @@ -0,0 +1,6 @@ + + From 9860da688d39d8a76293f5ebfa49c901268cf268 Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Thu, 8 Dec 2022 19:20:50 +0300 Subject: [PATCH 31/42] Variable:Add the ability to open `variable` plugin from JetpackCompose --- .../debug/variable/plugin/VariablePlugin.kt | 18 ++++++++++++++++++ .../res/layout/fragment_container_variable.xml | 6 ++++++ .../src/main/res/layout/fragment_variable.xml | 4 ++-- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 plugins/variable/src/main/res/layout/fragment_container_variable.xml diff --git a/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/plugin/VariablePlugin.kt b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/plugin/VariablePlugin.kt index 88113a92..646dba20 100644 --- a/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/plugin/VariablePlugin.kt +++ b/plugins/variable/src/main/kotlin/com/redmadrobot/debug/variable/plugin/VariablePlugin.kt @@ -2,12 +2,18 @@ package com.redmadrobot.debug.variable.plugin import android.view.View import android.view.ViewGroup +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.viewinterop.AndroidViewBinding import androidx.fragment.app.Fragment import com.redmadrobot.debug.core.CommonContainer import com.redmadrobot.debug.core.extension.getPlugin import com.redmadrobot.debug.core.plugin.Plugin import com.redmadrobot.debug.core.plugin.PluginDependencyContainer import com.redmadrobot.debug.variable.ui.VariableFragment +import com.redmadrobot.variable_plugin.databinding.FragmentContainerVariableBinding import kotlin.reflect.KClass public class VariablePlugin( @@ -27,9 +33,21 @@ public class VariablePlugin( ) } + @Deprecated( + "You should't use fragments for you plugins. Please use Jetpack Compose", + replaceWith = ReplaceWith("content()", "com.redmadrobot.debug.core.plugin.Plugin") + ) override fun getFragment(): Fragment { return VariableFragment() } + + @Composable + override fun content() { + AndroidViewBinding( + FragmentContainerVariableBinding::inflate, + modifier = Modifier.verticalScroll(rememberScrollState()) + ) + } } public fun T.asDebugVariable( diff --git a/plugins/variable/src/main/res/layout/fragment_container_variable.xml b/plugins/variable/src/main/res/layout/fragment_container_variable.xml new file mode 100644 index 00000000..5b94476f --- /dev/null +++ b/plugins/variable/src/main/res/layout/fragment_container_variable.xml @@ -0,0 +1,6 @@ + + diff --git a/plugins/variable/src/main/res/layout/fragment_variable.xml b/plugins/variable/src/main/res/layout/fragment_variable.xml index 1f14ffee..388f7cc9 100644 --- a/plugins/variable/src/main/res/layout/fragment_variable.xml +++ b/plugins/variable/src/main/res/layout/fragment_variable.xml @@ -1,5 +1,5 @@ - - + From c8dfcbc87e1da2c5b43c48b2efab76bc85bc1090 Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Mon, 26 Dec 2022 23:28:29 +0300 Subject: [PATCH 32/42] Core: Add ability to open panel without fragment manager --- common/build.gradle.kts | 2 +- .../core/inapp/compose/DebugBottomSheet.kt | 110 ++++++++++++++++++ .../debug/core/internal/DebugPanel.kt | 21 +++- .../redmadrobot/debug/noop/core/DebugPanel.kt | 3 + .../redmadrobot/debug_sample/MainActivity.kt | 3 +- 5 files changed, 135 insertions(+), 4 deletions(-) create mode 100644 core/src/main/kotlin/com/redmadrobot/debug/core/inapp/compose/DebugBottomSheet.kt diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 3506fde7..0870258c 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -45,7 +45,7 @@ android { dependencies { api(androidx.compose.animation) - api(stack.material.compose.themeAdapter) + api(stack.accompanist.themeadapter.material) api(androidx.compose.material) api(androidx.compose.foundation) api(androidx.compose.ui) diff --git a/core/src/main/kotlin/com/redmadrobot/debug/core/inapp/compose/DebugBottomSheet.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/inapp/compose/DebugBottomSheet.kt new file mode 100644 index 00000000..4bb325e0 --- /dev/null +++ b/core/src/main/kotlin/com/redmadrobot/debug/core/inapp/compose/DebugBottomSheet.kt @@ -0,0 +1,110 @@ +@file:OptIn(ExperimentalFoundationApi::class) + +package com.redmadrobot.debug.core.inapp.compose + +import androidx.appcompat.view.ContextThemeWrapper +import androidx.compose.foundation.ExperimentalFoundationApi +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.* +import androidx.compose.foundation.pager.HorizontalPager +import androidx.compose.foundation.pager.PagerState +import androidx.compose.foundation.pager.rememberPagerState +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.material.* +import androidx.compose.material.TabRowDefaults.tabIndicatorOffset +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.remember +import androidx.compose.runtime.rememberCoroutineScope +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.unit.dp +import com.google.accompanist.themeadapter.material.MdcTheme +import com.redmadrobot.debug.core.extension.getAllPlugins +import com.redmadrobot.debug.core.plugin.Plugin +import com.redmadrobot.panel_core.R +import kotlinx.coroutines.launch +import com.redmadrobot.debug.panel.common.R as CommonR + +@OptIn(ExperimentalMaterialApi::class) +@Composable +public fun DebugBottomSheet(onClose: () -> Unit) { + val state = rememberModalBottomSheetState( + initialValue = ModalBottomSheetValue.Hidden, + confirmStateChange = { + if (it == ModalBottomSheetValue.Hidden) onClose() + true + } + ) + + MdcTheme(context = ContextThemeWrapper(LocalContext.current, CommonR.style.DebugPanelTheme)) { + ModalBottomSheetLayout( + sheetContent = { BottomSheetContent() }, + sheetState = state, + content = {} + ) + } + LaunchedEffect(true) { + state.animateTo(ModalBottomSheetValue.HalfExpanded) + } +} + +@OptIn(ExperimentalFoundationApi::class) +@Composable +private fun BottomSheetContent() { + val plugins = remember { getAllPlugins() } + val pluginsName = remember { plugins.map { it.getName() } } + val pagerState = rememberPagerState(initialPage = 0, pageCount = { plugins.size }) + Column(modifier = Modifier.fillMaxSize()) { + Spacer(modifier = Modifier.height(8.dp)) + // Handle + Box( + modifier = Modifier + .height(4.dp) + .width(50.dp) + .clip(CircleShape) + .background(Color.Gray) + .align(Alignment.CenterHorizontally) + ) + Spacer(modifier = Modifier.height(8.dp)) + PluginsTabLayout(pluginsName, pagerState = pagerState) + PluginsPager(plugins, pagerState = pagerState) + } +} + +@Composable +private fun PluginsTabLayout(pluginsName: List, pagerState: PagerState) { + val scope = rememberCoroutineScope() + ScrollableTabRow( + selectedTabIndex = pagerState.currentPage, + backgroundColor = MaterialTheme.colors.background, + indicator = { tabPositions -> + TabRowDefaults.Indicator( + modifier = Modifier.tabIndicatorOffset(tabPositions[pagerState.currentPage]), + height = 2.dp, + color = MaterialTheme.colors.secondary + ) + } + ) { + pluginsName.forEachIndexed { index, _ -> + Tab( + text = { Text(pluginsName[index]) }, + selected = pagerState.currentPage == index, + onClick = { + scope.launch { pagerState.animateScrollToPage(index) } + } + ) + } + } +} + +@Composable +private fun PluginsPager(plugins: List, pagerState: PagerState) { + plugins[pagerState.currentPage].content() + HorizontalPager(state = pagerState) { + // no impl. Temporary solution + } +} diff --git a/core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugPanel.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugPanel.kt index 06495d8a..e8d10816 100644 --- a/core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugPanel.kt +++ b/core/src/main/kotlin/com/redmadrobot/debug/core/internal/DebugPanel.kt @@ -1,11 +1,16 @@ package com.redmadrobot.debug.core.internal +import android.app.Activity import android.app.Application +import android.view.ViewGroup +import android.widget.FrameLayout +import androidx.compose.ui.platform.ComposeView import androidx.fragment.app.FragmentManager import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.Observer import com.redmadrobot.debug.core.DebugPanelInstance import com.redmadrobot.debug.core.inapp.DebugBottomSheet +import com.redmadrobot.debug.core.inapp.compose.DebugBottomSheet import com.redmadrobot.debug.core.plugin.Plugin import com.redmadrobot.debug.core.util.ApplicationLifecycleHandler import kotlinx.coroutines.flow.Flow @@ -40,9 +45,21 @@ public object DebugPanel { } } + public fun showPanel(activity: Activity) { + if (isInitialized) { + val contentView = activity.window.decorView + .findViewById(android.R.id.content) as FrameLayout + + val debugPanelComposeView = ComposeView(contentView.context).apply { + setContent { + DebugBottomSheet(onClose = { contentView.removeView(this) }) + } + } + contentView.addView(debugPanelComposeView) + } + } + private fun createDebugPanelInstance(application: Application, plugins: List) { instance = DebugPanelInstance(application, plugins) } - - } diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/core/DebugPanel.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/core/DebugPanel.kt index 2b97e16a..dc05c23b 100644 --- a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/core/DebugPanel.kt +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/core/DebugPanel.kt @@ -1,5 +1,6 @@ package com.redmadrobot.debug.core.internal +import android.app.Activity import android.app.Application import androidx.fragment.app.FragmentManager import androidx.lifecycle.LifecycleOwner @@ -18,4 +19,6 @@ object DebugPanel { fun observeEvents(): Flow? = emptyFlow() fun showPanel(fragmentManager: FragmentManager) = Unit + + fun showPanel(activity: Activity) = Unit } diff --git a/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt b/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt index 7dd81849..64f35711 100644 --- a/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt +++ b/sample/src/main/kotlin/com/redmadrobot/debug_sample/MainActivity.kt @@ -153,7 +153,8 @@ class MainActivity : AppCompatActivity() { private fun chooseAccount() { - DebugPanel.showPanel(supportFragmentManager) + DebugPanel.showPanel(this) +// DebugPanel.showPanel(supportFragmentManager) } @OptIn(DelicateCoroutinesApi::class) From 4f04b447810aa90309a32e53a3eabc9b65b5c7fb Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Thu, 12 Jan 2023 12:27:34 +0300 Subject: [PATCH 33/42] Servers: Add the ability to add a stage with multiple hosts --- plugins/servers/build.gradle.kts | 1 + .../servers/data/DebugServerRepository.kt | 71 ++++++++++-- .../servers/data/DebugStageRepository.kt | 78 ++++++++++++++ .../data/LocalDebugServerRepository.kt | 79 -------------- .../debug/servers/data/model/DebugServer.kt | 9 +- .../servers/data/model/DebugServerData.kt | 10 ++ .../debug/servers/data/model/DebugStage.kt | 25 +++++ .../servers/data/storage/DbConverters.kt | 20 ++++ .../servers/data/storage/DebugStagesDao.kt | 23 ++++ .../data/storage/ServersPluginDatabase.kt | 15 ++- .../data/storage/SharedPreferencesFactory.kt | 13 +++ .../DebugServerInterceptor.kt | 4 +- .../interceptor/DebugStageInterceptor.kt | 57 ++++++++++ .../DefaultOnServerChangedListener.kt | 7 -- .../servers/plugin/ServerSelectedEvent.kt | 3 + .../debug/servers/plugin/ServersPlugin.kt | 4 +- .../servers/plugin/ServersPluginContainer.kt | 22 +++- .../debug/servers/ui/ServersFragment.kt | 66 ++++++++---- .../debug/servers/ui/ServersViewModel.kt | 101 ++++++++++++++---- .../debug/servers/ui/ServersViewState.kt | 6 +- .../debug/servers/ui/item/DebugServerItems.kt | 5 +- .../src/main/res/drawable/icon_router.xml | 13 ++- .../src/main/res/drawable/icon_stage.xml | 5 + .../src/main/res/layout/item_debug_stage.xml | 66 ++++++++++++ .../servers/src/main/res/values/strings.xml | 4 +- 25 files changed, 545 insertions(+), 162 deletions(-) create mode 100644 plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/DebugStageRepository.kt delete mode 100644 plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/LocalDebugServerRepository.kt create mode 100644 plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/model/DebugServerData.kt create mode 100644 plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/model/DebugStage.kt create mode 100644 plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/storage/DbConverters.kt create mode 100644 plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/storage/DebugStagesDao.kt create mode 100644 plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/storage/SharedPreferencesFactory.kt rename plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/{util => interceptor}/DebugServerInterceptor.kt (93%) create mode 100644 plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/interceptor/DebugStageInterceptor.kt delete mode 100644 plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/listener/DefaultOnServerChangedListener.kt create mode 100644 plugins/servers/src/main/res/drawable/icon_stage.xml create mode 100644 plugins/servers/src/main/res/layout/item_debug_stage.xml diff --git a/plugins/servers/build.gradle.kts b/plugins/servers/build.gradle.kts index a9cd8676..6666c311 100644 --- a/plugins/servers/build.gradle.kts +++ b/plugins/servers/build.gradle.kts @@ -55,5 +55,6 @@ dependencies { implementation(project(":core")) implementation(project(":common")) implementation(kotlin("stdlib")) + implementation(stack.kotlinx.serialization.json) kapt(androidx.room.compiler) } diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/DebugServerRepository.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/DebugServerRepository.kt index ff52189f..e1acc2f1 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/DebugServerRepository.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/DebugServerRepository.kt @@ -1,23 +1,76 @@ package com.redmadrobot.debug.servers.data +import android.content.Context import com.redmadrobot.debug.servers.data.model.DebugServer +import com.redmadrobot.debug.servers.data.storage.DebugServersDao +import com.redmadrobot.debug.servers.data.storage.SharedPreferencesProvider +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext -internal interface DebugServerRepository { +internal class DebugServerRepository( + private val context: Context, + private val debugServersDao: DebugServersDao, + private val preInstalledServers: List, +) { - fun getPreInstalledServers(): List + companion object { + private const val SELECTED_SERVER_URL = "SELECTED_SERVER_URL" + private const val SELECTED_SERVER_NAME = "SELECTED_SERVER_NAME" + } - fun saveSelectedServer(selectedServer: DebugServer) + private val sharedPreferences by lazy { + SharedPreferencesProvider.get(context) + } + fun getPreInstalledServers(): List { + return preInstalledServers + } - fun getDefault(): DebugServer + fun saveSelectedServer(selectedServer: DebugServer) { + sharedPreferences.edit().apply { + putString(SELECTED_SERVER_NAME, selectedServer.name) + putString(SELECTED_SERVER_URL, selectedServer.url) + }.apply() + } - suspend fun getSelectedServer(): DebugServer + suspend fun getSelectedServer(): DebugServer { + val serverName = sharedPreferences.getString(SELECTED_SERVER_NAME, null) + val serverUrl = sharedPreferences.getString(SELECTED_SERVER_URL, null) - suspend fun getServers(): List + return if (serverName != null && serverUrl != null) { + preInstalledServers.find { it.name == serverName && it.url == serverUrl } + ?: debugServersDao.getServer(serverName, serverUrl) + ?: getDefault() + } else { + getDefault() + } + } - suspend fun addServer(server: DebugServer) + fun getDefault(): DebugServer { + return preInstalledServers.first { it.isDefault } + } - suspend fun removeServer(server: DebugServer) + suspend fun addServer(server: DebugServer) { + withContext(Dispatchers.IO) { + debugServersDao.insert(server) + } + } - suspend fun updateServer(server: DebugServer) + suspend fun getServers(): List { + return withContext(Dispatchers.IO) { + debugServersDao.getAll() + } + } + + suspend fun removeServer(server: DebugServer) { + withContext(Dispatchers.IO) { + debugServersDao.remove(server) + } + } + + suspend fun updateServer(server: DebugServer) { + withContext(Dispatchers.IO) { + debugServersDao.update(server) + } + } } diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/DebugStageRepository.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/DebugStageRepository.kt new file mode 100644 index 00000000..bf908f59 --- /dev/null +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/DebugStageRepository.kt @@ -0,0 +1,78 @@ +package com.redmadrobot.debug.servers.data + +import android.content.Context +import androidx.core.content.edit +import com.redmadrobot.debug.servers.data.model.DebugStage +import com.redmadrobot.debug.servers.data.storage.DebugStagesDao +import com.redmadrobot.debug.servers.data.storage.SharedPreferencesProvider +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext + +internal class DebugStageRepository( + private val context: Context, + private val debugStagesDao: DebugStagesDao, + private val preInstalledStages: List, +) { + + companion object { + private const val SELECTED_STAGE_HOSTS_HASH = "SELECTED_STAGE_HOSTS_HASH" + private const val SELECTED_STAGE_NAME = "SELECTED_STAGE_NAME" + } + + private val sharedPreferences by lazy { + SharedPreferencesProvider.get(context) + } + + fun getPreInstalledStages(): List { + return preInstalledStages + } + + fun saveSelectedStage(selectedStage: DebugStage) { + sharedPreferences.edit { + putString(SELECTED_STAGE_NAME, selectedStage.name) + putInt(SELECTED_STAGE_HOSTS_HASH, selectedStage.hosts.hashCode()) + } + } + + fun getSelectedStage(): DebugStage { + val stageName = sharedPreferences.getString(SELECTED_STAGE_NAME, null) + val hostsHash = sharedPreferences.getInt(SELECTED_STAGE_HOSTS_HASH, -1) + + return if (stageName != null) { + preInstalledStages + .find { it.name == stageName && it.hosts.hashCode() == hostsHash } + ?: debugStagesDao.getStage(stageName) + ?: getDefault() + } else { + getDefault() + } + } + + private fun getDefault(): DebugStage { + return preInstalledStages.first { it.isDefault } + } + + suspend fun addStage(server: DebugStage) { + withContext(Dispatchers.IO) { + debugStagesDao.insert(server) + } + } + + suspend fun getStages(): List { + return withContext(Dispatchers.IO) { + debugStagesDao.getAll() + } + } + + suspend fun removeStage(server: DebugStage) { + withContext(Dispatchers.IO) { + debugStagesDao.remove(server) + } + } + + suspend fun updateStage(server: DebugStage) { + withContext(Dispatchers.IO) { + debugStagesDao.update(server) + } + } +} diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/LocalDebugServerRepository.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/LocalDebugServerRepository.kt deleted file mode 100644 index ea938901..00000000 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/LocalDebugServerRepository.kt +++ /dev/null @@ -1,79 +0,0 @@ -package com.redmadrobot.debug.servers.data - -import android.content.Context -import com.redmadrobot.debug.servers.data.model.DebugServer -import com.redmadrobot.debug.servers.data.storage.DebugServersDao -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.withContext - -internal class LocalDebugServerRepository( - private val context: Context, - private val debugServersDao: DebugServersDao, - private val preInstalledServers: List -) : DebugServerRepository { - - companion object { - private const val NAME = ":servers" - private const val SELECTED_SERVER_URL = "SELECTED_SERVER_URL" - private const val SELECTED_SERVER_NAME = "SELECTED_SERVER_NAME" - } - - - private val sharedPreferences by lazy { - val prefFileName = "${context.packageName}$NAME" - context.getSharedPreferences(prefFileName, 0) - } - - - override fun getPreInstalledServers(): List { - return preInstalledServers - } - - override fun saveSelectedServer(selectedServer: DebugServer) { - sharedPreferences.edit().apply { - putString(SELECTED_SERVER_NAME, selectedServer.name) - putString(SELECTED_SERVER_URL, selectedServer.url) - }.apply() - } - - override suspend fun getSelectedServer(): DebugServer { - val serverName = sharedPreferences.getString(SELECTED_SERVER_NAME, null) - val serverUrl = sharedPreferences.getString(SELECTED_SERVER_URL, null) - - return if (serverName != null && serverUrl != null) { - preInstalledServers.find { it.name == serverName && it.url == serverUrl } - ?: debugServersDao.getServer(serverName, serverUrl) - ?: getDefault() - } else { - getDefault() - } - } - - override fun getDefault(): DebugServer { - return preInstalledServers.first { it.isDefault } - } - - override suspend fun addServer(server: DebugServer) { - withContext(Dispatchers.IO) { - debugServersDao.insert(server) - } - } - - override suspend fun getServers(): List { - return withContext(Dispatchers.IO) { - debugServersDao.getAll() - } - } - - override suspend fun removeServer(server: DebugServer) { - withContext(Dispatchers.IO) { - debugServersDao.remove(server) - } - } - - override suspend fun updateServer(server: DebugServer) { - withContext(Dispatchers.IO) { - debugServersDao.update(server) - } - } -} diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/model/DebugServer.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/model/DebugServer.kt index 060550d0..3243d3cb 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/model/DebugServer.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/model/DebugServer.kt @@ -6,11 +6,11 @@ import androidx.room.PrimaryKey @Entity(tableName = DebugServer.TABLE_NAME) public data class DebugServer( @PrimaryKey(autoGenerate = true) - val id: Int = 0, - val name: String, + override val id: Int = 0, + override val name: String, val url: String, - val isDefault: Boolean = false -) { + override val isDefault: Boolean = false +) : DebugServerData { internal companion object { const val TABLE_NAME = "debug_server" } @@ -19,5 +19,4 @@ public data class DebugServer( val otherServer = other as DebugServer return this.name == otherServer.name && this.url == otherServer.url } - } diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/model/DebugServerData.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/model/DebugServerData.kt new file mode 100644 index 00000000..dc1b1287 --- /dev/null +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/model/DebugServerData.kt @@ -0,0 +1,10 @@ +package com.redmadrobot.debug.servers.data.model + +import com.redmadrobot.debug.core.annotation.DebugPanelInternal + +@DebugPanelInternal +public interface DebugServerData { + public val id: Int + public val name: String + public val isDefault: Boolean +} diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/model/DebugStage.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/model/DebugStage.kt new file mode 100644 index 00000000..47912083 --- /dev/null +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/model/DebugStage.kt @@ -0,0 +1,25 @@ +package com.redmadrobot.debug.servers.data.model + +import androidx.room.Entity +import androidx.room.PrimaryKey + + +@Entity(tableName = DebugStage.TABLE_NAME) +public data class DebugStage( + @PrimaryKey(autoGenerate = true) + override val id: Int = 0, + override val name: String, + val hosts: Map, + override val isDefault: Boolean = false +) : DebugServerData { + + internal companion object { + const val TABLE_NAME = "debug_stage" + } + + override fun equals(other: Any?): Boolean { + val otherServer = other as DebugStage + return this.name == otherServer.name + && this.hosts.hashCode() == otherServer.hosts.hashCode() + } +} diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/storage/DbConverters.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/storage/DbConverters.kt new file mode 100644 index 00000000..d453c090 --- /dev/null +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/storage/DbConverters.kt @@ -0,0 +1,20 @@ +package com.redmadrobot.debug.servers.data.storage + +import androidx.room.TypeConverter +import kotlinx.serialization.decodeFromString +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + + +internal class DbConverters { + + @TypeConverter + fun fromMap(map: Map?): String { + return Json.encodeToString(map ?: emptyMap()) + } + + @TypeConverter + fun toMap(data: String?): Map { + return data?.let { Json.decodeFromString(data) } ?: emptyMap() + } +} \ No newline at end of file diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/storage/DebugStagesDao.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/storage/DebugStagesDao.kt new file mode 100644 index 00000000..a20b3393 --- /dev/null +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/storage/DebugStagesDao.kt @@ -0,0 +1,23 @@ +package com.redmadrobot.debug.servers.data.storage + +import androidx.room.* +import com.redmadrobot.debug.servers.data.model.DebugStage + +@Dao +internal interface DebugStagesDao { + + @Query("SELECT * FROM ${DebugStage.TABLE_NAME}") + suspend fun getAll(): List + + @Insert(onConflict = OnConflictStrategy.REPLACE) + suspend fun insert(server: DebugStage) + + @Delete + suspend fun remove(server: DebugStage) + + @Update + suspend fun update(server: DebugStage) + + @Query("SELECT * FROM ${DebugStage.TABLE_NAME} WHERE name = :name") + fun getStage(name: String): DebugStage? +} diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/storage/ServersPluginDatabase.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/storage/ServersPluginDatabase.kt index d9a8a82d..8c5b1d1a 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/storage/ServersPluginDatabase.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/storage/ServersPluginDatabase.kt @@ -4,15 +4,21 @@ import android.content.Context import androidx.room.Database import androidx.room.Room import androidx.room.RoomDatabase +import androidx.room.TypeConverters +import androidx.room.migration.AutoMigrationSpec import com.redmadrobot.debug.servers.data.model.DebugServer +import com.redmadrobot.debug.servers.data.model.DebugStage @Database( - entities = [DebugServer::class], - version = 1 + entities = [DebugServer::class, DebugStage::class], + version = 2 ) +@TypeConverters(DbConverters::class) internal abstract class ServersPluginDatabase : RoomDatabase() { abstract fun getDebugServersDao(): DebugServersDao + abstract fun getDebugStagesDao(): DebugStagesDao + companion object { private const val DATABASE_NAME = "servers_plugin_db" @@ -21,7 +27,10 @@ internal abstract class ServersPluginDatabase : RoomDatabase() { context.applicationContext, ServersPluginDatabase::class.java, DATABASE_NAME - ).build() + ) + .fallbackToDestructiveMigration() + .allowMainThreadQueries() + .build() } } } diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/storage/SharedPreferencesFactory.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/storage/SharedPreferencesFactory.kt new file mode 100644 index 00000000..5da9927c --- /dev/null +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/storage/SharedPreferencesFactory.kt @@ -0,0 +1,13 @@ +package com.redmadrobot.debug.servers.data.storage + +import android.content.Context +import android.content.SharedPreferences + +internal object SharedPreferencesProvider { + private const val NAME = ":servers" + + fun get(context: Context): SharedPreferences { + val prefFileName = "${context.packageName}${NAME}" + return context.getSharedPreferences(prefFileName, 0) + } +} diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/util/DebugServerInterceptor.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/interceptor/DebugServerInterceptor.kt similarity index 93% rename from plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/util/DebugServerInterceptor.kt rename to plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/interceptor/DebugServerInterceptor.kt index e10efcb9..d17b6b98 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/util/DebugServerInterceptor.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/interceptor/DebugServerInterceptor.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.debug.servers.util +package com.redmadrobot.debug.servers.interceptor import com.redmadrobot.debug.core.extension.getPlugin import com.redmadrobot.debug.core.internal.DebugPanel @@ -23,7 +23,7 @@ public class DebugServerInterceptor : Interceptor { } /** - * Дополнительная Модификация запроса + * Additional request modification * */ public fun modifyRequest(block: (Request, DebugServer) -> Request): DebugServerInterceptor { this.requestModifier = block diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/interceptor/DebugStageInterceptor.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/interceptor/DebugStageInterceptor.kt new file mode 100644 index 00000000..d35f651e --- /dev/null +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/interceptor/DebugStageInterceptor.kt @@ -0,0 +1,57 @@ +package com.redmadrobot.debug.servers.interceptor + +import com.redmadrobot.debug.core.extension.getPlugin +import com.redmadrobot.debug.core.internal.DebugPanel +import com.redmadrobot.debug.servers.data.model.DebugStage +import com.redmadrobot.debug.servers.plugin.ServersPlugin +import com.redmadrobot.debug.servers.plugin.ServersPluginContainer +import okhttp3.HttpUrl +import okhttp3.Interceptor +import okhttp3.Request +import okhttp3.Response +import java.net.URI + +public class DebugStageInterceptor(private val hostName: String) : Interceptor { + + private var requestModifier: ((Request, DebugStage) -> Request?)? = null + + private val stageRepository by lazy { + getPlugin() + .getContainer() + .stagesRepository + } + + /** + * Additional request modification + * */ + public fun modifyRequest(block: (Request, DebugStage) -> Request): DebugStageInterceptor { + this.requestModifier = block + return this + } + + override fun intercept(chain: Interceptor.Chain): Response { + var request = chain.request() + return if (DebugPanel.isInitialized) { + val debugStage = stageRepository.getSelectedStage() + val host = debugStage.hosts[hostName] + if (host != null) { + val newUrl = request.getNewUrl(host) + request = request.newBuilder() + .url(newUrl) + .build() + } + chain.proceed(requestModifier?.invoke(request, debugStage) ?: request) + } else { + chain.proceed(request) + } + } + + + private fun Request.getNewUrl(debugServer: String): HttpUrl { + val serverUri = URI(debugServer) + return this.url.newBuilder() + .scheme(serverUri.scheme) + .host(serverUri.host) + .build() + } +} diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/listener/DefaultOnServerChangedListener.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/listener/DefaultOnServerChangedListener.kt deleted file mode 100644 index dae29f71..00000000 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/listener/DefaultOnServerChangedListener.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.redmadrobot.debug.servers.listener - -import com.redmadrobot.debug.servers.data.model.DebugServer - -internal class DefaultOnServerChangedListener : OnServerChangedListener { - override fun onChanged(server: DebugServer?) {/*do nothing*/} -} diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServerSelectedEvent.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServerSelectedEvent.kt index 48136800..5cea1181 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServerSelectedEvent.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServerSelectedEvent.kt @@ -2,5 +2,8 @@ package com.redmadrobot.debug.servers.plugin import com.redmadrobot.debug.core.internal.DebugEvent import com.redmadrobot.debug.servers.data.model.DebugServer +import com.redmadrobot.debug.servers.data.model.DebugStage public data class ServerSelectedEvent(val debugServer: DebugServer) : DebugEvent + +public data class StageSelectedEvent(val debugServer: DebugStage) : DebugEvent diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPlugin.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPlugin.kt index 1deb60a7..489ee5fa 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPlugin.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPlugin.kt @@ -5,7 +5,6 @@ import androidx.compose.foundation.verticalScroll import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.viewinterop.AndroidViewBinding -import androidx.core.os.bundleOf import androidx.fragment.app.Fragment import com.redmadrobot.debug.core.CommonContainer import com.redmadrobot.debug.core.data.DebugDataProvider @@ -13,12 +12,13 @@ import com.redmadrobot.debug.core.extension.getPlugin import com.redmadrobot.debug.core.plugin.Plugin import com.redmadrobot.debug.core.plugin.PluginDependencyContainer import com.redmadrobot.debug.servers.data.model.DebugServer +import com.redmadrobot.debug.servers.data.model.DebugServerData import com.redmadrobot.debug.servers.ui.ServersFragment import com.redmadrobot.servers_plugin.databinding.FragmentContainerServersBinding import kotlinx.coroutines.runBlocking public class ServersPlugin( - private val preInstalledServers: List = emptyList() + private val preInstalledServers: List = emptyList(), ) : Plugin() { init { diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPluginContainer.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPluginContainer.kt index 15eea77d..0c6ce95a 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPluginContainer.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPluginContainer.kt @@ -2,30 +2,42 @@ package com.redmadrobot.debug.servers.plugin import com.redmadrobot.debug.core.CommonContainer import com.redmadrobot.debug.core.plugin.PluginDependencyContainer -import com.redmadrobot.debug.servers.data.LocalDebugServerRepository +import com.redmadrobot.debug.servers.data.DebugServerRepository +import com.redmadrobot.debug.servers.data.DebugStageRepository import com.redmadrobot.debug.servers.data.model.DebugServer +import com.redmadrobot.debug.servers.data.model.DebugServerData +import com.redmadrobot.debug.servers.data.model.DebugStage import com.redmadrobot.debug.servers.data.storage.ServersPluginDatabase import com.redmadrobot.debug.servers.ui.ServersViewModel internal class ServersPluginContainer( - private val preInstalledServers: List, + private val preinstalledStages: List, private val container: CommonContainer ) : PluginDependencyContainer { private val pluginStorage by lazy { ServersPluginDatabase.getInstance(container.context) } val serversRepository by lazy { - LocalDebugServerRepository( + DebugServerRepository( container.context, pluginStorage.getDebugServersDao(), - preInstalledServers + preinstalledStages.filterIsInstance(), + ) + } + + val stagesRepository by lazy { + DebugStageRepository( + container.context, + pluginStorage.getDebugStagesDao(), + preinstalledStages.filterIsInstance() ) } fun createServersViewModel(): ServersViewModel { return ServersViewModel( container.context, - serversRepository + serversRepository, + stagesRepository ) } } diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersFragment.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersFragment.kt index 69e96b98..43130e9f 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersFragment.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersFragment.kt @@ -9,6 +9,7 @@ import com.redmadrobot.debug.common.extension.observe import com.redmadrobot.debug.common.extension.obtainShareViewModel import com.redmadrobot.debug.core.extension.getPlugin import com.redmadrobot.debug.servers.data.model.DebugServer +import com.redmadrobot.debug.servers.data.model.DebugStage import com.redmadrobot.debug.servers.plugin.ServersPlugin import com.redmadrobot.debug.servers.plugin.ServersPluginContainer import com.redmadrobot.debug.servers.ui.item.DebugServerItems @@ -19,6 +20,7 @@ import com.redmadrobot.itemsadapter.itemsAdapter import com.redmadrobot.servers_plugin.R import com.redmadrobot.servers_plugin.databinding.FragmentServersBinding import com.redmadrobot.servers_plugin.databinding.ItemDebugServerBinding +import com.redmadrobot.servers_plugin.databinding.ItemDebugStageBinding internal class ServersFragment : PluginFragment(R.layout.fragment_servers) { @@ -54,13 +56,12 @@ internal class ServersFragment : PluginFragment(R.layout.fragment_servers) { addServer.isVisible = isSettingMode } - private fun render(state: ServersViewState) { + private fun render(state: List) { val adapter = createAdapterByState(state) binding.serverList.adapter = adapter } - private fun createAdapterByState(state: ServersViewState): ItemsAdapter { - val items = state.preInstalledServers.plus(state.addedServers) + private fun createAdapterByState(items: List): ItemsAdapter { return itemsAdapter(items) { item -> when (item) { is DebugServerItems.Header -> { @@ -70,29 +71,54 @@ internal class ServersFragment : PluginFragment(R.layout.fragment_servers) { } is DebugServerItems.PreinstalledServer -> { - bind(R.layout.item_debug_server) { - itemServerName.text = item.debugServer.name - isSelectedIcon.isVisible = item.isSelected && !isSettingMode - if (!isSettingMode) { - root.setOnClickListener { - viewModel.onServerSelected(item.debugServer) + val server = item.debugServer + if (server is DebugServer) { + bind(R.layout.item_debug_server) { + itemServerName.text = item.debugServer.name + isSelectedIcon.isVisible = item.isSelected && !isSettingMode + if (!isSettingMode) { + root.setOnClickListener { + viewModel.onServerSelected(server) + } + } + } + } else { + bind(R.layout.item_debug_stage) { + itemStageName.text = item.debugServer.name + isSelectedIcon.isVisible = item.isSelected && !isSettingMode + if (!isSettingMode && server is DebugStage) { + root.setOnClickListener { + viewModel.onStageSelected(server) + } } } } } is DebugServerItems.AddedServer -> { - bind(R.layout.item_debug_server) { - itemServerName.text = item.debugServer.name - isSelectedIcon.isVisible = item.isSelected && !isSettingMode - itemServerDelete.isVisible = isSettingMode - val server = item.debugServer - itemServerDelete.setOnClickListener { viewModel.removeServer(server) } - root.setOnClickListener { - if (!isSettingMode) { - viewModel.onServerSelected(server) - } else { - editServerData(server) + val server = item.debugServer + if (server is DebugServer) { + bind(R.layout.item_debug_server) { + itemServerName.text = item.debugServer.name + isSelectedIcon.isVisible = item.isSelected && !isSettingMode + itemServerDelete.isVisible = isSettingMode + itemServerDelete.setOnClickListener { viewModel.removeServer(server) } + root.setOnClickListener { + if (!isSettingMode) { + viewModel.onServerSelected(server) + } else { + editServerData(server) + } + } + } + } else { + bind(R.layout.item_debug_server) { + itemServerName.text = item.debugServer.name + isSelectedIcon.isVisible = item.isSelected && !isSettingMode + root.setOnClickListener { + if (!isSettingMode && server is DebugStage) { + viewModel.onStageSelected(server) + } } } } diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersViewModel.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersViewModel.kt index 1d8b98f6..8b944586 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersViewModel.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersViewModel.kt @@ -1,39 +1,54 @@ package com.redmadrobot.debug.servers.ui import android.content.Context +import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.map import androidx.lifecycle.viewModelScope import com.redmadrobot.debug.common.base.PluginViewModel import com.redmadrobot.debug.common.extension.safeLaunch import com.redmadrobot.debug.core.extension.getPlugin import com.redmadrobot.servers_plugin.R import com.redmadrobot.debug.servers.data.DebugServerRepository +import com.redmadrobot.debug.servers.data.DebugStageRepository import com.redmadrobot.debug.servers.data.model.DebugServer +import com.redmadrobot.debug.servers.data.model.DebugServerData +import com.redmadrobot.debug.servers.data.model.DebugStage import com.redmadrobot.debug.servers.plugin.ServerSelectedEvent import com.redmadrobot.debug.servers.plugin.ServersPlugin +import com.redmadrobot.debug.servers.plugin.StageSelectedEvent import com.redmadrobot.debug.servers.ui.item.DebugServerItems import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch +import kotlinx.coroutines.runBlocking import kotlinx.coroutines.withContext internal class ServersViewModel( private val context: Context, - private val serversRepository: DebugServerRepository + private val serversRepository: DebugServerRepository, + private val stagesRepository: DebugStageRepository ) : PluginViewModel() { - val state = MutableLiveData().apply { - /*Default state*/ - value = ServersViewState( - preInstalledServers = emptyList(), - addedServers = emptyList() - ) - } + private val _state = MutableLiveData(ServersViewState()) + val state: LiveData> + get() = _state.map { + it.preinstalledStages + .plus(it.addedStages) + .plus(it.preInstalledServers) + .plus(it.addedServers) + } + fun loadServers() { viewModelScope.safeLaunch { withContext(Dispatchers.IO) { loadPreInstalledServers() loadAddedServers() + loadPreInstalledStages() + loadAddedStages() } } } @@ -54,16 +69,16 @@ internal class ServersViewModel( } fun updateServerData(id: Int, name: String, url: String) { - val itemForUpdate = state.value?.addedServers + val itemForUpdate = _state.value?.addedServers ?.find { it is DebugServerItems.AddedServer && it.debugServer.id == id } as? DebugServerItems.AddedServer val serverForUpdate = itemForUpdate?.debugServer - val updatedServer = serverForUpdate?.copy(name = name, url = url) - updatedServer?.let { server -> + (serverForUpdate as? DebugServer)?.let { + val updatedServer = serverForUpdate.copy(name = name, url = url) viewModelScope.safeLaunch { - serversRepository.updateServer(server) + serversRepository.updateServer(updatedServer) loadAddedServers() } } @@ -71,7 +86,8 @@ internal class ServersViewModel( fun onServerSelected(debugServer: DebugServer) { viewModelScope.launch { - if (debugServer != getSelectedServer()) { + val selectedServer = serversRepository.getSelectedServer() + if (debugServer != selectedServer) { getPlugin().pushEvent(ServerSelectedEvent(debugServer)) serversRepository.saveSelectedServer(debugServer) loadServers() @@ -79,47 +95,90 @@ internal class ServersViewModel( } } + fun onStageSelected(debugStage: DebugStage) { + val selectedStage = stagesRepository.getSelectedStage() + if (debugStage != selectedStage) { + stagesRepository.saveSelectedStage(debugStage) + getPlugin().pushEvent(StageSelectedEvent(debugStage)) + loadServers() + } + } + + @Deprecated("Migration to the stages system. Please use loadPreInstalledStages()") private suspend fun loadPreInstalledServers() { val servers = serversRepository.getPreInstalledServers() val headerText = context.getString(R.string.pre_installed_servers) val serverItems = mapToPreinstalledItems(headerText, servers) withContext(Dispatchers.Main) { - state.value = state.value?.copy(preInstalledServers = serverItems) + _state.value = _state.value?.copy(preInstalledServers = serverItems) + } + } + + private suspend fun loadPreInstalledStages() { + val stages = stagesRepository.getPreInstalledStages() + val headerText = context.getString(R.string.pre_installed_stages) + val stageItems = mapToPreinstalledItems(headerText, stages) + withContext(Dispatchers.Main) { + _state.value = _state.value?.copy(preinstalledStages = stageItems) } } + @Deprecated("Migration to the stages system. Please use loadAddedStages()") private suspend fun loadAddedServers() { val servers = serversRepository.getServers() val headerText = context.getString(R.string.added_servers) val serverItems = mapToAddedItems(headerText, servers) withContext(Dispatchers.Main) { - state.value = state.value?.copy(addedServers = serverItems) + _state.value = _state.value?.copy(addedServers = serverItems) + } + } + + private suspend fun loadAddedStages() { + val stages = stagesRepository.getStages() + val headerText = context.getString(R.string.added_servers) + val serverItems = mapToAddedItems(headerText, stages) + withContext(Dispatchers.Main) { + _state.value = _state.value?.copy(addedStages = serverItems) } } private suspend fun mapToPreinstalledItems( header: String, - servers: List + servers: List ): List { + val selectedServer = serversRepository.getSelectedServer() + val selectedStage = stagesRepository.getSelectedStage() + val items = servers.map { debugServer -> - val isSelected = getSelectedServer().url == debugServer.url + val isSelected = when (debugServer) { + is DebugServer -> selectedServer.url == debugServer.url + is DebugStage -> selectedStage == debugServer + else -> false + } DebugServerItems.PreinstalledServer(debugServer, isSelected) } - return listOf(/*Заголовок списка*/DebugServerItems.Header(header)).plus(items) + return listOf(DebugServerItems.Header(header)).plus(items) } private suspend fun mapToAddedItems( header: String, - servers: List + servers: List ): List { if (servers.isEmpty()) return emptyList() + val selectedServer = serversRepository.getSelectedServer() + val selectedStage = stagesRepository.getSelectedStage() + val items = servers.map { debugServer -> - val isSelected = getSelectedServer().url == debugServer.url + val isSelected = when (debugServer) { + is DebugServer -> selectedServer.url == debugServer.url + is DebugStage -> selectedStage == debugServer + else -> false + } DebugServerItems.AddedServer(debugServer, isSelected) } - return listOf(/*Заголовок списка*/DebugServerItems.Header(header)).plus(items) + return listOf(DebugServerItems.Header(header)).plus(items) } private suspend fun getSelectedServer(): DebugServer { diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersViewState.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersViewState.kt index 2a94dfe1..3dba6efd 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersViewState.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersViewState.kt @@ -3,6 +3,8 @@ package com.redmadrobot.debug.servers.ui import com.redmadrobot.debug.servers.ui.item.DebugServerItems internal data class ServersViewState( - val preInstalledServers: List, - val addedServers: List + val preInstalledServers: List = emptyList(), + val addedServers: List = emptyList(), + val preinstalledStages: List = emptyList(), + val addedStages: List = emptyList(), ) diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/item/DebugServerItems.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/item/DebugServerItems.kt index dd799247..0e80fcb9 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/item/DebugServerItems.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/item/DebugServerItems.kt @@ -1,18 +1,19 @@ package com.redmadrobot.debug.servers.ui.item import com.redmadrobot.debug.servers.data.model.DebugServer +import com.redmadrobot.debug.servers.data.model.DebugServerData internal sealed class DebugServerItems { data class Header(val header: String) : DebugServerItems() data class PreinstalledServer( - var debugServer: DebugServer, + var debugServer: DebugServerData, var isSelected: Boolean ) : DebugServerItems() data class AddedServer( - var debugServer: DebugServer, + var debugServer: DebugServerData, var isSelected: Boolean ) : DebugServerItems() } diff --git a/plugins/servers/src/main/res/drawable/icon_router.xml b/plugins/servers/src/main/res/drawable/icon_router.xml index af4e8e58..70ac290e 100644 --- a/plugins/servers/src/main/res/drawable/icon_router.xml +++ b/plugins/servers/src/main/res/drawable/icon_router.xml @@ -1,5 +1,10 @@ - - + + diff --git a/plugins/servers/src/main/res/drawable/icon_stage.xml b/plugins/servers/src/main/res/drawable/icon_stage.xml new file mode 100644 index 00000000..dcde3147 --- /dev/null +++ b/plugins/servers/src/main/res/drawable/icon_stage.xml @@ -0,0 +1,5 @@ + + + diff --git a/plugins/servers/src/main/res/layout/item_debug_stage.xml b/plugins/servers/src/main/res/layout/item_debug_stage.xml new file mode 100644 index 00000000..4fbc0ea5 --- /dev/null +++ b/plugins/servers/src/main/res/layout/item_debug_stage.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + diff --git a/plugins/servers/src/main/res/values/strings.xml b/plugins/servers/src/main/res/values/strings.xml index a5ed16f8..8e6c23fd 100644 --- a/plugins/servers/src/main/res/values/strings.xml +++ b/plugins/servers/src/main/res/values/strings.xml @@ -1,11 +1,13 @@ Pre-installed servers + Pre-installed stages https://google.com Wrong host format. Must be filled save Default server - Added + Added servers + Added stages Name From 22374268fdd5a6da0c3ba71fa7c7beb8ddf70bbc Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Thu, 12 Jan 2023 15:56:22 +0300 Subject: [PATCH 34/42] No-op: update no-op module --- .../debug/noop/servers/DebugServer.kt | 3 ++- .../noop/servers/DebugServerInterceptor.kt | 2 +- .../debug/noop/servers/DebugStage.kt | 9 +++++++++ .../noop/servers/DebugStageInterceptor.kt | 18 ++++++++++++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugStage.kt create mode 100644 no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugStageInterceptor.kt diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugServer.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugServer.kt index 70e8a556..2ed1b16d 100644 --- a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugServer.kt +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugServer.kt @@ -3,5 +3,6 @@ package com.redmadrobot.debug.servers.data.model data class DebugServer( val id: Int = 0, val name: String, - val url: String + val url: String, + val isDefault: Boolean = false ) diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugServerInterceptor.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugServerInterceptor.kt index 4b68a20d..2fc35bc7 100644 --- a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugServerInterceptor.kt +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugServerInterceptor.kt @@ -1,4 +1,4 @@ -package com.redmadrobot.debug.servers.util +package com.redmadrobot.debug.servers.interceptor import com.redmadrobot.debug.servers.data.model.DebugServer import okhttp3.Interceptor diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugStage.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugStage.kt new file mode 100644 index 00000000..8ebcad11 --- /dev/null +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugStage.kt @@ -0,0 +1,9 @@ +package com.redmadrobot.debug.servers.data.model + + +data class DebugStage( + val id: Int = 0, + val name: String, + val hosts: Map, + val isDefault: Boolean = false +) diff --git a/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugStageInterceptor.kt b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugStageInterceptor.kt new file mode 100644 index 00000000..c2dccf2c --- /dev/null +++ b/no-op/src/main/kotlin/com/redmadrobot/debug/noop/servers/DebugStageInterceptor.kt @@ -0,0 +1,18 @@ +package com.redmadrobot.debug.servers.interceptor + +import com.redmadrobot.debug.servers.data.model.DebugStage +import okhttp3.Interceptor +import okhttp3.Request +import okhttp3.Response + + +public class DebugStageInterceptor(private val tag: String) : Interceptor { + + public fun modifyRequest(block: (Request, DebugStage) -> Request): DebugStageInterceptor { + return this + } + + override fun intercept(chain: Interceptor.Chain): Response { + return chain.proceed(chain.request()) + } +} From 16dac5eb0744d02b4993d79df5b4ac5e8685df7f Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Mon, 16 Jan 2023 19:52:37 +0300 Subject: [PATCH 35/42] Servers: Migrate to Jetpack Compose UI --- common/build.gradle.kts | 1 + .../debug/core/extension/ComposeExt.kt | 46 +++ .../debug/servers/plugin/ServersPlugin.kt | 19 +- .../servers/plugin/ServersPluginContainer.kt | 1 - .../debug/servers/ui/ServerHostDialog.kt | 141 ------- .../debug/servers/ui/ServersFragment.kt | 138 +------ .../debug/servers/ui/ServersScreen.kt | 374 ++++++++++++++++++ .../debug/servers/ui/ServersViewModel.kt | 249 ++++++------ .../debug/servers/ui/ServersViewState.kt | 24 +- .../debug/servers/ui/item/DebugServerItems.kt | 19 - 10 files changed, 593 insertions(+), 419 deletions(-) create mode 100644 core/src/main/kotlin/com/redmadrobot/debug/core/extension/ComposeExt.kt delete mode 100644 plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServerHostDialog.kt create mode 100644 plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersScreen.kt delete mode 100644 plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/item/DebugServerItems.kt diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 0870258c..bc81ac76 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -54,6 +54,7 @@ dependencies { api(androidx.constraintlayout.compose) api(androidx.activity.compose) api(androidx.compose.ui.tooling.preview) + api(androidx.lifecycle.viewmodel.compose) api(androidx.room.runtime) api(androidx.room) api(androidx.core) diff --git a/core/src/main/kotlin/com/redmadrobot/debug/core/extension/ComposeExt.kt b/core/src/main/kotlin/com/redmadrobot/debug/core/extension/ComposeExt.kt new file mode 100644 index 00000000..4a812474 --- /dev/null +++ b/core/src/main/kotlin/com/redmadrobot/debug/core/extension/ComposeExt.kt @@ -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 provideViewModel(crossinline block: () -> T): T { + return viewModel( + factory = object : ViewModelProvider.Factory { + override fun create(modelClass: Class): 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) + } + } +} diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPlugin.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPlugin.kt index 489ee5fa..583577d1 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPlugin.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPlugin.kt @@ -14,6 +14,7 @@ import com.redmadrobot.debug.core.plugin.PluginDependencyContainer import com.redmadrobot.debug.servers.data.model.DebugServer import com.redmadrobot.debug.servers.data.model.DebugServerData import com.redmadrobot.debug.servers.ui.ServersFragment +import com.redmadrobot.debug.servers.ui.ServersScreen import com.redmadrobot.servers_plugin.databinding.FragmentContainerServersBinding import kotlinx.coroutines.runBlocking @@ -57,16 +58,16 @@ public class ServersPlugin( } @Deprecated( - "You should't use fragments for you plugins. Please use Jetpack Compose", - replaceWith = ReplaceWith("content()", "com.redmadrobot.debug.core.plugin.Plugin") + "You shouldn't use fragments for you plugins. Please use Jetpack Compose", + replaceWith = ReplaceWith("content()") ) override fun getFragment(): Fragment { return ServersFragment() } @Deprecated( - "You should't use fragments for you plugins. Please use Jetpack Compose", - replaceWith = ReplaceWith("content()", "com.redmadrobot.debug.core.plugin.Plugin") + "You shouldn't use fragments for you plugins. Please use Jetpack Compose", + replaceWith = ReplaceWith("settingsContent()") ) override fun getSettingFragment(): Fragment { return ServersFragment() @@ -74,17 +75,11 @@ public class ServersPlugin( @Composable override fun content() { - AndroidViewBinding( - FragmentContainerServersBinding::inflate, - modifier = Modifier.verticalScroll(rememberScrollState()) - ) + ServersScreen(isEditMode = false) } @Composable override fun settingsContent() { - AndroidViewBinding( - FragmentContainerServersBinding::inflate, - modifier = Modifier.verticalScroll(rememberScrollState()) - ) + AndroidViewBinding(FragmentContainerServersBinding::inflate) } } diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPluginContainer.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPluginContainer.kt index 0c6ce95a..e670ee83 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPluginContainer.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPluginContainer.kt @@ -35,7 +35,6 @@ internal class ServersPluginContainer( fun createServersViewModel(): ServersViewModel { return ServersViewModel( - container.context, serversRepository, stagesRepository ) diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServerHostDialog.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServerHostDialog.kt deleted file mode 100644 index 744f381d..00000000 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServerHostDialog.kt +++ /dev/null @@ -1,141 +0,0 @@ -package com.redmadrobot.debug.servers.ui - -import android.os.Bundle -import android.util.Patterns -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.LinearLayout -import androidx.fragment.app.DialogFragment -import androidx.fragment.app.FragmentManager -import com.redmadrobot.debug.common.extension.obtainShareViewModel -import com.redmadrobot.debug.core.extension.getPlugin -import com.redmadrobot.servers_plugin.R -import com.redmadrobot.servers_plugin.databinding.DialogServerBinding -import com.redmadrobot.debug.servers.plugin.ServersPlugin -import com.redmadrobot.debug.servers.plugin.ServersPluginContainer - -internal class ServerHostDialog : DialogFragment() { - - companion object { - const val KEY_NAME = "NAME" - const val KEY_URL = "URL" - const val KEY_ID = "ID" - private const val TAG = "AddServerDialog" - - fun show(fragmentManager: FragmentManager, params: Bundle? = null) { - ServerHostDialog().apply { - arguments = params - }.show(fragmentManager, TAG) - } - } - - private var _binding: DialogServerBinding? = null - private val binding get() = checkNotNull(_binding) - - private val shareViewModel by lazy { - obtainShareViewModel { - getPlugin() - .getContainer() - .createServersViewModel() - } - } - - private var isEditMode = false - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle? - ): View? { - _binding = DialogServerBinding.inflate(inflater, container, false) - return binding.root - } - - override fun onStart() { - super.onStart() - dialog?.window?.setLayout( - LinearLayout.LayoutParams.MATCH_PARENT, - LinearLayout.LayoutParams.WRAP_CONTENT - ) - } - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - binding.setViews() - obtainArguments() - } - - override fun onDestroyView() { - super.onDestroyView() - _binding = null - } - - private fun obtainArguments() { - val name = arguments?.getString(KEY_NAME) - val url = arguments?.getString(KEY_URL) - if (!name.isNullOrEmpty() && !url.isNullOrEmpty()) { - binding.serverName.setText(name) - binding.serverHost.setText(url) - isEditMode = true - } - } - - private fun DialogServerBinding.setViews() { - saveServerButton.setOnClickListener { - val name = serverName.text.toString() - val url = serverHost.text.toString() - if (isDataValid(name, url)) { - save(name, url) - } else { - showWrongHostError() - } - } - serverName.requestFocus() - } - - private fun save(name: String, url: String) { - if (isEditMode) { - update(name, url) - } else { - saveNew(name, url) - } - } - - private fun update(name: String, url: String) { - val id = arguments?.getInt(KEY_ID) - id?.let { - shareViewModel.updateServerData(id, name, url) - } - dialog?.dismiss() - } - - private fun saveNew(name: String, url: String) { - shareViewModel.addServer(name, url) - dialog?.dismiss() - } - - private fun isDataValid(name: String, url: String): Boolean { - return when { - name.isEmpty() -> { - showEmptyNameError() - false - } - !Patterns.WEB_URL.matcher(url).matches() -> { - showWrongHostError() - false - } - else -> { - true - } - } - } - - private fun showEmptyNameError() { - binding.serverNameInputLayout.error = getString(R.string.error_empty_name) - } - - private fun showWrongHostError() { - binding.serverNameInputLayout.error = getString(R.string.error_wrong_host) - } -} diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersFragment.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersFragment.kt index 43130e9f..aef10f74 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersFragment.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersFragment.kt @@ -1,138 +1,28 @@ package com.redmadrobot.debug.servers.ui import android.os.Bundle -import android.view.View -import androidx.core.view.isVisible -import androidx.recyclerview.widget.LinearLayoutManager -import com.redmadrobot.debug.common.base.PluginFragment -import com.redmadrobot.debug.common.extension.observe +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.compose.ui.platform.ComposeView +import androidx.fragment.app.Fragment import com.redmadrobot.debug.common.extension.obtainShareViewModel import com.redmadrobot.debug.core.extension.getPlugin -import com.redmadrobot.debug.servers.data.model.DebugServer -import com.redmadrobot.debug.servers.data.model.DebugStage import com.redmadrobot.debug.servers.plugin.ServersPlugin import com.redmadrobot.debug.servers.plugin.ServersPluginContainer -import com.redmadrobot.debug.servers.ui.item.DebugServerItems -import com.redmadrobot.debug_panel_common.databinding.ItemSectionHeaderBinding -import com.redmadrobot.itemsadapter.ItemsAdapter -import com.redmadrobot.itemsadapter.bind -import com.redmadrobot.itemsadapter.itemsAdapter -import com.redmadrobot.servers_plugin.R -import com.redmadrobot.servers_plugin.databinding.FragmentServersBinding -import com.redmadrobot.servers_plugin.databinding.ItemDebugServerBinding -import com.redmadrobot.servers_plugin.databinding.ItemDebugStageBinding -internal class ServersFragment : PluginFragment(R.layout.fragment_servers) { +internal class ServersFragment : Fragment() { - private var _binding: FragmentServersBinding? = null - private val binding get() = checkNotNull(_binding) - - private val viewModel by lazy { - obtainShareViewModel { - getPlugin() - .getContainer() - .createServersViewModel() - } - } - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - _binding = FragmentServersBinding.bind(view) - observe(viewModel.state, ::render) - binding.setViews() - viewModel.loadServers() - } - - override fun onDestroyView() { - super.onDestroyView() - _binding = null - } - - private fun FragmentServersBinding.setViews() { - serverList.layoutManager = LinearLayoutManager(requireContext()) - addServer.setOnClickListener { - ServerHostDialog.show(childFragmentManager) - } - addServer.isVisible = isSettingMode - } - - private fun render(state: List) { - val adapter = createAdapterByState(state) - binding.serverList.adapter = adapter - } - - private fun createAdapterByState(items: List): ItemsAdapter { - return itemsAdapter(items) { item -> - when (item) { - is DebugServerItems.Header -> { - bind(CommonR.layout.item_section_header) { - itemSectionTitle.text = item.header - } - } - - is DebugServerItems.PreinstalledServer -> { - val server = item.debugServer - if (server is DebugServer) { - bind(R.layout.item_debug_server) { - itemServerName.text = item.debugServer.name - isSelectedIcon.isVisible = item.isSelected && !isSettingMode - if (!isSettingMode) { - root.setOnClickListener { - viewModel.onServerSelected(server) - } - } - } - } else { - bind(R.layout.item_debug_stage) { - itemStageName.text = item.debugServer.name - isSelectedIcon.isVisible = item.isSelected && !isSettingMode - if (!isSettingMode && server is DebugStage) { - root.setOnClickListener { - viewModel.onStageSelected(server) - } - } - } - } - } - - is DebugServerItems.AddedServer -> { - val server = item.debugServer - if (server is DebugServer) { - bind(R.layout.item_debug_server) { - itemServerName.text = item.debugServer.name - isSelectedIcon.isVisible = item.isSelected && !isSettingMode - itemServerDelete.isVisible = isSettingMode - itemServerDelete.setOnClickListener { viewModel.removeServer(server) } - root.setOnClickListener { - if (!isSettingMode) { - viewModel.onServerSelected(server) - } else { - editServerData(server) - } - } - } - } else { - bind(R.layout.item_debug_server) { - itemServerName.text = item.debugServer.name - isSelectedIcon.isVisible = item.isSelected && !isSettingMode - root.setOnClickListener { - if (!isSettingMode && server is DebugStage) { - viewModel.onStageSelected(server) - } - } - } - } - } - } - } + private val isSettingMode: Boolean by lazy { + activity?.javaClass?.simpleName == "DebugActivity" } - private fun editServerData(debugServer: DebugServer) { - val bundle = Bundle().apply { - putInt(ServerHostDialog.KEY_ID, debugServer.id) - putString(ServerHostDialog.KEY_NAME, debugServer.name) - putString(ServerHostDialog.KEY_URL, debugServer.url) + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ) = ComposeView(inflater.context).apply { + setContent { + ServersScreen(isEditMode = isSettingMode) } - ServerHostDialog.show(childFragmentManager, bundle) } } diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersScreen.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersScreen.kt new file mode 100644 index 00000000..c1a9f261 --- /dev/null +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersScreen.kt @@ -0,0 +1,374 @@ +package com.redmadrobot.debug.servers.ui + +import android.annotation.SuppressLint +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.defaultMinSize +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.wrapContentHeight +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Button +import androidx.compose.material.Card +import androidx.compose.material.ExtendedFloatingActionButton +import androidx.compose.material.Icon +import androidx.compose.material.IconButton +import androidx.compose.material.MaterialTheme +import androidx.compose.material.OutlinedTextField +import androidx.compose.material.Scaffold +import androidx.compose.material.Surface +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.ExperimentalComposeUiApi +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import androidx.compose.ui.window.Dialog +import androidx.compose.ui.window.DialogProperties +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.ViewModel +import androidx.lifecycle.ViewModelProvider +import androidx.lifecycle.viewmodel.compose.viewModel +import com.redmadrobot.debug.core.extension.OnLifecycleEvent +import com.redmadrobot.debug.core.extension.getPlugin +import com.redmadrobot.debug.core.extension.provideViewModel +import com.redmadrobot.debug.servers.data.model.DebugServer +import com.redmadrobot.debug.servers.data.model.DebugStage +import com.redmadrobot.debug.servers.plugin.ServersPlugin +import com.redmadrobot.debug.servers.plugin.ServersPluginContainer +import com.redmadrobot.servers_plugin.R + +@SuppressLint("UnusedMaterialScaffoldPaddingParameter") +@Composable +internal fun ServersScreen( + viewModel: ServersViewModel = provideViewModel { + getPlugin() + .getContainer() + .createServersViewModel() + }, + isEditMode: Boolean +) { + val state by viewModel.state.collectAsState() + Scaffold( + floatingActionButton = { + if (isEditMode) { + ExtendedFloatingActionButton( + onClick = { viewModel.onAddClicked() }, + text = { Text("Add") }, + icon = { + Icon( + painterResource(R.drawable.icon_add_server), + contentDescription = null + ) + } + ) + } + } + ) { + ServersScreenLayout( + state = state, + isEditMode = isEditMode, + onServerClick = if (!isEditMode) viewModel::onServerClicked else viewModel::onEditServerClicked, + onStageClick = viewModel::onStageClicked, + onServerDeleteClick = viewModel::onRemoveServerClicked + ) + } + if (state.serverDialogState.show) { + ServerDialog( + state = state.serverDialogState, + onNameChange = viewModel::onServerNameChanged, + onUrlChange = viewModel::onServerUrlChanged, + onDismiss = viewModel::dismissDialogs, + onSaveClick = viewModel::onSaveServerClicked, + ) + } + OnLifecycleEvent { event -> + if (event == Lifecycle.Event.ON_RESUME) { + viewModel.loadServers() + } + } +} + +@Composable +private fun ServersScreenLayout( + state: ServersViewState, + isEditMode: Boolean, + onServerClick: (DebugServer) -> Unit, + onServerDeleteClick: (DebugServer) -> Unit, + onStageClick: (DebugStage) -> Unit, +) { + LazyColumn( + modifier = Modifier + .fillMaxSize(), + verticalArrangement = Arrangement.spacedBy(8.dp), + contentPadding = PaddingValues(start = 16.dp, end = 16.dp, bottom = 64.dp), + ) { + if (state.preinstalledStages.isNotEmpty()) { + item { + Text( + stringResource(id = R.string.pre_installed_stages).uppercase(), + modifier = Modifier + .fillParentMaxWidth() + .padding(vertical = 16.dp), + fontSize = 16.sp + ) + } + items(state.preinstalledStages) { item -> + StageItem( + stage = item.server, + selected = item.isSelected && !isEditMode, + showDelete = false, + onItemClick = onStageClick.takeIf { !isEditMode }, + ) + } + } + + if (state.preInstalledServers.isNotEmpty()) { + item { + Text( + stringResource(id = R.string.pre_installed_servers).uppercase(), + modifier = Modifier + .fillParentMaxWidth() + .padding(vertical = 16.dp), + fontSize = 16.sp + ) + } + items(state.preInstalledServers) { item -> + ServerItem( + server = item.server, + selected = item.isSelected && !isEditMode, + showDelete = false, + onItemClick = onServerClick.takeIf { !isEditMode }, + onDeleteClick = onServerDeleteClick, + ) + } + } + if (state.addedStages.isNotEmpty()) { + item { + Text( + stringResource(id = R.string.added_stages).uppercase(), + modifier = Modifier + .fillParentMaxWidth() + .padding(vertical = 16.dp), + fontSize = 16.sp + ) + } + items(state.addedStages) { item -> + StageItem( + stage = item.server, + selected = item.isSelected && !isEditMode, + showDelete = isEditMode, + onItemClick = onStageClick, + ) + } + } + + if (state.addedServers.isNotEmpty()) { + item { + Text( + stringResource(id = R.string.added_servers).uppercase(), + modifier = Modifier + .fillParentMaxWidth() + .padding(vertical = 16.dp), + fontSize = 16.sp + ) + } + items(state.addedServers) { item -> + ServerItem( + server = item.server, + selected = item.isSelected && !isEditMode, + showDelete = isEditMode, + onItemClick = onServerClick, + onDeleteClick = onServerDeleteClick, + ) + } + } + } +} + +@Composable +private fun ServerItem( + server: DebugServer, + selected: Boolean, + showDelete: Boolean, + onDeleteClick: (DebugServer) -> Unit, + onItemClick: ((DebugServer) -> Unit)? = null, +) { + Card( + modifier = Modifier + .fillMaxWidth() + .defaultMinSize(minHeight = 56.dp) + .clickable { onItemClick?.invoke(server) } + ) { + Column( + modifier = Modifier + .fillMaxSize() + .padding(16.dp) + ) { + Row( + modifier = Modifier.fillMaxSize(), + horizontalArrangement = Arrangement.spacedBy(32.dp), + verticalAlignment = Alignment.CenterVertically + ) { + Icon( + painter = painterResource(R.drawable.icon_router), + contentDescription = null, + tint = MaterialTheme.colors.primary + ) + Text(server.name, fontWeight = FontWeight.SemiBold) + Box(modifier = Modifier.weight(1f)) { + if (selected) { + Icon( + painterResource(R.drawable.icon_selected), + contentDescription = null, + modifier = Modifier.align(Alignment.CenterEnd) + ) + } else if (showDelete) { + IconButton( + modifier = Modifier.align(Alignment.CenterEnd), + onClick = { onDeleteClick(server) }, + ) { + Icon( + painterResource(R.drawable.icon_delete), + contentDescription = null, + tint = Color.Red + ) + } + } + } + } + Spacer(modifier = Modifier.height(8.dp)) + Text(text = "url: ${server.url}", color = Color.Gray, fontSize = 12.sp) + } + } +} + +@Composable +private fun StageItem( + stage: DebugStage, + showDelete: Boolean, + selected: Boolean, + onItemClick: ((DebugStage) -> Unit)? = null, + onDeleteClick: (DebugStage) -> Unit = {}, +) { + Card( + modifier = Modifier + .fillMaxWidth() + .defaultMinSize(minHeight = 56.dp) + .clickable { onItemClick?.invoke(stage) } + ) { + Column( + modifier = Modifier + .fillMaxSize() + .padding(16.dp) + ) { + Row( + modifier = Modifier.fillMaxSize(), + horizontalArrangement = Arrangement.spacedBy(32.dp), + verticalAlignment = Alignment.CenterVertically + ) { + Icon( + painter = painterResource(R.drawable.icon_stage), + contentDescription = null, + tint = MaterialTheme.colors.primary + ) + Text(stage.name, fontWeight = FontWeight.SemiBold) + Box(modifier = Modifier.weight(1f)) { + if (selected) { + Icon( + painterResource(R.drawable.icon_selected), + contentDescription = null, + modifier = Modifier.align(Alignment.CenterEnd) + ) + } else if (showDelete) { + IconButton( + modifier = Modifier.align(Alignment.CenterEnd), + onClick = { onDeleteClick(stage) }, + ) { + Icon( + painterResource(R.drawable.icon_delete), + contentDescription = null, + tint = Color.Red + ) + } + } + } + } + Spacer(modifier = Modifier.height(8.dp)) + Column { + stage.hosts.forEach { (key, value) -> + Text(text = "$key: $value", color = Color.Gray, fontSize = 12.sp) + } + } + } + } +} + +@OptIn(ExperimentalComposeUiApi::class) +@Composable +private fun ServerDialog( + state: ServerDialogState, + onNameChange: (String) -> Unit, + onUrlChange: (String) -> Unit, + onDismiss: () -> Unit, + onSaveClick: () -> Unit, +) { + + Dialog( + onDismissRequest = onDismiss, + properties = DialogProperties(usePlatformDefaultWidth = false) + ) { + Surface( + shape = RoundedCornerShape(16.dp), + color = Color.White, + modifier = Modifier.wrapContentHeight() + ) { + Column( + modifier = Modifier.padding(16.dp) + ) { + OutlinedTextField( + value = state.serverName, + onValueChange = onNameChange, + label = { Text(stringResource(R.string.name)) }, + isError = state.nameError != null + ) + if (state.nameError != null) { + Text(text = stringResource(id = state.nameError), color = Color.Red) + } + Spacer(modifier = Modifier.height(16.dp)) + OutlinedTextField( + value = state.serverUrl, + onValueChange = onUrlChange, + label = { Text(stringResource(R.string.server_host_hint)) }, + isError = state.urlError != null + ) + if (state.urlError != null) { + Text(text = stringResource(id = state.urlError), color = Color.Red) + } + Button( + onClick = onSaveClick, + modifier = Modifier.align(Alignment.End) + ) { + Text(stringResource(R.string.save_server).uppercase()) + } + } + } + + } +} diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersViewModel.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersViewModel.kt index 8b944586..60727618 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersViewModel.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersViewModel.kt @@ -1,188 +1,203 @@ package com.redmadrobot.debug.servers.ui -import android.content.Context -import androidx.lifecycle.LiveData -import androidx.lifecycle.MutableLiveData -import androidx.lifecycle.map +import android.util.Patterns import androidx.lifecycle.viewModelScope import com.redmadrobot.debug.common.base.PluginViewModel import com.redmadrobot.debug.common.extension.safeLaunch import com.redmadrobot.debug.core.extension.getPlugin -import com.redmadrobot.servers_plugin.R import com.redmadrobot.debug.servers.data.DebugServerRepository import com.redmadrobot.debug.servers.data.DebugStageRepository import com.redmadrobot.debug.servers.data.model.DebugServer -import com.redmadrobot.debug.servers.data.model.DebugServerData import com.redmadrobot.debug.servers.data.model.DebugStage import com.redmadrobot.debug.servers.plugin.ServerSelectedEvent import com.redmadrobot.debug.servers.plugin.ServersPlugin import com.redmadrobot.debug.servers.plugin.StageSelectedEvent -import com.redmadrobot.debug.servers.ui.item.DebugServerItems +import com.redmadrobot.servers_plugin.R import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking -import kotlinx.coroutines.withContext internal class ServersViewModel( - private val context: Context, private val serversRepository: DebugServerRepository, private val stagesRepository: DebugStageRepository ) : PluginViewModel() { - private val _state = MutableLiveData(ServersViewState()) - val state: LiveData> - get() = _state.map { - it.preinstalledStages - .plus(it.addedStages) - .plus(it.preInstalledServers) - .plus(it.addedServers) - } - + private val _state = MutableStateFlow(ServersViewState()) + val state: StateFlow = _state fun loadServers() { - viewModelScope.safeLaunch { - withContext(Dispatchers.IO) { - loadPreInstalledServers() - loadAddedServers() - loadPreInstalledStages() - loadAddedStages() + viewModelScope.launch(Dispatchers.IO) { + _state.update { + it.copy( + preInstalledServers = serversRepository.getPreInstalledServers() + .mapToServerItems(), + preinstalledStages = stagesRepository.getPreInstalledStages().mapToStageItems(), + addedServers = serversRepository.getServers().mapToServerItems(), + addedStages = stagesRepository.getStages().mapToStageItems() + ) } } } - fun addServer(name: String, url: String) { - val server = DebugServer(name = name, url = url, isDefault = false) - viewModelScope.safeLaunch { - serversRepository.addServer(server) - loadAddedServers() + fun onAddClicked() { + _state.update { + it.copy(serverDialogState = it.serverDialogState.copy(show = true)) } } - fun removeServer(debugServer: DebugServer) { - viewModelScope.safeLaunch { - serversRepository.removeServer(debugServer) - loadAddedServers() + fun dismissDialogs() { + _state.update { + it.copy(serverDialogState = ServerDialogState()) } } - fun updateServerData(id: Int, name: String, url: String) { - val itemForUpdate = _state.value?.addedServers - ?.find { it is DebugServerItems.AddedServer && it.debugServer.id == id } - as? DebugServerItems.AddedServer - - val serverForUpdate = itemForUpdate?.debugServer - - (serverForUpdate as? DebugServer)?.let { - val updatedServer = serverForUpdate.copy(name = name, url = url) - viewModelScope.safeLaunch { - serversRepository.updateServer(updatedServer) - loadAddedServers() - } + fun onServerNameChanged(name: String) { + _state.update { + it.copy(serverDialogState = it.serverDialogState.copy(serverName = name)) } } - fun onServerSelected(debugServer: DebugServer) { - viewModelScope.launch { - val selectedServer = serversRepository.getSelectedServer() - if (debugServer != selectedServer) { - getPlugin().pushEvent(ServerSelectedEvent(debugServer)) - serversRepository.saveSelectedServer(debugServer) - loadServers() - } + fun onServerUrlChanged(url: String) { + _state.update { + it.copy(serverDialogState = it.serverDialogState.copy(serverUrl = url)) } } - fun onStageSelected(debugStage: DebugStage) { - val selectedStage = stagesRepository.getSelectedStage() - if (debugStage != selectedStage) { - stagesRepository.saveSelectedStage(debugStage) - getPlugin().pushEvent(StageSelectedEvent(debugStage)) - loadServers() + fun onSaveServerClicked() { + if (allServerFieldValid()) { + val dialogState = _state.value.serverDialogState + + if (dialogState.editableServerId == null) { + addServer(dialogState.serverName, dialogState.serverUrl) + } else { + updateServerData( + dialogState.editableServerId, + dialogState.serverName, + dialogState.serverUrl + ) + } + + _state.update { + it.copy(serverDialogState = ServerDialogState()) + } } } - @Deprecated("Migration to the stages system. Please use loadPreInstalledStages()") - private suspend fun loadPreInstalledServers() { - val servers = serversRepository.getPreInstalledServers() - val headerText = context.getString(R.string.pre_installed_servers) - val serverItems = mapToPreinstalledItems(headerText, servers) - withContext(Dispatchers.Main) { - _state.value = _state.value?.copy(preInstalledServers = serverItems) + private fun allServerFieldValid(): Boolean { + val dialogState = _state.value.serverDialogState + val nameError = if (dialogState.serverName.isEmpty()) { + R.string.error_empty_name + } else { + null + } + val urlError = if (!Patterns.WEB_URL.matcher(dialogState.serverUrl).matches()) { + R.string.error_wrong_host + } else { + null } - } - private suspend fun loadPreInstalledStages() { - val stages = stagesRepository.getPreInstalledStages() - val headerText = context.getString(R.string.pre_installed_stages) - val stageItems = mapToPreinstalledItems(headerText, stages) - withContext(Dispatchers.Main) { - _state.value = _state.value?.copy(preinstalledStages = stageItems) + _state.update { + it.copy( + serverDialogState = dialogState.copy( + nameError = nameError, + urlError = urlError + ) + ) } + + return nameError == null && urlError == null } - @Deprecated("Migration to the stages system. Please use loadAddedStages()") - private suspend fun loadAddedServers() { - val servers = serversRepository.getServers() - val headerText = context.getString(R.string.added_servers) - val serverItems = mapToAddedItems(headerText, servers) - withContext(Dispatchers.Main) { - _state.value = _state.value?.copy(addedServers = serverItems) + fun onRemoveServerClicked(debugServer: DebugServer) { + viewModelScope.safeLaunch { + serversRepository.removeServer(debugServer) + _state.update { + it.copy( + addedServers = serversRepository.getServers().mapToServerItems() + ) + } } } - private suspend fun loadAddedStages() { - val stages = stagesRepository.getStages() - val headerText = context.getString(R.string.added_servers) - val serverItems = mapToAddedItems(headerText, stages) - withContext(Dispatchers.Main) { - _state.value = _state.value?.copy(addedStages = serverItems) + private fun addServer(name: String, url: String) { + val server = DebugServer(name = name, url = url, isDefault = false) + viewModelScope.safeLaunch { + serversRepository.addServer(server) + _state.update { + it.copy( + addedServers = serversRepository.getServers().mapToServerItems() + ) + } } } - private suspend fun mapToPreinstalledItems( - header: String, - servers: List - ): List { - val selectedServer = serversRepository.getSelectedServer() - val selectedStage = stagesRepository.getSelectedStage() + private fun updateServerData(id: Int, name: String, url: String) { + val serverForUpdate = _state.value.addedServers + .find { it.server.id == id } + ?.server - val items = servers.map { debugServer -> - val isSelected = when (debugServer) { - is DebugServer -> selectedServer.url == debugServer.url - is DebugStage -> selectedStage == debugServer - else -> false + serverForUpdate?.let { + val updatedServer = serverForUpdate.copy(name = name, url = url) + viewModelScope.safeLaunch { + serversRepository.updateServer(updatedServer) + _state.update { + it.copy(addedServers = serversRepository.getServers().mapToServerItems()) + } } - DebugServerItems.PreinstalledServer(debugServer, isSelected) } - - return listOf(DebugServerItems.Header(header)).plus(items) } - private suspend fun mapToAddedItems( - header: String, - servers: List - ): List { - if (servers.isEmpty()) return emptyList() - val selectedServer = serversRepository.getSelectedServer() - val selectedStage = stagesRepository.getSelectedStage() + fun onEditServerClicked(debugServer: DebugServer) { + _state.update { + it.copy( + serverDialogState = ServerDialogState( + editableServerId = debugServer.id, + serverName = debugServer.name, + serverUrl = debugServer.url, + show = true + ) + ) + } + } - val items = servers.map { debugServer -> - val isSelected = when (debugServer) { - is DebugServer -> selectedServer.url == debugServer.url - is DebugStage -> selectedStage == debugServer - else -> false + fun onServerClicked(debugServer: DebugServer) { + viewModelScope.launch { + val selectedServer = serversRepository.getSelectedServer() + if (debugServer != selectedServer) { + getPlugin().pushEvent(ServerSelectedEvent(debugServer)) + serversRepository.saveSelectedServer(debugServer) + loadServers() } - DebugServerItems.AddedServer(debugServer, isSelected) } + } - return listOf(DebugServerItems.Header(header)).plus(items) + fun onStageClicked(debugStage: DebugStage) { + viewModelScope.launch { + val selectedStage = stagesRepository.getSelectedStage() + if (debugStage != selectedStage) { + stagesRepository.saveSelectedStage(debugStage) + getPlugin().pushEvent(StageSelectedEvent(debugStage)) + loadServers() + } + } } - private suspend fun getSelectedServer(): DebugServer { - return serversRepository.getSelectedServer() + private suspend fun List.mapToServerItems(): List { + val selectedServer = serversRepository.getSelectedServer() + return map { debugServer -> + val isSelected = debugServer == selectedServer + ServerItemData(debugServer, isSelected) + } } + private fun List.mapToStageItems(): List { + val selectedStage = stagesRepository.getSelectedStage() + return map { debugStage -> + val isSelected = debugStage == selectedStage + StageItemData(debugStage, isSelected) + } + } } diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersViewState.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersViewState.kt index 3dba6efd..1b991155 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersViewState.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/ServersViewState.kt @@ -1,10 +1,24 @@ package com.redmadrobot.debug.servers.ui -import com.redmadrobot.debug.servers.ui.item.DebugServerItems +import com.redmadrobot.debug.servers.data.model.DebugServer +import com.redmadrobot.debug.servers.data.model.DebugStage internal data class ServersViewState( - val preInstalledServers: List = emptyList(), - val addedServers: List = emptyList(), - val preinstalledStages: List = emptyList(), - val addedStages: List = emptyList(), + val preInstalledServers: List = emptyList(), + val addedServers: List = emptyList(), + val preinstalledStages: List = emptyList(), + val addedStages: List = emptyList(), + val serverDialogState: ServerDialogState = ServerDialogState() ) + +internal data class ServerDialogState( + val show: Boolean = false, + val serverName: String = "", + val serverUrl: String = "", + val editableServerId: Int? = null, + val nameError: Int? = null, + val urlError: Int? = null, +) + +internal data class ServerItemData(val server: DebugServer, val isSelected: Boolean) +internal data class StageItemData(val server: DebugStage, val isSelected: Boolean) diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/item/DebugServerItems.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/item/DebugServerItems.kt deleted file mode 100644 index 0e80fcb9..00000000 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/ui/item/DebugServerItems.kt +++ /dev/null @@ -1,19 +0,0 @@ -package com.redmadrobot.debug.servers.ui.item - -import com.redmadrobot.debug.servers.data.model.DebugServer -import com.redmadrobot.debug.servers.data.model.DebugServerData - -internal sealed class DebugServerItems { - - data class Header(val header: String) : DebugServerItems() - - data class PreinstalledServer( - var debugServer: DebugServerData, - var isSelected: Boolean - ) : DebugServerItems() - - data class AddedServer( - var debugServer: DebugServerData, - var isSelected: Boolean - ) : DebugServerItems() -} From 7d9f57c6e16c97e58d8a576f38c5270af8789fce Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Mon, 16 Jan 2023 19:53:14 +0300 Subject: [PATCH 36/42] Sample: Update sample project --- .../debug_data/DebugServersProvider.kt | 40 ++++++++++++++++--- .../debug_sample/network/ApiFactory.kt | 10 ++++- 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugServersProvider.kt b/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugServersProvider.kt index bf750c92..7ced2ebb 100644 --- a/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugServersProvider.kt +++ b/sample/src/debug/kotlin/com/redmadrobot/debug_sample/debug_data/DebugServersProvider.kt @@ -1,14 +1,44 @@ package com.redmadrobot.debug_sample.debug_data -import com.redmadrobot.debug.core.data.DebugDataProvider import com.redmadrobot.debug.servers.data.model.DebugServer +import com.redmadrobot.debug.servers.data.model.DebugServerData +import com.redmadrobot.debug.servers.data.model.DebugStage -class DebugServersProvider : DebugDataProvider> { +class DebugServersProvider { - override fun provideData(): List { + fun provideData(): List { return listOf( - DebugServer(name = "debug 1", url = "https://testserver1.com", isDefault = true), - DebugServer(name = "debug 2", url = "https://testserver2.com") + DebugServer( + name = "debug 1", + url = "https://testserver1.com", + isDefault = true + ), + DebugServer( + name = "debug 2", url = "https://testserver2.com" + ), + DebugServer( + name = "debug 3", url = "https://testserver3.com" + ), + DebugServer( + name = "debug 4", url = "https://testserver4.com" + ), + DebugStage( + name = "debug stage 1", + hosts = mapOf( + "main" to "https://testserver1main.com", + "s3" to "https://testserver1s3.com", + "wss" to "https://testserver1wss.com" + ), + isDefault = true + ), + DebugStage( + name = "debug stage 2", + hosts = mapOf( + "main" to "https://testserver2main.com", + "s3" to "https://testserver2s3.com", + "wss" to "https://testserver2wss.com" + ) + ), ) } } diff --git a/sample/src/main/kotlin/com/redmadrobot/debug_sample/network/ApiFactory.kt b/sample/src/main/kotlin/com/redmadrobot/debug_sample/network/ApiFactory.kt index 42a9da99..ee354c4a 100644 --- a/sample/src/main/kotlin/com/redmadrobot/debug_sample/network/ApiFactory.kt +++ b/sample/src/main/kotlin/com/redmadrobot/debug_sample/network/ApiFactory.kt @@ -1,10 +1,15 @@ package com.redmadrobot.debug_sample.network -import com.redmadrobot.debug.servers.util.DebugServerInterceptor +import com.redmadrobot.debug.servers.interceptor.DebugServerInterceptor +import com.redmadrobot.debug.servers.interceptor.DebugStageInterceptor import okhttp3.Interceptor import okhttp3.OkHttpClient import okhttp3.Response import retrofit2.Retrofit +import java.net.HttpURLConnection +import java.net.URL +import java.net.URLConnection +import java.net.URLStreamHandler object ApiFactory { @@ -18,9 +23,10 @@ object ApiFactory { } private fun getSampleClient(onCalled: (String) -> Unit): OkHttpClient { + return OkHttpClient.Builder() .addInterceptor( - DebugServerInterceptor().modifyRequest { request, server -> + DebugStageInterceptor("s3").modifyRequest { request, server -> if (server.name == "Test") { request.newBuilder() .addHeader("Authorization", "testToken") From 525ba7306d5e9a02420af8924f82d298bda6a09e Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Mon, 16 Jan 2023 20:02:10 +0300 Subject: [PATCH 37/42] Servers: Add methods to get the selected stage and the default stage --- .../debug/servers/data/DebugStageRepository.kt | 14 +------------- .../debug/servers/plugin/ServersPlugin.kt | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/DebugStageRepository.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/DebugStageRepository.kt index bf908f59..784495cf 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/DebugStageRepository.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/data/DebugStageRepository.kt @@ -48,28 +48,16 @@ internal class DebugStageRepository( } } - private fun getDefault(): DebugStage { + fun getDefault(): DebugStage { return preInstalledStages.first { it.isDefault } } - suspend fun addStage(server: DebugStage) { - withContext(Dispatchers.IO) { - debugStagesDao.insert(server) - } - } - suspend fun getStages(): List { return withContext(Dispatchers.IO) { debugStagesDao.getAll() } } - suspend fun removeStage(server: DebugStage) { - withContext(Dispatchers.IO) { - debugStagesDao.remove(server) - } - } - suspend fun updateStage(server: DebugStage) { withContext(Dispatchers.IO) { debugStagesDao.update(server) diff --git a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPlugin.kt b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPlugin.kt index 583577d1..071d01d7 100644 --- a/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPlugin.kt +++ b/plugins/servers/src/main/kotlin/com/redmadrobot/debug/servers/plugin/ServersPlugin.kt @@ -1,9 +1,6 @@ package com.redmadrobot.debug.servers.plugin -import androidx.compose.foundation.rememberScrollState -import androidx.compose.foundation.verticalScroll import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier import androidx.compose.ui.viewinterop.AndroidViewBinding import androidx.fragment.app.Fragment import com.redmadrobot.debug.core.CommonContainer @@ -13,6 +10,7 @@ import com.redmadrobot.debug.core.plugin.Plugin import com.redmadrobot.debug.core.plugin.PluginDependencyContainer import com.redmadrobot.debug.servers.data.model.DebugServer import com.redmadrobot.debug.servers.data.model.DebugServerData +import com.redmadrobot.debug.servers.data.model.DebugStage import com.redmadrobot.debug.servers.ui.ServersFragment import com.redmadrobot.debug.servers.ui.ServersScreen import com.redmadrobot.servers_plugin.databinding.FragmentContainerServersBinding @@ -45,6 +43,20 @@ public class ServersPlugin( .serversRepository .getDefault() } + + public fun getSelectedStage(): DebugStage { + return getPlugin() + .getContainer() + .stagesRepository + .getSelectedStage() + } + + public fun getDefaultStage(): DebugStage { + return getPlugin() + .getContainer() + .stagesRepository + .getDefault() + } } public constructor(preInstalledServers: DebugDataProvider>) : this( From 2d9b5ea8ae157178d92f2c4ebdb2fa4566faa450 Mon Sep 17 00:00:00 2001 From: Roman Choryev Date: Sat, 21 Jan 2023 20:41:04 +0300 Subject: [PATCH 38/42] AppSettings: Migrate App-settings plugin to the Jetpack Compose --- .../data/AppSettingsRepositoryImpl.kt | 5 +- .../appsettings/plugin/AppSettingsPlugin.kt | 21 +-- .../ui/ApplicationSettingsFragment.kt | 48 ----- .../ui/ApplicationSettingsScreen.kt | 177 ++++++++++++++++++ .../ui/ApplicationSettingsViewModel.kt | 34 ++-- .../appsettings/ui/SettingItemUiModel.kt | 22 +++ .../appsettings/ui/item/AppSettingItems.kt | 97 ---------- .../main/res/layout/fragment_app_settings.xml | 17 -- .../fragment_container_app_settings.xml | 6 - .../src/main/res/layout/item_header.xml | 21 --- .../res/layout/item_preference_boolean.xml | 43 ----- .../layout/item_preference_unsupported.xml | 33 ---- .../main/res/layout/item_preference_value.xml | 66 ------- .../src/main/res/values/strings.xml | 1 + 14 files changed, 220 insertions(+), 371 deletions(-) delete mode 100644 plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/ApplicationSettingsFragment.kt create mode 100644 plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/ApplicationSettingsScreen.kt create mode 100644 plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/SettingItemUiModel.kt delete mode 100644 plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/item/AppSettingItems.kt delete mode 100644 plugins/app-settings/src/main/res/layout/fragment_app_settings.xml delete mode 100644 plugins/app-settings/src/main/res/layout/fragment_container_app_settings.xml delete mode 100644 plugins/app-settings/src/main/res/layout/item_header.xml delete mode 100644 plugins/app-settings/src/main/res/layout/item_preference_boolean.xml delete mode 100644 plugins/app-settings/src/main/res/layout/item_preference_unsupported.xml delete mode 100644 plugins/app-settings/src/main/res/layout/item_preference_value.xml diff --git a/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/data/AppSettingsRepositoryImpl.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/data/AppSettingsRepositoryImpl.kt index 22417a97..8619c45f 100644 --- a/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/data/AppSettingsRepositoryImpl.kt +++ b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/data/AppSettingsRepositoryImpl.kt @@ -1,6 +1,7 @@ package com.redmadrobot.debug.appsettings.data import android.content.SharedPreferences +import androidx.core.content.edit internal class AppSettingsRepositoryImpl( private val sharedPreferencesList: List @@ -12,7 +13,7 @@ internal class AppSettingsRepositoryImpl( override fun updateSetting(key: String, value: Any) { val sharedPreferences = sharedPreferencesList.find { it.contains(key) } - sharedPreferences?.edit()?.apply { + sharedPreferences?.edit { when (value) { is Boolean -> putBoolean(key, value) is Int -> putInt(key, value) @@ -20,6 +21,6 @@ internal class AppSettingsRepositoryImpl( is Float -> putFloat(key, value) is String -> putString(key, value) } - }?.apply() + } } } diff --git a/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/plugin/AppSettingsPlugin.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/plugin/AppSettingsPlugin.kt index b97d6ce2..e7cdec4b 100644 --- a/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/plugin/AppSettingsPlugin.kt +++ b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/plugin/AppSettingsPlugin.kt @@ -1,15 +1,9 @@ package com.redmadrobot.debug.appsettings.plugin import android.content.SharedPreferences -import androidx.compose.foundation.rememberScrollState -import androidx.compose.foundation.verticalScroll import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.viewinterop.AndroidViewBinding -import androidx.fragment.app.Fragment -import com.redmadrobot.app_settings_plugin.databinding.FragmentContainerAppSettingsBinding import com.redmadrobot.debug.appsettings.data.DefaultSharedPreferences -import com.redmadrobot.debug.appsettings.ui.ApplicationSettingsFragment +import com.redmadrobot.debug.appsettings.ui.ApplicationSettingsScreen import com.redmadrobot.debug.core.CommonContainer import com.redmadrobot.debug.core.plugin.Plugin import com.redmadrobot.debug.core.plugin.PluginDependencyContainer @@ -28,19 +22,8 @@ public class AppSettingsPlugin( return AppSettingsPluginContainer(sharedPreferences) } - @Deprecated( - "You should't use fragments for you plugins. Please use Jetpack Compose", - replaceWith = ReplaceWith("content()", "com.redmadrobot.debug.core.plugin.Plugin") - ) - override fun getFragment(): Fragment { - return ApplicationSettingsFragment() - } - @Composable override fun content() { - AndroidViewBinding( - FragmentContainerAppSettingsBinding::inflate, - modifier = Modifier.verticalScroll(rememberScrollState()) - ) + ApplicationSettingsScreen() } } diff --git a/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/ApplicationSettingsFragment.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/ApplicationSettingsFragment.kt deleted file mode 100644 index f73ef3d9..00000000 --- a/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/ApplicationSettingsFragment.kt +++ /dev/null @@ -1,48 +0,0 @@ -package com.redmadrobot.debug.appsettings.ui - -import android.os.Bundle -import android.view.View -import androidx.recyclerview.widget.LinearLayoutManager -import com.redmadrobot.app_settings_plugin.R -import com.redmadrobot.app_settings_plugin.databinding.FragmentAppSettingsBinding -import com.redmadrobot.debug.appsettings.plugin.AppSettingsPlugin -import com.redmadrobot.debug.appsettings.plugin.AppSettingsPluginContainer -import com.redmadrobot.debug.appsettings.ui.item.AppSettingItems -import com.redmadrobot.debug.common.base.PluginFragment -import com.redmadrobot.debug.common.extension.observe -import com.redmadrobot.debug.common.extension.obtainViewModel -import com.redmadrobot.debug.core.extension.getPlugin -import com.redmadrobot.itemsadapter.itemsAdapter - -internal class ApplicationSettingsFragment : PluginFragment(R.layout.fragment_app_settings) { - - private var binding: FragmentAppSettingsBinding? = null - - private val settingsViewModel by lazy { - obtainViewModel { - getPlugin() - .getContainer() - .createApplicationSettingsViewModel() - } - } - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - observe(settingsViewModel.settingsLiveData, ::setSettingList) - binding = FragmentAppSettingsBinding.bind(view).also { - it.setViews() - } - settingsViewModel.loadSettings() - } - - private fun FragmentAppSettingsBinding.setViews() { - appSettings.layoutManager = LinearLayoutManager(context) - } - - private fun setSettingList(settings: List) { - val binding = binding ?: return - binding.appSettings.adapter = itemsAdapter(settings) { item -> - item.getItem(this) - } - } -} diff --git a/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/ApplicationSettingsScreen.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/ApplicationSettingsScreen.kt new file mode 100644 index 00000000..f47ef838 --- /dev/null +++ b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/ApplicationSettingsScreen.kt @@ -0,0 +1,177 @@ +package com.redmadrobot.debug.appsettings.ui + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items +import androidx.compose.material.Button +import androidx.compose.material.Card +import androidx.compose.material.OutlinedTextField +import androidx.compose.material.Switch +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.focus.FocusRequester +import androidx.compose.ui.focus.focusRequester +import androidx.compose.ui.focus.onFocusChanged +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.platform.LocalFocusManager +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import androidx.lifecycle.Lifecycle +import com.redmadrobot.app_settings_plugin.R +import com.redmadrobot.debug.appsettings.plugin.AppSettingsPlugin +import com.redmadrobot.debug.appsettings.plugin.AppSettingsPluginContainer +import com.redmadrobot.debug.core.extension.OnLifecycleEvent +import com.redmadrobot.debug.core.extension.getPlugin +import com.redmadrobot.debug.core.extension.provideViewModel + +@Composable +internal fun ApplicationSettingsScreen( + viewModel: ApplicationSettingsViewModel = provideViewModel { + getPlugin() + .getContainer() + .createApplicationSettingsViewModel() + } +) { + val state by viewModel.state.collectAsState() + ApplicationSettingsLayout(state, onValueChanged = viewModel::updateSetting) + OnLifecycleEvent { event -> + if (event == Lifecycle.Event.ON_RESUME) { + viewModel.loadSettings() + } + } +} + +@Composable +private fun ApplicationSettingsLayout( + state: List, + onValueChanged: (String, Any) -> Unit +) { + LazyColumn( + modifier = Modifier.fillMaxSize(), + contentPadding = PaddingValues(horizontal = 16.dp, vertical = 16.dp), + verticalArrangement = Arrangement.spacedBy(8.dp) + ) { + items(state) { itemUiModel -> + when (itemUiModel) { + is SettingItemUiModel.Header -> { + Text( + text = itemUiModel.header, + modifier = Modifier.padding(vertical = 16.dp) + ) + } + + is SettingItemUiModel.ValueItem -> { + ValueItem(itemUiModel, onValueChanged) + } + + is SettingItemUiModel.BooleanItem -> { + BooleanItem(itemUiModel, onValueChanged) + } + } + } + } +} + +@Composable +private fun ValueItem( + itemUiModel: SettingItemUiModel.ValueItem, + onValueChanged: (String, Any) -> Unit +) { + var value by remember { mutableStateOf(itemUiModel.value.toString()) } + var hasFocus by remember { mutableStateOf(false) } + var error by remember(value) { mutableStateOf("") } + val focusManager = LocalFocusManager.current + + Card(modifier = Modifier.fillMaxWidth()) { + Column(modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp)) { + Row(horizontalArrangement = Arrangement.SpaceBetween) { + Text( + text = itemUiModel.key, + modifier = Modifier + .fillMaxWidth() + .weight(1f), + fontWeight = FontWeight.SemiBold, + ) + if (hasFocus) { + Button( + onClick = { + try { + val newValue = itemUiModel.castToNeededType(value) + onValueChanged(itemUiModel.key, newValue) + focusManager.clearFocus(force = true) + } catch (e: Throwable) { + error = "Wrong data type" + } + } + ) { + Text(text = stringResource(id = R.string.save)) + } + } + } + Spacer(modifier = Modifier.height(8.dp)) + Text( + text = itemUiModel.value?.let { it::class.java.simpleName } + ?: stringResource(id = R.string.unknown_type), + color = Color.Gray, + fontSize = 12.sp + ) + Spacer(modifier = Modifier.height(8.dp)) + OutlinedTextField( + modifier = Modifier + .fillMaxWidth() + .onFocusChanged { hasFocus = it.hasFocus }, + value = value, + onValueChange = { value = it }, + isError = error.isNotEmpty(), + label = { Text(text = stringResource(id = R.string.value)) }, + ) + if (error.isNotEmpty()) { + Text(text = error, color = Color.Red) + } + } + } +} + +@Composable +private fun BooleanItem( + itemUiModel: SettingItemUiModel.BooleanItem, + onValueChanged: (String, Boolean) -> Unit +) { + Card(modifier = Modifier.fillMaxWidth()) { + Column(modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp)) { + Text( + text = itemUiModel.key, + modifier = Modifier + .fillMaxWidth(), + fontWeight = FontWeight.SemiBold, + ) + Spacer(modifier = Modifier.height(8.dp)) + Text( + text = "Boolean", + color = Color.Gray, + fontSize = 12.sp + ) + Spacer(modifier = Modifier.height(8.dp)) + Switch( + checked = itemUiModel.value, + onCheckedChange = { onValueChanged(itemUiModel.key, it) } + ) + } + } +} diff --git a/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/ApplicationSettingsViewModel.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/ApplicationSettingsViewModel.kt index 5191a60f..4e828a3f 100644 --- a/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/ApplicationSettingsViewModel.kt +++ b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/ApplicationSettingsViewModel.kt @@ -1,50 +1,46 @@ package com.redmadrobot.debug.appsettings.ui import android.content.SharedPreferences -import androidx.lifecycle.MutableLiveData import com.redmadrobot.debug.appsettings.data.AppSettingsRepository -import com.redmadrobot.debug.appsettings.ui.item.AppSettingItems import com.redmadrobot.debug.common.base.PluginViewModel +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.update internal class ApplicationSettingsViewModel( private val appSettingsRepository: AppSettingsRepository ) : PluginViewModel() { - val settingsLiveData = MutableLiveData>() + val state = MutableStateFlow>(emptyList()) fun loadSettings() { val settings = appSettingsRepository.getSettings() - val settingItems = mapToItems(settings) - settingsLiveData.value = settingItems + val newSettingItems = mapToItemsNew(settings) + state.update { newSettingItems } } - @Suppress("NewApi") - private fun mapToItems(settings: List): List { - val items = mutableListOf() + fun updateSetting(settingKey: String, newValue: Any) { + appSettingsRepository.updateSetting(settingKey, newValue) + loadSettings() + } + + private fun mapToItemsNew(settings: List): MutableList { + val items = mutableListOf() settings.forEach { sharedPreferences -> /*Settings header*/ items.add( - AppSettingItems.Header(sharedPreferences.toString()) + SettingItemUiModel.Header(sharedPreferences.toString()) ) /*Map SharedPreferences to Items*/ sharedPreferences.all.forEach { (key, value) -> val item = if (value is Boolean) { - AppSettingItems.BooleanValueItem(key, value) { settingKey, newValue -> - updateSetting(settingKey, newValue) - } + SettingItemUiModel.BooleanItem(key, value) } else { - AppSettingItems.ValueItem(key, value) { settingKey, newValue -> - updateSetting(settingKey, newValue) - } + SettingItemUiModel.ValueItem(key, value) } items.add(item) } } return items } - - private fun updateSetting(settingKey: String, newValue: Any) { - appSettingsRepository.updateSetting(settingKey, newValue) - } } diff --git a/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/SettingItemUiModel.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/SettingItemUiModel.kt new file mode 100644 index 00000000..5d0a369c --- /dev/null +++ b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/SettingItemUiModel.kt @@ -0,0 +1,22 @@ +package com.redmadrobot.debug.appsettings.ui + +internal sealed class SettingItemUiModel { + + data class Header(val header: String) : SettingItemUiModel() + data class ValueItem( + val key: String, + var value: Any?, + ) : SettingItemUiModel() { + fun castToNeededType(newValue: String): Any { + return when (value) { + is Long -> newValue.toLong() + is String -> newValue + is Float -> newValue.toFloat() + is Int -> newValue.toInt() + else -> error("Unexpected type") + } + } + } + + data class BooleanItem(val key: String, var value: Boolean) : SettingItemUiModel() +} diff --git a/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/item/AppSettingItems.kt b/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/item/AppSettingItems.kt deleted file mode 100644 index e52a7c2c..00000000 --- a/plugins/app-settings/src/main/kotlin/com/redmadrobot/debug/appsettings/ui/item/AppSettingItems.kt +++ /dev/null @@ -1,97 +0,0 @@ -package com.redmadrobot.debug.appsettings.ui.item - -import androidx.core.view.isVisible -import com.redmadrobot.app_settings_plugin.R -import com.redmadrobot.app_settings_plugin.databinding.ItemHeaderBinding -import com.redmadrobot.app_settings_plugin.databinding.ItemPreferenceBooleanBinding -import com.redmadrobot.app_settings_plugin.databinding.ItemPreferenceValueBinding -import com.redmadrobot.itemsadapter.ItemsAdapter -import com.redmadrobot.itemsadapter.bind -import timber.log.Timber - -internal sealed class AppSettingItems { - - abstract fun getItem(bindingContext: ItemsAdapter.BindingContext): ItemsAdapter.Item - - internal class Header(private val header: String) : AppSettingItems() { - override fun getItem(bindingContext: ItemsAdapter.BindingContext): ItemsAdapter.Item { - return bindingContext.bind(R.layout.item_header) { - itemHeaderText.text = header - } - } - } - - class ValueItem( - private val key: String, - var value: Any?, - private val onChanged: (key: String, newValue: Any) -> Unit - ) : AppSettingItems() { - override fun getItem(bindingContext: ItemsAdapter.BindingContext): ItemsAdapter.Item { - return bindingContext.bind(R.layout.item_preference_value) { - settingLabel.text = key - settingType.text = value?.let { it::class.java.simpleName } - settingType.isVisible = value != null - - setSettingValue() - saveValue.setOnClickListener { saveNewValue() } - } - } - - private fun ItemPreferenceValueBinding.setSettingValue() = with(settingValue) { - setText(value.toString()) - clearFocus() - settingValueContainer.error = null - - setOnFocusChangeListener { _, hasFocus -> - saveValue.isVisible = hasFocus && value != null - } - } - - private fun ItemPreferenceValueBinding.saveNewValue() { - val fieldValue = settingValue.text.toString() - try { - val newValue = castToNeededType(fieldValue) - onChanged.invoke(key, newValue) - - value = newValue - setSettingValue() - } catch (e: Exception) { - Timber.e(e) - settingValueContainer.error = root.context.getString(R.string.wrong_type) - } - } - - private fun castToNeededType(newValue: String): Any { - return when (value) { - is Long -> newValue.toLong() - is String -> newValue - is Float -> newValue.toFloat() - is Int -> newValue.toInt() - else -> throw Throwable("Unexpected type") - } - } - } - - class BooleanValueItem( - private val key: String, - var value: Boolean, - private val onChanged: (key: String, newValue: Any) -> Unit - ) : AppSettingItems() { - - override fun getItem(bindingContext: ItemsAdapter.BindingContext): ItemsAdapter.Item { - return bindingContext.bind(R.layout.item_preference_boolean) { - settingLabel.text = key - settingType.text = value::class.java.simpleName - - with(settingSwitch) { - setOnCheckedChangeListener(null) - isChecked = value - setOnCheckedChangeListener { _, isChecked -> - onChanged.invoke(key, isChecked) - value = isChecked - } - } - } - } - } -} diff --git a/plugins/app-settings/src/main/res/layout/fragment_app_settings.xml b/plugins/app-settings/src/main/res/layout/fragment_app_settings.xml deleted file mode 100644 index 7dc0e7a7..00000000 --- a/plugins/app-settings/src/main/res/layout/fragment_app_settings.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - diff --git a/plugins/app-settings/src/main/res/layout/fragment_container_app_settings.xml b/plugins/app-settings/src/main/res/layout/fragment_container_app_settings.xml deleted file mode 100644 index 2695a975..00000000 --- a/plugins/app-settings/src/main/res/layout/fragment_container_app_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/plugins/app-settings/src/main/res/layout/item_header.xml b/plugins/app-settings/src/main/res/layout/item_header.xml deleted file mode 100644 index 0c14cf96..00000000 --- a/plugins/app-settings/src/main/res/layout/item_header.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - diff --git a/plugins/app-settings/src/main/res/layout/item_preference_boolean.xml b/plugins/app-settings/src/main/res/layout/item_preference_boolean.xml deleted file mode 100644 index def246fc..00000000 --- a/plugins/app-settings/src/main/res/layout/item_preference_boolean.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - diff --git a/plugins/app-settings/src/main/res/layout/item_preference_unsupported.xml b/plugins/app-settings/src/main/res/layout/item_preference_unsupported.xml deleted file mode 100644 index 74ed1890..00000000 --- a/plugins/app-settings/src/main/res/layout/item_preference_unsupported.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - diff --git a/plugins/app-settings/src/main/res/layout/item_preference_value.xml b/plugins/app-settings/src/main/res/layout/item_preference_value.xml deleted file mode 100644 index a85965a4..00000000 --- a/plugins/app-settings/src/main/res/layout/item_preference_value.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - -