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
315d21e4
Commit
315d21e4
authored
Dec 09, 2020
by
xw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[提交人]:王雪伟
[提交简述] :多多菜园1.0.8 [实现方案] :log
parent
1c075b9e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
36 deletions
+36
-36
MainDialog.kt
app/src/main/java/com/ym/game/view/MainDialog.kt
+8
-8
dialog_seed_not_enough.xml
app/src/main/res/layout/dialog_seed_not_enough.xml
+1
-1
AdUtils.kt
library/src/main/java/com/ym/library/utils/AdUtils.kt
+27
-27
No files found.
app/src/main/java/com/ym/game/view/MainDialog.kt
View file @
315d21e4
...
@@ -701,7 +701,7 @@ object MainDialog {
...
@@ -701,7 +701,7 @@ object MainDialog {
0
,
0
,
Gravity
.
CENTER
Gravity
.
CENTER
)
)
val
layoutAd
=
mDialogView
?.
findViewById
<
FrameLayout
>(
R
.
id
.
layout_get_drop_ad
)
val
layoutAd
=
mDialogView
?.
findViewById
<
FrameLayout
>(
R
.
id
.
layout_get_drop_ad
_seed
)
AdUtils
.
showFeedAd
(
activity
,
"seed_not_enough_bigimage"
,
layoutAd
)
AdUtils
.
showFeedAd
(
activity
,
"seed_not_enough_bigimage"
,
layoutAd
)
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
id_tv_seed_price
)
?.
text
=
"$seedPrice"
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
id_tv_seed_price
)
?.
text
=
"$seedPrice"
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
id_tv_seed_video_num
)
?.
text
=
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
id_tv_seed_video_num
)
?.
text
=
...
@@ -761,12 +761,12 @@ object MainDialog {
...
@@ -761,12 +761,12 @@ object MainDialog {
fun
onDestroy
()
{
fun
onDestroy
()
{
if
(
adView
!=
null
)
{
//
if (adView != null) {
if
(
adView
is
NativeExpressADView
)
{
//
if (adView is NativeExpressADView) {
(
adView
as
NativeExpressADView
)
?.
destroy
()
//
(adView as NativeExpressADView)?.destroy()
}
else
if
(
adView
is
TTNativeExpressAd
)
{
//
} else if (adView is TTNativeExpressAd) {
(
adView
as
TTNativeExpressAd
)
?.
destroy
()
//
(adView as TTNativeExpressAd)?.destroy()
}
//
}
}
//
}
}
}
}
}
\ No newline at end of file
app/src/main/res/layout/dialog_seed_not_enough.xml
View file @
315d21e4
...
@@ -127,7 +127,7 @@
...
@@ -127,7 +127,7 @@
</RelativeLayout>
</RelativeLayout>
<FrameLayout
<FrameLayout
android:id=
"@+id/layout_get_drop_ad"
android:id=
"@+id/layout_get_drop_ad
_seed
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_5"
android:layout_marginLeft=
"@dimen/dp_5"
...
...
library/src/main/java/com/ym/library/utils/AdUtils.kt
View file @
315d21e4
...
@@ -23,7 +23,7 @@ object AdUtils {
...
@@ -23,7 +23,7 @@ object AdUtils {
var
handler
=
object
:
Handler
()
{
var
handler
=
object
:
Handler
()
{
override
fun
handleMessage
(
msg
:
Message
?)
{
override
fun
handleMessage
(
msg
:
Message
?)
{
super
.
handleMessage
(
msg
)
super
.
handleMessage
(
msg
)
when
(
msg
?.
what
)
{
when
(
msg
?.
what
)
{
0
->
{
0
->
{
if
(
activity
!=
null
)
{
if
(
activity
!=
null
)
{
AdManager
.
loadNextCacheRewardVideoAd
(
ADConfig
.
AD_REWARD_VIDIO
,
activity
!!
)
AdManager
.
loadNextCacheRewardVideoAd
(
ADConfig
.
AD_REWARD_VIDIO
,
activity
!!
)
...
@@ -53,17 +53,17 @@ object AdUtils {
...
@@ -53,17 +53,17 @@ object AdUtils {
override
fun
onAdShow
()
{
override
fun
onAdShow
()
{
Utils
.
showToast
(
activity
,
"看完视频可获得奖励"
)
Utils
.
showToast
(
activity
,
"看完视频可获得奖励"
)
// AdManager.loadNextCacheRewardVideoAd(ADConfig.AD_VIDEO, activity!!)
// AdManager.loadNextCacheRewardVideoAd(ADConfig.AD_VIDEO, activity!!)
handler
?.
sendEmptyMessageDelayed
(
0
,
2000
)
handler
?.
sendEmptyMessageDelayed
(
0
,
2000
)
}
}
override
fun
onAdVideoBarClick
()
{
override
fun
onAdVideoBarClick
()
{
Log
.
d
(
TAG
,
"onAdVideoBarClick:"
)
Log
.
d
(
TAG
,
"onAdVideoBarClick:"
)
}
}
override
fun
onError
(
errorMsg
:
String
?)
{
override
fun
onError
(
errorMsg
:
String
?)
{
listener
?.
onError
(
errorMsg
)
listener
?.
onError
(
errorMsg
)
Log
.
d
(
TAG
,
"onError:"
+
errorMsg
)
Log
.
d
(
TAG
,
"onError:"
+
errorMsg
)
}
}
})
})
...
@@ -72,26 +72,25 @@ object AdUtils {
...
@@ -72,26 +72,25 @@ object AdUtils {
fun
showFeedAd
(
activity
:
Activity
,
actionName
:
String
,
view
:
FrameLayout
)
{
fun
showFeedAd
(
activity
:
Activity
,
actionName
:
String
,
view
:
FrameLayout
)
{
try
{
try
{
view
.
postDelayed
(
object
:
Runnable
{
override
fun
run
()
{
if
(
activity
?.
isFinishing
)
{
if
(
activity
?.
isFinishing
){
return
return
}
}
activity
?.
runOnUiThread
()
{
activity
?.
runOnUiThread
()
{
Log
.
d
(
TAG
,
"loadFeedCacheAdToCache展示广告"
)
AdManager
.
showFeedAd
(
AdManager
.
showFeedAd
(
ADConfig
.
AD_IMG_FADE
,
ADConfig
.
AD_IMG_FADE
,
actionName
,
actionName
,
ZXADSizeConfig
(
ZXADSizeConfig
(
// Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 40, 280
Utils
.
px2dip
(
PhoneUtils
.
getScreenWidth
(
activity
).
toFloat
())
-
40
,
280
Utils
.
px2dip
(
PhoneUtils
.
getScreenWidth
(
activity
).
toFloat
())
-
40
,
// Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 40,
((
Utils
.
px2dip
(
activity
.
windowManager
?.
defaultDisplay
?.
width
!!
.
toFloat
())
-
40
)
*
0.66
).
toInt
()
// ((Utils.px2dip(activity.windowManager?.defaultDisplay?.width!!.toFloat()) - 40) * 0.66).toInt()
),
),
activity
,
activity
,
view
view
)
)
}
}
}
},
500
)
}
catch
(
e
:
Exception
)
{
}
catch
(
e
:
Exception
)
{
}
}
}
}
...
@@ -103,11 +102,12 @@ object AdUtils {
...
@@ -103,11 +102,12 @@ object AdUtils {
//预加载信息流
//预加载信息流
fun
loadFeedCacheAdToCache
(
activity
:
Activity
)
{
fun
loadFeedCacheAdToCache
(
activity
:
Activity
)
{
Log
.
d
(
TAG
,
"loadFeedCacheAdToCache吓一跳广告"
)
AdManager
.
loadFeedAdToCache
(
AdManager
.
loadFeedAdToCache
(
ADConfig
.
AD_IMG_FADE
,
activity
,
ZXADSizeConfig
(
ADConfig
.
AD_IMG_FADE
,
activity
,
ZXADSizeConfig
(
//
Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 40, 280
Utils
.
px2dip
(
PhoneUtils
.
getScreenWidth
(
activity
).
toFloat
())
-
40
,
280
Utils
.
px2dip
(
PhoneUtils
.
getScreenWidth
(
activity
).
toFloat
())
-
40
,
//
Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 40,
((
Utils
.
px2dip
(
activity
.
windowManager
?.
defaultDisplay
?.
width
!!
.
toFloat
())
-
40
)
*
0.66
).
toInt
()
//
((Utils.px2dip(activity.windowManager?.defaultDisplay?.width!!.toFloat()) - 40) * 0.66).toInt()
)
)
)
)
}
}
...
...
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