mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 07:49:44 +08:00
feat: use Kotlin Symbol Processor to generate IViewAdapterIndex implementation
This commit is contained in:
@@ -20,7 +20,7 @@ dependencies {
|
||||
implementation(libs.common.kotlin)
|
||||
implementation(libs.common.utilcode)
|
||||
implementation(libs.google.material)
|
||||
|
||||
|
||||
implementation(projects.actions)
|
||||
implementation(projects.annotations)
|
||||
implementation(projects.common)
|
||||
@@ -31,7 +31,7 @@ dependencies {
|
||||
implementation(projects.lsp.xml)
|
||||
implementation(projects.resources)
|
||||
implementation(projects.xmlInflater)
|
||||
|
||||
|
||||
testImplementation(libs.tests.junit)
|
||||
testImplementation(libs.tests.google.truth)
|
||||
testImplementation(libs.tests.robolectric)
|
||||
|
||||
@@ -33,7 +33,6 @@ import com.itsaky.androidide.actions.ActionData
|
||||
import com.itsaky.androidide.actions.ActionItem.Location.UI_DESIGNER_TOOLBAR
|
||||
import com.itsaky.androidide.actions.ActionsRegistry
|
||||
import com.itsaky.androidide.app.BaseIDEActivity
|
||||
import com.itsaky.androidide.inflater.IView
|
||||
import com.itsaky.androidide.uidesigner.actions.clearUiDesignerActions
|
||||
import com.itsaky.androidide.uidesigner.actions.registerUiDesignerActions
|
||||
import com.itsaky.androidide.uidesigner.databinding.ActivityUiDesignerBinding
|
||||
@@ -53,7 +52,7 @@ class UIDesignerActivity : BaseIDEActivity() {
|
||||
private var binding: ActivityUiDesignerBinding? = null
|
||||
private val log = ILogger.newInstance("UIDesignerActivity")
|
||||
private val viewModel by viewModels<WorkspaceViewModel>()
|
||||
|
||||
|
||||
private val workspace: DesignerWorkspaceFragment?
|
||||
get() = this.binding?.workspace?.getFragment<DesignerWorkspaceFragment>()
|
||||
|
||||
@@ -183,9 +182,7 @@ class UIDesignerActivity : BaseIDEActivity() {
|
||||
}
|
||||
|
||||
fun setupHierarchy(view: com.itsaky.androidide.inflater.IView) {
|
||||
binding?.hierarchy?.setupWithView(view) {
|
||||
workspace()?.showViewInfo(it)
|
||||
}
|
||||
binding?.hierarchy?.setupWithView(view) { workspace()?.showViewInfo(it) }
|
||||
}
|
||||
|
||||
fun openHierarchyView() {
|
||||
|
||||
@@ -46,8 +46,8 @@ internal object Widgets {
|
||||
}
|
||||
this.widgets =
|
||||
IViewAdapterIndex.instance.getWidgetProviders(WIDGETS)
|
||||
.flatMap { it.getUiWidgets() }
|
||||
.sortedBy { it.name.simpleName() }
|
||||
?.flatMap { it.getUiWidgets() }
|
||||
?.sortedBy { it.name.simpleName() } ?: emptyList()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,8 +59,8 @@ internal object Widgets {
|
||||
|
||||
this.widgets =
|
||||
IViewAdapterIndex.instance.getWidgetProviders(LAYOUTS)
|
||||
.flatMap { it.getUiWidgets() }
|
||||
.sortedBy { it.name.simpleName() }
|
||||
?.flatMap { it.getUiWidgets() }
|
||||
?.sortedBy { it.name.simpleName() } ?: emptyList()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user