Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_goodmoney
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_goodmoney
Commits
60f5e048
Commit
60f5e048
authored
Jan 06, 2021
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
a0b51d39
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
61 deletions
+67
-61
VedioAdingManager.java
.../java/com/mints/goodmoney/ad/vedio/VedioAdingManager.java
+17
-17
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+7
-1
item_rv_kyl_page.xml
GoodMoney/app/src/main/res/layout/item_rv_kyl_page.xml
+8
-19
item_rv_xmly_page.xml
GoodMoney/app/src/main/res/layout/item_rv_xmly_page.xml
+35
-24
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/vedio/VedioAdingManager.java
View file @
60f5e048
...
@@ -95,8 +95,6 @@ public class VedioAdingManager {
...
@@ -95,8 +95,6 @@ public class VedioAdingManager {
// 权重自有逻辑
// 权重自有逻辑
loadAdVedio
(
getVedioAdType
(),
bean
);
loadAdVedio
(
getVedioAdType
(),
bean
);
}
}
isHighWeight
=
false
;
}
}
/**
/**
...
@@ -159,10 +157,12 @@ public class VedioAdingManager {
...
@@ -159,10 +157,12 @@ public class VedioAdingManager {
// 根据权重获取广告类型
// 根据权重获取广告类型
String
adType
;
String
adType
;
if
(
isHighWeight
)
{
if
(
isHighWeight
)
{
setVedioAdingListener
(
null
);
adType
=
getHighWeight
();
adType
=
getHighWeight
();
}
else
{
}
else
{
adType
=
getRandomWeight
();
adType
=
getRandomWeight
();
}
}
isHighWeight
=
false
;
LogUtil
.
d
(
TAG
,
"权重结果返回的广告类型:"
+
adType
);
LogUtil
.
d
(
TAG
,
"权重结果返回的广告类型:"
+
adType
);
return
adType
;
return
adType
;
...
@@ -348,7 +348,7 @@ public class VedioAdingManager {
...
@@ -348,7 +348,7 @@ public class VedioAdingManager {
// 优量汇
// 优量汇
if
(
ylhVedioAdManager
==
null
)
{
if
(
ylhVedioAdManager
==
null
)
{
if
(
activity
==
null
)
{
if
(
activity
==
null
)
{
if
(
vedioAdingListener
!=
null
&&
!
isHighWeight
)
{
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerError
(
Constant
.
YLH_VEDIO_AD
);
vedioAdingListener
.
vedioAdingListenerError
(
Constant
.
YLH_VEDIO_AD
);
}
}
return
;
return
;
...
@@ -359,7 +359,7 @@ public class VedioAdingManager {
...
@@ -359,7 +359,7 @@ public class VedioAdingManager {
ylhVedioAdManager
.
setYlhVedioAdListener
(
new
YlhVedioAdManager
.
YlhVedioAdListener
()
{
ylhVedioAdManager
.
setYlhVedioAdListener
(
new
YlhVedioAdManager
.
YlhVedioAdListener
()
{
@Override
@Override
public
void
ylhVedioAdFail
()
{
public
void
ylhVedioAdFail
()
{
if
(
vedioAdingListener
!=
null
&&
!
isHighWeight
)
{
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerFail
(
Constant
.
YLH_VEDIO_AD
);
vedioAdingListener
.
vedioAdingListenerFail
(
Constant
.
YLH_VEDIO_AD
);
}
}
}
}
...
@@ -367,7 +367,7 @@ public class VedioAdingManager {
...
@@ -367,7 +367,7 @@ public class VedioAdingManager {
@Override
@Override
public
void
ylhVedioAdSuccess
()
{
public
void
ylhVedioAdSuccess
()
{
AppConfig
.
ylhAdCount
--;
AppConfig
.
ylhAdCount
--;
if
(
vedioAdingListener
!=
null
&&
!
isHighWeight
)
{
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerSuccess
(
Constant
.
YLH_VEDIO_AD
);
vedioAdingListener
.
vedioAdingListenerSuccess
(
Constant
.
YLH_VEDIO_AD
);
}
}
}
}
...
@@ -382,7 +382,7 @@ public class VedioAdingManager {
...
@@ -382,7 +382,7 @@ public class VedioAdingManager {
// 穿山甲激励视频
// 穿山甲激励视频
if
(
csjVedioAdManager
==
null
)
{
if
(
csjVedioAdManager
==
null
)
{
if
(
activity
==
null
)
{
if
(
activity
==
null
)
{
if
(
vedioAdingListener
!=
null
&&
!
isHighWeight
)
{
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerError
(
Constant
.
CSJ_VEDIO_AD
);
vedioAdingListener
.
vedioAdingListenerError
(
Constant
.
CSJ_VEDIO_AD
);
}
}
return
;
return
;
...
@@ -394,7 +394,7 @@ public class VedioAdingManager {
...
@@ -394,7 +394,7 @@ public class VedioAdingManager {
csjVedioAdManager
.
setCsjVedioAdListener
(
new
CsjVedioAdManager
.
CsjVedioAdListener
()
{
csjVedioAdManager
.
setCsjVedioAdListener
(
new
CsjVedioAdManager
.
CsjVedioAdListener
()
{
@Override
@Override
public
void
csjVedioAdFail
()
{
public
void
csjVedioAdFail
()
{
if
(
vedioAdingListener
!=
null
&&
!
isHighWeight
)
{
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerFail
(
Constant
.
CSJ_VEDIO_AD
);
vedioAdingListener
.
vedioAdingListenerFail
(
Constant
.
CSJ_VEDIO_AD
);
}
}
}
}
...
@@ -402,7 +402,7 @@ public class VedioAdingManager {
...
@@ -402,7 +402,7 @@ public class VedioAdingManager {
@Override
@Override
public
void
csjVedioAdSuccess
()
{
public
void
csjVedioAdSuccess
()
{
AppConfig
.
csjVedioAdCount
--;
AppConfig
.
csjVedioAdCount
--;
if
(
vedioAdingListener
!=
null
&&
!
isHighWeight
)
{
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerSuccess
(
Constant
.
CSJ_VEDIO_AD
);
vedioAdingListener
.
vedioAdingListenerSuccess
(
Constant
.
CSJ_VEDIO_AD
);
}
}
}
}
...
@@ -417,7 +417,7 @@ public class VedioAdingManager {
...
@@ -417,7 +417,7 @@ public class VedioAdingManager {
// 闪电盒子激励视频
// 闪电盒子激励视频
if
(
wnVedioAdManager
==
null
)
{
if
(
wnVedioAdManager
==
null
)
{
if
(
activity
==
null
)
{
if
(
activity
==
null
)
{
if
(
vedioAdingListener
!=
null
&&
!
isHighWeight
)
{
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerError
(
Constant
.
SDHZ_VEDIO_AD
);
vedioAdingListener
.
vedioAdingListenerError
(
Constant
.
SDHZ_VEDIO_AD
);
}
}
return
;
return
;
...
@@ -428,14 +428,14 @@ public class VedioAdingManager {
...
@@ -428,14 +428,14 @@ public class VedioAdingManager {
@Override
@Override
public
void
wnVedioAdSuccess
()
{
public
void
wnVedioAdSuccess
()
{
AppConfig
.
wnVedioAdCount
--;
AppConfig
.
wnVedioAdCount
--;
if
(
vedioAdingListener
!=
null
&&
!
isHighWeight
)
{
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerSuccess
(
Constant
.
SDHZ_VEDIO_AD
);
vedioAdingListener
.
vedioAdingListenerSuccess
(
Constant
.
SDHZ_VEDIO_AD
);
}
}
}
}
@Override
@Override
public
void
wnVedioAdFail
()
{
public
void
wnVedioAdFail
()
{
if
(
vedioAdingListener
!=
null
&&
!
isHighWeight
)
{
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerFail
(
Constant
.
SDHZ_VEDIO_AD
);
vedioAdingListener
.
vedioAdingListenerFail
(
Constant
.
SDHZ_VEDIO_AD
);
}
}
}
}
...
@@ -450,7 +450,7 @@ public class VedioAdingManager {
...
@@ -450,7 +450,7 @@ public class VedioAdingManager {
// 枫岚广告激励视频
// 枫岚广告激励视频
if
(
mhVedioAdManager
==
null
)
{
if
(
mhVedioAdManager
==
null
)
{
if
(
activity
==
null
)
{
if
(
activity
==
null
)
{
if
(
vedioAdingListener
!=
null
&&
!
isHighWeight
)
{
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerError
(
Constant
.
FL_VEDIO_AD
);
vedioAdingListener
.
vedioAdingListenerError
(
Constant
.
FL_VEDIO_AD
);
}
}
return
;
return
;
...
@@ -461,14 +461,14 @@ public class VedioAdingManager {
...
@@ -461,14 +461,14 @@ public class VedioAdingManager {
@Override
@Override
public
void
mhVedioAdSuccess
()
{
public
void
mhVedioAdSuccess
()
{
AppConfig
.
flVedioAdCount
--;
AppConfig
.
flVedioAdCount
--;
if
(
vedioAdingListener
!=
null
&&
!
isHighWeight
)
{
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerSuccess
(
Constant
.
FL_VEDIO_AD
);
vedioAdingListener
.
vedioAdingListenerSuccess
(
Constant
.
FL_VEDIO_AD
);
}
}
}
}
@Override
@Override
public
void
mhVedioAdFail
()
{
public
void
mhVedioAdFail
()
{
if
(
vedioAdingListener
!=
null
&&
!
isHighWeight
)
{
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerFail
(
Constant
.
FL_VEDIO_AD
);
vedioAdingListener
.
vedioAdingListenerFail
(
Constant
.
FL_VEDIO_AD
);
}
}
}
}
...
@@ -483,9 +483,9 @@ public class VedioAdingManager {
...
@@ -483,9 +483,9 @@ public class VedioAdingManager {
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
if
(
vedioAdingListener
!=
null
&&
!
isHighWeight
)
{
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerError
(
bean
.
getCarrierType
());
vedioAdingListener
.
vedioAdingListenerError
(
bean
.
getCarrierType
());
}
}
}
}
}
}
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
60f5e048
...
@@ -445,6 +445,11 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
...
@@ -445,6 +445,11 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
when
(
taskBean
.
baseConfig
.
taskId
)
{
when
(
taskBean
.
baseConfig
.
taskId
)
{
// 跳转高额视频
// 跳转高额视频
MainMyAdapter
.
APP_HiGH_ACTIVITY
->
{
MainMyAdapter
.
APP_HiGH_ACTIVITY
->
{
if
(!
UserManager
.
getInstance
().
userIsLogin
())
{
readyGo
(
WxLoginActivity
::
class
.
java
)
return
}
if
(
taskBean
.
otherConfig
!=
null
)
{
if
(
taskBean
.
otherConfig
!=
null
)
{
if
(
taskBean
.
otherConfig
.
complete
>=
taskBean
.
otherConfig
.
max
)
{
if
(
taskBean
.
otherConfig
.
complete
>=
taskBean
.
otherConfig
.
max
)
{
showToast
(
"看高额视频赚金币任务已完成,请明日再来"
)
showToast
(
"看高额视频赚金币任务已完成,请明日再来"
)
...
@@ -1057,7 +1062,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
...
@@ -1057,7 +1062,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
}
}
when
(
v
.
id
)
{
when
(
v
.
id
)
{
R
.
id
.
dialog_btn_left
->
{
R
.
id
.
dialog_btn_left
->
{
cdaa
!!
.
dismiss
()
}
}
R
.
id
.
dialog_btn_right
->
{
R
.
id
.
dialog_btn_right
->
{
cdaa
!!
.
dismiss
()
cdaa
!!
.
dismiss
()
...
@@ -1081,6 +1086,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
...
@@ -1081,6 +1086,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
it
.
setTitle
(
"任务步骤"
)
it
.
setTitle
(
"任务步骤"
)
it
.
setContent
(
ssb
)
it
.
setContent
(
ssb
)
it
.
setContentGravity
(
Gravity
.
START
)
it
.
setContentGravity
(
Gravity
.
START
)
it
.
setLeft
(
"取消"
)
it
.
setRight
(
"开始任务"
)
it
.
setRight
(
"开始任务"
)
it
.
show
()
it
.
show
()
}
}
...
...
GoodMoney/app/src/main/res/layout/item_rv_kyl_page.xml
View file @
60f5e048
...
@@ -2,19 +2,21 @@
...
@@ -2,19 +2,21 @@
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"4dp"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_margin=
"6dp"
android:background=
"@color/white"
android:background=
"@color/white"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<ImageView
<
com.shehuan.niv.Nice
ImageView
android:id=
"@+id/iv
Xmly
Page"
android:id=
"@+id/iv
Kyl
Page"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
30
0dp"
android:layout_height=
"
18
0dp"
android:scaleType=
"fitXY"
android:scaleType=
"fitXY"
android:src=
"@mipmap/bg_eat"
/>
android:src=
"@mipmap/bg_eat"
app:corner_radius=
"10dp"
/>
<TextView
<TextView
android:id=
"@+id/tv
Xmly
PageContent"
android:id=
"@+id/tv
Kyl
PageContent"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"6dp"
android:layout_margin=
"6dp"
...
@@ -26,17 +28,4 @@
...
@@ -26,17 +28,4 @@
android:textSize=
"14sp"
android:textSize=
"14sp"
android:textStyle=
"bold"
/>
android:textStyle=
"bold"
/>
<TextView
android:visibility=
"gone"
android:id=
"@+id/tvXmlyPagecount"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"6dp"
android:layout_marginBottom=
"6dp"
android:drawableLeft=
"@mipmap/ic_headset"
android:drawablePadding=
"6dp"
android:gravity=
"center_vertical"
android:text=
"7.2亿"
android:textColor=
"@color/color_AAA"
android:textSize=
"12sp"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
GoodMoney/app/src/main/res/layout/item_rv_xmly_page.xml
View file @
60f5e048
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"4dp"
android:background=
"@color/white"
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/ivXmlyPage"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"300dp"
android:scaleType=
"fitXY"
android:src=
"@mipmap/bg_eat"
/>
<TextView
android:id=
"@+id/tvXmlyPageContent"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_margin=
"6dp"
android:layout_margin=
"6dp"
android:background=
"@color/white"
android:ellipsize=
"end"
android:orientation=
"vertical"
>
android:lines=
"1"
android:singleLine=
"true"
<com.shehuan.niv.NiceImageView
android:text=
"123213112321311232131123213112321311232131123213112321311232131123213112321311232131"
android:id=
"@+id/ivKylPage"
android:textColor=
"@color/black"
android:layout_width=
"match_parent"
android:textSize=
"14sp"
android:layout_height=
"180dp"
android:textStyle=
"bold"
/>
android:scaleType=
"fitXY"
android:src=
"@mipmap/bg_eat"
app:corner_radius=
"10dp"
/>
<TextView
android:id=
"@+id/tvKylPageContent"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"6dp"
android:ellipsize=
"end"
android:lines=
"1"
android:singleLine=
"true"
android:text=
"123213112321311232131123213112321311232131123213112321311232131123213112321311232131"
android:textColor=
"@color/black"
android:textSize=
"14sp"
android:textStyle=
"bold"
/>
<TextView
android:visibility=
"gone"
android:id=
"@+id/tvXmlyPagecount"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"6dp"
android:layout_marginBottom=
"6dp"
android:drawableLeft=
"@mipmap/ic_headset"
android:drawablePadding=
"6dp"
android:gravity=
"center_vertical"
android:text=
"7.2亿"
android:textColor=
"@color/color_AAA"
android:textSize=
"12sp"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
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