Commit ece8fc3c authored by jyx's avatar jyx

活动页信息流预加载

parent e1d8d3c1
...@@ -67,7 +67,7 @@ public class TTNativeExpressManager { ...@@ -67,7 +67,7 @@ public class TTNativeExpressManager {
* @param viewHeight * @param viewHeight
*/ */
private void getTtNativeExpress(String codeId, FrameLayout view, float viewWidth, float viewHeight) { private void getTtNativeExpress(String codeId, FrameLayout view, float viewWidth, float viewHeight) {
Context context= MintsApplication.getContext(); // Context context= MintsApplication.getContext();
//step4:创建广告请求参数AdSlot,具体参数含义参考文档 //step4:创建广告请求参数AdSlot,具体参数含义参考文档
AdSlot adSlot = new AdSlot.Builder() AdSlot adSlot = new AdSlot.Builder()
.setCodeId(codeId) //广告位id .setCodeId(codeId) //广告位id
......
package com.mints.goodmoney.manager;
import android.content.Context;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.os.Message;
import android.widget.FrameLayout;
import androidx.annotation.NonNull;
import com.mints.goodmoney.MintsApplication;
public class TTPreLoadCarrierExpressManager {
private static TTPreLoadCarrierExpressManager _inst;
private FrameLayout ttFrameLayout;
private TTNativeExpressManager ttNativeExpressManager;
private HandlerThread mHandlerThread = new HandlerThread("TTPreLoadHandlerThread");
private Handler mWorkHandler;
private Handler mMainHandler = new Handler(Looper.getMainLooper());
private int mTTPreLoadWhat = 0x3243434;
public static TTPreLoadCarrierExpressManager getInstance() {
if (_inst == null) {
_inst = new TTPreLoadCarrierExpressManager();
}
return _inst;
}
private TTPreLoadCarrierExpressManager() {
init();
}
private void init() {
ttNativeExpressManager = new TTNativeExpressManager();
ttNativeExpressManager.initTTAd(false);
// 启动异步线程
mHandlerThread.start();
mWorkHandler = new Handler(mHandlerThread.getLooper()) {
@Override
public void handleMessage(@NonNull Message msg) {
// 工作线程进行加载数据
if (msg.what == mTTPreLoadWhat) {
loadTtFrameLayoutInThread((String) msg.obj);
}
}
};
}
public void onDestroy() {
mHandlerThread.quit();
mHandlerThread = null;
mWorkHandler.removeCallbacksAndMessages(null);
mWorkHandler = null;
}
public FrameLayout getTtFrameLayout() {
return ttFrameLayout;
}
private void loadTtFrameLayoutInThread(String codeId) {
Context context = MintsApplication.getContext();
ttFrameLayout = null;
try {
ttFrameLayout = new FrameLayout(context);
ttNativeExpressManager.getNativeExpressInit(codeId, ttFrameLayout, 340, 0);
ttNativeExpressManager.setTTNativeExpressManagerListener(view -> {
mMainHandler.post(() -> {
// 主线程更新UI操作
if (view == null) {
ttFrameLayout = null;
} else {
try {
ttFrameLayout = view;
} catch (Exception e) {
e.printStackTrace();
ttFrameLayout = null;
}
}
});
});
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 预加载 信息流
*/
public void loadTtFrameLayout(String codeId) {
Message msg = Message.obtain();
msg.what = mTTPreLoadWhat;
msg.obj = codeId;
mWorkHandler.sendMessage(msg);
}
}
...@@ -38,13 +38,12 @@ public class TTPreLoadExpressManager { ...@@ -38,13 +38,12 @@ public class TTPreLoadExpressManager {
* 预加载 信息流 * 预加载 信息流
*/ */
public void loadTtFrameLayout() { public void loadTtFrameLayout() {
Context context= MintsApplication.getContext(); Context context = MintsApplication.getContext();
ttFrameLayout = null;
try { try {
ttFrameLayout = new FrameLayout(context); ttFrameLayout = new FrameLayout(context);
ttNativeExpressManager.getNativeExpressInit(TtCsjAdManager.TT_AD_NATIVEEXPRESS_AWARD, ttFrameLayout, 310, 0); ttNativeExpressManager.getNativeExpressInit(TtCsjAdManager.TT_AD_NATIVEEXPRESS_AWARD, ttFrameLayout, 310, 0);
ttNativeExpressManager.setTTNativeExpressManagerListener(new TTNativeExpressManager.TTNativeExpressManagerListener() { ttNativeExpressManager.setTTNativeExpressManagerListener(view -> {
@Override
public void setTtExpressView(FrameLayout view) {
if (view == null) { if (view == null) {
ttFrameLayout = null; ttFrameLayout = null;
} else { } else {
...@@ -56,12 +55,10 @@ public class TTPreLoadExpressManager { ...@@ -56,12 +55,10 @@ public class TTPreLoadExpressManager {
ttFrameLayout = null; ttFrameLayout = null;
} }
} }
}
}); });
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
ttFrameLayout = null;
} }
} }
...@@ -5,6 +5,7 @@ import android.view.View ...@@ -5,6 +5,7 @@ import android.view.View
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.TTNativeExpressManager import com.mints.goodmoney.manager.TTNativeExpressManager
import com.mints.goodmoney.manager.TTPreLoadCarrierExpressManager
import com.mints.goodmoney.manager.TtCsjAdManager import com.mints.goodmoney.manager.TtCsjAdManager
import com.mints.goodmoney.mvp.model.MealBean import com.mints.goodmoney.mvp.model.MealBean
import com.mints.goodmoney.mvp.presenters.FoodSubsidyPresenter import com.mints.goodmoney.mvp.presenters.FoodSubsidyPresenter
...@@ -92,6 +93,9 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie ...@@ -92,6 +93,9 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie
readyGo(AwardActivity::class.java, bundle) readyGo(AwardActivity::class.java, bundle)
} }
} }
// 预加载信息流
TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_EAT)
} }
...@@ -99,9 +103,20 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie ...@@ -99,9 +103,20 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie
* 初始化信息iyc * 初始化信息iyc
*/ */
private fun initExpress() { private fun initExpress() {
try { // try {
// ttNativeExpressManager.initTTAd(false) // ttNativeExpressManager.initTTAd(false)
ttNativeExpressManager.getNativeExpressInit(TtCsjAdManager.TT_AD_NATIVEEXPRESS_EAT, flWalkAd, 320f, 0f) // ttNativeExpressManager.getNativeExpressInit(TtCsjAdManager.TT_AD_NATIVEEXPRESS_EAT, flSubsidykAd, 320f, 0f)
// } catch (e: Exception) {
// e.printStackTrace()
// }
try {
if (TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout != null) {
if (flSubsidykAd != null) {
flSubsidykAd.removeAllViews()
flSubsidykAd.addView(TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout)
}
}
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
} }
......
...@@ -12,6 +12,7 @@ import com.mints.goodmoney.R ...@@ -12,6 +12,7 @@ import com.mints.goodmoney.R
import com.mints.goodmoney.ad.video.VedioAdingManager import com.mints.goodmoney.ad.video.VedioAdingManager
import com.mints.goodmoney.common.AppConfig import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.TTPreLoadCarrierExpressManager
import com.mints.goodmoney.manager.ZhangyueManager import com.mints.goodmoney.manager.ZhangyueManager
import com.mints.goodmoney.mvp.views.MainView import com.mints.goodmoney.mvp.views.MainView
import com.mints.goodmoney.ui.activitys.base.BaseActivity import com.mints.goodmoney.ui.activitys.base.BaseActivity
...@@ -70,6 +71,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener { ...@@ -70,6 +71,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
super.onDestroy() super.onDestroy()
TTPreLoadCarrierExpressManager.getInstance().onDestroy()
VedioAdingManager.getInstance(this).setVedioAdingListener(null) VedioAdingManager.getInstance(this).setVedioAdingListener(null)
VedioAdingManager.getInstance(this).onDestory() VedioAdingManager.getInstance(this).onDestory()
} }
......
...@@ -7,6 +7,7 @@ import com.mints.goodmoney.R ...@@ -7,6 +7,7 @@ import com.mints.goodmoney.R
import com.mints.goodmoney.ad.video.VedioAdingManager import com.mints.goodmoney.ad.video.VedioAdingManager
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.TTNativeExpressManager import com.mints.goodmoney.manager.TTNativeExpressManager
import com.mints.goodmoney.manager.TTPreLoadCarrierExpressManager
import com.mints.goodmoney.manager.TtCsjAdManager import com.mints.goodmoney.manager.TtCsjAdManager
import com.mints.goodmoney.mvp.model.MorningClockBean import com.mints.goodmoney.mvp.model.MorningClockBean
import com.mints.goodmoney.mvp.model.VedioAdingBean import com.mints.goodmoney.mvp.model.VedioAdingBean
...@@ -15,7 +16,6 @@ import com.mints.goodmoney.mvp.views.MorningClockView ...@@ -15,7 +16,6 @@ import com.mints.goodmoney.mvp.views.MorningClockView
import com.mints.goodmoney.ui.activitys.base.BaseActivity import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.adapter.MorningClockAdapter import com.mints.goodmoney.ui.adapter.MorningClockAdapter
import com.mints.goodmoney.utils.SpanUtils import com.mints.goodmoney.utils.SpanUtils
import kotlinx.android.synthetic.main.activity_drawcash.*
import kotlinx.android.synthetic.main.activity_morning_clock.* import kotlinx.android.synthetic.main.activity_morning_clock.*
/** /**
...@@ -64,6 +64,9 @@ class MorningClockActivity : BaseActivity() ...@@ -64,6 +64,9 @@ class MorningClockActivity : BaseActivity()
R.id.ivMorningClockBack -> finish() R.id.ivMorningClockBack -> finish()
R.id.tvMorningClockClick -> { R.id.tvMorningClockClick -> {
awardVedio() awardVedio()
// 预加载信息流
TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_MORNINGCLOCK)
} }
} }
} }
...@@ -73,19 +76,18 @@ class MorningClockActivity : BaseActivity() ...@@ -73,19 +76,18 @@ class MorningClockActivity : BaseActivity()
morningClockList = data.targetList morningClockList = data.targetList
if (data.isCanClick) { if (data.isCanClick) {
tvMorningClockClick.setBackground(resources.getDrawable(R.drawable.shape_water_btn)) tvMorningClockClick.background = resources.getDrawable(R.drawable.shape_water_btn)
tvMorningClockClick.isEnabled = true tvMorningClockClick.isEnabled = true
} else { } else {
tvMorningClockClick.setBackground(resources.getDrawable(R.drawable.shape_tv_gold_none)) tvMorningClockClick.background = resources.getDrawable(R.drawable.shape_tv_gold_none)
tvMorningClockClick.isEnabled = false tvMorningClockClick.isEnabled = false
} }
tvMorningClockClick.text = data.buttonMsg tvMorningClockClick.text = data.buttonMsg
tvMorningClockDay.setText( tvMorningClockDay.text = SpanUtils()
SpanUtils()
.append("打卡领金币 已连续打卡") .append("打卡领金币 已连续打卡")
.append("${data.continuityDays}").setForegroundColor(resources.getColor(R.color.main_mints)) .append("${data.continuityDays}").setForegroundColor(resources.getColor(R.color.main_mints))
.append("天") .append("天")
.create()) .create()
initRvView() initRvView()
} }
...@@ -178,9 +180,20 @@ class MorningClockActivity : BaseActivity() ...@@ -178,9 +180,20 @@ class MorningClockActivity : BaseActivity()
* 初始化信息iyc * 初始化信息iyc
*/ */
private fun initExpress() { private fun initExpress() {
// try {
// ttNativeExpressManager.initTTAd(false)
// ttNativeExpressManager.getNativeExpressInit(TtCsjAdManager.TT_AD_NATIVEEXPRESS_MORNINGCLOCK, flMorningClockAd, 320f, 0f)
// } catch (e: Exception) {
// e.printStackTrace()
// }
try { try {
ttNativeExpressManager.initTTAd(false) if (TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout != null) {
ttNativeExpressManager.getNativeExpressInit(TtCsjAdManager.TT_AD_NATIVEEXPRESS_MORNINGCLOCK, flMorningClockAd, 320f, 0f) if (flMorningClockAd != null) {
flMorningClockAd.removeAllViews()
flMorningClockAd.addView(TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout)
}
}
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
} }
......
...@@ -4,7 +4,7 @@ import android.os.Bundle ...@@ -4,7 +4,7 @@ import android.os.Bundle
import android.view.View import android.view.View
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.TTNativeExpressManager import com.mints.goodmoney.manager.TTPreLoadCarrierExpressManager
import com.mints.goodmoney.manager.TtCsjAdManager import com.mints.goodmoney.manager.TtCsjAdManager
import com.mints.goodmoney.mvp.model.WalkBean import com.mints.goodmoney.mvp.model.WalkBean
import com.mints.goodmoney.mvp.presenters.WalkPresenter import com.mints.goodmoney.mvp.presenters.WalkPresenter
...@@ -21,7 +21,8 @@ import kotlinx.android.synthetic.main.activity_walk.* ...@@ -21,7 +21,8 @@ import kotlinx.android.synthetic.main.activity_walk.*
class WalkActivity : BaseActivity(), View.OnClickListener, WalkView, StepView.StepViewListener { class WalkActivity : BaseActivity(), View.OnClickListener, WalkView, StepView.StepViewListener {
private val walkPresenter by lazy { WalkPresenter() } private val walkPresenter by lazy { WalkPresenter() }
private val ttNativeExpressManager by lazy { TTNativeExpressManager() }
// private val ttNativeExpressManager by lazy { TTNativeExpressManager() }
private var curCoin = 0//点击的汽泡金币 private var curCoin = 0//点击的汽泡金币
override fun getContentViewLayoutID() = R.layout.activity_walk override fun getContentViewLayoutID() = R.layout.activity_walk
...@@ -45,7 +46,7 @@ class WalkActivity : BaseActivity(), View.OnClickListener, WalkView, StepView.St ...@@ -45,7 +46,7 @@ class WalkActivity : BaseActivity(), View.OnClickListener, WalkView, StepView.St
super.onDestroy() super.onDestroy()
svWalk?.destoryAnim() svWalk?.destoryAnim()
ttNativeExpressManager.onTTAdDestroy() // ttNativeExpressManager.onTTAdDestroy()
walkPresenter.detachView() walkPresenter.detachView()
} }
...@@ -97,15 +98,29 @@ class WalkActivity : BaseActivity(), View.OnClickListener, WalkView, StepView.St ...@@ -97,15 +98,29 @@ class WalkActivity : BaseActivity(), View.OnClickListener, WalkView, StepView.St
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_WALK_BUBBLE) bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_WALK_BUBBLE)
readyGo(AwardActivity::class.java, bundle) readyGo(AwardActivity::class.java, bundle)
} }
// 预加载信息流
TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WALK)
} }
/** /**
* 初始化信息iyc * 初始化信息iyc
*/ */
private fun initExpress() { private fun initExpress() {
// try {
// ttNativeExpressManager.initTTAd(false)
// ttNativeExpressManager.getNativeExpressInit(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WALK, flWalkAd, 320f, 0f)
// } catch (e: Exception) {
// e.printStackTrace()
// }
try { try {
ttNativeExpressManager.initTTAd(false) if (TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout != null) {
ttNativeExpressManager.getNativeExpressInit(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WALK, flWalkAd, 320f, 0f) if (flWalkAd != null) {
flWalkAd.removeAllViews()
flWalkAd.addView(TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout)
}
}
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
} }
......
...@@ -4,7 +4,7 @@ import android.os.Bundle ...@@ -4,7 +4,7 @@ import android.os.Bundle
import android.view.View import android.view.View
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.TTNativeExpressManager import com.mints.goodmoney.manager.TTPreLoadCarrierExpressManager
import com.mints.goodmoney.manager.TtCsjAdManager import com.mints.goodmoney.manager.TtCsjAdManager
import com.mints.goodmoney.mvp.model.WaterBean import com.mints.goodmoney.mvp.model.WaterBean
import com.mints.goodmoney.mvp.presenters.WaterPresenter import com.mints.goodmoney.mvp.presenters.WaterPresenter
...@@ -17,11 +17,9 @@ import kotlinx.android.synthetic.main.activity_water.* ...@@ -17,11 +17,9 @@ import kotlinx.android.synthetic.main.activity_water.*
* 作者:孟崔广 * 作者:孟崔广
* 时间:2020/10/13 11:55 * 时间:2020/10/13 11:55
*/ */
class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewListener class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewListener, com.mints.goodmoney.mvp.views.WaterView {
, com.mints.goodmoney.mvp.views.WaterView {
private val waterPresenter by lazy { WaterPresenter() } private val waterPresenter by lazy { WaterPresenter() }
private val ttNativeExpressManager by lazy { TTNativeExpressManager() }
override fun getContentViewLayoutID() = R.layout.activity_water override fun getContentViewLayoutID() = R.layout.activity_water
...@@ -53,7 +51,7 @@ class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewL ...@@ -53,7 +51,7 @@ class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewL
wvWater?.destoryAnim() wvWater?.destoryAnim()
wvWater?.closeWaterViewTime() wvWater?.closeWaterViewTime()
ttNativeExpressManager.onTTAdDestroy() // ttNativeExpressManager.onTTAdDestroy()
waterPresenter.detachView() waterPresenter.detachView()
} }
...@@ -69,6 +67,9 @@ class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewL ...@@ -69,6 +67,9 @@ class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewL
if (water == 0) { if (water == 0) {
waterPresenter.clickForWater() waterPresenter.clickForWater()
} }
// 预加载信息流
TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WATER)
} }
override fun clickForWaterSuc(waterCoin: Int) { override fun clickForWaterSuc(waterCoin: Int) {
...@@ -110,8 +111,12 @@ class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewL ...@@ -110,8 +111,12 @@ class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewL
*/ */
private fun initExpress() { private fun initExpress() {
try { try {
ttNativeExpressManager.initTTAd( false) if (TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout != null) {
ttNativeExpressManager.getNativeExpressInit(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WATER, flWaterAd, 320f, 0f) if (flWaterAd != null) {
flWaterAd.removeAllViews()
flWaterAd.addView(TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout)
}
}
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
} }
......
...@@ -213,6 +213,7 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC ...@@ -213,6 +213,7 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
* 显示红包动画 * 显示红包动画
*/ */
fun showRedbox(view: View?) { fun showRedbox(view: View?) {
rope = null
rope = YoYo.with(Techniques.Pulse).duration(1200) rope = YoYo.with(Techniques.Pulse).duration(1200)
.interpolate(AccelerateDecelerateInterpolator()) .interpolate(AccelerateDecelerateInterpolator())
.repeat(-1) .repeat(-1)
...@@ -234,7 +235,6 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC ...@@ -234,7 +235,6 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
btn_get_bonus.isEnabled = data.status == 0 && data.cash > 0 btn_get_bonus.isEnabled = data.status == 0 && data.cash > 0
if (data.button == "戳我分红") { if (data.button == "戳我分红") {
btn_get_bonus.isEnabled = true
btn_get_bonus.setTextColor(resources.getColor(R.color.white)) btn_get_bonus.setTextColor(resources.getColor(R.color.white))
btn_get_bonus.setBackgroundResource(R.drawable.shape_btn_friends_unenabled) btn_get_bonus.setBackgroundResource(R.drawable.shape_btn_friends_unenabled)
showRedbox(btn_get_bonus) showRedbox(btn_get_bonus)
...@@ -259,8 +259,8 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC ...@@ -259,8 +259,8 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
.create() .create()
tv_bonus_money.text = SpanUtils() tv_bonus_money.text = SpanUtils()
.append(data.cash.toString()).setFontSize(50).setForegroundColor(resources.getColor(R.color.color_E72C2B)) .append(data.cash.toString()).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.append("元").setFontSize(30).setForegroundColor(resources.getColor(R.color.color_E72C2B)) .append("元").setFontSize(22).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.create() .create()
tv_bonus_rate.text = SpanUtils() tv_bonus_rate.text = SpanUtils()
......
...@@ -20,9 +20,7 @@ import com.mints.goodmoney.R ...@@ -20,9 +20,7 @@ import com.mints.goodmoney.R
import com.mints.goodmoney.ad.video.VedioAdingManager import com.mints.goodmoney.ad.video.VedioAdingManager
import com.mints.goodmoney.common.AppConfig import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.BxmManager import com.mints.goodmoney.manager.*
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.manager.YwhzManager
import com.mints.goodmoney.mvp.model.* import com.mints.goodmoney.mvp.model.*
import com.mints.goodmoney.mvp.presenters.MyPresenter import com.mints.goodmoney.mvp.presenters.MyPresenter
import com.mints.goodmoney.mvp.views.MyView import com.mints.goodmoney.mvp.views.MyView
...@@ -363,7 +361,15 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi ...@@ -363,7 +361,15 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
// 已登录 // 已登录
if (userManager.wxOpenid.isNotEmpty()) { if (userManager.wxOpenid.isNotEmpty()) {
GlideUtils.loadImageViewLoding(context, userManager.wxHeader, item_title_avatar, R.mipmap.ic_my, R.mipmap.ic_my) GlideUtils.loadImageViewLoding(context, userManager.wxHeader, item_title_avatar, R.mipmap.ic_my, R.mipmap.ic_my)
if (userManager.wxName.isEmpty()) {
var mobile = userManager.mobile
if (mobile.isNotEmpty()) {
mobile = mobile.substring(0, 3) + "****" + mobile.substring(mobile.length - 4, mobile.length)
}
item_title_id.text = "手机:$mobile"
} else {
item_title_id.text = userManager.wxName item_title_id.text = userManager.wxName
}
} else { } else {
var mobile = userManager.mobile var mobile = userManager.mobile
if (mobile.isNotEmpty()) { if (mobile.isNotEmpty()) {
...@@ -599,9 +605,11 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi ...@@ -599,9 +605,11 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
// 自有界面 // 自有界面
when (hotBean.toUrl) { when (hotBean.toUrl) {
Constant.HOT_ACTIVITY_WATER -> { Constant.HOT_ACTIVITY_WATER -> {
TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WATER)
readyGo(WaterActivity::class.java) readyGo(WaterActivity::class.java)
} }
Constant.HOT_ACTIVITY_WALK -> { Constant.HOT_ACTIVITY_WALK -> {
TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WALK)
readyGo(WalkActivity::class.java) readyGo(WalkActivity::class.java)
} }
Constant.HOT_ACTIVITY_CARD -> { Constant.HOT_ACTIVITY_CARD -> {
...@@ -611,12 +619,14 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi ...@@ -611,12 +619,14 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
readyGo(LiebaoGameActivity::class.java) readyGo(LiebaoGameActivity::class.java)
} }
Constant.HOT_ACTIVITY_MORNINGCLOCK -> { Constant.HOT_ACTIVITY_MORNINGCLOCK -> {
TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_MORNINGCLOCK)
readyGo(MorningClockActivity::class.java) readyGo(MorningClockActivity::class.java)
} }
Constant.HOT_ACTIVITY_BXM -> { Constant.HOT_ACTIVITY_BXM -> {
// 消费变现猫事件 // 消费变现猫事件
} }
Constant.HOT_ACTIVITY_EAT -> { Constant.HOT_ACTIVITY_EAT -> {
TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_EAT)
readyGo(FoodSubsidyActivity::class.java) readyGo(FoodSubsidyActivity::class.java)
} }
else -> { else -> {
......
<?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"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
...@@ -110,11 +109,12 @@ ...@@ -110,11 +109,12 @@
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:layout_gravity="center"
android:layout_marginLeft="25dp" android:layout_marginLeft="25dp"
android:layout_marginTop="10dp"
android:layout_marginRight="25dp" android:layout_marginRight="25dp"
android:layout_gravity="center"
android:background="@drawable/shape_bg_write"> android:background="@drawable/shape_bg_write">
<FrameLayout <FrameLayout
android:id="@+id/flAwardAd" android:id="@+id/flAwardAd"
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
...@@ -7,8 +7,10 @@ ...@@ -7,8 +7,10 @@
android:overScrollMode="never"> android:overScrollMode="never">
<LinearLayout <LinearLayout
android:id="@+id/ll_food"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout <FrameLayout
...@@ -41,14 +43,12 @@ ...@@ -41,14 +43,12 @@
</FrameLayout> </FrameLayout>
<FrameLayout <FrameLayout
android:id="@+id/flWalkAd" android:id="@+id/flSubsidykAd"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:background="@color/full_transparent"> android:background="@color/full_transparent"/>
</FrameLayout>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
...@@ -46,9 +46,8 @@ ...@@ -46,9 +46,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:background="@color/full_transparent"> android:background="@color/full_transparent"/>
</FrameLayout>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
...@@ -23,14 +23,14 @@ ...@@ -23,14 +23,14 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:padding="15dp" android:padding="15dp"
android:src="@drawable/yl_mp_ic_back_left"></ImageView> android:src="@drawable/yl_mp_ic_back_left" />
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:src="@mipmap/ic_font_water" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="60dp" android:layout_marginTop="60dp"
android:layout_height="wrap_content"/> android:src="@mipmap/ic_font_water" />
<com.mints.goodmoney.ui.widgets.WaterView <com.mints.goodmoney.ui.widgets.WaterView
android:id="@+id/wvWater" android:id="@+id/wvWater"
...@@ -42,13 +42,12 @@ ...@@ -42,13 +42,12 @@
<FrameLayout <FrameLayout
android:id="@+id/flWaterAd" android:id="@+id/flWaterAd"
android:layout_marginTop="20dp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:background="@color/full_transparent"> android:layout_marginTop="20dp"
android:background="@color/full_transparent" />
</FrameLayout>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
...@@ -186,19 +186,19 @@ ...@@ -186,19 +186,19 @@
android:id="@+id/tv_yesterday_bonus" android:id="@+id/tv_yesterday_bonus"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="right" android:gravity="end"
android:paddingRight="10dp" android:paddingEnd="10dp"
android:text="@string/dot" android:text="@string/dot"
android:textSize="20sp" /> android:textSize="22sp" />
<TextView <TextView
android:id="@+id/tv_today_bonus" android:id="@+id/tv_today_bonus"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="right" android:gravity="end"
android:paddingRight="10dp" android:paddingEnd="10dp"
android:text="@string/dot" android:text="@string/dot"
android:textSize="20sp" /> android:textSize="22sp" />
</LinearLayout> </LinearLayout>
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="6dp"
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:text="分红收益" android:text="分红收益"
android:textColor="@color/color_CF7E7E" /> android:textColor="@color/color_CF7E7E" />
...@@ -223,9 +223,10 @@ ...@@ -223,9 +223,10 @@
android:id="@+id/tv_bonus_money" android:id="@+id/tv_bonus_money"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="6dp"
android:layout_marginTop="40dp" android:layout_marginTop="40dp"
android:text="@string/dot" /> android:text="@string/dot"
android:textSize="22sp" />
<Button <Button
android:id="@+id/btn_get_bonus" android:id="@+id/btn_get_bonus"
......
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