Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
A
appzxhy
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
appzxhy
Commits
3fe5963d
Commit
3fe5963d
authored
Jun 06, 2025
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[新增]首页app退出弹窗
parent
f933117c
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
215 additions
and
1 deletion
+215
-1
MyApplication.kt
app/src/main/java/com/base/appzxhy/MyApplication.kt
+2
-0
PopupConfigBean.kt
...main/java/com/base/appzxhy/bean/config/PopupConfigBean.kt
+1
-1
AppExitDialog.kt
...src/main/java/com/base/appzxhy/ui/dialog/AppExitDialog.kt
+58
-0
MainActivity.kt
app/src/main/java/com/base/appzxhy/ui/main/MainActivity.kt
+12
-0
SettingsFragment.kt
...src/main/java/com/base/appzxhy/ui/set/SettingsFragment.kt
+9
-0
icon_close_pop.png
app/src/main/res/drawable-xxhdpi/icon_close_pop.png
+0
-0
img_bj_pop.png
app/src/main/res/drawable-xxhdpi/img_bj_pop.png
+0
-0
dialog_app_exit.xml
app/src/main/res/layout/dialog_app_exit.xml
+127
-0
dimens.xml
app/src/main/res/values/dimens.xml
+2
-0
strings.xml
app/src/main/res/values/strings.xml
+4
-0
No files found.
app/src/main/java/com/base/appzxhy/MyApplication.kt
View file @
3fe5963d
...
...
@@ -278,4 +278,6 @@ class MyApplication : Application() {
}
}
\ No newline at end of file
app/src/main/java/com/base/appzxhy/bean/config/PopupConfigBean.kt
View file @
3fe5963d
...
...
@@ -2,7 +2,7 @@ package com.base.appzxhy.bean.config
class
PopupConfigBean
(
var
popupForegroundCanPush
:
Boolean
=
tru
e
,
//前台是否可以推送
var
popupForegroundCanPush
:
Boolean
=
fals
e
,
//前台是否可以推送
var
popupStatus
:
Boolean
=
true
,
//推送总开关
var
popupCount
:
Int
=
500
,
//推送总次数
var
isDifferNotificationId
:
Boolean
=
true
,
//推送使用不同的通知ID
...
...
app/src/main/java/com/base/appzxhy/ui/dialog/AppExitDialog.kt
0 → 100644
View file @
3fe5963d
package
com.base.appzxhy.ui.dialog
import
android.animation.ValueAnimator
import
android.app.Activity
import
android.view.LayoutInflater
import
android.view.animation.LinearInterpolator
import
androidx.appcompat.app.AlertDialog
import
androidx.constraintlayout.widget.ConstraintLayout
import
com.base.appzxhy.R
import
com.base.appzxhy.business.ads.AdsMgr
import
com.base.appzxhy.databinding.DialogAppExitBinding
class
AppExitDialog
(
val
activity
:
Activity
)
{
val
dialog
=
AlertDialog
.
Builder
(
activity
).
create
()
val
binding
=
DialogAppExitBinding
.
inflate
(
LayoutInflater
.
from
(
activity
))
var
action
:
(()
->
Unit
)?
=
null
fun
showDialog
()
{
dialog
.
setView
(
binding
.
root
)
dialog
.
setCancelable
(
false
)
dialog
.
setCanceledOnTouchOutside
(
true
)
dialog
.
show
()
val
params
=
dialog
.
window
?.
attributes
// params?.width = ConstraintLayout.LayoutParams.MATCH_PARENT
params
?.
width
=
activity
.
resources
.
getDimensionPixelSize
(
R
.
dimen
.
dp_295
)
params
?.
height
=
ConstraintLayout
.
LayoutParams
.
WRAP_CONTENT
// params?.gravity = Gravity.BOTTOM
dialog
.
window
?.
attributes
=
params
dialog
.
window
?.
setBackgroundDrawableResource
(
android
.
R
.
color
.
transparent
)
val
exit
=
activity
.
getString
(
R
.
string
.
exit
)
ValueAnimator
.
ofInt
(
0
,
3
).
apply
{
duration
=
3000
interpolator
=
LinearInterpolator
()
addUpdateListener
{
animation
->
val
value
=
animation
.
animatedValue
as
Int
binding
.
tvExit
.
text
=
if
(
value
<
3
)
"$exit (${3 - value})"
else
exit
binding
.
tvExit
.
isEnabled
=
value
==
3
}
}.
start
()
AdsMgr
.
showNative
(
binding
.
flAd
,
R
.
layout
.
layout_admob_native_custom
)
binding
.
ivCancel
.
setOnClickListener
{
dialog
.
dismiss
()
}
binding
.
tvExit
.
setOnClickListener
{
activity
.
finish
()
}
binding
.
tvCleanNow
.
setOnClickListener
{
dialog
.
dismiss
()
action
?.
invoke
()
}
}
}
\ No newline at end of file
app/src/main/java/com/base/appzxhy/ui/main/MainActivity.kt
View file @
3fe5963d
...
...
@@ -13,11 +13,14 @@ import androidx.viewpager2.widget.ViewPager2
import
com.base.appzxhy.R
import
com.base.appzxhy.SpConstObject.mainPageCount
import
com.base.appzxhy.base.BaseActivity
import
com.base.appzxhy.bean.FeatureBean.Companion.JUNK_CLEAN
import
com.base.appzxhy.bean.HomeTabUIBean
import
com.base.appzxhy.business.ads.AdsMgr
import
com.base.appzxhy.databinding.ActivityMainBinding
import
com.base.appzxhy.databinding.ItemHomeTabBinding
import
com.base.appzxhy.ui.dialog.AppExitDialog
import
com.base.appzxhy.ui.dialog.StoragePermissionDialog
import
com.base.appzxhy.ui.dialog.permissionStorageJump
import
com.base.appzxhy.ui.recyclebin.RecycleBinFragment
import
com.base.appzxhy.utils.PermissionUtils.requestStoragePermission
import
com.google.android.material.tabs.TabLayout
...
...
@@ -143,4 +146,13 @@ class MainActivity : BaseActivity<ActivityMainBinding>(ActivityMainBinding::infl
viewModel
.
refreshRecycleBin
()
}
override
fun
handleBackCallBack
()
{
val
dialog
=
AppExitDialog
(
this
)
dialog
.
action
=
{
permissionStorageJump
(
JUNK_CLEAN
)
}
dialog
.
showDialog
()
}
}
\ No newline at end of file
app/src/main/java/com/base/appzxhy/ui/set/SettingsFragment.kt
View file @
3fe5963d
...
...
@@ -14,11 +14,13 @@ import androidx.core.net.toUri
import
androidx.core.view.updatePadding
import
com.base.appzxhy.R
import
com.base.appzxhy.SpConstObject.fcmToken
import
com.base.appzxhy.bean.config.ConfigBean
import
com.base.appzxhy.business.ads.AdsMgr
import
com.base.appzxhy.ui.dialog.RateDialog
import
com.base.appzxhy.utils.ClipboardUtils.copyText
import
com.base.appzxhy.utils.MyAnimationUtils
import
com.base.appzxhy.utils.ToastUtils.toast
import
com.google.gson.Gson
class
SettingsFragment
:
BaseFragment
<
FragmentSettingsBinding
>(
FragmentSettingsBinding
::
inflate
)
{
...
...
@@ -48,6 +50,13 @@ class SettingsFragment : BaseFragment<FragmentSettingsBinding>(FragmentSettingsB
requireContext
().
copyText
(
"token"
,
fcmToken
)
requireContext
().
toast
(
"copy token"
)
}
binding
.
tvSettings
.
setOnClickListener
{
val
configBean
=
ConfigBean
()
val
json
=
Gson
().
toJson
(
configBean
)
requireContext
().
copyText
(
"json"
,
json
)
requireContext
().
toast
(
"copy json"
)
}
}
}
...
...
app/src/main/res/drawable-xxhdpi/icon_close_pop.png
0 → 100644
View file @
3fe5963d
11.1 KB
app/src/main/res/drawable-xxhdpi/img_bj_pop.png
0 → 100644
View file @
3fe5963d
796 KB
app/src/main/res/layout/dialog_app_exit.xml
0 → 100644
View file @
3fe5963d
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"@dimen/dp_330"
android:layout_height=
"wrap_content"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/cl_top"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/img_bj_pop"
android:paddingBottom=
"32dp"
app:layout_constraintTop_toTopOf=
"parent"
>
<androidx.appcompat.widget.AppCompatImageView
android:id=
"@+id/iv_logo"
android:layout_width=
"64dp"
android:layout_height=
"64dp"
android:layout_marginTop=
"30dp"
android:src=
"@mipmap/logo"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<androidx.appcompat.widget.AppCompatImageView
android:id=
"@+id/iv_cancel"
android:layout_width=
"@dimen/dp_30"
android:layout_height=
"@dimen/dp_30"
android:layout_marginTop=
"20dp"
android:layout_marginEnd=
"20dp"
android:src=
"@drawable/icon_close_pop"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_title"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"16dp"
android:layout_marginTop=
"12dp"
android:text=
"@string/please_wait_a_moment"
android:textAlignment=
"center"
android:textColor=
"@color/color_1a1a1a"
android:textSize=
"22sp"
android:textStyle=
"bold"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/iv_logo"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_content"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"16dp"
android:layout_marginTop=
"6dp"
android:text=
"@string/logout_content"
android:textAlignment=
"center"
android:textColor=
"@color/color_666666"
android:textSize=
"18sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tv_title"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_exit"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"4dp"
android:background=
"@drawable/bg_enable_no_50"
android:paddingVertical=
"10dp"
android:text=
"@string/exit"
android:textAlignment=
"center"
android:textColor=
"@color/white"
android:textSize=
"18sp"
android:textStyle=
"bold"
app:layout_constraintEnd_toStartOf=
"@id/tvCleanNow"
app:layout_constraintHorizontal_weight=
"1"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tv_content"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tvCleanNow"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"4dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:background=
"@drawable/bg_btn_50"
android:paddingVertical=
"10dp"
android:text=
"@string/clean_now"
android:textAlignment=
"center"
android:textColor=
"@color/white"
android:textSize=
"18sp"
android:textStyle=
"bold"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_weight=
"1.3"
app:layout_constraintStart_toEndOf=
"@id/tv_exit"
app:layout_constraintTop_toBottomOf=
"@id/tv_content"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginVertical=
"8dp"
android:background=
"@drawable/white_background_24"
android:padding=
"10dp"
app:layout_constraintTop_toBottomOf=
"@id/cl_top"
>
<com.base.appzxhy.business.ads.NativeParentView
android:id=
"@+id/flAd"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<androidx.appcompat.widget.AppCompatImageView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:src=
"@drawable/zhanwei1"
/>
</com.base.appzxhy.business.ads.NativeParentView>
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/values/dimens.xml
View file @
3fe5963d
...
...
@@ -38,4 +38,6 @@
<dimen
name=
"dp_6"
>
6dp
</dimen>
<dimen
name=
"dp_345"
>
345dp
</dimen>
<dimen
name=
"sp_15"
>
15sp
</dimen>
<dimen
name=
"dp_280"
>
280dp
</dimen>
<dimen
name=
"dp_295"
>
295dp
</dimen>
</resources>
\ No newline at end of file
app/src/main/res/values/strings.xml
View file @
3fe5963d
...
...
@@ -143,4 +143,8 @@ Please rest assured that we will handle your information in strict accordance wi
<string
name=
"exit_screenshot_cleaner_content"
>
Exit Screenshot Clean? Undeleted screenshots might be using space.
</string>
<string
name=
"exit_similar_photos"
>
Exit Similar Photos
</string>
<string
name=
"exit_similar_photos_content"
>
Exit Similar Photos? Unmoved similar photos might be occupying space.
</string>
<string
name=
"logout_content"
>
Are you sure you want to quit without trying to clean up the garbage again?
</string>
<string
name=
"please_wait_a_moment"
>
Please wait a moment
</string>
<string
name=
"exit"
>
Exit
</string>
</resources>
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