From 279b8f0be0d25f89ca32d8d652701fc53a9c03dc Mon Sep 17 00:00:00 2001 From: Akash Yadav Date: Sun, 22 May 2022 18:00:06 +0530 Subject: [PATCH] Fixed: ProjectSyncAction not staged --- .../actions/build/ProjectSyncAction.kt | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 app/src/main/java/com/itsaky/androidide/actions/build/ProjectSyncAction.kt diff --git a/app/src/main/java/com/itsaky/androidide/actions/build/ProjectSyncAction.kt b/app/src/main/java/com/itsaky/androidide/actions/build/ProjectSyncAction.kt new file mode 100644 index 000000000..bea895626 --- /dev/null +++ b/app/src/main/java/com/itsaky/androidide/actions/build/ProjectSyncAction.kt @@ -0,0 +1,46 @@ +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package com.itsaky.androidide.actions.build + +import android.content.Context +import androidx.core.content.ContextCompat +import com.itsaky.androidide.R +import com.itsaky.androidide.R.string +import com.itsaky.androidide.actions.ActionData +import com.itsaky.androidide.actions.BaseBuildAction +import com.itsaky.androidide.actions.EditorActivityAction + +/** + * Triggers a project sync request. + * + * @author Akash Yadav + */ +class ProjectSyncAction() : BaseBuildAction() { + + override val id: String = "action_editor_syncProject" + override var requiresUIThread = true + + constructor(context: Context) : this() { + label = context.getString(string.title_sync_project) + icon = ContextCompat.getDrawable(context, R.drawable.ic_sync) + } + + override fun execAction(data: ActionData): Any { + return getActivity(data)!!.initializeProject() + } +}