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
02c3c8a5
Commit
02c3c8a5
authored
Jul 22, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
5a514230
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
35 additions
and
21 deletions
+35
-21
MainActivity.kt
.../com/base/filerecoveryrecyclebin/activity/MainActivity.kt
+8
-5
AdMaxNativeUtils.kt
...m/base/filerecoveryrecyclebin/ads/max/AdMaxNativeUtils.kt
+4
-5
HomeFragment.kt
.../com/base/filerecoveryrecyclebin/fragment/HomeFragment.kt
+18
-7
fragment_home_3.xml
app/src/main/res/layout/fragment_home_3.xml
+1
-0
layout_max_native_big.xml
app/src/main/res/layout/layout_max_native_big.xml
+1
-1
layout_max_native_custom.xml
app/src/main/res/layout/layout_max_native_custom.xml
+1
-1
layout_max_native_small.xml
app/src/main/res/layout/layout_max_native_small.xml
+1
-1
layout_max_native_small_f8f8f8.xml
app/src/main/res/layout/layout_max_native_small_f8f8f8.xml
+1
-1
No files found.
app/src/main/java/com/base/filerecoveryrecyclebin/activity/MainActivity.kt
View file @
02c3c8a5
...
@@ -22,11 +22,13 @@ import com.base.filerecoveryrecyclebin.help.PermissionHelp.checkStorePermission
...
@@ -22,11 +22,13 @@ import com.base.filerecoveryrecyclebin.help.PermissionHelp.checkStorePermission
import
com.base.filerecoveryrecyclebin.service.StayNotificationService
import
com.base.filerecoveryrecyclebin.service.StayNotificationService
import
com.base.filerecoveryrecyclebin.utils.BarUtils
import
com.base.filerecoveryrecyclebin.utils.BarUtils
import
com.base.filerecoveryrecyclebin.utils.FileHexEx
import
com.base.filerecoveryrecyclebin.utils.FileHexEx
import
com.base.filerecoveryrecyclebin.utils.LogEx
import
com.base.filerecoveryrecyclebin.view.DialogViews.showExitDialog
import
com.base.filerecoveryrecyclebin.view.DialogViews.showExitDialog
import
com.base.filerecoveryrecyclebin.view.PermissionDialog.showPermissionBottomSheet
import
com.base.filerecoveryrecyclebin.view.PermissionDialog.showPermissionBottomSheet
import
com.base.filerecoveryrecyclebin.view.RateStarPop.showRateStarPopDialog
import
com.base.filerecoveryrecyclebin.view.RateStarPop.showRateStarPopDialog
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.delay
import
kotlinx.coroutines.delay
import
kotlinx.coroutines.flow.MutableSharedFlow
import
kotlinx.coroutines.launch
import
kotlinx.coroutines.launch
import
java.io.File
import
java.io.File
...
@@ -134,8 +136,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
...
@@ -134,8 +136,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
}
}
var
photoSize
Action
:
((
size
:
Long
)
->
Unit
)?
=
null
var
photoSize
Flow
:
MutableSharedFlow
<
Long
>
=
MutableSharedFlow
(
0
)
fun
initPhotoSize
()
=
lifecycleScope
.
launch
(
Dispatchers
.
IO
)
{
fun
initPhotoSize
()
=
lifecycleScope
.
launch
(
Dispatchers
.
IO
)
{
LogEx
.
logDebug
(
TAG
,
"initPhotoSize"
)
val
dcimSize
=
val
dcimSize
=
FileHelp
.
getDirFiles
(
Environment
.
getExternalStoragePublicDirectory
(
Environment
.
DIRECTORY_DCIM
))
FileHelp
.
getDirFiles
(
Environment
.
getExternalStoragePublicDirectory
(
Environment
.
DIRECTORY_DCIM
))
.
filter
{
FileHexEx
.
isImage
(
it
)
}
.
filter
{
FileHexEx
.
isImage
(
it
)
}
...
@@ -145,11 +148,11 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
...
@@ -145,11 +148,11 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
getImageMedia
(
list
)
getImageMedia
(
list
)
val
photoSize
=
list
.
map
{
File
(
it
.
path
)
}.
sumOf
{
it
.
length
()
}
val
photoSize
=
list
.
map
{
File
(
it
.
path
)
}.
sumOf
{
it
.
length
()
}
launch
(
Dispatchers
.
Main
)
{
val
size
=
dcimSize
+
photoSize
val
size
=
dcimSize
+
photoSize
LogEx
.
logDebug
(
TAG
,
"size=$size"
)
photoSizeAction
?.
invoke
(
size
)
}
delay
(
1500
)
photoSizeFlow
.
emit
(
size
)
}
}
override
fun
onResume
()
{
override
fun
onResume
()
{
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/max/AdMaxNativeUtils.kt
View file @
02c3c8a5
...
@@ -17,7 +17,6 @@ import com.base.filerecoveryrecyclebin.help.BaseApplication
...
@@ -17,7 +17,6 @@ import com.base.filerecoveryrecyclebin.help.BaseApplication
import
com.base.filerecoveryrecyclebin.help.ConfigHelper
import
com.base.filerecoveryrecyclebin.help.ConfigHelper
import
com.base.filerecoveryrecyclebin.utils.EventUtils
import
com.base.filerecoveryrecyclebin.utils.EventUtils
import
com.base.filerecoveryrecyclebin.utils.LogEx
import
com.base.filerecoveryrecyclebin.utils.LogEx
import
com.ironsource.na
import
org.json.JSONObject
import
org.json.JSONObject
object
AdMaxNativeUtils
{
object
AdMaxNativeUtils
{
...
@@ -106,7 +105,7 @@ object AdMaxNativeUtils {
...
@@ -106,7 +105,7 @@ object AdMaxNativeUtils {
.
setBodyTextViewId
(
R
.
id
.
ad_body
)
.
setBodyTextViewId
(
R
.
id
.
ad_body
)
// .setAdvertiserTextViewId(R.id.advertiser_text_view)
// .setAdvertiserTextViewId(R.id.advertiser_text_view)
.
setIconImageViewId
(
R
.
id
.
ad_app_icon
)
.
setIconImageViewId
(
R
.
id
.
ad_app_icon
)
.
setMediaContentViewGroupId
(
R
.
id
.
media_view_container
)
.
setMediaContentViewGroupId
(
R
.
id
.
ad_media
)
// .setOptionsContentViewGroupId(R.id.options_view)
// .setOptionsContentViewGroupId(R.id.options_view)
// .setStarRatingContentViewGroupId(R.id.star_rating_view)
// .setStarRatingContentViewGroupId(R.id.star_rating_view)
.
setCallToActionButtonId
(
R
.
id
.
ad_call_to_action
)
.
setCallToActionButtonId
(
R
.
id
.
ad_call_to_action
)
...
@@ -139,16 +138,16 @@ object AdMaxNativeUtils {
...
@@ -139,16 +138,16 @@ object AdMaxNativeUtils {
nativeAdLoader
.
loadAd
()
nativeAdLoader
.
loadAd
()
loadingListener
=
{
loadingListener
=
{
if
(
nativeAd
!=
null
)
{
if
(
nativeAd
!=
null
)
{
showReadNative
(
activity
,
parent
,
layout
)
showRead
y
Native
(
activity
,
parent
,
layout
)
}
}
}
}
}
else
{
}
else
{
showReadNative
(
activity
,
parent
,
layout
)
showRead
y
Native
(
activity
,
parent
,
layout
)
}
}
}
}
private
fun
showReadNative
(
activity
:
Activity
,
parent
:
ViewGroup
,
layout
:
Int
)
{
private
fun
showRead
y
Native
(
activity
:
Activity
,
parent
:
ViewGroup
,
layout
:
Int
)
{
val
adView
=
createNativeAdView
(
activity
,
layout
)
val
adView
=
createNativeAdView
(
activity
,
layout
)
LogEx
.
logDebug
(
TAG
,
"showReadNative adUnitId=${nativeAd?.adUnitId}"
)
LogEx
.
logDebug
(
TAG
,
"showReadNative adUnitId=${nativeAd?.adUnitId}"
)
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/fragment/HomeFragment.kt
View file @
02c3c8a5
...
@@ -4,6 +4,7 @@ import android.animation.ValueAnimator
...
@@ -4,6 +4,7 @@ import android.animation.ValueAnimator
import
android.annotation.SuppressLint
import
android.annotation.SuppressLint
import
android.content.Intent
import
android.content.Intent
import
android.view.View
import
android.view.View
import
androidx.lifecycle.lifecycleScope
import
com.base.filerecoveryrecyclebin.activity.MainActivity
import
com.base.filerecoveryrecyclebin.activity.MainActivity
import
com.base.filerecoveryrecyclebin.activity.SettingActivity
import
com.base.filerecoveryrecyclebin.activity.SettingActivity
import
com.base.filerecoveryrecyclebin.activity.junkclean.ScanJunkActivity
import
com.base.filerecoveryrecyclebin.activity.junkclean.ScanJunkActivity
...
@@ -19,7 +20,11 @@ import com.base.filerecoveryrecyclebin.bean.ConstObject.SCAN_VIDEOS
...
@@ -19,7 +20,11 @@ import com.base.filerecoveryrecyclebin.bean.ConstObject.SCAN_VIDEOS
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.KotlinExt.toFormatSize
import
com.base.filerecoveryrecyclebin.help.PermissionHelp.checkStorePermission
import
com.base.filerecoveryrecyclebin.utils.LogEx
import
com.base.filerecoveryrecyclebin.utils.LogEx
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.flow.collectLatest
import
kotlinx.coroutines.launch
class
HomeFragment
:
BaseFragment
<
FragmentHome3Binding
>()
{
class
HomeFragment
:
BaseFragment
<
FragmentHome3Binding
>()
{
private
val
TAG
=
"HomeFragment"
private
val
TAG
=
"HomeFragment"
...
@@ -72,17 +77,20 @@ class HomeFragment : BaseFragment<FragmentHome3Binding>() {
...
@@ -72,17 +77,20 @@ class HomeFragment : BaseFragment<FragmentHome3Binding>() {
binding
.
ivVip
.
setOnClickListener
{
binding
.
ivVip
.
setOnClickListener
{
startActivity
(
Intent
(
requireContext
(),
VipActivity
::
class
.
java
))
startActivity
(
Intent
(
requireContext
(),
VipActivity
::
class
.
java
))
}
}
(
requireActivity
()
as
MainActivity
).
photoSizeAction
=
{
if
(
it
==
0L
)
{
lifecycleScope
.
launch
(
Dispatchers
.
Main
)
{
binding
.
tvPhotoSize
.
visibility
=
View
.
INVISIBLE
(
requireActivity
()
as
MainActivity
).
photoSizeFlow
.
collectLatest
{
binding
.
tvPhotoSize
.
text
=
it
.
toFormatSize
(
0
)
LogEx
.
logDebug
(
TAG
,
"photoSizeFlow=$it"
)
}
else
{
if
(
it
==
0L
)
{
binding
.
tvPhotoSize
.
visibility
=
View
.
INVISIBLE
binding
.
tvPhotoSize
.
visibility
=
View
.
INVISIBLE
}
else
{
binding
.
tvPhotoSize
.
visibility
=
View
.
VISIBLE
binding
.
tvPhotoSize
.
text
=
it
.
toFormatSize
(
0
)
}
}
}
}
}
}
}
override
fun
onPause
()
{
override
fun
onPause
()
{
super
.
onPause
()
super
.
onPause
()
binding
.
lottie
.
pauseAnimation
()
binding
.
lottie
.
pauseAnimation
()
...
@@ -92,6 +100,9 @@ class HomeFragment : BaseFragment<FragmentHome3Binding>() {
...
@@ -92,6 +100,9 @@ class HomeFragment : BaseFragment<FragmentHome3Binding>() {
override
fun
onResume
()
{
override
fun
onResume
()
{
super
.
onResume
()
super
.
onResume
()
binding
.
lottie
.
resumeAnimation
()
binding
.
lottie
.
resumeAnimation
()
if
(
requireContext
().
checkStorePermission
())
{
(
requireActivity
()
as
MainActivity
).
initPhotoSize
()
}
}
}
}
}
\ No newline at end of file
app/src/main/res/layout/fragment_home_3.xml
View file @
02c3c8a5
...
@@ -458,6 +458,7 @@
...
@@ -458,6 +458,7 @@
android:gravity=
"center"
android:gravity=
"center"
android:textColor=
"@color/white"
android:textColor=
"@color/white"
android:textSize=
"9sp"
android:textSize=
"9sp"
android:visibility=
"invisible"
tools:ignore=
"SmallSp"
tools:ignore=
"SmallSp"
tools:text=
"0.1GB"
/>
tools:text=
"0.1GB"
/>
...
...
app/src/main/res/layout/layout_max_native_big.xml
View file @
02c3c8a5
...
@@ -78,7 +78,7 @@
...
@@ -78,7 +78,7 @@
<FrameLayout
<FrameLayout
android:id=
"@+id/
media_view_container
"
android:id=
"@+id/
ad_media
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"100dp"
android:layout_height=
"100dp"
android:layout_gravity=
"center_vertical"
android:layout_gravity=
"center_vertical"
...
...
app/src/main/res/layout/layout_max_native_custom.xml
View file @
02c3c8a5
...
@@ -89,7 +89,7 @@
...
@@ -89,7 +89,7 @@
tools:text=
"Body"
/>
tools:text=
"Body"
/>
<FrameLayout
<FrameLayout
android:id=
"@+id/
media_view_container
"
android:id=
"@+id/
ad_media
"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"100dp"
android:layout_height=
"100dp"
android:layout_marginTop=
"4dp"
android:layout_marginTop=
"4dp"
...
...
app/src/main/res/layout/layout_max_native_small.xml
View file @
02c3c8a5
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
android:layout_gravity=
"center_vertical"
>
android:layout_gravity=
"center_vertical"
>
<FrameLayout
<FrameLayout
android:id=
"@+id/
media_view_container
"
android:id=
"@+id/
ad_media
"
android:layout_width=
"80dp"
android:layout_width=
"80dp"
android:layout_height=
"60dp"
android:layout_height=
"60dp"
android:layout_gravity=
"center"
/>
android:layout_gravity=
"center"
/>
...
...
app/src/main/res/layout/layout_max_native_small_f8f8f8.xml
View file @
02c3c8a5
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
android:layout_gravity=
"center_vertical"
>
android:layout_gravity=
"center_vertical"
>
<FrameLayout
<FrameLayout
android:id=
"@+id/
media_view_container
"
android:id=
"@+id/
ad_media
"
android:layout_width=
"80dp"
android:layout_width=
"80dp"
android:layout_height=
"60dp"
android:layout_height=
"60dp"
android:layout_gravity=
"center"
/>
android:layout_gravity=
"center"
/>
...
...
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