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 {
val
mDialog
=
Dialog
(
context
,
R
.
style
.
UpdateVersionCompatDialogTheme
)
val
mDialogView
=
showBottomDialog
(
R
.
layout
.
dialog_get_
water_drop
,
R
.
layout
.
dialog_get_
diamand
,
context
,
mDialog
,
0
,
...
...
@@ -224,7 +224,7 @@ object MainDialog {
val
mDialog
=
Dialog
(
context
,
R
.
style
.
UpdateVersionCompatDialogTheme
)
val
mDialogView
=
showBottomDialog
(
R
.
layout
.
dialog_get_
water_drop
,
R
.
layout
.
dialog_get_
diamand
,
context
,
mDialog
,
0
,
...
...
library/src/main/java/com/ym/library/utils/CenterDialog.kt
View file @
959d91d5
...
...
@@ -8,11 +8,10 @@ import android.content.DialogInterface
import
android.os.Build
import
android.os.CountDownTimer
import
android.text.TextUtils
import
android.util.Log
import
android.view.Gravity
import
android.view.View
import
android.view.animation.AnimationUtils
import
android.webkit.WebView
import
android.widget.FrameLayout
import
android.widget.ImageView
import
android.widget.TextView
import
androidx.annotation.RequiresApi
...
...
@@ -337,13 +336,14 @@ object CenterDialog : BaseDialog() {
val
mDialog
=
Dialog
(
context
,
R
.
style
.
UpdateVersionCompatDialogTheme
)
val
mDialogView
=
showBottomDialog
(
R
.
layout
.
dialog_get_
water_drop
,
R
.
layout
.
dialog_get_
diamand
,
context
,
mDialog
,
0
,
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
)
tvGetDropCount
.
text
=
"+${rewardCount}"
...
...
@@ -390,10 +390,12 @@ object CenterDialog : BaseDialog() {
var
coinsDialog
:
Dialog
?
=
null
@RequiresApi
(
Build
.
VERSION_CODES
.
JELLY_BEAN_MR1
)
fun
showNewCoinsDialog
(
context
:
Activity
,
rewardCoins
:
Int
):
Dialog
?
{
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
)
coinsDialog
?.
window
?.
setDimAmount
(
0f
)
...
...
@@ -415,6 +417,7 @@ object CenterDialog : BaseDialog() {
return
coinsDialog
}
fun
showDialogReadCoins
(
activity
:
Activity
?,
coins
:
Int
,
...
...
@@ -458,6 +461,7 @@ object CenterDialog : BaseDialog() {
mDialog
?.
setCancelable
(
false
)
mDialog
?.
show
()
}
/**
* 退出弹窗
*/
...
...
@@ -467,7 +471,8 @@ object CenterDialog : BaseDialog() {
}
Constant
.
isDialogActivity
=
1
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
btn
=
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
dialog_scratch_dialog_bg
)
val
cancelBtn
=
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
dialog_scratch_dialog_cancel
)
...
...
@@ -510,7 +515,12 @@ object CenterDialog : BaseDialog() {
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
)
{
return
}
...
...
@@ -522,7 +532,8 @@ object CenterDialog : BaseDialog() {
0
,
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
{
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 @@
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/iv_get_
drop_
bg"
android:id=
"@+id/iv_get_bg"
android:layout_width=
"80dp"
android:layout_height=
"80dp"
android:layout_gravity=
"center"
...
...
@@ -85,12 +85,11 @@
android:src=
"@drawable/icon_top_bg"
/>
<TextView
android:id=
"@+id/id_tv_get"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"40dp"
android:text=
"恭喜获得
金币
"
android:text=
"恭喜获得
钻石
"
android:textColor=
"@color/white"
android:textSize=
"24sp"
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