Commit 60f5e048 authored by jyx's avatar jyx

代码优化

parent a0b51d39
......@@ -95,8 +95,6 @@ public class VedioAdingManager {
// 权重自有逻辑
loadAdVedio(getVedioAdType(), bean);
}
isHighWeight = false;
}
/**
......@@ -159,10 +157,12 @@ public class VedioAdingManager {
// 根据权重获取广告类型
String adType;
if (isHighWeight) {
setVedioAdingListener(null);
adType = getHighWeight();
} else {
} else {
adType = getRandomWeight();
}
isHighWeight = false;
LogUtil.d(TAG, "权重结果返回的广告类型:" + adType);
return adType;
......@@ -348,7 +348,7 @@ public class VedioAdingManager {
// 优量汇
if (ylhVedioAdManager == null) {
if (activity == null) {
if (vedioAdingListener != null && !isHighWeight) {
if (vedioAdingListener != null) {
vedioAdingListener.vedioAdingListenerError(Constant.YLH_VEDIO_AD);
}
return;
......@@ -359,7 +359,7 @@ public class VedioAdingManager {
ylhVedioAdManager.setYlhVedioAdListener(new YlhVedioAdManager.YlhVedioAdListener() {
@Override
public void ylhVedioAdFail() {
if (vedioAdingListener != null && !isHighWeight) {
if (vedioAdingListener != null) {
vedioAdingListener.vedioAdingListenerFail(Constant.YLH_VEDIO_AD);
}
}
......@@ -367,7 +367,7 @@ public class VedioAdingManager {
@Override
public void ylhVedioAdSuccess() {
AppConfig.ylhAdCount--;
if (vedioAdingListener != null && !isHighWeight) {
if (vedioAdingListener != null) {
vedioAdingListener.vedioAdingListenerSuccess(Constant.YLH_VEDIO_AD);
}
}
......@@ -382,7 +382,7 @@ public class VedioAdingManager {
// 穿山甲激励视频
if (csjVedioAdManager == null) {
if (activity == null) {
if (vedioAdingListener != null && !isHighWeight) {
if (vedioAdingListener != null) {
vedioAdingListener.vedioAdingListenerError(Constant.CSJ_VEDIO_AD);
}
return;
......@@ -394,7 +394,7 @@ public class VedioAdingManager {
csjVedioAdManager.setCsjVedioAdListener(new CsjVedioAdManager.CsjVedioAdListener() {
@Override
public void csjVedioAdFail() {
if (vedioAdingListener != null && !isHighWeight) {
if (vedioAdingListener != null) {
vedioAdingListener.vedioAdingListenerFail(Constant.CSJ_VEDIO_AD);
}
}
......@@ -402,7 +402,7 @@ public class VedioAdingManager {
@Override
public void csjVedioAdSuccess() {
AppConfig.csjVedioAdCount--;
if (vedioAdingListener != null && !isHighWeight) {
if (vedioAdingListener != null) {
vedioAdingListener.vedioAdingListenerSuccess(Constant.CSJ_VEDIO_AD);
}
}
......@@ -417,7 +417,7 @@ public class VedioAdingManager {
// 闪电盒子激励视频
if (wnVedioAdManager == null) {
if (activity == null) {
if (vedioAdingListener != null && !isHighWeight) {
if (vedioAdingListener != null) {
vedioAdingListener.vedioAdingListenerError(Constant.SDHZ_VEDIO_AD);
}
return;
......@@ -428,14 +428,14 @@ public class VedioAdingManager {
@Override
public void wnVedioAdSuccess() {
AppConfig.wnVedioAdCount--;
if (vedioAdingListener != null && !isHighWeight) {
if (vedioAdingListener != null) {
vedioAdingListener.vedioAdingListenerSuccess(Constant.SDHZ_VEDIO_AD);
}
}
@Override
public void wnVedioAdFail() {
if (vedioAdingListener != null && !isHighWeight) {
if (vedioAdingListener != null) {
vedioAdingListener.vedioAdingListenerFail(Constant.SDHZ_VEDIO_AD);
}
}
......@@ -450,7 +450,7 @@ public class VedioAdingManager {
// 枫岚广告激励视频
if (mhVedioAdManager == null) {
if (activity == null) {
if (vedioAdingListener != null && !isHighWeight) {
if (vedioAdingListener != null) {
vedioAdingListener.vedioAdingListenerError(Constant.FL_VEDIO_AD);
}
return;
......@@ -461,14 +461,14 @@ public class VedioAdingManager {
@Override
public void mhVedioAdSuccess() {
AppConfig.flVedioAdCount--;
if (vedioAdingListener != null && !isHighWeight) {
if (vedioAdingListener != null) {
vedioAdingListener.vedioAdingListenerSuccess(Constant.FL_VEDIO_AD);
}
}
@Override
public void mhVedioAdFail() {
if (vedioAdingListener != null && !isHighWeight) {
if (vedioAdingListener != null) {
vedioAdingListener.vedioAdingListenerFail(Constant.FL_VEDIO_AD);
}
}
......@@ -483,9 +483,9 @@ public class VedioAdingManager {
}
} catch (Exception e) {
e.printStackTrace();
if (vedioAdingListener != null && !isHighWeight) {
if (vedioAdingListener != null) {
vedioAdingListener.vedioAdingListenerError(bean.getCarrierType());
}
}
}
}
}
\ No newline at end of file
......@@ -445,6 +445,11 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
when (taskBean.baseConfig.taskId) {
// 跳转高额视频
MainMyAdapter.APP_HiGH_ACTIVITY -> {
if (!UserManager.getInstance().userIsLogin()) {
readyGo(WxLoginActivity::class.java)
return
}
if (taskBean.otherConfig != null) {
if (taskBean.otherConfig.complete >= taskBean.otherConfig.max) {
showToast("看高额视频赚金币任务已完成,请明日再来")
......@@ -1057,7 +1062,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
}
when (v.id) {
R.id.dialog_btn_left -> {
cdaa!!.dismiss()
}
R.id.dialog_btn_right -> {
cdaa!!.dismiss()
......@@ -1081,6 +1086,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
it.setTitle("任务步骤")
it.setContent(ssb)
it.setContentGravity(Gravity.START)
it.setLeft("取消")
it.setRight("开始任务")
it.show()
}
......
......@@ -2,19 +2,21 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
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:orientation="vertical">
<ImageView
android:id="@+id/ivXmlyPage"
<com.shehuan.niv.NiceImageView
android:id="@+id/ivKylPage"
android:layout_width="match_parent"
android:layout_height="300dp"
android:layout_height="180dp"
android:scaleType="fitXY"
android:src="@mipmap/bg_eat" />
android:src="@mipmap/bg_eat"
app:corner_radius="10dp"/>
<TextView
android:id="@+id/tvXmlyPageContent"
android:id="@+id/tvKylPageContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="6dp"
......@@ -26,17 +28,4 @@
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>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<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_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"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_margin="6dp"
android:background="@color/white"
android:orientation="vertical">
<com.shehuan.niv.NiceImageView
android:id="@+id/ivKylPage"
android:layout_width="match_parent"
android:layout_height="180dp"
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" />
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>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment