mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 15:56:48 +08:00
Fixed #513: 'Open with' start file sharing intent
This commit is contained in:
@@ -46,7 +46,7 @@ import com.itsaky.androidide.projects.ProjectManager.getProjectDirPath
|
||||
import com.itsaky.androidide.tasks.executeAsync
|
||||
import com.itsaky.androidide.utils.DialogUtils
|
||||
import com.itsaky.androidide.utils.Environment
|
||||
import com.itsaky.androidide.utils.IntentUtils.shareFile
|
||||
import com.itsaky.androidide.utils.IntentUtils.startIntent
|
||||
import com.itsaky.androidide.utils.ProjectWriter
|
||||
import com.itsaky.androidide.utils.SingleTextWatcher
|
||||
import com.itsaky.toaster.Toaster.Type.ERROR
|
||||
@@ -169,7 +169,7 @@ class FileTreeActionHandler : BaseEventHandler() {
|
||||
}
|
||||
|
||||
private fun openWith(context: Context, file: File) {
|
||||
shareFile(context, file, "*/*")
|
||||
startIntent(context, file, "*/*", Intent.ACTION_VIEW)
|
||||
}
|
||||
|
||||
private fun createNewFile(context: Context, file: File) {
|
||||
@@ -245,7 +245,7 @@ class FileTreeActionHandler : BaseEventHandler() {
|
||||
toast(string.msg_invalid_name, ERROR)
|
||||
return@setPositiveButton
|
||||
}
|
||||
|
||||
|
||||
val name: String = binding.name.editText!!.text.toString().trim()
|
||||
val autoLayout = binding.checkButton.isChecked
|
||||
val pkgName = ProjectWriter.getPackageName(file)
|
||||
@@ -284,10 +284,10 @@ class FileTreeActionHandler : BaseEventHandler() {
|
||||
builder.setCancelable(false)
|
||||
builder.create().show()
|
||||
}
|
||||
|
||||
|
||||
private fun isValidJavaName(s: CharSequence?) =
|
||||
s == null || !SourceVersion.isName(s) || SourceVersion.isKeyword(s)
|
||||
|
||||
|
||||
private fun createLayoutRes(context: Context, file: File) {
|
||||
createNewFileWithContent(
|
||||
context,
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="48dp"
|
||||
android:height="48dp"
|
||||
android:viewportWidth="48"
|
||||
android:viewportHeight="48">
|
||||
<path
|
||||
android:fillColor="#ffffff"
|
||||
android:pathData="M24,44 L15.85,35.85 18.05,33.65 22.5,38.1V28.65H25.5V38.1L29.95,33.65L32.15,35.85ZM11.9,31.9 L4,24 11.95,16.05 14.15,18.25 9.9,22.5H19.35V25.5H9.9L14.1,29.7ZM36.1,31.9 L33.9,29.7 38.1,25.5H28.7V22.5H38.1L33.9,18.3L36.1,16.1L44,24ZM22.5,19.3V9.9L18.3,14.1L16.1,11.9L24,4L31.9,11.9L29.7,14.1L25.5,9.9V19.3Z"/>
|
||||
</vector>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:autoMirrored="true"
|
||||
android:tint="#FFFFFF"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@color/primaryIconColor"
|
||||
android:pathData="M19,19H5V5h7V3H5c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2v-7h-2v7zM14,3v2h3.59l-9.83,9.83 1.41,1.41L19,6.41V10h2V3h-7z" />
|
||||
</vector>
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user