pull/274/head
gedoor 4 years ago
parent 07af514413
commit 5956f6032a
  1. 1
      app/src/main/AndroidManifest.xml
  2. 2
      app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt
  3. 8
      app/src/main/java/io/legado/app/ui/filechooser/FilePicker.kt
  4. 2
      app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleActivity.kt
  5. 2
      app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt

@ -301,6 +301,7 @@
<data android:scheme="content"/>
<data android:mimeType="text/plain" />
<data android:mimeType="application/json" />
<data android:mimeType="application/epub" />
</intent-filter>
</activity>

@ -91,7 +91,7 @@ class BookSourceActivity : VMBaseActivity<BookSourceViewModel>(R.layout.activity
.selectFile(
this,
importRequestCode,
type = "text/*",
type = arrayOf("text/*", "application/json"),
allowExtensions = arrayOf("txt", "json")
)
R.id.menu_import_source_onLine -> showImportDialog()

@ -91,7 +91,7 @@ object FilePicker {
activity: BaseActivity,
requestCode: Int,
title: String = activity.getString(R.string.select_file),
type: String,
type: Array<String>,
allowExtensions: Array<String>?,
default: (() -> Unit)? = null
) {
@ -107,7 +107,7 @@ object FilePicker {
1 -> {
try {
val intent = createSelectFileIntent()
intent.type = type//设置类型
intent.putExtra(Intent.EXTRA_MIME_TYPES, type)
activity.startActivityForResult(intent, requestCode)
} catch (e: java.lang.Exception) {
e.printStackTrace()
@ -131,7 +131,7 @@ object FilePicker {
fragment: Fragment,
requestCode: Int,
title: String = fragment.getString(R.string.select_file),
type: String,
type: Array<String>,
allowExtensions: Array<String>,
default: (() -> Unit)? = null
) {
@ -148,7 +148,7 @@ object FilePicker {
1 -> {
try {
val intent = createSelectFileIntent()
intent.type = type//设置类型
intent.putExtra(Intent.EXTRA_MIME_TYPES, type)
fragment.startActivityForResult(intent, requestCode)
} catch (e: java.lang.Exception) {
e.printStackTrace()

@ -190,7 +190,7 @@ class ReplaceRuleActivity : VMBaseActivity<ReplaceRuleViewModel>(R.layout.activi
.selectFile(
this,
importRequestCode,
type = "text/*",
type = arrayOf("text/*", "application/json"),
allowExtensions = arrayOf("txt", "json")
)
}

@ -86,7 +86,7 @@ class RssSourceActivity : VMBaseActivity<RssSourceViewModel>(R.layout.activity_r
.selectFile(
this,
importRequestCode,
type = "text/*",
type = arrayOf("text/*", "application/json"),
allowExtensions = arrayOf("txt", "json")
)
R.id.menu_import_source_onLine -> showImportDialog()

Loading…
Cancel
Save