Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
F
Fast File Manager Pro
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
Fast File Manager Pro
Commits
0f0e2911
Commit
0f0e2911
authored
Mar 27, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善代码
parent
c6a412c7
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
141 additions
and
19 deletions
+141
-19
build.gradle.kts
app/build.gradle.kts
+27
-0
KoInternalkoActivity.kt
...ilemanagerpro/kokoInternalstorage/KoInternalkoActivity.kt
+6
-2
KoInternalkoAdapter.kt
...filemanagerpro/kokoInternalstorage/KoInternalkoAdapter.kt
+25
-5
KoDupFilekoViewModel.kt
...m/zxhy/fastfilemanagerpro/kokodup/KoDupFilekoViewModel.kt
+1
-1
PermissionEx.kt
...y/fastfilemanagerpro/kokotools/permission/PermissionEx.kt
+4
-3
GrayLinearLayout.kt
...va/com/zxhy/fastfilemanagerpro/widget/GrayLinearLayout.kt
+56
-0
item_koko_list_file.xml
app/src/main/res/layout/item_koko_list_file.xml
+20
-8
colors.xml
app/src/main/res/values/colors.xml
+2
-0
kokoAndroidConfigure.jks
kokoAndroidConfigure.jks
+0
-0
No files found.
app/build.gradle.kts
View file @
0f0e2911
...
...
@@ -35,6 +35,33 @@ android {
}
buildFeatures
{
viewBinding
=
true
buildConfig
=
true
}
lint
{
//https://blog.csdn.net/destiny1507/article/details/104329583
checkReleaseBuilds
=
false
abortOnError
=
false
}
signingConfigs
{
create
(
"keyStore"
)
{
storeFile
=
file
(
"../kokoAndroidConfigure.jks"
)
storePassword
=
"wenlu1796"
keyAlias
=
"Smilekoko"
keyPassword
=
"wanglei1796"
}
}
buildTypes
{
val
signConfig
=
signingConfigs
.
getByName
(
"keyStore"
)
release
{
isMinifyEnabled
=
true
proguardFiles
(
getDefaultProguardFile
(
"proguard-android-optimize.txt"
),
"proguard-rules.pro"
)
signingConfig
=
signConfig
}
}
}
...
...
app/src/main/java/com/zxhy/fastfilemanagerpro/kokoInternalstorage/KoInternalkoActivity.kt
View file @
0f0e2911
...
...
@@ -177,8 +177,9 @@ class KoInternalkoActivity : AppCompatActivity() {
binding
.
llOperation
.
visibility
=
View
.
GONE
binding
.
clOperationConfirm
.
visibility
=
View
.
VISIBLE
adapter
.
showSelectMode
(
false
)
adapter
.
setCannotDir
(
data
.
filter
{
it
.
isDirectory
})
adapter
.
showSelectMode
(
false
,
false
)
adapter
.
setCannotDir
(
data
)
adapter
.
pageRoot
()
binding
.
tvConfirmItems
.
text
=
"${data.size} items"
when
(
operation
)
{
...
...
@@ -213,6 +214,7 @@ class KoInternalkoActivity : AppCompatActivity() {
}
}
binding
.
tvCancel
.
setOnClickListener
{
adapter
.
clearCannotDir
()
browserMode
()
}
}
...
...
@@ -294,12 +296,14 @@ class KoInternalkoActivity : AppCompatActivity() {
binding
.
llCopy
.
isEnabled
=
true
binding
.
llMove
.
isEnabled
=
true
binding
.
llRename
.
isEnabled
=
true
binding
.
llRename
.
visibility
=
View
.
VISIBLE
}
else
{
binding
.
llShare
.
isEnabled
=
true
binding
.
llDelete
.
isEnabled
=
true
binding
.
llCopy
.
isEnabled
=
true
binding
.
llMove
.
isEnabled
=
true
binding
.
llRename
.
isEnabled
=
false
binding
.
llRename
.
visibility
=
View
.
GONE
}
}
...
...
app/src/main/java/com/zxhy/fastfilemanagerpro/kokoInternalstorage/KoInternalkoAdapter.kt
View file @
0f0e2911
package
com.zxhy.fastfilemanagerpro.kokoInternalstorage
import
android.annotation.SuppressLint
import
android.app.Activity
import
android.content.Context
import
android.graphics.ColorMatrix
import
android.graphics.ColorMatrixColorFilter
import
android.graphics.Paint
import
android.os.Environment
import
android.view.View
import
android.view.ViewGroup
...
...
@@ -17,6 +21,7 @@ import com.zxhy.fastfilemanagerpro.kokodata.KoFileDatako.Companion.toFile
import
com.zxhy.fastfilemanagerpro.kokotools.XmlEx.inflate
import
java.io.File
class
KoInternalkoAdapter
(
private
val
context
:
Context
,
private
val
allSelect
:
(
flag
:
Boolean
)
->
Unit
,
...
...
@@ -37,9 +42,11 @@ class KoInternalkoAdapter(
}
@SuppressLint
(
"NotifyDataSetChanged"
)
fun
showSelectMode
(
show
:
Boolean
)
{
fun
showSelectMode
(
show
:
Boolean
,
refresh
:
Boolean
=
true
)
{
selectMode
=
show
notifyDataSetChanged
()
if
(
refresh
)
{
notifyDataSetChanged
()
}
}
class
KoInternalkoViewHolder
(
view
:
View
)
:
ViewHolder
(
view
)
{
...
...
@@ -68,10 +75,10 @@ class KoInternalkoAdapter(
data
.
loadImageIcon
(
context
,
ivIcon
)
if
(
cannotFiles
.
contains
(
data
.
toFile
().
absolutePath
))
{
root
.
setBackgroundColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_606060
))
vOverly
.
visibility
=
View
.
VISIBLE
root
.
setOnClickListener
{
}
}
else
{
root
.
setBackgroundColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_ffffff
))
vOverly
.
visibility
=
View
.
GONE
root
.
setOnClickListener
{
if
(
canPage
)
{
pageNext
(
context
,
data
)
...
...
@@ -102,6 +109,12 @@ class KoInternalkoAdapter(
}
}
fun
pageRoot
()
{
currentDir
=
Environment
.
getExternalStorageDirectory
()
val
list
=
currentDir
.
listFiles
()
?.
map
{
it
.
koFileDatako
(
context
)
}
?:
listOf
()
setData
(
list
)
}
private
fun
pageNext
(
context
:
Context
,
data
:
KoFileDatako
)
{
val
list
=
data
.
toFile
().
listFiles
()
?.
map
{
it
.
koFileDatako
(
context
)
}
?:
listOf
()
setData
(
list
)
...
...
@@ -138,10 +151,17 @@ class KoInternalkoAdapter(
@SuppressLint
(
"NotifyDataSetChanged"
)
fun
setCannotDir
(
dirs
:
List
<
File
>)
{
cannotFiles
.
addAll
(
dirs
.
map
{
it
.
absolutePath
})
notifyDataSetChanged
()
}
fun
clearCannotDir
()
{
cannotFiles
.
clear
()
}
fun
aa
(
view
:
View
,
context
:
Context
)
{
val
paint
=
Paint
()
val
cm
=
ColorMatrix
()
cm
.
setSaturation
(
0f
)
paint
.
setColorFilter
(
ColorMatrixColorFilter
(
cm
))
view
.
setLayerType
(
View
.
LAYER_TYPE_HARDWARE
,
paint
)
}
}
\ No newline at end of file
app/src/main/java/com/zxhy/fastfilemanagerpro/kokodup/KoDupFilekoViewModel.kt
View file @
0f0e2911
...
...
@@ -20,7 +20,7 @@ class KoDupFilekoViewModel : CommonViewModel() {
}
fun
isDupFileFilter
(
file
:
File
):
Boolean
{
return
file
.
length
()
>
0
return
file
.
length
()
>
0
&&
!
isImageFilter
(
file
)
}
...
...
app/src/main/java/com/zxhy/fastfilemanagerpro/kokotools/permission/PermissionEx.kt
View file @
0f0e2911
...
...
@@ -45,9 +45,9 @@ object PermissionEx {
fun
Context
.
alert
(
title
:
String
=
""
,
message
:
String
,
positiveButtonText
:
String
=
""
,
positiveButtonText
:
String
=
"
Jump
"
,
positiveButton
:
(()
->
Unit
)?
=
null
,
negativeButtonText
:
String
=
""
,
negativeButtonText
:
String
=
"
Cancel
"
,
negativeButton
:
(()
->
Unit
)?
=
null
,
)
{
val
builder
=
MaterialAlertDialogBuilder
(
this
)
...
...
@@ -61,7 +61,8 @@ object PermissionEx {
}
val
dialog
=
builder
.
create
()
dialog
.
setCanceledOnTouchOutside
(
false
)
dialog
.
setTitle
(
title
)
//
dialog.setTitle(title)
dialog
.
setMessage
(
message
)
dialog
.
show
()
}
}
app/src/main/java/com/zxhy/fastfilemanagerpro/widget/GrayLinearLayout.kt
0 → 100644
View file @
0f0e2911
package
com.zxhy.fastfilemanagerpro.widget
import
android.content.Context
import
android.graphics.Canvas
import
android.graphics.Color
import
android.graphics.ColorFilter
import
android.graphics.ColorMatrix
import
android.graphics.ColorMatrixColorFilter
import
android.graphics.Paint
import
android.graphics.PorterDuff
import
android.graphics.PorterDuffColorFilter
import
android.util.AttributeSet
import
android.widget.LinearLayout
class
GrayLinearLayout
:
LinearLayout
{
private
val
mPaint
=
Paint
()
private
var
flag
=
false
var
filter
:
ColorFilter
=
PorterDuffColorFilter
(
Color
.
rgb
(
34
,
136
,
201
),
PorterDuff
.
Mode
.
OVERLAY
)
constructor
(
context
:
Context
?)
:
super
(
context
)
constructor
(
context
:
Context
?,
attrs
:
AttributeSet
?)
:
super
(
context
,
attrs
)
{
val
cm
=
ColorMatrix
()
cm
.
setSaturation
(
0f
)
mPaint
.
setColorFilter
(
ColorMatrixColorFilter
(
cm
))
// mPaint.setColorFilter(filter)
}
constructor
(
context
:
Context
?,
attrs
:
AttributeSet
?,
defStyleAttr
:
Int
)
:
super
(
context
,
attrs
,
defStyleAttr
)
override
fun
onDraw
(
canvas
:
Canvas
)
{
if
(
flag
)
{
canvas
.
saveLayer
(
null
,
mPaint
,
Canvas
.
ALL_SAVE_FLAG
)
}
super
.
onDraw
(
canvas
)
}
override
fun
dispatchDraw
(
canvas
:
Canvas
)
{
if
(
flag
)
{
canvas
.
saveLayer
(
null
,
mPaint
,
Canvas
.
ALL_SAVE_FLAG
)
super
.
dispatchDraw
(
canvas
)
canvas
.
restore
()
}
super
.
dispatchDraw
(
canvas
)
}
fun
setGray
(
flag
:
Boolean
)
{
this
.
flag
=
flag
invalidate
()
}
}
\ No newline at end of file
app/src/main/res/layout/item_koko_list_file.xml
View file @
0f0e2911
...
...
@@ -2,21 +2,21 @@
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_marginHorizontal=
"20dp"
android:layout_marginVertical=
"12dp"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"20dp"
android:layout_marginVertical=
"12dp"
>
<ImageView
android:src=
"@mipmap/qwe_889989111"
android:id=
"@+id/iv_icon"
android:layout_width=
"45dp"
android:layout_height=
"45dp"
android:src=
"@mipmap/qwe_889989111"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:ignore=
"ContentDescription"
/>
<LinearLayout
<
com.zxhy.fastfilemanagerpro.widget.Gray
LinearLayout
android:id=
"@+id/ll"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
...
...
@@ -46,17 +46,29 @@
android:textColor=
"#666666"
android:textSize=
"12sp"
tools:ignore=
"HardcodedText"
/>
</LinearLayout>
</
com.zxhy.fastfilemanagerpro.widget.Gray
LinearLayout>
<ImageView
android:src=
"@drawable/bg_file_selector"
android:id=
"@+id/iv_selector"
android:layout_width=
"24dp"
android:layout_marginEnd=
"6dp"
android:layout_height=
"24dp"
android:layout_marginEnd=
"6dp"
android:src=
"@drawable/bg_file_selector"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/ll"
app:layout_constraintTop_toTopOf=
"parent"
tools:ignore=
"ContentDescription"
/>
<View
android:visibility=
"gone"
android:id=
"@+id/v_overly"
android:layout_width=
"0dp"
android:layout_height=
"0dp"
android:background=
"@color/color_80000000"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/values/colors.xml
View file @
0f0e2911
...
...
@@ -11,4 +11,6 @@
<color
name=
"color_fffdf6"
>
#FFFDF6
</color>
<color
name=
"color_494949"
>
#494949
</color>
<color
name=
"color_faf6e9"
>
#FAF6E9
</color>
<color
name=
"color_798fad"
>
#798FAD
</color>
<color
name=
"color_80000000"
>
#80000000
</color>
</resources>
\ No newline at end of file
kokoAndroidConfigure.jks
0 → 100644
View file @
0f0e2911
File added
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