Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,7 @@ abstract class ProjectHandlerActivity : BaseEditorActivity() {
initialSetup()
setStatus(getString(string.msg_project_initialized))
editorViewModel.isInitializing = false
invalidateOptionsMenu()

if (mFindInProjectDialog?.isShowing == true) {
mFindInProjectDialog!!.dismiss()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ object ToolbarActionIds {
FIND, FIND_IN_FILE, FIND_IN_PROJECT,
LAUNCH_APP, DISCONNECT_LOG_SENDERS, GENERATE_XML
)

val BUILD_HIDEABLE: Set<String> = setOf(
QUICK_RUN, PROJECT_SYNC, DEBUG, RUN_TASKS, LAUNCH_APP
)
}

data class PluginBuildAction(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,22 @@ class PluginBuildActionManager private constructor() {
fun getHiddenActionIds(): Set<String> {
val hidden = mutableSetOf<String>()

for ((_, extension) in pluginExtensions) {
for ((pluginId, extension) in pluginExtensions) {
runCatching {
val requested = extension.toolbarActionsToHide()
hidden.addAll(requested.intersect(ToolbarActionIds.ALL))
val allowed = requested.intersect(ToolbarActionIds.BUILD_HIDEABLE)
hidden.addAll(allowed)

val rejected = requested - ToolbarActionIds.BUILD_HIDEABLE
if (rejected.isNotEmpty()) {
Log.w(
TAG,
"Plugin $pluginId requested to hide non-build toolbar actions " +
"$rejected; ignored. Only ${ToolbarActionIds.BUILD_HIDEABLE} are hideable."
)
}
}.onFailure { e ->
Log.w(TAG, "Failed to get hidden action ids from plugin", e)
Log.w(TAG, "Failed to get hidden action ids from plugin $pluginId", e)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import com.itsaky.androidide.projects.api.AndroidModule
import com.itsaky.androidide.projects.api.ModuleProject
import com.itsaky.androidide.projects.api.Workspace
import com.itsaky.androidide.tooling.api.models.BuildVariantInfo
import com.itsaky.androidide.utils.Environment

import com.itsaky.androidide.utils.ServiceLoader
import java.io.File
import java.nio.file.Path
Expand Down Expand Up @@ -175,13 +175,5 @@ interface IProjectManager {
}

fun IProjectManager.isPluginProject(): Boolean {
val cached = (this as? ProjectManagerImpl)?.pluginProjectCached
if (cached != null) {
return cached
}
val result = File(projectDir, Environment.PLUGIN_API_JAR_RELATIVE_PATH).exists()
if (this is ProjectManagerImpl) {
this.pluginProjectCached = result
}
return result
return (this as? ProjectManagerImpl)?.pluginProjectCached ?: false
}
Loading