Commit e7b0ce9f authored by mengcuiguang's avatar mengcuiguang

代码优化

parent fa2e1fd4
...@@ -82,7 +82,6 @@ class MyPresenter : BasePresenter<MyView>() { ...@@ -82,7 +82,6 @@ class MyPresenter : BasePresenter<MyView>() {
val code = baseResponse.status val code = baseResponse.status
when (code) { when (code) {
200 -> { 200 -> {
showTurn()
getMyInfo() getMyInfo()
} }
} }
...@@ -128,142 +127,4 @@ class MyPresenter : BasePresenter<MyView>() { ...@@ -128,142 +127,4 @@ class MyPresenter : BasePresenter<MyView>() {
} }
}) })
} }
fun showTurn() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.showTurn(),
object : BaseSubscriber<BaseResponse<NineShowBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<NineShowBean>) {
if (isLinkView) return
view.hideLoading()
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> view.showTurnSuc(baseResponse.data)
else -> {
view.showToast(message)
}
}
}
override fun onError(e: Throwable?) {
if (isLinkView) return
view.hideLoading()
view.showToast(e?.message)
}
})
}
fun getTurnIphoneMsg() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.getTurnConfig(),
object : BaseSubscriber<BaseResponse<NineListBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<NineListBean>) {
if (isLinkView) return
view.hideLoading()
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> view.getTurnIphoneMsgSuc(baseResponse.data)
else -> {
view.showToast(message)
}
}
}
override fun onError(e: Throwable?) {
if (isLinkView) return
view.hideLoading()
view.showToast(e?.message)
}
})
}
fun toTurn() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.toTurn(),
object : BaseSubscriber<BaseResponse<NineListBean.NineBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<NineListBean.NineBean>) {
if (isLinkView) return
view.hideLoading()
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> view.toTurnSuc(baseResponse.data)
else -> {
view.showToast(message)
}
}
}
override fun onError(e: Throwable?) {
if (isLinkView) return
view.hideLoading()
view.showToast(e?.message)
}
})
}
fun unlock(vo: java.util.HashMap<String, Any>) {
AppHttpManager.getInstance(loanApplication)
.call(
loanService.unlock(vo),
object : BaseSubscriber<BaseResponse<IndexList>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<IndexList>) {
if (isLinkView) return
view.hideLoading()
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> view.unlockSuc()
else -> {
view.showToast(message)
}
}
}
override fun onError(e: Throwable?) {
if (isLinkView) return
view.hideLoading()
view.showToast(e?.message)
}
})
}
} }
\ No newline at end of file
package com.mints.helivideo.mvp.views package com.mints.helivideo.mvp.views
import com.mints.helivideo.mvp.model.NineListBean
import com.mints.helivideo.mvp.model.NineShowBean
import com.mints.helivideo.mvp.model.UserBean import com.mints.helivideo.mvp.model.UserBean
interface MyView : BaseView { interface MyView : BaseView {
fun getUserSuc(data:UserBean) fun getUserSuc(data:UserBean)
fun showTurnSuc(data: NineShowBean)
fun getTurnIphoneMsgSuc(data: NineListBean)
fun toTurnSuc(data: NineListBean.NineBean)
fun unlockSuc()
} }
package com.mints.helivideo.ui.adapter
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.ProgressBar
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.mints.helivideo.R
import com.mints.helivideo.mvp.model.BannerBean
/**
* 任务中心-列表适配器
*/
class TasksAdapter(context: Context, var taskData: MutableList<BannerBean>? = null) :
RecyclerView.Adapter<TasksAdapter.ViewHolder>() {
private var mContext: Context = context
private var itemListener: ItemListener? = null
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val inflater: LayoutInflater = LayoutInflater.from(mContext)
return ViewHolder(inflater.inflate(R.layout.item_fragment_adapter_task, parent, false))
}
override fun getItemCount(): Int {
return if (taskData == null) {
30
} else {
taskData!!.size
}
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
// taskData?.let {
// // 一级标题
// holder.itemTaskTitle.text = baseConfig.title
// // 二级内容
// holder.itemTaskContent.text = baseConfig.context
// // 按钮文字
// holder.itemTaskClick.text = baseConfig.buttonText
// // 金币
// holder.itemTaskMoney.text = baseConfig.coinText
// // 提现券
// holder.itemTaskCoupons.text = baseConfig.diText
//
// // 进度条 (文本)
// if (baseConfig.runingMax > 0) {
// holder.itemTaskPb.visibility = View.VISIBLE
// holder.itemTaskPb.max = baseConfig.runingMax
// holder.itemTaskPb.progress = baseConfig.runingComplete
//
// // 进度条文字
// holder.itemTaskProgress.visibility = View.VISIBLE
// holder.itemTaskProgress.text = baseConfig.runingText
// } else {
// holder.itemTaskPb.visibility = View.GONE
// holder.itemTaskProgress.visibility = View.GONE
// }
// }
}
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val itemTaskTitle: TextView = itemView.findViewById(R.id.item_task_title)
val itemTaskMoney: TextView = itemView.findViewById(R.id.item_task_money)
val itemTaskCoupons: TextView = itemView.findViewById(R.id.item_task_coupons)
val itemTaskProgress: TextView = itemView.findViewById(R.id.item_task_progress)
val itemTaskClick: TextView = itemView.findViewById(R.id.item_task)
val itemTaskContent: TextView = itemView.findViewById(R.id.item_task_content)
val itemTaskPb: ProgressBar = itemView.findViewById(R.id.item_task_pb)
val llTaskRoot: FrameLayout = itemView.findViewById(R.id.ll_task_root)
}
fun setItemListener(listener: ItemListener) {
itemListener = listener
}
interface ItemListener {
// fun onItemClick(bean: MyInfo.AutoListBean?)
}
}
\ No newline at end of file
package com.mints.helivideo.ui.fragment package com.mints.helivideo.ui.fragment
import android.app.Dialog
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.text.TextUtils import android.text.TextUtils
import android.view.View import android.view.View
import android.widget.FrameLayout
import com.daimajia.androidanimations.library.Techniques
import com.daimajia.androidanimations.library.YoYo
import com.mints.helivideo.R import com.mints.helivideo.R
import com.mints.helivideo.ad.AdManager
import com.mints.helivideo.ad.AdStatusListener
import com.mints.helivideo.ad.NoPreAdManager
import com.mints.helivideo.ad.express.ExpressAdCallback
import com.mints.helivideo.ad.express.MyExpressManager
import com.mints.helivideo.common.AppConfig import com.mints.helivideo.common.AppConfig
import com.mints.helivideo.common.Constant import com.mints.helivideo.common.Constant
import com.mints.helivideo.manager.UserManager import com.mints.helivideo.manager.UserManager
import com.mints.helivideo.mvp.model.NineListBean
import com.mints.helivideo.mvp.model.NineShowBean
import com.mints.helivideo.mvp.model.UserBean import com.mints.helivideo.mvp.model.UserBean
import com.mints.helivideo.mvp.presenters.MyPresenter import com.mints.helivideo.mvp.presenters.MyPresenter
import com.mints.helivideo.mvp.views.MyView import com.mints.helivideo.mvp.views.MyView
import com.mints.helivideo.ui.activitys.* import com.mints.helivideo.ui.adapter.TasksAdapter
import com.mints.helivideo.ui.fragment.base.LazyLoadBaseFragment import com.mints.helivideo.ui.fragment.base.LazyLoadBaseFragment
import com.mints.helivideo.ui.widgets.DialogListener
import com.mints.helivideo.ui.widgets.NineContinueDialog
import com.mints.helivideo.utils.AppPreferencesManager
import com.mints.helivideo.utils.SpanUtils
import com.mints.helivideo.utils.TimeRender
import com.mints.helivideo.utils.UIUtils
import com.mints.helivideo.utils.rxutil.CommonRxTask
import com.mints.helivideo.utils.rxutil.RxjavaUtil
import com.mints.library.utils.nodoubleclick.AntiShake import com.mints.library.utils.nodoubleclick.AntiShake
import kotlinx.android.synthetic.main.fragment_main_my.* import kotlinx.android.synthetic.main.fragment_main_my.*
/** /**
* 描述:我 * 描述:我
* 作者:孟崔广 * 作者:孟崔广
* 时间:2023/7/7 11:30 * 时间:2023/9/7 11:30
*/ */
class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener { class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
private val myPresenter by lazy { MyPresenter() } private val myPresenter by lazy { MyPresenter() }
private val userManager by lazy { UserManager.getInstance() } private val userManager by lazy { UserManager.getInstance() }
private var tasksAdapter: TasksAdapter? = null
val luckyIndexMap: MutableMap<Int, String> = HashMap()
private var yoyo: YoYo.YoYoString? = null
private var isInitLuckyData = false
private var isTurnLuckyPage = false
private var nineShowBean: NineShowBean? = null
var carrierType = Constant.CARRIERTYPE_NINE
override fun getContentViewLayoutID() = R.layout.fragment_main_my override fun getContentViewLayoutID() = R.layout.fragment_main_my
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
myPresenter.attachView(this) myPresenter.attachView(this)
tv_contact.text = SpanUtils() initRecy()
.append("如有问题,请直接联系")
.append("在线客服\n")
.setForegroundColor(resources.getColor(R.color.main_mints))
.append("处理速度更快,")
.append("无需联系支付宝")
.setForegroundColor(resources.getColor(R.color.main_mints))
.create()
initListener() initListener()
} }
private fun initRecy() {
tasksAdapter = TasksAdapter(mContext)
recy_tasks.adapter = tasksAdapter
// recy_tasks.adapter?.notifyDataSetChanged()
}
override fun onFragmentFirstVisible() { override fun onFragmentFirstVisible() {
super.onFragmentFirstVisible() super.onFragmentFirstVisible()
...@@ -78,8 +49,6 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener { ...@@ -78,8 +49,6 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
yoyo?.stop()
yoyo = null
myPresenter.detachView() myPresenter.detachView()
} }
...@@ -87,20 +56,9 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener { ...@@ -87,20 +56,9 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
super.onFragmentResume() super.onFragmentResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FOUR) { if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FOUR) {
if (AntiShake.check(ll_my_record?.id)) return // if (AntiShake.check(ll_my_record?.id)) return
if(userManager.vipFlag){
MyExpressManager.instance.preLoadAd()
showAd()
}
if(isTurnLuckyPage){
isTurnLuckyPage=false
clickTurn()
}
if (!TextUtils.isEmpty(userManager?.userID)) { if (!TextUtils.isEmpty(userManager?.userID)) {
myPresenter.showTurn()
myPresenter.getMyInfo() myPresenter.getMyInfo()
} else { } else {
myPresenter.userLogin() myPresenter.userLogin()
...@@ -111,32 +69,10 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener { ...@@ -111,32 +69,10 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
override fun onClick(v: View?) { override fun onClick(v: View?) {
if (AntiShake.check(v?.id)) return if (AntiShake.check(v?.id)) return
when (v?.id) { // when (v?.id) {
R.id.tv_my_btn -> { // R.id.tv_my_btn -> {
} // }
R.id.ll_my_setting -> { // }
readyGo(SettingsActivity::class.java)
}
R.id.tv_my_account, R.id.ll_my_login -> {
if (!userManager.userIsLogin()) {
readyGo(MobileLoginActivity::class.java)
}
}
R.id.ll_my_record -> {
readyGo(WatchRecordActivity::class.java)
}
R.id.ll_my_feed -> {
readyGo(FeedbackActivity::class.java)
}
R.id.ll_contactus -> {
// (requireActivity() as MainActivity).backPhoneDialog()
}
R.id.ll_my_payrecord -> {
}
R.id.btn_action,R.id.rl_lucky -> {
clickTurn()
}
}
} }
override fun getUserSuc(data: UserBean) { override fun getUserSuc(data: UserBean) {
...@@ -144,275 +80,52 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener { ...@@ -144,275 +80,52 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
} }
private fun loginStatus(consumer: UserBean) { private fun loginStatus(consumer: UserBean) {
// 1-匹配用户 // // 1-匹配用户
if (consumer.activiteFlag == 1) { // if (consumer.activiteFlag == 1) {
// 匹配 // // 匹配
ll_my_vip.visibility = View.VISIBLE // ll_my_vip.visibility = View.VISIBLE
ll_my_payrecord.visibility = View.VISIBLE // ll_my_payrecord.visibility = View.VISIBLE
ll_contactus.visibility = View.VISIBLE // ll_contactus.visibility = View.VISIBLE
line_my_payrecord.visibility = View.VISIBLE // line_my_payrecord.visibility = View.VISIBLE
line_my_contactus.visibility = View.VISIBLE // line_my_contactus.visibility = View.VISIBLE
} else { // } else {
// 未匹配 // // 未匹配
ll_my_vip.visibility = View.GONE // ll_my_vip.visibility = View.GONE
ll_my_payrecord.visibility = View.GONE // ll_my_payrecord.visibility = View.GONE
ll_contactus.visibility = View.GONE // ll_contactus.visibility = View.GONE
line_my_payrecord.visibility = View.GONE // line_my_payrecord.visibility = View.GONE
line_my_contactus.visibility = View.GONE // line_my_contactus.visibility = View.GONE
} // }
//
// 2-是否有手机号 // // 2-是否有手机号
if (!TextUtils.isEmpty(userManager.mobile)) { // if (!TextUtils.isEmpty(userManager.mobile)) {
tv_my_account.text = "手机号:" + consumer.mobile.substring(0,3)+"****"+consumer.mobile.substring(consumer.mobile.length-4) // tv_my_account.text = "手机号:" + consumer.mobile.substring(0,3)+"****"+consumer.mobile.substring(consumer.mobile.length-4)
iv_my_bind.visibility = View.GONE // iv_my_bind.visibility = View.GONE
} else { // } else {
tv_my_account.text = "绑定手机号" // tv_my_account.text = "绑定手机号"
iv_my_bind.visibility = View.VISIBLE // iv_my_bind.visibility = View.VISIBLE
} // }
tv_my_id.text = "用户ID:"+consumer.idcode // tv_my_id.text = "用户ID:"+consumer.idcode
//
// 3-vip // // 3-vip
if (consumer.expireTime > 0) { // if (consumer.expireTime > 0) {
tv_my_vip.text = "VIP会员" // tv_my_vip.text = "VIP会员"
tv_my_btn.visibility = View.GONE // tv_my_btn.visibility = View.GONE
if (consumer.isForever) { // if (consumer.isForever) {
tv_my_status.text = "有效期: 永久有效" // tv_my_status.text = "有效期: 永久有效"
} else { // } else {
tv_my_status.text = // tv_my_status.text =
"到期时间 ${TimeRender.formatDate(consumer.expireTime, TimeRender.ALL_FORMAT_LINE)}" // "到期时间 ${TimeRender.formatDate(consumer.expireTime, TimeRender.ALL_FORMAT_LINE)}"
} // }
} else { // } else {
tv_my_vip.text = "开通VIP会员" // tv_my_vip.text = "开通VIP会员"
tv_my_status.text = "解锁全部短剧" // tv_my_status.text = "解锁全部短剧"
tv_my_btn.visibility = View.VISIBLE // tv_my_btn.visibility = View.VISIBLE
tv_my_btn.text = "立即开通" // tv_my_btn.text = "立即开通"
} // }
} }
private fun initListener() { private fun initListener() {
ll_my_login.setOnClickListener(this)
tv_my_btn.setOnClickListener(this)
tv_my_account.setOnClickListener(this)
ll_my_record.setOnClickListener(this)
ll_my_feed.setOnClickListener(this)
ll_my_payrecord.setOnClickListener(this)
ll_my_setting.setOnClickListener(this)
ll_contactus.setOnClickListener(this)
btn_action.setOnClickListener(this)
rl_lucky.setOnClickListener(this)
}
//----9宫格逻辑--开始--//
override fun unlockSuc() {
myPresenter.showTurn()
if (nineShowBean != null) {
if (nineShowBean!!.need - nineShowBean!!.complete-1>0) {
showContinueDialog()
}
}
}
override fun getTurnIphoneMsgSuc(data: NineListBean) {
lucky_panel.setImgArray(data.list)
initLuckyIndexForPid(data.list)
}
private fun initLuckyIndexForPid(list: List<NineListBean.NineBean>) {
if (list != null && list.size > 0) {
for (i in 0 until list.size) {
luckyIndexMap.put(i, list.get(i).pid ?: i.toString())
}
}
}
override fun toTurnSuc(data: NineListBean.NineBean) {
Handler(Looper.getMainLooper()).postDelayed({
startNine(data)
}, 500)
}
override fun showTurnSuc(data: NineShowBean) {
AppPreferencesManager.get()
.put(Constant.LUCKY_FLAG, data.isShow)
nineShowBean = data
if (data.isShow) {
// 加载一次转盘数据
if (!isInitLuckyData) {
myPresenter.getTurnIphoneMsg()
btn_action?.postDelayed({
yoyo = YoYo.with(Techniques.Pulse).duration(1000).repeat(-1).playOn(btn_action)
}, 200)
isInitLuckyData = true
}
rl_lucky.visibility = View.VISIBLE
if (TextUtils.equals(
carrierType,
Constant.CARRIERTYPE_NINE3
) && data.complete >= data.need
) {
carrierType = Constant.CARRIERTYPE_NINE
myPresenter.toTurn()
}
tv_nine_count.text = "${data.complete}/${data.need}次"
} else {
rl_lucky.visibility = View.GONE
}
}
private fun luckyAward() {
if (nineShowBean != null) {
if (nineShowBean!!.complete >= nineShowBean!!.need) {
carrierType = Constant.CARRIERTYPE_NINE3
}
}
AdManager.instance.showAd(requireActivity(), carrierType,
object : AdStatusListener {
var canFail = false
override fun adSuccess() {
canFail = true
}
override fun adFail() {
if (canFail) return
showLoading("正在获取视频", false)
NoPreAdManager.loadVideoAd(
requireActivity(),
carrierType, object : AdStatusListener {
override fun adFail() {
carrierType = Constant.CARRIERTYPE_NINE
hideLoading()
showToast("广告太火爆了,请稍候再试")
}
override fun adSuccess() {
hideLoading()
}
override fun adClose(vo: HashMap<String, Any>?) {
hideLoading()
vo?.let {
myPresenter.unlock(vo)
}
}
})
}
override fun adClose(vo: HashMap<String, Any>?) {
vo?.let {
myPresenter.unlock(vo)
}
}
})
}
private fun startNine(data: NineListBean.NineBean) {
if (data.pid == null) {
showToast("抽奖产品未配置")
return
}
if (!lucky_panel.isGameRunning) {
lucky_panel.startGame()
RxjavaUtil.executeRxTask(object : CommonRxTask<String>("") {
override fun doInIOThread() {
Thread.sleep(3000)
}
override fun doInUIThread() {
val index = getLuckyIndex(data.pid)
lucky_panel.tryToStop(index)
Handler(Looper.getMainLooper()).postDelayed({
}, 1500)
}
})
}
}
private fun getLuckyIndex(pid: String): Int {
if (luckyIndexMap.size > 0) {
for ((key, value) in luckyIndexMap) {
if (TextUtils.equals(pid, value)) {
return key
}
}
}
return 1
}
// 点击九宫格按钮
private fun clickTurn() {
if (luckyIndexMap.size == 0) {
showToast("界面初始异常,请重新进入")
return
} }
if (nineShowBean != null) {
if (nineShowBean!!.complete != nineShowBean!!.need) {
val luckyFirst =
AppPreferencesManager.get().getBoolean(Constant.LUCKY_MY_FIRST, false)
if (!luckyFirst) {
isTurnLuckyPage=true
AppPreferencesManager.get().put(Constant.LUCKY_MY_FIRST, true)
return
}
}
}
luckyAward()
}
// 继续观看逻辑
private fun showContinueDialog() {
nineShowBean?.let {
NineContinueDialog(
requireActivity(),
it.need - it.complete - 1,
object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) {
super.onClick(dialog, v)
dialog?.dismiss()
clickTurn()
}
}).show()
}
}
//----9宫格逻辑--结束--//
private fun showAd() {
MyExpressManager.instance.getAdView(object : ExpressAdCallback {
override fun loadSuccess(adView: FrameLayout?) {
adView?.let {
UIUtils.removeFromParent(it)
fl_ad.removeAllViews()
fl_ad.addView(it)
}
MyExpressManager.instance.preLoadAd()
}
override fun renderSuccess(adView: FrameLayout?): Boolean {
adView?.let {
UIUtils.removeFromParent(it)
fl_ad.removeAllViews()
fl_ad.addView(it)
}
MyExpressManager.instance.preLoadAd()
return false
}
override fun loadFail() {
}
})
}
} }
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white" />
<corners android:radius="9dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!--3个层的顺序即为显示时的叠加顺序-->
<!--背景色-->
<item android:id="@android:id/background">
<shape>
<corners android:radius="5dip" />
<solid android:color="#FFE9E9" />
</shape>
</item>
<!--一级进度条的颜色,也可以直接替换成图片-->
<item android:id="@android:id/progress">
<clip>
<shape>
<corners android:radius="5dip" />
<solid android:color="#F13D3D" />
</shape>
</clip>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="500dp" />
<gradient
android:angle="270"
android:endColor="#F13D3D"
android:startColor="#F13D3D" />
</shape>
\ No newline at end of file
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
...@@ -51,9 +51,9 @@ ...@@ -51,9 +51,9 @@
android:textSize="16sp" /> android:textSize="16sp" />
<LinearLayout <LinearLayout
android:layout_marginTop="6dp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
...@@ -81,260 +81,16 @@ ...@@ -81,260 +81,16 @@
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="140dp"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_my_vip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@mipmap/bg_my_vip"
android:orientation="vertical"
android:paddingLeft="24dp"
android:visibility="gone">
<TextView
android:id="@+id/tv_my_vip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="开通VIP会员"
android:textColor="#5B1500"
android:textSize="22sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_my_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="解锁全部短剧"
android:textColor="#5B1500" />
<Button
android:id="@+id/tv_my_btn"
android:layout_width="120dp"
android:layout_height="40dp"
android:layout_marginTop="20dp"
android:background="@drawable/shape_my"
android:text="立即开通"
android:textColor="#FFEED3"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
<RelativeLayout
android:id="@+id/rl_lucky"
android:layout_width="300dp"
android:layout_height="300dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:visibility="gone">
<com.mints.helivideo.ui.widgets.luckymonkeypanel.LuckyMonkeyPanelView
android:id="@+id/lucky_panel"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<RelativeLayout
android:id="@+id/btn_action"
android:layout_width="82dp"
android:layout_height="82dp"
android:layout_centerInParent="true"
android:background="@mipmap/ic_luckly_btn">
<TextView
android:id="@+id/tv_nine_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp"
android:text="-/-"
android:textColor="@color/white"
android:textSize="10dp"></TextView>
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="14dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="14dp"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_bg_mobile"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_my_record"
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="20dp"
android:paddingEnd="15dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="观看记录"
android:textColor="@color/black"
android:textSize="16sp" />
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:padding="6dp"
android:src="@mipmap/ic_arrow_more" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/my_color_gray" />
<LinearLayout
android:id="@+id/ll_my_feed"
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="20dp"
android:paddingEnd="15dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="意见反馈"
android:textColor="@color/black"
android:textSize="16sp" />
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:padding="6dp"
android:src="@mipmap/ic_arrow_more" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/my_color_gray" />
<LinearLayout
android:id="@+id/ll_my_payrecord"
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="20dp"
android:paddingEnd="15dp"
android:visibility="gone">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="取消订阅"
android:textColor="@color/black"
android:textSize="16sp" />
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:padding="6dp"
android:src="@mipmap/ic_arrow_more" />
</LinearLayout>
<View
android:id="@+id/line_my_payrecord"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/my_color_gray" />
<LinearLayout
android:id="@+id/ll_my_setting"
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="20dp"
android:paddingEnd="15dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="功能设置"
android:textColor="@color/black"
android:textSize="16sp" />
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:padding="6dp"
android:src="@mipmap/ic_arrow_more" />
</LinearLayout>
<View
android:id="@+id/line_my_contactus"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/my_color_gray" />
<LinearLayout
android:id="@+id/ll_contactus"
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="20dp"
android:paddingEnd="15dp"
android:visibility="gone">
<TextView
android:id="@+id/tv_contact"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="如有问题,请直接联系在线客服\n"
android:textColor="@color/black" />
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:padding="6dp"
android:src="@mipmap/ic_arrow_more" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</FrameLayout> </FrameLayout>
<com.mints.helivideo.ui.widgets.RoundRectLayout <androidx.recyclerview.widget.RecyclerView
android:id="@+id/fl_ad" android:id="@+id/recy_tasks"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:background="@drawable/shape_bg_write" /> android:background="@null"
android:nestedScrollingEnabled="false"
android:paddingBottom="10dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
......
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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"
android:id="@+id/ll_task_root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_task_list"
android:orientation="vertical"
android:padding="14dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/item_task_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/black"
android:textSize="16sp"
android:text="领金币" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:orientation="horizontal">
<ProgressBar
android:id="@+id/item_task_pb"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="70dp"
android:layout_height="6dp"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:progress="20"
android:progressDrawable="@drawable/progressbar_versus_changevedio_bg" />
<TextView
android:id="@+id/item_task_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="2dp"
android:gravity="center_vertical|left"
android:textColor="#F13D3D"
android:textSize="11sp"
android:text="88/85" />
</LinearLayout>
</RelativeLayout>
<TextView
android:id="@+id/item_task_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginBottom="8dp"
android:textColor="#464646"
android:textSize="12sp"
android:text="观看福利视频赚金币" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/item_task_money"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:drawableLeft="@mipmap/ic_task_sign_coin"
android:gravity="center_vertical"
android:textColor="#F13D3D"
android:textSize="22sp"
android:text="+1500金币" />
<TextView
android:id="@+id/item_task_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_toRightOf="@+id/item_task_money"
android:gravity="center_vertical"
android:text="+"
android:textColor="#FF9700"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="@+id/item_task_coupons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/item_task_plus"
android:drawableLeft="@mipmap/ic_task_sign_coin"
android:gravity="center_vertical"
android:textColor="#F13D3D"
android:textSize="22sp"
android:text="*15" />
</RelativeLayout>
</LinearLayout>
<TextView
android:id="@+id/item_task"
android:layout_width="76dp"
android:layout_height="30dp"
android:layout_gravity="right|bottom"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_task_btn"
android:gravity="center"
android:textColor="@color/white"
android:textSize="13dp"
android:text="去完成" />
</FrameLayout>
\ 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