From e4fd087dbc009621c9b814aba933996e55d8117a Mon Sep 17 00:00:00 2001 From: Akash Yadav Date: Tue, 16 Jun 2026 19:25:22 +0530 Subject: [PATCH 1/4] feat: add profiler module Signed-off-by: Akash Yadav --- profiler/.gitignore | 1 + profiler/build.gradle.kts | 17 +++++++++++++++++ profiler/consumer-rules.pro | 0 profiler/proguard-rules.pro | 21 +++++++++++++++++++++ profiler/src/main/AndroidManifest.xml | 4 ++++ settings.gradle.kts | 1 + 6 files changed, 44 insertions(+) create mode 100644 profiler/.gitignore create mode 100644 profiler/build.gradle.kts create mode 100644 profiler/consumer-rules.pro create mode 100644 profiler/proguard-rules.pro create mode 100644 profiler/src/main/AndroidManifest.xml diff --git a/profiler/.gitignore b/profiler/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/profiler/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/profiler/build.gradle.kts b/profiler/build.gradle.kts new file mode 100644 index 0000000000..5e4aeb930c --- /dev/null +++ b/profiler/build.gradle.kts @@ -0,0 +1,17 @@ +import com.itsaky.androidide.build.config.BuildConfig + +plugins { + alias(libs.plugins.android.library) + alias(libs.plugins.kotlin.android) +} + +android { + namespace = "${BuildConfig.PACKAGE_NAME}.profiler" +} + +dependencies { + api(projects.actions) + api(libs.androidx.fragment) + api(libs.androidx.lifecycle.viewmodel.ktx) + api(libs.androidx.lifecycle.runtime.ktx) +} \ No newline at end of file diff --git a/profiler/consumer-rules.pro b/profiler/consumer-rules.pro new file mode 100644 index 0000000000..e69de29bb2 diff --git a/profiler/proguard-rules.pro b/profiler/proguard-rules.pro new file mode 100644 index 0000000000..481bb43481 --- /dev/null +++ b/profiler/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/profiler/src/main/AndroidManifest.xml b/profiler/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..a5918e68ab --- /dev/null +++ b/profiler/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 1b75673afd..f082d324de 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -150,6 +150,7 @@ include( ":lsp:jvm-symbol-models", ":lsp:kotlin", ":lsp:xml", + ":profiler", ":subprojects:aapt2-proto", ":subprojects:aaptcompiler", ":subprojects:builder-model-impl", From a61b18db78f63c69a365123431caac1f844ea5f3 Mon Sep 17 00:00:00 2001 From: Daniel Alome Date: Fri, 19 Jun 2026 12:33:57 -0400 Subject: [PATCH 2/4] ADFA-4385: Make it easier to navigate to your point of origin when in the help activity --- .../activities/editor/HelpActivity.kt | 29 +++++++++++++++++++ common/src/main/res/menu/menu_help.xml | 11 +++++++ 2 files changed, 40 insertions(+) create mode 100644 common/src/main/res/menu/menu_help.xml diff --git a/common/src/main/java/com/itsaky/androidide/activities/editor/HelpActivity.kt b/common/src/main/java/com/itsaky/androidide/activities/editor/HelpActivity.kt index 166ff76380..6684025c0b 100644 --- a/common/src/main/java/com/itsaky/androidide/activities/editor/HelpActivity.kt +++ b/common/src/main/java/com/itsaky/androidide/activities/editor/HelpActivity.kt @@ -21,6 +21,8 @@ import android.app.Activity import android.content.Context import android.content.Intent import android.os.Bundle +import android.view.Menu +import android.view.MenuItem import android.view.View import android.webkit.WebViewClient import androidx.activity.OnBackPressedCallback @@ -102,6 +104,12 @@ class HelpActivity : BaseIDEActivity() { override fun onPageFinished(view: android.webkit.WebView?, url: String?) { super.onPageFinished(view, url) + invalidateOptionsMenu() + } + + override fun doUpdateVisitedHistory(view: android.webkit.WebView?, url: String?, isReload: Boolean) { + super.doUpdateVisitedHistory(view, url, isReload) + invalidateOptionsMenu() } override fun shouldOverrideUrlLoading(view: android.webkit.WebView?, url: String?): Boolean { @@ -165,6 +173,27 @@ class HelpActivity : BaseIDEActivity() { } } + override fun onCreateOptionsMenu(menu: Menu): Boolean { + menuInflater.inflate(com.itsaky.androidide.common.R.menu.menu_help, menu) + return true + } + + override fun onPrepareOptionsMenu(menu: Menu): Boolean { + menu.findItem(com.itsaky.androidide.common.R.id.action_close_help)?.isVisible = + _binding != null && binding.webView.canGoBack() + return super.onPrepareOptionsMenu(menu) + } + + override fun onOptionsItemSelected(item: MenuItem): Boolean { + return when (item.itemId) { + com.itsaky.androidide.common.R.id.action_close_help -> { + finish() + true + } + else -> super.onOptionsItemSelected(item) + } + } + private fun handleBackNavigation() { if (binding.webView.canGoBack()) { binding.webView.goBack() diff --git a/common/src/main/res/menu/menu_help.xml b/common/src/main/res/menu/menu_help.xml new file mode 100644 index 0000000000..9d594bb09d --- /dev/null +++ b/common/src/main/res/menu/menu_help.xml @@ -0,0 +1,11 @@ + + + + + + From 5edcedfb60fecb4b75d73ba865b7cb6a83ccaa9b Mon Sep 17 00:00:00 2001 From: Daniel Alome Date: Fri, 19 Jun 2026 12:42:38 -0400 Subject: [PATCH 3/4] Revert "feat: add profiler module" This reverts commit e4fd087dbc009621c9b814aba933996e55d8117a. --- profiler/.gitignore | 1 - profiler/build.gradle.kts | 17 ----------------- profiler/consumer-rules.pro | 0 profiler/proguard-rules.pro | 21 --------------------- profiler/src/main/AndroidManifest.xml | 4 ---- settings.gradle.kts | 1 - 6 files changed, 44 deletions(-) delete mode 100644 profiler/.gitignore delete mode 100644 profiler/build.gradle.kts delete mode 100644 profiler/consumer-rules.pro delete mode 100644 profiler/proguard-rules.pro delete mode 100644 profiler/src/main/AndroidManifest.xml diff --git a/profiler/.gitignore b/profiler/.gitignore deleted file mode 100644 index 42afabfd2a..0000000000 --- a/profiler/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/profiler/build.gradle.kts b/profiler/build.gradle.kts deleted file mode 100644 index 5e4aeb930c..0000000000 --- a/profiler/build.gradle.kts +++ /dev/null @@ -1,17 +0,0 @@ -import com.itsaky.androidide.build.config.BuildConfig - -plugins { - alias(libs.plugins.android.library) - alias(libs.plugins.kotlin.android) -} - -android { - namespace = "${BuildConfig.PACKAGE_NAME}.profiler" -} - -dependencies { - api(projects.actions) - api(libs.androidx.fragment) - api(libs.androidx.lifecycle.viewmodel.ktx) - api(libs.androidx.lifecycle.runtime.ktx) -} \ No newline at end of file diff --git a/profiler/consumer-rules.pro b/profiler/consumer-rules.pro deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/profiler/proguard-rules.pro b/profiler/proguard-rules.pro deleted file mode 100644 index 481bb43481..0000000000 --- a/profiler/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/profiler/src/main/AndroidManifest.xml b/profiler/src/main/AndroidManifest.xml deleted file mode 100644 index a5918e68ab..0000000000 --- a/profiler/src/main/AndroidManifest.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index f082d324de..1b75673afd 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -150,7 +150,6 @@ include( ":lsp:jvm-symbol-models", ":lsp:kotlin", ":lsp:xml", - ":profiler", ":subprojects:aapt2-proto", ":subprojects:aaptcompiler", ":subprojects:builder-model-impl", From f819c74aa739b42ae5288397e9d6a38c0811d7c9 Mon Sep 17 00:00:00 2001 From: Daniel Alome Date: Fri, 19 Jun 2026 13:01:25 -0400 Subject: [PATCH 4/4] fixes --- .../itsaky/androidide/activities/editor/HelpActivity.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/com/itsaky/androidide/activities/editor/HelpActivity.kt b/common/src/main/java/com/itsaky/androidide/activities/editor/HelpActivity.kt index 6684025c0b..e2bb9c7cc9 100644 --- a/common/src/main/java/com/itsaky/androidide/activities/editor/HelpActivity.kt +++ b/common/src/main/java/com/itsaky/androidide/activities/editor/HelpActivity.kt @@ -31,6 +31,7 @@ import androidx.core.view.WindowCompat import org.adfa.constants.CONTENT_KEY import com.itsaky.androidide.resources.R import com.itsaky.androidide.app.BaseIDEActivity +import com.itsaky.androidide.common.R as CommonR import com.itsaky.androidide.common.databinding.ActivityHelpBinding import com.itsaky.androidide.utils.DeviceFormFactorUtils import com.itsaky.androidide.utils.isSystemInDarkMode @@ -174,19 +175,19 @@ class HelpActivity : BaseIDEActivity() { } override fun onCreateOptionsMenu(menu: Menu): Boolean { - menuInflater.inflate(com.itsaky.androidide.common.R.menu.menu_help, menu) + menuInflater.inflate(CommonR.menu.menu_help, menu) return true } override fun onPrepareOptionsMenu(menu: Menu): Boolean { - menu.findItem(com.itsaky.androidide.common.R.id.action_close_help)?.isVisible = + menu.findItem(CommonR.id.action_close_help)?.isVisible = _binding != null && binding.webView.canGoBack() return super.onPrepareOptionsMenu(menu) } override fun onOptionsItemSelected(item: MenuItem): Boolean { return when (item.itemId) { - com.itsaky.androidide.common.R.id.action_close_help -> { + CommonR.id.action_close_help -> { finish() true }