Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
F
FileManager
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
yanglin
FileManager
Commits
1fa11825
Commit
1fa11825
authored
Apr 16, 2024
by
yanglin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
被冲掉的代码提交
parent
1b1200a0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
6 deletions
+28
-6
MediaAdapter.kt
...ain/java/com/xm/test/myfilemaster/adapter/MediaAdapter.kt
+1
-1
SimilarBeanAdapter.kt
...va/com/xm/test/myfilemaster/adapter/SimilarBeanAdapter.kt
+2
-2
BaseActivity.kt
...c/main/java/com/xm/test/myfilemaster/base/BaseActivity.kt
+16
-1
MediaUtil.kt
.../src/main/java/com/xm/test/myfilemaster/util/MediaUtil.kt
+8
-1
fragment_file_manager.xml
MyDemo3/app/src/main/res/layout/fragment_file_manager.xml
+1
-1
No files found.
MyDemo3/app/src/main/java/com/xm/test/myfilemaster/adapter/MediaAdapter.kt
View file @
1fa11825
...
@@ -66,7 +66,7 @@ class MediaAdapter(
...
@@ -66,7 +66,7 @@ class MediaAdapter(
if
(
mFileType
.
equals
(
"image"
)){
if
(
mFileType
.
equals
(
"image"
)){
mViewHolder
.
image
.
setImageDrawable
(
mListData
[
position
].
drawable
)
//
mViewHolder.image.setImageDrawable(mListData[position].drawable)
mViewHolder
.
image
.
layoutParams
.
height
=
dpToPx
mViewHolder
.
image
.
layoutParams
.
height
=
dpToPx
}
else
{
}
else
{
...
...
MyDemo3/app/src/main/java/com/xm/test/myfilemaster/adapter/SimilarBeanAdapter.kt
View file @
1fa11825
...
@@ -58,9 +58,9 @@ class SimilarBeanAdapter(context: Context) : RecyclerView.Adapter<SimilarBeanAda
...
@@ -58,9 +58,9 @@ class SimilarBeanAdapter(context: Context) : RecyclerView.Adapter<SimilarBeanAda
val
layoutParams
=
holder
.
binding
.
imageItemGrid
.
layoutParams
val
layoutParams
=
holder
.
binding
.
imageItemGrid
.
layoutParams
if
(
list
[
position
].
getmList
().
size
.
toFloat
()
/
4.0
==
1.0
){
if
(
list
[
position
].
getmList
().
size
.
toFloat
()
/
4.0
==
1.0
){
layoutParams
.
height
=
FileUtil
.
dpToPx
(
8
3
*(
list
[
position
].
getmList
().
size
/
4
),
context
)
layoutParams
.
height
=
FileUtil
.
dpToPx
(
8
0
*(
list
[
position
].
getmList
().
size
/
4
),
context
)
}
else
{
}
else
{
layoutParams
.
height
=
FileUtil
.
dpToPx
(
8
3
*(
list
[
position
].
getmList
().
size
/
4
+
1
),
context
)
layoutParams
.
height
=
FileUtil
.
dpToPx
(
8
0
*(
list
[
position
].
getmList
().
size
/
4
+
1
),
context
)
}
}
holder
.
binding
.
imageItemGrid
.
setOnItemClickListener
{
parent
,
view
,
itemPosition
,
id
->
holder
.
binding
.
imageItemGrid
.
setOnItemClickListener
{
parent
,
view
,
itemPosition
,
id
->
...
...
MyDemo3/app/src/main/java/com/xm/test/myfilemaster/base/BaseActivity.kt
View file @
1fa11825
...
@@ -17,6 +17,7 @@ import androidx.core.content.FileProvider
...
@@ -17,6 +17,7 @@ import androidx.core.content.FileProvider
import
androidx.core.view.isVisible
import
androidx.core.view.isVisible
import
androidx.lifecycle.Observer
import
androidx.lifecycle.Observer
import
androidx.lifecycle.ViewModelProvider
import
androidx.lifecycle.ViewModelProvider
import
com.xm.test.myfilemaster.MyApplication
import
com.xm.test.myfilemaster.R
import
com.xm.test.myfilemaster.R
import
com.xm.test.myfilemaster.activity.BaseActivityViewModel
import
com.xm.test.myfilemaster.activity.BaseActivityViewModel
import
com.xm.test.myfilemaster.activity.HomeActivity
import
com.xm.test.myfilemaster.activity.HomeActivity
...
@@ -194,7 +195,21 @@ abstract class BaseActivity : BaseAbsView(), BaseActivityListener{
...
@@ -194,7 +195,21 @@ abstract class BaseActivity : BaseAbsView(), BaseActivityListener{
mFileAdapter
.
setEditClickState
(
isClickEditBtn
)
mFileAdapter
.
setEditClickState
(
isClickEditBtn
)
}
}
R
.
id
.
btn_delete
->{
R
.
id
.
btn_delete
->{
//TODO 删除
val
customDialog
=
CustomDialog
(
this
)
customDialog
.
setsCancel
(
View
.
OnClickListener
{
customDialog
.
dismiss
()
}).
setsConfirm
(
View
.
OnClickListener
{
for
(
fileBean
in
mFileCheckedItemList
!!
){
mItemDataList
.
remove
(
fileBean
)
MyApplication
.
mCleanSdk
?.
delete
(
File
(
fileBean
.
filePath
))
}
mFileAdapter
.
setData
(
mItemDataList
)
}).
show
()
customDialog
.
isShowEditText
(
false
)
customDialog
.
setsTitle
(
"Delete"
)
customDialog
.
setsHint
(
"Are you sure you want to delete ${mFileCheckedItemList.size} item?"
)
customDialog
.
setsRightDelete
(
"Delete"
)
}
}
R
.
id
.
btn_share
->{
R
.
id
.
btn_share
->{
if
(
switchNumber
>
1
){
if
(
switchNumber
>
1
){
...
...
MyDemo3/app/src/main/java/com/xm/test/myfilemaster/util/MediaUtil.kt
View file @
1fa11825
...
@@ -5,6 +5,8 @@ import android.content.ContentResolver
...
@@ -5,6 +5,8 @@ import android.content.ContentResolver
import
android.content.Context
import
android.content.Context
import
android.graphics.Bitmap
import
android.graphics.Bitmap
import
android.graphics.BitmapFactory
import
android.graphics.BitmapFactory
import
android.graphics.drawable.BitmapDrawable
import
android.graphics.drawable.Drawable
import
android.provider.MediaStore
import
android.provider.MediaStore
import
android.util.TypedValue
import
android.util.TypedValue
import
com.xm.test.myfilemaster.model.FileBean
import
com.xm.test.myfilemaster.model.FileBean
...
@@ -78,7 +80,8 @@ object MediaUtil {
...
@@ -78,7 +80,8 @@ object MediaUtil {
fileBean
.
fileName
=
file
.
name
fileBean
.
fileName
=
file
.
name
fileBean
.
filePath
=
file
.
absolutePath
fileBean
.
filePath
=
file
.
absolutePath
fileBean
.
fileType
=
FileUtil
.
getFileType
(
file
)
fileBean
.
fileType
=
FileUtil
.
getFileType
(
file
)
fileBean
.
fileBitmap
=
BitmapFactory
.
decodeFile
(
imagePath
)
// fileBean.fileBitmap = BitmapFactory.decodeFile(imagePath)
fileBean
.
drawable
=
getDrawable
(
context
,
imagePath
)
images
.
add
(
fileBean
)
images
.
add
(
fileBean
)
count
++
count
++
}
}
...
@@ -109,6 +112,10 @@ object MediaUtil {
...
@@ -109,6 +112,10 @@ object MediaUtil {
// return similarImages
// return similarImages
// }
// }
fun
getDrawable
(
context
:
Context
,
filePath
:
String
):
Drawable
{
return
BitmapDrawable
(
context
.
resources
,
filePath
)
}
}
}
\ No newline at end of file
MyDemo3/app/src/main/res/layout/fragment_file_manager.xml
View file @
1fa11825
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
android:orientation=
"vertical"
android:orientation=
"vertical"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
>
<RelativeLayout
<RelativeLayout
android:id=
"@+id/recent_file_view"
android:id=
"@+id/recent_file_view"
android:layout_marginTop=
"12dp"
android:layout_marginTop=
"12dp"
android:layout_marginStart=
"12dp"
android:layout_marginStart=
"12dp"
android:layout_marginEnd=
"12dp"
android:layout_marginEnd=
"12dp"
...
...
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