Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
L
LuckyFarm
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
王雪伟
LuckyFarm
Commits
959d91d5
Commit
959d91d5
authored
Oct 20, 2020
by
maxiaoliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改弹窗显示
parent
31512e8c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
13 deletions
+23
-13
MainDialog.kt
app/src/main/java/com/ym/game/view/MainDialog.kt
+2
-2
CenterDialog.kt
library/src/main/java/com/ym/library/utils/CenterDialog.kt
+19
-8
dialog_get_diamand.xml
library/src/main/res/layout/dialog_get_diamand.xml
+2
-3
No files found.
app/src/main/java/com/ym/game/view/MainDialog.kt
View file @
959d91d5
...
@@ -69,7 +69,7 @@ object MainDialog {
...
@@ -69,7 +69,7 @@ object MainDialog {
val
mDialog
=
Dialog
(
context
,
R
.
style
.
UpdateVersionCompatDialogTheme
)
val
mDialog
=
Dialog
(
context
,
R
.
style
.
UpdateVersionCompatDialogTheme
)
val
mDialogView
=
val
mDialogView
=
showBottomDialog
(
showBottomDialog
(
R
.
layout
.
dialog_get_
water_drop
,
R
.
layout
.
dialog_get_
diamand
,
context
,
context
,
mDialog
,
mDialog
,
0
,
0
,
...
@@ -224,7 +224,7 @@ object MainDialog {
...
@@ -224,7 +224,7 @@ object MainDialog {
val
mDialog
=
Dialog
(
context
,
R
.
style
.
UpdateVersionCompatDialogTheme
)
val
mDialog
=
Dialog
(
context
,
R
.
style
.
UpdateVersionCompatDialogTheme
)
val
mDialogView
=
val
mDialogView
=
showBottomDialog
(
showBottomDialog
(
R
.
layout
.
dialog_get_
water_drop
,
R
.
layout
.
dialog_get_
diamand
,
context
,
context
,
mDialog
,
mDialog
,
0
,
0
,
...
...
library/src/main/java/com/ym/library/utils/CenterDialog.kt
View file @
959d91d5
...
@@ -8,11 +8,10 @@ import android.content.DialogInterface
...
@@ -8,11 +8,10 @@ import android.content.DialogInterface
import
android.os.Build
import
android.os.Build
import
android.os.CountDownTimer
import
android.os.CountDownTimer
import
android.text.TextUtils
import
android.text.TextUtils
import
android.util.Log
import
android.view.Gravity
import
android.view.Gravity
import
android.view.View
import
android.view.View
import
android.view.animation.AnimationUtils
import
android.webkit.WebView
import
android.webkit.WebView
import
android.widget.FrameLayout
import
android.widget.ImageView
import
android.widget.ImageView
import
android.widget.TextView
import
android.widget.TextView
import
androidx.annotation.RequiresApi
import
androidx.annotation.RequiresApi
...
@@ -337,13 +336,14 @@ object CenterDialog : BaseDialog() {
...
@@ -337,13 +336,14 @@ object CenterDialog : BaseDialog() {
val
mDialog
=
Dialog
(
context
,
R
.
style
.
UpdateVersionCompatDialogTheme
)
val
mDialog
=
Dialog
(
context
,
R
.
style
.
UpdateVersionCompatDialogTheme
)
val
mDialogView
=
val
mDialogView
=
showBottomDialog
(
showBottomDialog
(
R
.
layout
.
dialog_get_
water_drop
,
R
.
layout
.
dialog_get_
diamand
,
context
,
context
,
mDialog
,
mDialog
,
0
,
0
,
Gravity
.
CENTER
Gravity
.
CENTER
)
)
val
imgbg
=
mDialogView
?.
findViewById
<
ImageView
>(
R
.
id
.
iv_get_bg
)
Log
.
e
(
"MM"
,
"t"
+
type
)
val
tvGetDropCount
=
mDialogView
?.
findViewById
<
TextView
>(
R
.
id
.
tv_get_drop_count
)
val
tvGetDropCount
=
mDialogView
?.
findViewById
<
TextView
>(
R
.
id
.
tv_get_drop_count
)
tvGetDropCount
.
text
=
"+${rewardCount}"
tvGetDropCount
.
text
=
"+${rewardCount}"
...
@@ -390,10 +390,12 @@ object CenterDialog : BaseDialog() {
...
@@ -390,10 +390,12 @@ object CenterDialog : BaseDialog() {
var
coinsDialog
:
Dialog
?
=
null
var
coinsDialog
:
Dialog
?
=
null
@RequiresApi
(
Build
.
VERSION_CODES
.
JELLY_BEAN_MR1
)
@RequiresApi
(
Build
.
VERSION_CODES
.
JELLY_BEAN_MR1
)
fun
showNewCoinsDialog
(
context
:
Activity
,
rewardCoins
:
Int
):
Dialog
?
{
fun
showNewCoinsDialog
(
context
:
Activity
,
rewardCoins
:
Int
):
Dialog
?
{
coinsDialog
=
Dialog
(
context
,
R
.
style
.
CenterCompatDialogTheme
)
coinsDialog
=
Dialog
(
context
,
R
.
style
.
CenterCompatDialogTheme
)
val
mDialogView
:
View
?
=
showBottomDialog
(
R
.
layout
.
dialog_coins
,
context
,
coinsDialog
!!
,
0
,
Gravity
.
CENTER
)
val
mDialogView
:
View
?
=
showBottomDialog
(
R
.
layout
.
dialog_coins
,
context
,
coinsDialog
!!
,
0
,
Gravity
.
CENTER
)
val
mCoinsText
:
TextView
=
mDialogView
!!
.
findViewById
(
R
.
id
.
id_dialog_coins_num
)
val
mCoinsText
:
TextView
=
mDialogView
!!
.
findViewById
(
R
.
id
.
id_dialog_coins_num
)
coinsDialog
?.
window
?.
setDimAmount
(
0f
)
coinsDialog
?.
window
?.
setDimAmount
(
0f
)
...
@@ -415,6 +417,7 @@ object CenterDialog : BaseDialog() {
...
@@ -415,6 +417,7 @@ object CenterDialog : BaseDialog() {
return
coinsDialog
return
coinsDialog
}
}
fun
showDialogReadCoins
(
fun
showDialogReadCoins
(
activity
:
Activity
?,
activity
:
Activity
?,
coins
:
Int
,
coins
:
Int
,
...
@@ -458,6 +461,7 @@ object CenterDialog : BaseDialog() {
...
@@ -458,6 +461,7 @@ object CenterDialog : BaseDialog() {
mDialog
?.
setCancelable
(
false
)
mDialog
?.
setCancelable
(
false
)
mDialog
?.
show
()
mDialog
?.
show
()
}
}
/**
/**
* 退出弹窗
* 退出弹窗
*/
*/
...
@@ -467,7 +471,8 @@ object CenterDialog : BaseDialog() {
...
@@ -467,7 +471,8 @@ object CenterDialog : BaseDialog() {
}
}
Constant
.
isDialogActivity
=
1
Constant
.
isDialogActivity
=
1
val
mDialog
=
Dialog
(
activity
,
R
.
style
.
UpdateVersionCompatDialogTheme
)
val
mDialog
=
Dialog
(
activity
,
R
.
style
.
UpdateVersionCompatDialogTheme
)
val
mDialogView
=
showBottomDialog
(
R
.
layout
.
dialog_sign_out_layout
,
activity
,
mDialog
,
0
,
Gravity
.
CENTER
)
val
mDialogView
=
showBottomDialog
(
R
.
layout
.
dialog_sign_out_layout
,
activity
,
mDialog
,
0
,
Gravity
.
CENTER
)
val
closeImg
=
mDialogView
.
findViewById
<
ImageView
>(
R
.
id
.
dialog_scratch_dialog_close_img
)
val
closeImg
=
mDialogView
.
findViewById
<
ImageView
>(
R
.
id
.
dialog_scratch_dialog_close_img
)
val
btn
=
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
dialog_scratch_dialog_bg
)
val
btn
=
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
dialog_scratch_dialog_bg
)
val
cancelBtn
=
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
dialog_scratch_dialog_cancel
)
val
cancelBtn
=
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
dialog_scratch_dialog_cancel
)
...
@@ -510,7 +515,12 @@ object CenterDialog : BaseDialog() {
...
@@ -510,7 +515,12 @@ object CenterDialog : BaseDialog() {
countDownTimer
?.
start
()
countDownTimer
?.
start
()
}
}
fun
showPermission
(
activity
:
Activity
,
title
:
String
,
quitListener
:
View
.
OnClickListener
,
settingListener
:
View
.
OnClickListener
)
{
fun
showPermission
(
activity
:
Activity
,
title
:
String
,
quitListener
:
View
.
OnClickListener
,
settingListener
:
View
.
OnClickListener
)
{
if
(
activity
==
null
)
{
if
(
activity
==
null
)
{
return
return
}
}
...
@@ -522,7 +532,8 @@ object CenterDialog : BaseDialog() {
...
@@ -522,7 +532,8 @@ object CenterDialog : BaseDialog() {
0
,
0
,
Gravity
.
CENTER
Gravity
.
CENTER
)
)
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
tv_info
).
text
=
"全民猜歌万缺少必要权限:\n\n${title}\n请点击\"设置\"-\"权限\"-打开所需权限。\n最后点击两次后退按钮,即可返回。"
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
tv_info
).
text
=
"全民猜歌万缺少必要权限:\n\n${title}\n请点击\"设置\"-\"权限\"-打开所需权限。\n最后点击两次后退按钮,即可返回。"
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
btn_permission_quit
).
setOnClickListener
{
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
btn_permission_quit
).
setOnClickListener
{
quitListener
.
onClick
(
it
)
quitListener
.
onClick
(
it
)
...
...
library/src/main/res/layout/dialog_get_
water_drop
.xml
→
library/src/main/res/layout/dialog_get_
diamand
.xml
View file @
959d91d5
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<ImageView
<ImageView
android:id=
"@+id/iv_get_
drop_
bg"
android:id=
"@+id/iv_get_bg"
android:layout_width=
"80dp"
android:layout_width=
"80dp"
android:layout_height=
"80dp"
android:layout_height=
"80dp"
android:layout_gravity=
"center"
android:layout_gravity=
"center"
...
@@ -85,12 +85,11 @@
...
@@ -85,12 +85,11 @@
android:src=
"@drawable/icon_top_bg"
/>
android:src=
"@drawable/icon_top_bg"
/>
<TextView
<TextView
android:id=
"@+id/id_tv_get"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"40dp"
android:layout_marginTop=
"40dp"
android:text=
"恭喜获得
金币
"
android:text=
"恭喜获得
钻石
"
android:textColor=
"@color/white"
android:textColor=
"@color/white"
android:textSize=
"24sp"
android:textSize=
"24sp"
android:textStyle=
"bold"
/>
android:textStyle=
"bold"
/>
...
...
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