Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
Solar Master Ace
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanglei
Solar Master Ace
Commits
985eb386
Commit
985eb386
authored
Mar 21, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:白包bug修复
parent
bd6767e7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
347 additions
and
205 deletions
+347
-205
deploymentTargetDropDown.xml
.idea/deploymentTargetDropDown.xml
+1
-14
gradle.xml
.idea/gradle.xml
+1
-1
misc.xml
.idea/misc.xml
+1
-1
AdapterCommonDataFunction.kt
.../zxhy/solarmasterace/adapter/AdapterCommonDataFunction.kt
+0
-1
CommonAdapter.kt
...ain/java/com/zxhy/solarmasterace/adapter/CommonAdapter.kt
+5
-14
FileBean.kt
app/src/main/java/com/zxhy/solarmasterace/data/FileBean.kt
+2
-1
FileBrowserActivity.kt
...om/zxhy/solarmasterace/filebrowser/FileBrowserActivity.kt
+237
-133
FileDirectoryAdapter.kt
...hy/solarmasterace/internalstorage/FileDirectoryAdapter.kt
+27
-0
InternalStorageActivity.kt
...solarmasterace/internalstorage/InternalStorageActivity.kt
+14
-5
FileEx.kt
...rc/main/java/com/zxhy/solarmasterace/quicktools/FileEx.kt
+36
-23
FileHelper.kt
...ain/java/com/zxhy/solarmasterace/quicktools/FileHelper.kt
+21
-12
colors.xml
app/src/main/res/values/colors.xml
+2
-0
No files found.
.idea/deploymentTargetDropDown.xml
View file @
985eb386
...
@@ -3,20 +3,7 @@
...
@@ -3,20 +3,7 @@
<component
name=
"deploymentTargetDropDown"
>
<component
name=
"deploymentTargetDropDown"
>
<value>
<value>
<entry
key=
"app"
>
<entry
key=
"app"
>
<State>
<State
/>
<runningDeviceTargetSelectedWithDropDown>
<Target>
<type
value=
"RUNNING_DEVICE_TARGET"
/>
<deviceKey>
<Key>
<type
value=
"SERIAL_NUMBER"
/>
<value
value=
"3426369207001D6"
/>
</Key>
</deviceKey>
</Target>
</runningDeviceTargetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown
value=
"2024-03-21T08:35:33.717775700Z"
/>
</State>
</entry>
</entry>
</value>
</value>
</component>
</component>
...
...
.idea/gradle.xml
View file @
985eb386
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<option
name=
"linkedExternalProjectsSettings"
>
<option
name=
"linkedExternalProjectsSettings"
>
<GradleProjectSettings>
<GradleProjectSettings>
<option
name=
"externalProjectPath"
value=
"$PROJECT_DIR$"
/>
<option
name=
"externalProjectPath"
value=
"$PROJECT_DIR$"
/>
<option
name=
"gradleJvm"
value=
"
#JAVA_HOME
"
/>
<option
name=
"gradleJvm"
value=
"
jbr-17
"
/>
<option
name=
"modules"
>
<option
name=
"modules"
>
<set>
<set>
<option
value=
"$PROJECT_DIR$"
/>
<option
value=
"$PROJECT_DIR$"
/>
...
...
.idea/misc.xml
View file @
985eb386
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<project
version=
"4"
>
<component
name=
"ExternalStorageConfigurationManager"
enabled=
"true"
/>
<component
name=
"ExternalStorageConfigurationManager"
enabled=
"true"
/>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_17"
default=
"true"
project-jdk-name=
"17"
project-jdk-type=
"JavaSDK"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_17"
default=
"true"
project-jdk-name=
"
jbr-
17"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
</component>
</component>
<component
name=
"ProjectType"
>
<component
name=
"ProjectType"
>
...
...
app/src/main/java/com/zxhy/solarmasterace/adapter/AdapterCommonDataFunction.kt
View file @
985eb386
...
@@ -6,7 +6,6 @@ interface AdapterCommonDataFunction {
...
@@ -6,7 +6,6 @@ interface AdapterCommonDataFunction {
abstract
fun
setData
(
data
:
List
<
FileBean
>)
abstract
fun
setData
(
data
:
List
<
FileBean
>)
abstract
fun
addData
(
data
:
List
<
FileBean
>)
abstract
fun
addData
(
data
:
List
<
FileBean
>)
abstract
fun
addDataFinish
(
data
:
List
<
FileBean
>)
abstract
fun
clearData
()
abstract
fun
clearData
()
abstract
fun
removeData
(
data
:
List
<
FileBean
>)
abstract
fun
removeData
(
data
:
List
<
FileBean
>)
abstract
fun
getSelectData
():
List
<
FileBean
>
abstract
fun
getSelectData
():
List
<
FileBean
>
...
...
app/src/main/java/com/zxhy/solarmasterace/adapter/CommonAdapter.kt
View file @
985eb386
...
@@ -20,19 +20,11 @@ abstract class CommonAdapter<T : ViewHolder?>() : RecyclerView.Adapter<T>(),
...
@@ -20,19 +20,11 @@ abstract class CommonAdapter<T : ViewHolder?>() : RecyclerView.Adapter<T>(),
@SuppressLint
(
"NotifyDataSetChanged"
)
@SuppressLint
(
"NotifyDataSetChanged"
)
override
fun
addData
(
data
:
List
<
FileBean
>)
{
override
fun
addData
(
data
:
List
<
FileBean
>)
{
fileList
.
addAll
(
data
)
if
(
firstRefresh
)
{
notifyDataSetChanged
()
firstRefresh
=
false
}
}
@SuppressLint
(
"NotifyDataSetChanged"
)
override
fun
addDataFinish
(
data
:
List
<
FileBean
>)
{
fileList
.
addAll
(
data
)
fileList
.
addAll
(
data
)
notifyDataSetChanged
()
notifyDataSetChanged
()
}
}
@SuppressLint
(
"NotifyDataSetChanged"
)
@SuppressLint
(
"NotifyDataSetChanged"
)
override
fun
clearData
()
{
override
fun
clearData
()
{
if
(
fileList
.
size
==
0
)
return
if
(
fileList
.
size
==
0
)
return
...
@@ -61,12 +53,11 @@ abstract class CommonAdapter<T : ViewHolder?>() : RecyclerView.Adapter<T>(),
...
@@ -61,12 +53,11 @@ abstract class CommonAdapter<T : ViewHolder?>() : RecyclerView.Adapter<T>(),
@SuppressLint
(
"NotifyDataSetChanged"
)
@SuppressLint
(
"NotifyDataSetChanged"
)
override
fun
toggleSelect
(
select
:
Boolean
)
{
override
fun
toggleSelect
(
select
:
Boolean
)
{
fileList
.
mapIndexed
{
index
,
fileBean
->
fileList
.
forEach
{
if
(
fileBean
.
isSelect
!=
select
)
{
fileBean
->
fileBean
.
isSelect
=
select
fileBean
.
isSelect
=
select
notifyItemChanged
(
index
,
"单条刷新"
)
}
}
}
notifyDataSetChanged
()
}
}
...
...
app/src/main/java/com/zxhy/solarmasterace/data/FileBean.kt
View file @
985eb386
...
@@ -174,9 +174,10 @@ fun File.isDocument(): Boolean {
...
@@ -174,9 +174,10 @@ fun File.isDocument(): Boolean {
return
isWord
()
or
isExcel
()
or
isPPt
()
or
isPdf
()
or
isTxt
()
return
isWord
()
or
isExcel
()
or
isPPt
()
or
isPdf
()
or
isTxt
()
}
}
fun
File
.
toFileBean
():
FileBean
{
fun
File
.
toFileBean
(
id
:
Long
=
0
):
FileBean
{
val
timeE
=
SimpleDateFormat
(
"MMM dd, yyyy"
,
Locale
.
ENGLISH
).
format
(
lastModified
())
val
timeE
=
SimpleDateFormat
(
"MMM dd, yyyy"
,
Locale
.
ENGLISH
).
format
(
lastModified
())
return
FileBean
(
return
FileBean
(
id
=
id
,
name
=
name
,
name
=
name
,
path
=
absolutePath
,
path
=
absolutePath
,
size
=
length
(),
size
=
length
(),
...
...
app/src/main/java/com/zxhy/solarmasterace/filebrowser/FileBrowserActivity.kt
View file @
985eb386
This diff is collapsed.
Click to expand it.
app/src/main/java/com/zxhy/solarmasterace/internalstorage/FileDirectoryAdapter.kt
View file @
985eb386
package
com.zxhy.solarmasterace.internalstorage
package
com.zxhy.solarmasterace.internalstorage
import
android.annotation.SuppressLint
import
android.annotation.SuppressLint
import
android.content.Context
import
android.os.Environment
import
android.os.Environment
import
android.util.Log
import
android.util.Log
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
androidx.core.content.ContextCompat
import
com.zxhy.solarmasterace.R
import
com.zxhy.solarmasterace.R
import
com.zxhy.solarmasterace.adapter.CommonAdapter
import
com.zxhy.solarmasterace.adapter.CommonAdapter
import
com.zxhy.solarmasterace.adapter.ItemCardFileViewHolder
import
com.zxhy.solarmasterace.adapter.ItemCardFileViewHolder
...
@@ -21,6 +23,7 @@ class FileDirectoryAdapter(
...
@@ -21,6 +23,7 @@ class FileDirectoryAdapter(
private
var
currentDir
=
Environment
.
getExternalStorageDirectory
()
private
var
currentDir
=
Environment
.
getExternalStorageDirectory
()
private
var
isSelectMode
=
false
private
var
isSelectMode
=
false
private
var
pageTurn
=
true
private
var
pageTurn
=
true
private
var
operationFile
=
arrayListOf
<
FileBean
>()
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
ItemCardFileViewHolder
{
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
ItemCardFileViewHolder
{
return
ItemCardFileViewHolder
(
R
.
layout
.
item_card_file
.
inflate
(
parent
))
return
ItemCardFileViewHolder
(
R
.
layout
.
item_card_file
.
inflate
(
parent
))
...
@@ -68,6 +71,18 @@ class FileDirectoryAdapter(
...
@@ -68,6 +71,18 @@ class FileDirectoryAdapter(
if
(!
pageTurn
)
return
@setOnClickListener
if
(!
pageTurn
)
return
@setOnClickListener
nextPage
(
data
)
nextPage
(
data
)
}
}
//该列表是选中列表
if
(
operationFile
.
map
{
it
.
path
}.
contains
(
data
.
path
))
{
root
.
setOnClickListener
{
}
root
.
setCardBackgroundColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_F4F4F4
)
)
}
else
{
root
.
setCardBackgroundColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
white
))
}
}
}
}
else
{
}
else
{
holder
.
binding
.
apply
{
holder
.
binding
.
apply
{
...
@@ -118,4 +133,16 @@ class FileDirectoryAdapter(
...
@@ -118,4 +133,16 @@ class FileDirectoryAdapter(
return
currentDir
return
currentDir
}
}
//当选中选中的列表,无法复制 移动到自身
fun
notifyCannotSelect
(
data
:
List
<
FileBean
>)
{
val
selectList
=
arrayListOf
<
FileBean
>()
selectList
.
addAll
(
data
)
operationFile
=
selectList
notifyDataSetChanged
()
}
fun
clearCannotSelect
()
{
operationFile
=
arrayListOf
()
}
}
}
\ No newline at end of file
app/src/main/java/com/zxhy/solarmasterace/internalstorage/InternalStorageActivity.kt
View file @
985eb386
...
@@ -31,8 +31,7 @@ class InternalStorageActivity : AppCompatActivity() {
...
@@ -31,8 +31,7 @@ class InternalStorageActivity : AppCompatActivity() {
private
val
MODE_BROWSE
=
0
private
val
MODE_BROWSE
=
0
private
val
MODE_SELECT
=
1
private
val
MODE_SELECT
=
1
private
val
MODE_SELECTED_OPERATION
=
2
private
val
MODE_SELECTED_OPERATION
=
2
private
val
MODE_LOCK
=
-
1
private
var
currentMode
=
MODE_BROWSE
//0普通浏览模式 1可选模式 2选中操作模式
private
var
currentMode
=
MODE_BROWSE
//0普通浏览模式 1可选模式 2选中操作模式 -1无权限锁功能模式
private
lateinit
var
activityLauncher
:
ActivityLauncher
private
lateinit
var
activityLauncher
:
ActivityLauncher
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
...
@@ -148,16 +147,21 @@ class InternalStorageActivity : AppCompatActivity() {
...
@@ -148,16 +147,21 @@ class InternalStorageActivity : AppCompatActivity() {
val
files
=
fileDirectoryAdapter
.
getSelectData
().
map
{
it
.
file
()
}
val
files
=
fileDirectoryAdapter
.
getSelectData
().
map
{
it
.
file
()
}
deleteFiles
(
files
)
{
deleteFiles
(
files
)
{
showCardTip
(
"Successfully deleted!"
)
showCardTip
(
"Successfully deleted!"
)
switchBrowseMode
()
}
}
}
}
binding
.
ivMove
.
setOnClickListener
{
binding
.
ivMove
.
setOnClickListener
{
val
moveFile
=
arrayListOf
<
File
>()
val
moveFile
=
arrayListOf
<
File
>()
fileDirectoryAdapter
.
getSelectData
().
map
{
moveFile
.
add
(
it
.
file
())
}
val
selectList
=
fileDirectoryAdapter
.
getSelectData
()
selectList
.
map
{
moveFile
.
add
(
it
.
file
())
}
fileDirectoryAdapter
.
notifyCannotSelect
(
selectList
)
switchSelectedOperationMode
(
"Motion"
,
moveFile
)
switchSelectedOperationMode
(
"Motion"
,
moveFile
)
}
}
binding
.
ivCopy
.
setOnClickListener
{
binding
.
ivCopy
.
setOnClickListener
{
val
copyFile
=
arrayListOf
<
File
>()
val
copyFile
=
arrayListOf
<
File
>()
fileDirectoryAdapter
.
getSelectData
().
map
{
copyFile
.
add
(
it
.
file
())
}
val
selectList
=
fileDirectoryAdapter
.
getSelectData
()
selectList
.
map
{
copyFile
.
add
(
it
.
file
())
}
fileDirectoryAdapter
.
notifyCannotSelect
(
selectList
)
switchSelectedOperationMode
(
"Copy"
,
copyFile
)
switchSelectedOperationMode
(
"Copy"
,
copyFile
)
}
}
}
}
...
@@ -185,6 +189,7 @@ class InternalStorageActivity : AppCompatActivity() {
...
@@ -185,6 +189,7 @@ class InternalStorageActivity : AppCompatActivity() {
binding
.
tvDefine
.
setOnClickListener
{
binding
.
tvDefine
.
setOnClickListener
{
moveFiles
(
files
)
{
moveFiles
(
files
)
{
showCardTip
(
"Successfully moved!"
)
showCardTip
(
"Successfully moved!"
)
fileDirectoryAdapter
.
clearCannotSelect
()
switchBrowseMode
()
switchBrowseMode
()
}
}
}
}
...
@@ -193,6 +198,7 @@ class InternalStorageActivity : AppCompatActivity() {
...
@@ -193,6 +198,7 @@ class InternalStorageActivity : AppCompatActivity() {
"Copy"
->
{
"Copy"
->
{
binding
.
tvDefine
.
setOnClickListener
{
binding
.
tvDefine
.
setOnClickListener
{
copyFiles
(
files
)
{
copyFiles
(
files
)
{
fileDirectoryAdapter
.
clearCannotSelect
()
showCardTip
(
"Successfully copied!"
)
showCardTip
(
"Successfully copied!"
)
switchBrowseMode
()
switchBrowseMode
()
}
}
...
@@ -210,7 +216,10 @@ class InternalStorageActivity : AppCompatActivity() {
...
@@ -210,7 +216,10 @@ class InternalStorageActivity : AppCompatActivity() {
val
dir
=
fileDirectoryAdapter
.
getCurrentDir
()
?:
File
(
""
)
val
dir
=
fileDirectoryAdapter
.
getCurrentDir
()
?:
File
(
""
)
files
.
forEach
{
files
.
forEach
{
if
(
it
.
isFile
)
{
if
(
it
.
isFile
)
{
it
.
copyTo
(
File
(
dir
,
it
.
name
))
val
destFile
=
File
(
dir
,
it
.
name
)
if
(!
destFile
.
exists
())
{
it
.
copyTo
(
destFile
)
}
}
else
{
}
else
{
FileHelper
.
copyDirectory
(
it
,
File
(
dir
,
it
.
name
))
FileHelper
.
copyDirectory
(
it
,
File
(
dir
,
it
.
name
))
}
}
...
...
app/src/main/java/com/zxhy/solarmasterace/quicktools/FileEx.kt
View file @
985eb386
package
com.zxhy.solarmasterace.quicktools
package
com.zxhy.solarmasterace.quicktools
import
android.os.Environment
import
android.os.Environment
import
androidx.lifecycle.LifecycleCoroutineScope
import
androidx.lifecycle.lifecycleScope
import
com.zxhy.solarmasterace.data.DupFileBean
import
com.zxhy.solarmasterace.data.DupFileBean
import
com.zxhy.solarmasterace.data.FileBean
import
com.zxhy.solarmasterace.data.FileBean
import
com.zxhy.solarmasterace.data.isApk
import
com.zxhy.solarmasterace.data.isApk
...
@@ -16,6 +18,8 @@ import com.zxhy.solarmasterace.data.isVideo
...
@@ -16,6 +18,8 @@ import com.zxhy.solarmasterace.data.isVideo
import
com.zxhy.solarmasterace.data.isWord
import
com.zxhy.solarmasterace.data.isWord
import
com.zxhy.solarmasterace.data.isZip
import
com.zxhy.solarmasterace.data.isZip
import
com.zxhy.solarmasterace.data.toFileBean
import
com.zxhy.solarmasterace.data.toFileBean
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.launch
import
java.io.File
import
java.io.File
import
java.util.Stack
import
java.util.Stack
...
@@ -52,23 +56,28 @@ fun dupImage(): List<DupFileBean> {
...
@@ -52,23 +56,28 @@ fun dupImage(): List<DupFileBean> {
}
}
fun
largeFile
(
fun
largeFile
(
lifecycleScope
:
LifecycleCoroutineScope
,
onDo
:
((
file
:
List
<
FileBean
>)
->
Unit
)?
=
null
,
onDo
:
((
file
:
List
<
FileBean
>)
->
Unit
)?
=
null
,
onFinish
:
((
file
:
List
<
FileBean
>,
count
:
Int
)
->
Unit
)?
=
null
onFinish
:
((
file
:
List
<
FileBean
>,
count
:
Int
)
->
Unit
)?
=
null
)
{
)
{
val
rootDir
=
Environment
.
getExternalStorageDirectory
()
lifecycleScope
.
launch
(
Dispatchers
.
IO
)
{
val
tempList
=
arrayListOf
<
FileBean
>()
val
rootDir
=
Environment
.
getExternalStorageDirectory
()
var
count
=
0
val
tempList
=
arrayListOf
<
FileBean
>()
FileHelper
.
linkedLisTraverseFolder
(
rootDir
)
{
var
count
=
0
if
(
it
.
length
()
>
10
*
1024
*
1024
)
{
FileHelper
.
linkedLisTraverseFolder
(
rootDir
)
{
tempList
.
add
(
it
.
toFileBean
())
if
(
it
.
length
()
>
10
*
1024
*
1024
)
{
count
++
tempList
.
add
(
it
.
toFileBean
())
if
(
tempList
.
size
==
10
)
{
count
++
onDo
?.
invoke
(
tempList
)
if
(
tempList
.
size
==
10
)
{
tempList
.
clear
()
onDo
?.
invoke
(
tempList
)
tempList
.
clear
()
}
}
}
}
}
onFinish
?.
invoke
(
tempList
,
count
)
}
}
onFinish
?.
invoke
(
tempList
,
count
)
}
}
fun
audioFile
(
fun
audioFile
(
...
@@ -295,25 +304,29 @@ fun emptyFile(
...
@@ -295,25 +304,29 @@ fun emptyFile(
}
}
fun
imageFile
(
fun
imageFile
(
lifecycleCoroutineScope
:
LifecycleCoroutineScope
,
onDo
:
((
file
:
List
<
FileBean
>)
->
Unit
)?
=
null
,
onDo
:
((
file
:
List
<
FileBean
>)
->
Unit
)?
=
null
,
onFinish
:
((
file
:
List
<
FileBean
>,
count
:
Int
)
->
Unit
)?
=
null
onFinish
:
((
file
:
List
<
FileBean
>,
count
:
Long
)
->
Unit
)?
=
null
)
{
)
{
val
rootDir
=
Environment
.
getExternalStorageDirectory
()
lifecycleCoroutineScope
.
launch
(
Dispatchers
.
IO
)
{
val
tempList
=
arrayListOf
<
FileBean
>()
val
rootDir
=
Environment
.
getExternalStorageDirectory
()
var
count
=
0
val
tempList
=
arrayListOf
<
FileBean
>()
FileHelper
.
linkedLisTraverseFolder
(
rootDir
)
{
var
count
=
0L
if
(
it
.
isImage
())
{
FileHelper
.
linkedLisTraverseFolder
(
rootDir
)
{
tempList
.
add
(
it
.
toFileBean
())
if
(
it
.
isImage
())
{
count
++
tempList
.
add
(
it
.
toFileBean
(
count
))
if
(
tempList
.
size
==
10
)
{
count
++
onDo
?.
invoke
(
tempList
)
if
(
tempList
.
size
==
10
)
{
tempList
.
clear
()
onDo
?.
invoke
(
tempList
)
tempList
.
clear
()
}
}
}
}
}
onFinish
?.
invoke
(
tempList
,
count
)
}
}
onFinish
?.
invoke
(
tempList
,
count
)
}
}
fun
videoFile
(
fun
videoFile
(
onDo
:
((
file
:
List
<
FileBean
>)
->
Unit
)?
=
null
,
onDo
:
((
file
:
List
<
FileBean
>)
->
Unit
)?
=
null
,
onFinish
:
((
file
:
List
<
FileBean
>,
count
:
Int
)
->
Unit
)?
=
null
onFinish
:
((
file
:
List
<
FileBean
>,
count
:
Int
)
->
Unit
)?
=
null
...
...
app/src/main/java/com/zxhy/solarmasterace/quicktools/FileHelper.kt
View file @
985eb386
...
@@ -83,13 +83,15 @@ object FileHelper {
...
@@ -83,13 +83,15 @@ object FileHelper {
val
currentFile
=
stackFiles
.
peek
()
val
currentFile
=
stackFiles
.
peek
()
val
subFiles
=
currentFile
.
listFiles
()
val
subFiles
=
currentFile
.
listFiles
()
for
(
i
in
subFiles
!!
.
indices
)
{
if
(
subFiles
!=
null
)
{
if
(
subFiles
[
i
].
isFile
)
{
for
(
i
in
subFiles
.
indices
)
{
if
(!
subFiles
[
i
].
delete
())
{
if
(
subFiles
[
i
].
isFile
)
{
return
false
if
(!
subFiles
[
i
].
delete
())
{
return
false
}
}
else
{
stackFiles
.
push
(
subFiles
[
i
])
}
}
}
else
{
stackFiles
.
push
(
subFiles
[
i
])
}
}
}
}
if
(
currentFile
===
stackFiles
.
peek
())
{
if
(
currentFile
===
stackFiles
.
peek
())
{
...
@@ -108,15 +110,22 @@ object FileHelper {
...
@@ -108,15 +110,22 @@ object FileHelper {
* @param target 目标文件夹
* @param target 目标文件夹
*/
*/
fun
copyDirectory
(
source
:
File
,
target
:
File
)
{
fun
copyDirectory
(
source
:
File
,
target
:
File
)
{
if
(
source
.
isDirectory
)
{
try
{
if
(!
target
.
exists
())
target
.
mkdir
()
if
(
source
.
isDirectory
)
{
if
(!
target
.
exists
())
target
.
mkdir
()
source
.
list
()
?.
map
{
sub
->
source
.
list
()
?.
map
{
sub
->
copyDirectory
(
File
(
source
,
sub
),
File
(
target
,
sub
))
copyDirectory
(
File
(
source
,
sub
),
File
(
target
,
sub
))
}
}
else
{
if
(!
target
.
exists
())
{
source
.
copyTo
(
target
)
}
}
}
}
else
{
}
catch
(
e
:
Exception
)
{
source
.
copyTo
(
target
)
e
.
printStackTrace
(
)
}
}
}
}
}
}
\ No newline at end of file
app/src/main/res/values/colors.xml
View file @
985eb386
...
@@ -6,4 +6,6 @@
...
@@ -6,4 +6,6 @@
<color
name=
"color_FF4CE0AB"
>
#FF4CE0AB
</color>
<color
name=
"color_FF4CE0AB"
>
#FF4CE0AB
</color>
<color
name=
"color_FF333333"
>
#FF333333
</color>
<color
name=
"color_FF333333"
>
#FF333333
</color>
<color
name=
"color_FF999999"
>
#FF999999
</color>
<color
name=
"color_FF999999"
>
#FF999999
</color>
<color
name=
"color_999999"
>
#999999
</color>
<color
name=
"color_F4F4F4"
>
#F4F4F4
</color>
</resources>
</resources>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment