Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
swiftcleanerphonehelper
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
swiftcleanerphonehelper
Commits
7aeb65d0
Commit
7aeb65d0
authored
Dec 20, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
02f16167
Pipeline
#1405
canceled with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
21 deletions
+43
-21
AppExitDialog.java
...va/com/swiftcleaner/chovey/view/dialog/AppExitDialog.java
+18
-5
CustomScoreDialog.java
...om/swiftcleaner/chovey/view/dialog/CustomScoreDialog.java
+4
-2
dialog_app_exit_item.xml
app/src/main/res/layout/dialog_app_exit_item.xml
+21
-14
No files found.
app/src/main/java/com/swiftcleaner/chovey/view/dialog/AppExitDialog.java
View file @
7aeb65d0
package
com
.
swiftcleaner
.
chovey
.
view
.
dialog
;
import
android.app.Activity
;
import
android.app.Dialog
;
import
android.content.Context
;
import
android.graphics.Color
;
...
...
@@ -9,18 +10,23 @@ import androidx.appcompat.widget.AppCompatButton;
import
androidx.cardview.widget.CardView
;
import
com.swiftcleaner.chovey.R
;
import
com.tool.zxdemo.utils.NativeView
;
import
com.zxdemo.admob.AdmobHelper
;
public
class
AppExitDialog
extends
Dialog
{
private
Context
context
;
private
Activity
activity
;
private
OnDialogClickListener
listener
;
public
interface
OnDialogClickListener
{
void
onCancel
();
void
onSubmit
();
}
public
AppExitDialog
(
Context
context
)
{
super
(
context
,
R
.
style
.
TransparentDialogTheme
);
this
.
context
=
context
;
public
AppExitDialog
(
Activity
activity
)
{
super
(
activity
,
R
.
style
.
TransparentDialogTheme
);
this
.
activity
=
activity
;
setContentView
(
R
.
layout
.
dialog_app_exit_item
);
AppCompatButton
dialog_exit
=
findViewById
(
R
.
id
.
dialog_exit
);
...
...
@@ -42,10 +48,17 @@ public class AppExitDialog extends Dialog {
}
dismiss
();
});
iv_dialog_close
.
setOnClickListener
(
v
->
{
iv_dialog_close
.
setOnClickListener
(
v
->
{
dismiss
();
});
setCanceledOnTouchOutside
(
false
);
NativeView
nativeView
=
findViewById
(
R
.
id
.
fl_ad
);
AdmobHelper
.
INSTANCE
.
showNativeAd
(
activity
,
(
nativeAd
)
->
{
nativeView
.
removeAllViews
();
nativeView
.
setNativeAd
(
nativeAd
,
R
.
layout
.
layout_ad_native
);
return
null
;
},
null
,
null
);
}
public
void
show
()
{
...
...
app/src/main/java/com/swiftcleaner/chovey/view/dialog/CustomScoreDialog.java
View file @
7aeb65d0
...
...
@@ -23,6 +23,8 @@ public class CustomScoreDialog extends Dialog {
void
onSubmit
();
}
private
NativeView
nativeView
;
public
CustomScoreDialog
(
Activity
activity
)
{
super
(
activity
,
R
.
style
.
TransparentDialogTheme
);
this
.
activity
=
activity
;
...
...
@@ -32,15 +34,14 @@ public class CustomScoreDialog extends Dialog {
AppCompatButton
dialog_ok
=
findViewById
(
R
.
id
.
dialog_ok
);
CardView
cardView
=
findViewById
(
R
.
id
.
cardview
);
cardView
.
setCardBackgroundColor
(
Color
.
TRANSPARENT
);
NativeView
nativeView
=
findViewById
(
R
.
id
.
fl_ad
);
NativeView
nativeView
=
findViewById
(
R
.
id
.
fl_ad
);
AdmobHelper
.
INSTANCE
.
showNativeAd
(
activity
,
(
nativeAd
)
->
{
nativeView
.
removeAllViews
();
nativeView
.
setNativeAd
(
nativeAd
,
R
.
layout
.
layout_ad_native
);
return
null
;
},
null
,
null
);
dialog_cancel
.
setOnClickListener
(
v
->
{
if
(
listener
!=
null
)
{
listener
.
onCancel
();
...
...
@@ -60,6 +61,7 @@ public class CustomScoreDialog extends Dialog {
public
void
show
()
{
super
.
show
();
}
public
void
setOnDialogClickListener
(
OnDialogClickListener
listener
)
{
...
...
app/src/main/res/layout/dialog_app_exit_item.xml
View file @
7aeb65d0
...
...
@@ -24,20 +24,21 @@
android:id=
"@+id/iv_dialog_close"
android:layout_width=
"23dp"
android:layout_height=
"23dp"
android:src=
"@mipmap/guanbi"
android:scaleType=
"centerCrop"
android:layout_gravity=
"end"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_marginTop=
"16dp"
/>
android:scaleType=
"centerCrop"
android:src=
"@mipmap/guanbi"
/>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginHorizontal=
"38dp"
android:layout_marginTop=
"17dp"
android:ellipsize=
"end"
android:gravity=
"center"
android:layout_marginHorizontal=
"38dp"
android:maxLines=
"2"
android:ellipsize=
"end"
android:text=
"Do you want to quit without trying garbage cleaning?"
android:textColor=
"#000000"
android:textSize=
"16sp"
...
...
@@ -46,13 +47,13 @@
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"Clean up the garbage now!"
android:textSize=
"14sp"
android:layout_marginTop=
"16dp"
android:ellipsize=
"end"
android:gravity=
"center"
android:maxLines=
"1"
android:ellipsize=
"end"
android:textColor=
"#000000"
/>
android:text=
"Clean up the garbage now!"
android:textColor=
"#000000"
android:textSize=
"14sp"
/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
...
...
@@ -91,13 +92,19 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<ImageView
<com.tool.zxdemo.utils.NativeView
android:id=
"@+id/fl_ad"
android:layout_width=
"match_parent"
android:layout_height=
"150dp"
android:src=
"@mipmap/qidongyelogo"
android:scaleType=
"centerCrop"
android:layout_marginTop=
"28dp"
android:layout_marginHorizontal=
"10dp"
/>
android:layout_marginHorizontal=
"10dp"
android:layout_marginTop=
"28dp"
>
<ImageView
android:scaleType=
"centerCrop"
android:src=
"@mipmap/qidongyelogo"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
</com.tool.zxdemo.utils.NativeView>
</LinearLayout>
...
...
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