Skip to content

Commit 388a257

Browse files
committed
working httpserver
TODO cp database in idesetup.sh TODO tooltip webview is hidden by editor window
1 parent d81212b commit 388a257

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

app/src/main/java/com/itsaky/androidide/activities/MainActivity.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package com.itsaky.androidide.activities
1919

2020
import android.content.Context
2121
import android.content.Intent
22+
import android.net.Uri
2223
import android.os.Bundle
2324
import android.text.TextUtils
2425
import android.util.Log
@@ -133,6 +134,7 @@ class MainActivity : EdgeToEdgeIDEActivity() {
133134
*/
134135
fun transferDatabaseFromAssets(context: Context, databaseName: String): Boolean {
135136
val dbPath = context.getDatabasePath(databaseName)
137+
Log.d(TAG, "transferDatabaseFromAssets\\\\dbPath = $dbPath")
136138

137139
// Check if the database already exists in internal storage.
138140
if (dbPath.exists()) {
@@ -151,6 +153,7 @@ class MainActivity : EdgeToEdgeIDEActivity() {
151153
}
152154

153155
// Copy the database file from assets to internal storage.
156+
154157
try {
155158
val inputStream: InputStream = context.assets.open("database/$databaseName") // Corrected path
156159
val outputStream = FileOutputStream(dbPath)

app/src/main/java/com/itsaky/androidide/fragments/IDETooltipWebViewFragment.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ class IDETooltipWebviewFragment : Fragment() {
8888

8989
// Set up WebChromeClient to support JavaScript
9090
// webView.webChromeClient = WebChromeClient()
91-
webView.canGoBack()
92-
webView.canGoForward()
9391
webView.settings.allowFileAccessFromFileURLs
9492
webView.settings.allowFileAccess
9593
webView.settings.allowUniversalAccessFromFileURLs
@@ -107,7 +105,10 @@ class IDETooltipWebviewFragment : Fragment() {
107105

108106
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
109107
super.onViewCreated(view, savedInstanceState)
110-
Log.d(Companion.TAG, "IDETooltipWebviewFragment\\\\onViewCreated called")
108+
Log.d(Companion.TAG, "IDETooltipWebViewFragment\\\\onViewCreated called")
109+
view.requestFocus()
110+
view.bringToFront()
111+
view.elevation = 5.0F
111112
}
112113

113114
override fun onDestroyView() {
@@ -116,13 +117,13 @@ class IDETooltipWebviewFragment : Fragment() {
116117
if(webView.isVisible) {
117118
webView.clearHistory()
118119
webView.loadUrl("about:blank")
120+
webView.destroy()
119121
}
120-
webView.destroy()
121122

122123
}
123124

124125
companion object {
125-
private const val TAG = "IDETooltipWebviewFragment"
126+
private const val TAG = "IDETooltipWebViewFragment"
126127
}
127128

128129

app/src/main/java/com/itsaky/androidide/utils/TooltipUtils.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ object TooltipUtils {
6868
bundle.putString(MainFragment.KEY_TOOLTIP_URL, url)
6969
fragment.arguments = bundle
7070
transaction.replace(R.id.fragment_containers_parent, fragment)
71+
transaction.show(fragment)
7172
transaction.commitAllowingStateLoss()
7273
}
7374

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[versions]
22
activityKtx = "1.8.2"
3-
agp = "8.9.2"
3+
agp = "8.10.0"
44
agp-tooling = "8.4.2"
55
appcompat = "1.6.1"
66
colorpickerview = "2.3.0"

termux/termux-app/src/main/assets/data/common/idesetup.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,6 @@ printf "JAVA_HOME=%s" "$jdk_dir" >"$props"
6969
#-- a permanent fix will be to change the source of the libs_source/bootstrap/boostrap-<arch>.zip
7070
#-- specifically the etc/apt/sources.list
7171
echo "deb [trusted=yes] https://packages.appdevforall.org/apt/termux-main/ stable main" > $SYSROOT/etc/apt/sources.list
72+
echo "copying documentation database from /data/user/0/com.itsaky.androidide/databases/documentation"
73+
echo " to /data/user/0/com.itsaky.androidide/databases/documentation"
74+
###cp -f /data/user/0/com.itsaky.androidide/databases/documentation /data/data/com.itsaky.androidide/databases/documentation

0 commit comments

Comments
 (0)