Commit df7344c2 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent c2dcd88d
......@@ -160,6 +160,9 @@
<activity
android:name=".ui.activitys.SplashADActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.MorningClockActivity"
android:screenOrientation="portrait" />
<service
android:name=".service.UpdateService"
......
package com.mints.goodmoney.mvp.presenters;
import com.mints.goodmoney.manager.AppHttpManager;
import com.mints.goodmoney.mvp.model.BaseResponse;
import com.mints.goodmoney.mvp.model.DrawcashBean;
import com.mints.goodmoney.mvp.views.MorningClockView;
import com.mints.library.net.neterror.BaseSubscriber;
import com.mints.library.net.neterror.Throwable;
public class MorningClockPresenter extends BasePresenter<MorningClockView> {
/**
* 获取用户配置信息
*/
public void getUserTaskMsg() {
view.showLoading("加载中...");
AppHttpManager.getInstance(loanApplication)
.call(loanService.getDrawcashUserTaskMsg(),
new BaseSubscriber<BaseResponse<DrawcashBean>>() {
@Override
public void onCompleted() {
if (isLinkView()) return;
view.hideLoading();
}
@Override
public void onError(Throwable e) {
if (isLinkView()) return;
view.hideLoading();
view.showToast(e.getMessage());
}
@Override
public void onNext(BaseResponse<DrawcashBean> baseResponse) {
if (isLinkView()) return;
int code = baseResponse.getStatus();
String message = baseResponse.getMessage();
switch (code) {
case 200://成功
break;
default:
view.showToast(message);
break;
}
}
});
}
}
package com.mints.goodmoney.mvp.views
interface MorningClockView : BaseView {
}
......@@ -103,7 +103,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
awardPresenter.reportAddCoinMsg(vo)
tvAwardContent.setText(curCoin.toString() + "金币已到账")
tvAwardNext.setText("金币翻倍")
tvAwardNext.setText("看视频赚${extraId}金币")
carrierType = Constant.CARRIER_CHALLENGE_SHAREFRIEND_DOUBLE
}
......
package com.mints.goodmoney.ui.activitys
import android.view.View
import com.mints.goodmoney.R
import com.mints.goodmoney.mvp.presenters.DrawcashPresenter
import com.mints.goodmoney.mvp.presenters.MorningClockPresenter
import com.mints.goodmoney.mvp.views.MorningClockView
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import kotlinx.android.synthetic.main.header_layout.*
/**
* 描述:早起打卡
* 作者:孟崔广
* 时间:2020/11/18 19:19
*/
class MorningClockActivity : BaseActivity()
, View.OnClickListener, MorningClockView {
private val morningClockPresenter by lazy { MorningClockPresenter() }
override fun getContentViewLayoutID() = R.layout.activity_morning_clock
override fun isApplyKitKatTranslucency() = false
override fun initViewsAndEvents() {
tv_title.text = "早起打卡"
iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
initListener()
morningClockPresenter.attachView(this)
}
override fun onDestroy() {
super.onDestroy()
morningClockPresenter.detachView()
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.iv_left_icon -> finish()
}
}
private fun initListener() {
iv_left_icon.setOnClickListener(this)
}
}
\ No newline at end of file
......@@ -41,6 +41,12 @@ class DhGameFragment : LazyLoadBaseFragment(), View.OnClickListener {
initListener()
}
override fun onFragmentPause() {
if (UserManager.getInstance().userIsLogin()) {
loadH5Game()
}
}
override fun onDestroy() {
super.onDestroy()
......
......@@ -17,13 +17,16 @@ import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.yilan.sdk.player.ylplayer.YLPlayerConfig
import com.yilan.sdk.player.ylplayer.callback.OnPlayerCallBack
import com.yilan.sdk.ui.category.ChannelFragment
import kotlinx.android.synthetic.main.fragment_horiz_channel.cdvvYilanTime
import kotlinx.android.synthetic.main.fragment_horiz_channel.vs_tips
import kotlinx.android.synthetic.main.fragment_main_first.*
import net.grandcentrix.tray.AppPreferences
import kotlinx.android.synthetic.main.fragment_horiz_channel.*
private val TAG = HorizChannelFragment::class.java.simpleName
class HorizChannelFragment : BaseFragment(), HorizChannelView, View.OnClickListener {
private val TAG = HorizChannelFragment::class.java.simpleName
private val horizChannelPresenter by lazy { HorizChannelPresenter() }
private val ps by lazy { AppPreferences(context) }
......@@ -64,6 +67,7 @@ class HorizChannelFragment : BaseFragment(), HorizChannelView, View.OnClickListe
// 防止界面切换 重置倒计时
// 第一次能过 isFirstLoadVedio 判断好兔先加载视频
if (!isFirstLoadVideo && !cdvvYilanTime.isPlaying && !isAward) {
cdvvYilanTime.setRedpkgImg(R.mipmap.ic_main_grey)
cdvvYilanTime?.reset()
cdvvYilanTime?.start()
}
......@@ -224,6 +228,7 @@ class HorizChannelFragment : BaseFragment(), HorizChannelView, View.OnClickListe
isFirstWatchVideo = false
}
cdvvYilanTime.setRedpkgImg(R.mipmap.ic_main_red)
// 转满一圈,可领金币标记
isAward = true
cdvvYilanTime?.showRedbox()
......
......@@ -241,6 +241,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
// 防止界面切换 重置倒计时
// 好兔视频已加载 且 红包已转满 且 奖励已领过
if (!isFirstLoadVedio && !cdvvYilanTime.isPlaying && !isAward) {
cdvvYilanTime.setRedpkgImg(R.mipmap.ic_main_grey)
cdvvYilanTime?.reset()
cdvvYilanTime?.start()
}
......@@ -388,6 +389,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
isFirstWatchVideo = false
}
cdvvYilanTime.setRedpkgImg(R.mipmap.ic_main_red)
// 转满一圈,可领金币标记
isAward = true
cdvvYilanTime?.showRedbox()
......
......@@ -456,6 +456,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, taskBean.otherConfig.coin)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CHALLENGE_SHAREFRIEND)
bundle.putString(Constant.MAIN_EXTRA_ID, taskBean.otherConfig.doubleCoin.toString())
readyGo(AwardActivity::class.java, bundle)
}
2 -> {
......
......@@ -92,6 +92,10 @@ public class CountDownVedioView extends LinearLayout {
cdCountVedioView.setTime(time);
}
public void setRedpkgImg(int img){
ivCountVedioRedbox.setImageResource(img);
}
public void setCountDownVedioListener(CountDownVedioListener countDownVedioListener) {
this.countDownVedioListener = countDownVedioListener;
}
......
<?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="match_parent"
android:background="@color/white"
android:orientation="vertical">
<include layout="@layout/header_layout" />
</LinearLayout>
......@@ -27,5 +27,5 @@
android:layout_width="24dp"
android:layout_height="28dp"
android:layout_gravity="center"
android:src="@mipmap/ic_count_red" />
android:src="@mipmap/ic_main_grey" />
</FrameLayout>
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