From 4883839988cec8d77b9febebd8b925efe018d025 Mon Sep 17 00:00:00 2001 From: Jason Yao Date: Wed, 9 Sep 2020 23:06:29 -0400 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E4=BA=AB=E9=80=89=E4=B8=AD=E4=B9=A6?= =?UTF-8?q?=E6=BA=90+=E6=8C=89=E6=97=B6=E9=97=B4=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/utils/FileUtils.kt | 19 +++++++++++++++++++ app/src/main/res/drawable/ic_share.xml | 13 ++++--------- app/src/main/res/menu/book_source.xml | 11 +++++++++++ app/src/main/res/values-zh-rHK/strings.xml | 2 ++ app/src/main/res/values-zh-rTW/strings.xml | 2 ++ app/src/main/res/values-zh/strings.xml | 2 ++ app/src/main/res/values/strings.xml | 5 ++++- app/src/main/res/xml/file_paths.xml | 15 +++++++++++++++ 8 files changed, 59 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/io/legado/app/utils/FileUtils.kt b/app/src/main/java/io/legado/app/utils/FileUtils.kt index eef940a86..19c03ae01 100644 --- a/app/src/main/java/io/legado/app/utils/FileUtils.kt +++ b/app/src/main/java/io/legado/app/utils/FileUtils.kt @@ -1,6 +1,7 @@ package io.legado.app.utils import android.os.Environment +import android.util.Log import android.webkit.MimeTypeMap import androidx.annotation.IntDef import io.legado.app.App @@ -55,6 +56,24 @@ object FileUtils { return file } + fun createFileWithReplace(filePath: String) : File{ + val file = File(filePath) + if (!file.exists()) { + //创建父类文件夹 + file.parent?.let { + createFolderIfNotExist(it) + } + //创建文件 + file.createNewFile() + } + else{ + val result = file.delete() + Log.d("Jason", result.toString()) + file.createNewFile() + } + return file + } + fun getFile(root: File, vararg subDirFiles: String): File { val filePath = getPath(root, *subDirFiles) return File(filePath) diff --git a/app/src/main/res/drawable/ic_share.xml b/app/src/main/res/drawable/ic_share.xml index 0022d3b38..7b4b0103b 100644 --- a/app/src/main/res/drawable/ic_share.xml +++ b/app/src/main/res/drawable/ic_share.xml @@ -1,14 +1,9 @@ - - - - - \ No newline at end of file + + diff --git a/app/src/main/res/menu/book_source.xml b/app/src/main/res/menu/book_source.xml index 4ae595bb7..ed20f9b16 100644 --- a/app/src/main/res/menu/book_source.xml +++ b/app/src/main/res/menu/book_source.xml @@ -46,6 +46,10 @@ android:checkable="true" android:title="@string/sort_by_url" /> + @@ -92,4 +96,11 @@ android:title="@string/import_by_qr_code" app:showAsAction="never" /> + + + diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 0e6ae2b2d..9494414c8 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -759,5 +759,7 @@ 主题列表 使用保存主题,导入,分享主题 切換默認主題 + 分享選中書源 + 時間排序 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 7be3d0924..09d1225b4 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -759,6 +759,8 @@ 主题列表 使用保存主题,导入,分享主题 切換默認主題 + 分享選中書源 + 時間排序 diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index fe359bf67..a32fa95bb 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -444,6 +444,7 @@ 请求头(header) 调试源 二维码导入 + 分享选中书源 扫描二维码 选中时点击可弹出菜单 主题 @@ -759,5 +760,6 @@ 主题列表 使用保存主题,导入,分享主题 切换默认主题 + 时间排序 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ccc85629a..6cdf21bb0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -388,6 +388,7 @@ 分类Url 登录URL(loginUrl) 源注释(sourceComment) + 请求头(header) 搜索地址(url) 发现地址规则(url) 书籍列表规则(bookList) @@ -444,7 +445,7 @@ Data parsing failed - Source http header + Debug source Import from QR code Scan QR code @@ -761,5 +762,7 @@ Save night theme config Theme list Save, Import, Share theme + Share selected sources + Sort by update time \ No newline at end of file diff --git a/app/src/main/res/xml/file_paths.xml b/app/src/main/res/xml/file_paths.xml index cdcf27e1b..779108dbf 100644 --- a/app/src/main/res/xml/file_paths.xml +++ b/app/src/main/res/xml/file_paths.xml @@ -6,4 +6,19 @@ + + + + + \ No newline at end of file