Commit f70a4a1f authored by mengcuiguang's avatar mengcuiguang

添加cpd新页面,优化来电秀提示,分红展示,平台攻略,cpd试玩任务标记等

parent 30ae1db2
......@@ -212,6 +212,9 @@
<activity
android:name=".ui.activitys.TaskActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.TaskCpdActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.KylVideoActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
......
......@@ -105,6 +105,11 @@ public class AppConfig {
*/
public static boolean isMainShowWz = false;
/**
* 显示cpd任务下载
*/
public static boolean useAppCpdModelShow = true;
/**
* 微转金币
*/
......
......@@ -36,7 +36,8 @@ class TaskPresenter : BasePresenter<TaskView>() {
when (code) {
200 -> {
if (data != null) {
view.getShCpdTimeSuc(data.get("needSeconds").asInt, data.get("CPD").asInt, data.get("CPD_SYD").asInt)
view.getShCpdTimeSuc(data.get("needSeconds").asInt,data.get("coin").asInt,
data.get("CPD").asInt, data.get("CPD_SYD").asInt)
}
}
}
......
......@@ -210,6 +210,7 @@ public class TrackPresenter extends BaseTrackPresenter {
JsonObject data = baseResponse.getData();
if (data != null) {
AppConfig.isMainShowWz = data.get("showCallShow").getAsBoolean();
AppConfig.useAppCpdModelShow = data.get("useAppCpdModelShow").getAsBoolean();
}
}
} catch (Exception e) {
......
......@@ -3,7 +3,7 @@ package com.mints.goodmoney.mvp.views
import com.mints.goodmoney.mvp.model.CpdModelBean
interface TaskView : BaseView {
fun getShCpdTimeSuc(time: Int, CPD: Int, CPD_SYD: Int)
fun getShCpdTimeSuc(time: Int, coin: Int, CPD: Int, CPD_SYD: Int)
fun getCpdModelSuc(dataBean: CpdModelBean.DataBean)
......
......@@ -146,7 +146,7 @@ class TaskActivity : BaseActivity(), TaskView,
override fun isApplyKitKatTranslucency() = false
override fun getShCpdTimeSuc(time: Int, CPD: Int, CPD_SYD: Int) {
override fun getShCpdTimeSuc(time: Int, coin: Int, CPD: Int, CPD_SYD: Int) {
needUseTime = time
shMax = CPD
cpdMax = CPD_SYD
......
package com.mints.goodmoney.ui.activitys
import android.view.View
import androidx.fragment.app.Fragment
import androidx.viewpager.widget.ViewPager
import com.mints.goodmoney.R
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.adapter.MessageFragAdapter
import com.mints.goodmoney.ui.fragment.TaskCpdFragment
import com.mints.goodmoney.ui.widgets.CustomDialogAsApple
import com.mints.goodmoney.ui.widgets.DialogListener
import kotlinx.android.synthetic.main.activity_task_cpd.*
import kotlinx.android.synthetic.main.header_layout.*
/**
* 描述:cpd管理
* 作者:孟崔广
* 时间:2021/1/28 14:29
*/
class TaskCpdActivity : BaseActivity(), View.OnClickListener {
private lateinit var cdaa: CustomDialogAsApple
override fun getContentViewLayoutID() = R.layout.activity_task_cpd
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)
initViewAndData()
initListener()
}
override fun onBackPressed() {
backDialog()
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.iv_left_icon -> backDialog()
}
}
private fun initListener() {
iv_left_icon.setOnClickListener(this)
}
private fun initViewAndData() {
val tabs: MutableList<String> = ArrayList()
val fragments: MutableList<Fragment> = ArrayList()
tabs.add("标签1")
fragments.add(TaskCpdFragment())
if (AppConfig.useAppCpdModelShow) {
tabs.add("标签2")
fragments.add(TaskCpdFragment())
xtTaskCpd.visibility = View.VISIBLE
} else {
xtTaskCpd.visibility = View.GONE
}
xtTaskCpd.overScrollMode = ViewPager.OVER_SCROLL_NEVER
val adapter = MessageFragAdapter(supportFragmentManager, fragments, tabs)
vpTaskCpd.adapter = adapter
xtTaskCpd.setxTabDisplayNum(tabs.size)
xtTaskCpd.setupWithViewPager(vpTaskCpd)
}
private fun backDialog() {
cdaa = CustomDialogAsApple(context, object : DialogListener() {
override fun onClick(v: View) {
if (cdaa.isShowing) {
cdaa.dismiss()
}
when (v.id) {
R.id.dialog_btn_right -> {
finish()
}
}
}
})
cdaa.setTitle("提示")
cdaa.setContent("退出当前页面将会重置当前任务状态")
cdaa.setLeft("取消")
cdaa.setRight("确定")
cdaa.show()
}
}
......@@ -467,9 +467,7 @@ class MyFragment : BaseFragment(),
carrierType = ""
val bundle = Bundle()
bundle.putInt(TaskActivity.TASK_COIN, taskBean.otherConfig.coin)
readyGo(TaskActivity::class.java, bundle)
readyGo(TaskCpdActivity::class.java)
}
// 跳转高额视频
MainMyAdapter.APP_HiGH_ACTIVITY -> {
......@@ -902,9 +900,7 @@ class MyFragment : BaseFragment(),
if (dataList.isNotEmpty()) {
for (listBean in dataList) {
if (listBean.baseConfig.taskId == MainMyAdapter.TO_SHARE_NEWS) {
val bundle = Bundle()
bundle.putInt(TaskActivity.TASK_COIN, listBean.otherConfig.coin)
readyGo(TaskActivity::class.java, bundle)
readyGo(TaskCpdActivity::class.java)
return
}
}
......@@ -1040,7 +1036,7 @@ class MyFragment : BaseFragment(),
iv_right_icon2.visibility = View.VISIBLE
iv_right_icon2.setImageResource(R.mipmap.icon_customer_service)
tv_left_subtitle.visibility = View.VISIBLE
tv_left_subtitle.text = "团长攻略"
tv_left_subtitle.text = "平台攻略"
tv_left_subtitle.setOnClickListener(this)
iv_right_icon2.setOnClickListener(this)
......
......@@ -135,9 +135,7 @@ class PanFragment : BaseFragment(), PanView {
return
}
val bundle = Bundle()
bundle.putInt(TaskActivity.TASK_COIN, panActionInfo.coin)
readyGo(TaskActivity::class.java, bundle)
readyGo(TaskCpdActivity::class.java)
}
2 -> {
if (!userManager.userIsLogin()) {
......
......@@ -40,7 +40,6 @@ class TaskCpdFragment : BaseFragment(), TaskView,
OnRefreshListener,
CoralDownload.OnAdLoadListener,
OnItemChildClickListener,
View.OnClickListener,
DownloadApkManager.OnMyDownloadListener {
private val taskPresenter by lazy { TaskPresenter() }
......@@ -69,12 +68,6 @@ class TaskCpdFragment : BaseFragment(), TaskView,
private val outNetIp by lazy { SPUtil.getInstance().getString(Constant.OUT_NET_IP) }
companion object {
const val TASK_COIN = "task_coin"
const val TASK_USE_MAX = "task_use_max"
const val TASK_USE_COMPLETE = "task_use_complete"
}
private var mCoin = 0
private var needUseTime = -1
......@@ -84,18 +77,9 @@ class TaskCpdFragment : BaseFragment(), TaskView,
private var shLoadCountTime = 0 // 珊瑚 加载广告次数
private var cpdLoadCountTime = 0 // CPD 加载广告次数
// override fun getBundleExtras(extras: Bundle) {
// super.getBundleExtras(extras)
// mCoin = extras.getInt(TaskActivity.TASK_COIN)
// }
override fun initViewsAndEvents() {
taskPresenter.attachView(this)
tv_title.text = "下载试玩任务"
iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
mCoralDownload = CoralDownload().setOnAdLoadListener(this)
CacheUtil.clearAllCache(context)
......@@ -118,7 +102,6 @@ class TaskCpdFragment : BaseFragment(), TaskView,
recy_task.adapter = mTaskAdapter
recy_task.setItemViewCacheSize(20)
mTaskAdapter?.setOnItemChildClickListener(this)
iv_left_icon.setOnClickListener(this)
}
private fun initListener() {
......@@ -141,8 +124,9 @@ class TaskCpdFragment : BaseFragment(), TaskView,
override fun getContentViewLayoutID() = R.layout.activity_task
override fun getShCpdTimeSuc(time: Int, CPD: Int, CPD_SYD: Int) {
override fun getShCpdTimeSuc(time: Int, coin: Int, CPD: Int, CPD_SYD: Int) {
needUseTime = time
mCoin = coin
shMax = CPD
cpdMax = CPD_SYD
......@@ -552,7 +536,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
if (trackerBean != null) {
// 上报CPD激活完成
LogUtil.d( "CPD -> install_start")
LogUtil.d("CPD -> install_start")
taskPresenter.cmtImp(trackerBean.install_start[0])
LogUtil.d("CPD -> install_finish")
......@@ -578,7 +562,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
val trackerBean = mFakeTaskList[position].trackerBean
if (trackerBean != null) {
// 上报CPD激活完成
LogUtil.d( "CPD -> activation")
LogUtil.d("CPD -> activation")
taskPresenter.cmtImp(trackerBean.activation[0])
}
......@@ -631,14 +615,6 @@ class TaskCpdFragment : BaseFragment(), TaskView,
cdaa.show()
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.iv_left_icon -> {
backDialog()
}
}
}
/**
* 开始下载
*/
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/color_FF9837" />
<corners
android:bottomLeftRadius="30dp"
android:topLeftRadius="30dp" />
</shape>
\ No newline at end of file
......@@ -44,7 +44,7 @@
android:layout_marginRight="50dp"
android:background="@drawable/shape_tv_gold"
android:gravity="center"
android:text="设置来电秀"
android:text="看广告设置来电秀"
android:layout_marginBottom="40dp"
app:layout_constraintBottom_toBottomOf="parent"
android:textColor="@color/white" />
......
......@@ -5,8 +5,6 @@
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/header_layout" />
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/srl_task"
android:layout_width="match_parent"
......
<?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"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/white"
android:orientation="vertical">
<include layout="@layout/header_layout" />
<com.androidkun.xtablayout.XTabLayout
android:id="@+id/xtTaskCpd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:xTabIndicatorColor="#F28335"
app:xTabIndicatorHeight="4dp"
app:xTabIndicatorRoundX="30dp"
app:xTabIndicatorRoundY="30dp"
android:visibility="gone"
app:xTabIndicatorWidth="20dp"
app:xTabMode="scrollable"
app:xTabSelectedTextColor="@color/color_FF9837"
app:xTabSelectedTextSize="18sp"
app:xTabTextColor="#000"
app:xTabTextSize="14sp" />
<com.mints.goodmoney.ui.widgets.MyViewPager
android:id="@+id/vpTaskCpd"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
......@@ -21,9 +21,10 @@
android:layout_height="wrap_content"
android:lines="1"
android:maxLength="12"
android:padding="10dp"
android:textColor="@color/color_121B32"
android:textSize="16sp"
android:padding="8dp"
android:textColor="@color/black"
android:textSize="18sp"
android:textStyle="bold"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
......
......@@ -5,8 +5,10 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/ll_my_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="15dp">
android:layout_marginLeft="15dp"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
android:layout_height="wrap_content">
<com.mints.goodmoney.ui.widgets.CircleImageView
android:id="@+id/item_title_avatar"
......@@ -32,18 +34,26 @@
app:layout_constraintLeft_toRightOf="@+id/item_title_avatar"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/item_title_friends"
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:drawableTop="@mipmap/ic_friends"
android:drawablePadding="2dp"
android:text="平台分红"
android:textColor="@color/color_FF9837"
android:textSize="14sp"
android:layout_height="50dp"
android:paddingLeft="16dp"
android:paddingRight="10dp"
android:background="@drawable/btn_my_friends"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/item_title_friends"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@mipmap/ic_friends"
android:text="平台分红"
android:layout_centerVertical="true"
android:textColor="@color/white"
android:textSize="14sp" />
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
......
......@@ -19,8 +19,8 @@
<ImageView
android:id="@+id/item_iv_avatar"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="10dp"
android:src="@mipmap/ic_launcher_main" />
......
......@@ -8,8 +8,8 @@
<ImageView
android:id="@+id/item_iv_avatar"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="10dp"
android:src="@mipmap/ic_launcher_main" />
......
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