Commit 17fc4c26 authored by mengcuiguang's avatar mengcuiguang

优化红包领取流程

parent 032fcc5e
...@@ -257,7 +257,7 @@ dependencies { ...@@ -257,7 +257,7 @@ dependencies {
implementation 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:3.0.0-RC3' implementation 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:3.0.0-RC3'
// 穿山甲聚合 接入【穿山甲、快手】 // 穿山甲聚合 接入【穿山甲、快手】
implementation "com.pangle.cn:mediation-sdk:5.6.0.8" implementation "com.pangle.cn:mediation-sdk:5.6.1.6"
// 腾讯播放器 // 腾讯播放器
implementation "com.tencent.liteav:LiteAVSDK_Player:11.3.0.13176" implementation "com.tencent.liteav:LiteAVSDK_Player:11.3.0.13176"
......
...@@ -247,5 +247,38 @@ ...@@ -247,5 +247,38 @@
</provider> </provider>
<!-- baidu end================== --> <!-- baidu end================== -->
<!-- GDT start================== -->
<!-- targetSDKVersion >= 24时才需要添加这个provider。provider的authorities属性的值为${applicationId}.fileprovider,请开发者根据自己的${applicationId}来设置这个值,例如本例中applicationId为"com.qq.e.union.demo"。 -->
<provider
android:name="com.qq.e.comm.GDTFileProvider"
android:authorities="${applicationId}.gdt.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/gdt_file_path" />
</provider>
<activity
android:name="com.qq.e.ads.PortraitADActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" />
<activity
android:name="com.qq.e.ads.LandscapeADActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="landscape"
tools:replace="android:screenOrientation" />
<!-- 声明SDK所需要的组件 -->
<service
android:name="com.qq.e.comm.DownloadService"
android:exported="false" />
<!-- 请开发者注意字母的大小写,ADActivity,而不是AdActivity -->
<activity
android:name="com.qq.e.ads.ADActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize" />
<!-- GDT end================== -->
</application> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -11,4 +11,5 @@ class MsgBean( ...@@ -11,4 +11,5 @@ class MsgBean(
var avatarImg: Any? = null, // 头像图片地址 var avatarImg: Any? = null, // 头像图片地址
var contentImg: Any? = null, // 图片地址 var contentImg: Any? = null, // 图片地址
var showFinger: Boolean = false, // 手指 var showFinger: Boolean = false, // 手指
var isGetRedpkg: Boolean = false, // 是否领取
) )
\ No newline at end of file
...@@ -100,16 +100,20 @@ class MsgAdapter : BaseMultiItemQuickAdapter<MSGMultiItemEntity, BaseViewHolder> ...@@ -100,16 +100,20 @@ class MsgAdapter : BaseMultiItemQuickAdapter<MSGMultiItemEntity, BaseViewHolder>
setGravity(llContent, Gravity.END) setGravity(llContent, Gravity.END)
setGravityLL(tvName, Gravity.END) setGravityLL(tvName, Gravity.END)
} }
if (msgBean.contentImg == null) {
GlideUtils.loadImageView(context, R.mipmap.bg_redpkg_enable, ivContent)
} else {
GlideUtils.loadImageView(context, msgBean.contentImg, ivContent)
}
ivContent.setOnClickListener { ivContent.setOnClickListener {
finger.visibility = View.GONE finger.visibility = View.GONE
mOnCustomChildClickListener?.onCustomChildClick(it) mOnCustomChildClickListener?.onCustomChildClick(it, holder.adapterPosition)
}
if (msgBean.isGetRedpkg) {
GlideUtils.loadImageView(context, R.mipmap.bg_redpkg_unenable, ivContent)
ivContent.isEnabled = false
} else {
GlideUtils.loadImageView(context, R.mipmap.bg_redpkg_enable, ivContent)
ivContent.isEnabled = true
} }
tvName.text = msgBean.name tvName.text = msgBean.name
if (msgBean.showFinger) { if (msgBean.showFinger) {
...@@ -146,6 +150,11 @@ class MsgAdapter : BaseMultiItemQuickAdapter<MSGMultiItemEntity, BaseViewHolder> ...@@ -146,6 +150,11 @@ class MsgAdapter : BaseMultiItemQuickAdapter<MSGMultiItemEntity, BaseViewHolder>
params.gravity = gravity params.gravity = gravity
} }
fun setRedpkgBgForPostition(position: Int) {
data[position].data.isGetRedpkg = true
notifyDataSetChanged()
}
private var mOnCustomChildClickListener: OnCustomChildClickListener? = null private var mOnCustomChildClickListener: OnCustomChildClickListener? = null
fun setOnCustomChildClickListener(onCustomChildClickListener: OnCustomChildClickListener) { fun setOnCustomChildClickListener(onCustomChildClickListener: OnCustomChildClickListener) {
...@@ -153,7 +162,7 @@ class MsgAdapter : BaseMultiItemQuickAdapter<MSGMultiItemEntity, BaseViewHolder> ...@@ -153,7 +162,7 @@ class MsgAdapter : BaseMultiItemQuickAdapter<MSGMultiItemEntity, BaseViewHolder>
} }
interface OnCustomChildClickListener { interface OnCustomChildClickListener {
fun onCustomChildClick(view: View) fun onCustomChildClick(view: View, position: Int)
} }
} }
\ No newline at end of file
...@@ -52,6 +52,7 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView ...@@ -52,6 +52,7 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView
private val redpkgPresenter by lazy { RedpkgPresenter() } private val redpkgPresenter by lazy { RedpkgPresenter() }
private var mCarrierType: String = Constant.CARRIERTYPE_REWARD_HONGBAO private var mCarrierType: String = Constant.CARRIERTYPE_REWARD_HONGBAO
var currentClickRedpkg = -1
override fun getContentViewLayoutID() = R.layout.fragment_redpkg override fun getContentViewLayoutID() = R.layout.fragment_redpkg
...@@ -99,15 +100,16 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView ...@@ -99,15 +100,16 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView
showMsgLoading(false) showMsgLoading(false)
} }
it.setOnCustomChildClickListener(object : MsgAdapter.OnCustomChildClickListener { it.setOnCustomChildClickListener(object : MsgAdapter.OnCustomChildClickListener {
override fun onCustomChildClick(view: View) { override fun onCustomChildClick(view: View, position: Int) {
if (AntiShake.check(view.id)) return if (AntiShake.check(view.id)) return
if (view.id == R.id.iv_content) { if (view.id == R.id.iv_content) {
view.isEnabled = false // view.isEnabled = false
GlideUtils.loadImageView( // GlideUtils.loadImageView(
context, // context,
R.mipmap.bg_redpkg_unenable, // R.mipmap.bg_redpkg_unenable,
view as ImageView // view as ImageView
) // )
currentClickRedpkg = position
redpkgPresenter.rdHongbaoClick() redpkgPresenter.rdHongbaoClick()
} }
} }
...@@ -206,6 +208,8 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView ...@@ -206,6 +208,8 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView
override fun adClose(vo: HashMap<String, Any>?) { override fun adClose(vo: HashMap<String, Any>?) {
hideLoading() hideLoading()
mMsgAdapter?.setRedpkgBgForPostition(currentClickRedpkg)
when (carrierType) { when (carrierType) {
Constant.CARRIERTYPE_FORCASH_HONGBAO -> { Constant.CARRIERTYPE_FORCASH_HONGBAO -> {
// 提现 // 提现
...@@ -231,6 +235,8 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView ...@@ -231,6 +235,8 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView
} }
override fun adClose(vo: HashMap<String, Any>?) { override fun adClose(vo: HashMap<String, Any>?) {
mMsgAdapter?.setRedpkgBgForPostition(currentClickRedpkg)
when (carrierType) { when (carrierType) {
Constant.CARRIERTYPE_FORCASH_HONGBAO -> { Constant.CARRIERTYPE_FORCASH_HONGBAO -> {
// 提现 // 提现
......
...@@ -447,6 +447,7 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic ...@@ -447,6 +447,7 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
} }
override fun reportAddCoinMsgSuc(coin: Int, di: Int) { override fun reportAddCoinMsgSuc(coin: Int, di: Int) {
cdvv.reset()
videoPresenter.rdVedioMsg() videoPresenter.rdVedioMsg()
showRewardAnim(coin, di) showRewardAnim(coin, di)
} }
......
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