Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
F
File Recovery RecycleBin
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
File Recovery RecycleBin
Commits
af1f01c3
Commit
af1f01c3
authored
Jul 29, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
1f9a8191
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
2 deletions
+78
-2
build.gradle
app/build.gradle
+3
-0
HomeFragment.kt
.../com/base/filerecoveryrecyclebin/fragment/HomeFragment.kt
+39
-0
fragment_home_3.xml
app/src/main/res/layout/fragment_home_3.xml
+36
-2
No files found.
app/build.gradle
View file @
af1f01c3
...
@@ -80,6 +80,9 @@ dependencies {
...
@@ -80,6 +80,9 @@ dependencies {
implementation
(
"com.github.pokercc:ExpandableRecyclerView:0.9.3"
)
implementation
(
"com.github.pokercc:ExpandableRecyclerView:0.9.3"
)
implementation
'com.github.zhpanvip:viewpagerindicator:1.2.3'
implementation
'com.github.zhpanvip:viewpagerindicator:1.2.3'
//图片处理
implementation
'org.opencv:opencv:4.10.0'
//网络
//网络
implementation
group:
'com.google.code.gson'
,
name:
'gson'
,
version:
'2.10.1'
implementation
group:
'com.google.code.gson'
,
name:
'gson'
,
version:
'2.10.1'
implementation
"com.squareup.okhttp3:okhttp:4.9.0"
implementation
"com.squareup.okhttp3:okhttp:4.9.0"
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/fragment/HomeFragment.kt
View file @
af1f01c3
...
@@ -2,7 +2,15 @@ package com.base.filerecoveryrecyclebin.fragment
...
@@ -2,7 +2,15 @@ package com.base.filerecoveryrecyclebin.fragment
import
android.animation.ValueAnimator
import
android.animation.ValueAnimator
import
android.annotation.SuppressLint
import
android.annotation.SuppressLint
import
android.app.usage.StorageStatsManager
import
android.content.Context
import
android.content.Context.STORAGE_STATS_SERVICE
import
android.content.Intent
import
android.content.Intent
import
android.os.Build
import
android.os.Environment
import
android.os.StatFs
import
android.os.storage.StorageManager
import
android.view.View
import
com.base.filerecoveryrecyclebin.activity.SettingActivity
import
com.base.filerecoveryrecyclebin.activity.SettingActivity
import
com.base.filerecoveryrecyclebin.activity.appprocess.AppProcessAnimationActivity
import
com.base.filerecoveryrecyclebin.activity.appprocess.AppProcessAnimationActivity
import
com.base.filerecoveryrecyclebin.activity.junkclean.ScanJunkActivity
import
com.base.filerecoveryrecyclebin.activity.junkclean.ScanJunkActivity
...
@@ -12,6 +20,10 @@ import com.base.filerecoveryrecyclebin.activity.screenshot.ScreenShotAnimationAc
...
@@ -12,6 +20,10 @@ import com.base.filerecoveryrecyclebin.activity.screenshot.ScreenShotAnimationAc
import
com.base.filerecoveryrecyclebin.activity.whatsapp.WhatsAppCleanerAnimationActivity
import
com.base.filerecoveryrecyclebin.activity.whatsapp.WhatsAppCleanerAnimationActivity
import
com.base.filerecoveryrecyclebin.databinding.FragmentHome3Binding
import
com.base.filerecoveryrecyclebin.databinding.FragmentHome3Binding
import
com.base.filerecoveryrecyclebin.help.BaseFragment
import
com.base.filerecoveryrecyclebin.help.BaseFragment
import
com.base.filerecoveryrecyclebin.help.KotlinExt.toFormatSize
import
com.base.filerecoveryrecyclebin.help.PermissionHelp.checkStorePermission
import
java.io.File
class
HomeFragment
:
BaseFragment
<
FragmentHome3Binding
>()
{
class
HomeFragment
:
BaseFragment
<
FragmentHome3Binding
>()
{
private
val
TAG
=
"HomeFragment"
private
val
TAG
=
"HomeFragment"
...
@@ -67,9 +79,36 @@ class HomeFragment : BaseFragment<FragmentHome3Binding>() {
...
@@ -67,9 +79,36 @@ class HomeFragment : BaseFragment<FragmentHome3Binding>() {
}
}
@SuppressLint
(
"SetTextI18n"
)
override
fun
onResume
()
{
override
fun
onResume
()
{
super
.
onResume
()
super
.
onResume
()
binding
.
lottie
.
resumeAnimation
()
binding
.
lottie
.
resumeAnimation
()
if
(
requireContext
().
checkStorePermission
())
{
binding
.
llStorage
.
visibility
=
View
.
VISIBLE
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
val
storageStatsManager
=
requireContext
().
getSystemService
(
STORAGE_STATS_SERVICE
)
as
StorageStatsManager
Thread
{
val
totalBytes
=
storageStatsManager
.
getTotalBytes
(
StorageManager
.
UUID_DEFAULT
)
val
usedBytes
=
totalBytes
-
storageStatsManager
.
getFreeBytes
(
StorageManager
.
UUID_DEFAULT
)
binding
.
root
.
post
{
binding
.
tvStorage
.
text
=
"${usedBytes.toFormatSize()} / ${totalBytes.toFormatSize()}"
}
}.
start
()
}
else
{
val
path1
:
File
=
Environment
.
getDataDirectory
()
val
stat1
=
StatFs
(
path1
.
path
)
val
path2
:
File
=
Environment
.
getExternalStorageDirectory
()
val
stat2
=
StatFs
(
path2
.
path
)
val
totalSize
=
(
stat1
.
totalBytes
+
stat2
.
totalBytes
).
toFormatSize
()
val
usedSize
=
((
stat1
.
totalBytes
+
stat2
.
totalBytes
)
-
(
stat1
.
availableBytes
+
stat2
.
availableBytes
)).
toFormatSize
()
binding
.
tvStorage
.
text
=
"$usedSize / $totalSize"
}
}
}
}
}
}
\ No newline at end of file
app/src/main/res/layout/fragment_home_3.xml
View file @
af1f01c3
...
@@ -114,13 +114,43 @@
...
@@ -114,13 +114,43 @@
</FrameLayout>
</FrameLayout>
<LinearLayout
android:id=
"@+id/ll_storage"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"-20dp"
android:layout_marginBottom=
"15dp"
android:visibility=
"gone"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:text=
"Used Space"
android:textColor=
"#666666"
android:textSize=
"16sp"
android:textStyle=
"bold"
tools:ignore=
"HardcodedText"
/>
<TextView
android:id=
"@+id/tv_storage"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"8dp"
android:textColor=
"#FF0303"
android:textSize=
"16sp"
android:textStyle=
"bold"
tools:text=
"52.0 GB : 128 GB"
/>
</LinearLayout>
<ImageView
<ImageView
android:id=
"@+id/iv_arrow_up"
android:id=
"@+id/iv_arrow_up"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"-15dp"
android:layout_marginBottom=
"15dp"
android:src=
"@mipmap/xiala_h"
android:src=
"@mipmap/xiala_h"
tools:ignore=
"ContentDescription"
tools:ignore=
"ContentDescription"
tools:text=
"Scanned junk files 29.69MB"
/>
tools:text=
"Scanned junk files 29.69MB"
/>
...
@@ -153,6 +183,7 @@
...
@@ -153,6 +183,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"10dp"
android:layout_marginEnd=
"8dp"
android:layout_marginEnd=
"8dp"
android:src=
"@mipmap/c_cleanjunk"
android:src=
"@mipmap/c_cleanjunk"
tools:ignore=
"ContentDescription"
/>
tools:ignore=
"ContentDescription"
/>
...
@@ -192,6 +223,7 @@
...
@@ -192,6 +223,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"10dp"
android:layout_marginEnd=
"8dp"
android:layout_marginEnd=
"8dp"
android:src=
"@mipmap/c_whatsapp"
android:src=
"@mipmap/c_whatsapp"
tools:ignore=
"ContentDescription"
/>
tools:ignore=
"ContentDescription"
/>
...
@@ -240,6 +272,7 @@
...
@@ -240,6 +272,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"10dp"
android:layout_marginEnd=
"8dp"
android:layout_marginEnd=
"8dp"
android:src=
"@mipmap/c_large"
android:src=
"@mipmap/c_large"
tools:ignore=
"ContentDescription"
/>
tools:ignore=
"ContentDescription"
/>
...
@@ -279,6 +312,7 @@
...
@@ -279,6 +312,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"10dp"
android:layout_marginEnd=
"8dp"
android:layout_marginEnd=
"8dp"
android:src=
"@mipmap/c_appprocess"
android:src=
"@mipmap/c_appprocess"
tools:ignore=
"ContentDescription"
/>
tools:ignore=
"ContentDescription"
/>
...
...
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