Commit 032fcc5e authored by mengcuiguang's avatar mengcuiguang

代码优化

parents df2c2ab5 e45337f9
......@@ -32,6 +32,7 @@ import com.duben.dayplaylet.ad.AdManager
import com.duben.dayplaylet.ad.AdStatusListener
import com.duben.dayplaylet.ad.NoPreAdManager
import com.duben.dayplaylet.ad.express.MyExpressManager
import com.duben.dayplaylet.ad.half.HalfScreenManager
import com.duben.dayplaylet.common.AppConfig
import com.duben.dayplaylet.common.Constant
import com.duben.dayplaylet.manager.DPHolder
......@@ -52,7 +53,13 @@ import com.duben.dayplaylet.utils.SpanUtils
import com.duben.library.utils.nodoubleclick.AntiShake
import io.reactivex.Observer
import io.reactivex.disposables.Disposable
import kotlinx.android.synthetic.main.drama_activity_api_detail.*
import kotlinx.android.synthetic.main.fragment_music.*
import kotlinx.android.synthetic.main.fragment_music.cl_reward
import kotlinx.android.synthetic.main.fragment_music.iv_cash_reward
import kotlinx.android.synthetic.main.fragment_music.iv_gold_reward
import kotlinx.android.synthetic.main.fragment_music.tv_cash_reward
import kotlinx.android.synthetic.main.fragment_music.tv_gold_reward
import kotlinx.android.synthetic.main.layout_draw_header.*
/**
......@@ -615,6 +622,10 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener {
mainHandler.postDelayed({
addAnimation(iv_cash_reward, iv_cash)
}, 800)
mainHandler.postDelayed({
rope = null
rope = YoYo.with(Techniques.Pulse).duration(300).playOn(rl_cash)
}, 1000)
}, 100)
}
......@@ -634,8 +645,17 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener {
mainHandler.postDelayed({
addAnimation(iv_gold_reward, iv_gold)
}, 800)
mainHandler.postDelayed({
rope = null
rope = YoYo.with(Techniques.Pulse).duration(300).playOn(rl_gold)
}, 1000)
}, 100)
}
mainHandler.postDelayed({
cl_reward.visibility = View.GONE
}, 1500)
}
override fun reportAddCoinMsgSuc(coin: Int, di: Int) {
......
......@@ -313,17 +313,16 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView
return
}
if (!isCash) {
val bundle = Bundle()
bundle.putString(LoadingActivity.TEXT, "正在为您发放奖励..")
readyGo(LoadingActivity::class.java, bundle)
Handler(Looper.getMainLooper()).postDelayed({
if (!isCash) {
awardVideo(Constant.CARRIERTYPE_REWARD_HONGBAO, cash)
}, 2200)
} else {
awardVideo(Constant.CARRIERTYPE_FORCASH_HONGBAO, cash, unitId)
}
}, 2200)
}
override fun rdHongbaoClickFail() {
......
......@@ -66,7 +66,6 @@ public class CountDownVideoView extends LinearLayout {
}
public void resume() {
isOver = false;
cdCountVedioView.resume();
}
......
......@@ -15,6 +15,8 @@ import android.widget.ImageView
import android.widget.RelativeLayout
import androidx.core.content.ContextCompat
import com.bytedance.sdk.dp.*
import com.daimajia.androidanimations.library.Techniques
import com.daimajia.androidanimations.library.YoYo
import com.google.gson.Gson
import com.duben.dayplaylet.R
import com.duben.dayplaylet.ad.AdManager
......@@ -54,6 +56,8 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
var outerDrama: DPDrama? = null
}
private var rope: YoYo.YoYoString? = null
private val videoPresenter by lazy { VideoPresenter() }
private var dpWidget: IDPWidget? = null
......@@ -431,7 +435,6 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
cdvv.setTime(data.surplusSeconds)
cdvv.start()
cdvv.setCountDownVideoListener(this)
cl_red_box.isClickable = false
cl_red_box.setOnClickListener {
if (!cdvv.isOver) return@setOnClickListener
......@@ -449,7 +452,6 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
}
override fun onLoadingFinish() {
cl_red_box.isClickable = true
tv_tips.visibility = View.VISIBLE
triangle.visibility = View.VISIBLE
}
......@@ -512,8 +514,6 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
super.onClick(dialog, v)
dialog?.dismiss()
showAd(Constant.CARRIERTYPE_VEDIO)
cl_red_box.isClickable = false
}
}
)
......@@ -522,7 +522,7 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
}
private fun showAd(carrierType: String, drama: DPDrama? = null, widget: IDPWidget? = null) {
HalfScreenManager.getInstance().preLoadAd(this)
// HalfScreenManager.getInstance().preLoadAd(this)
AdManager.instance.showAd(this@DramaApiDetailActivity, carrierType,
object : AdStatusListener {
......@@ -645,8 +645,13 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
addAnimation(iv_cash_reward, iv_cash)
}, 800)
}, 100)
mainHandler.postDelayed({
rope = null
rope = YoYo.with(Techniques.Pulse).duration(300).playOn(rl_cash)
}, 1000)
}
if (goldReward <= 0) {
iv_gold_reward.visibility = View.GONE
tv_gold_reward.visibility = View.GONE
......@@ -664,13 +669,17 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
addAnimation(iv_gold_reward, iv_gold)
}, 800)
}, 100)
mainHandler.postDelayed({
rope = null
rope = YoYo.with(Techniques.Pulse).duration(300).playOn(rl_gold)
}, 1000)
}
HalfScreenManager.getInstance().preLoadAd(this)
// HalfScreenManager.getInstance().preLoadAd(this)
mainHandler.postDelayed({
cl_reward.visibility = View.GONE
// 展示插屏
HalfScreenManager.getInstance().showAd(this, null)
// HalfScreenManager.getInstance().showAd(this, null)
}, 1500)
}
......
......@@ -56,7 +56,8 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginEnd="@dimen/dp_10"
android:layout_marginBottom="260dp" />
android:layout_marginBottom="260dp"
android:visibility="gone" />
<ImageView
android:id="@+id/iv_pause"
......
......@@ -18,7 +18,8 @@
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginTop="160dp"
android:layout_marginEnd="15dp">
android:layout_marginEnd="15dp"
android:visibility="gone">
<ImageView
android:id="@+id/iv_open_cash"
......
......@@ -14,6 +14,7 @@
android:visibility="gone" />
<RelativeLayout
android:id="@+id/rl_cash"
android:layout_width="wrap_content"
android:layout_height="42dp"
android:layout_marginStart="16dp">
......@@ -59,6 +60,7 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_gold"
android:layout_width="wrap_content"
android:layout_height="42dp"
android:layout_gravity="end"
......
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