Commit 03432d7e authored by mengcuiguang's avatar mengcuiguang

首页4tab改为平台分红切换,首页添加来电秀,删除微转sdk方式等

parent bbbb08cd
......@@ -34,7 +34,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
private var moneyFragment: Fragment? = null
private var panFragment: Fragment? = null
// private var friendsFragment: Fragment? = null
private var friendsFragment: Fragment? = null
private var myFragment: Fragment? = null
private var channelFragment: Fragment? = null
private var kuYinyueFragment: Fragment? = null
......@@ -69,8 +69,8 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
tab_tv_four.text = "新闻分享"
isMainShowWz = true
} else {
tab_iv_four.setImageResource(R.drawable.tab_bell_btn)
tab_tv_four.text = "来电秀"
tab_iv_four.setImageResource(R.drawable.tab_friends_btn)
tab_tv_four.text = "平台分红"
isMainShowWz = false
}
......@@ -219,10 +219,10 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
addOrShowFragment(supportFragmentManager, wzFragment!!, Constant.FRAGMENT_TAG_FOUR)
} else {
AppConfig.fragmentClickFlag = Constant.FRAGMENT_CLICK_FOUR
if (kuYinyueFragment == null) {
kuYinyueFragment = KuYinYueFragment()
if (friendsFragment == null) {
friendsFragment = FriendsFragment()
}
addOrShowFragment(supportFragmentManager, kuYinyueFragment!!, Constant.FRAGMENT_TAG_FOUR)
addOrShowFragment(supportFragmentManager, friendsFragment!!, Constant.FRAGMENT_TAG_FOUR)
}
......
......@@ -13,6 +13,7 @@ import com.mints.goodmoney.manager.DownloadApkManager
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.utils.CacheUtil
import kotlinx.android.synthetic.main.activity_web.*
import kotlinx.android.synthetic.main.web_header_layout.*
/**
* 描述:WebActivity
......
......@@ -57,7 +57,7 @@ class WrapperActivity : BaseActivity(), View.OnClickListener {
}
Constant.WRAPPER_TYPE_FRIENDS -> {
tv_title.text = "瓜分百万现金福利"
currentFragment = FriendsFragment()
currentFragment = FriendsFragment(true)
}
Constant.WRAPPER_TYPE_KYL -> {
tv_title.text = "来电秀"
......
......@@ -12,6 +12,7 @@ import androidx.viewpager.widget.ViewPager
import com.daimajia.androidanimations.library.Techniques
import com.daimajia.androidanimations.library.YoYo
import com.mints.goodmoney.R
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.FriendHallMsgBean
......@@ -41,7 +42,7 @@ import java.math.BigDecimal
* 时间:2020/9/20 17:30
*/
@SuppressLint("SetTextI18n")
class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnClickListener {
class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), FriendsView, OnRefreshListener, View.OnClickListener {
private val friendsPresenter by lazy { FriendsPresenter() }
......@@ -75,6 +76,12 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
friendsPresenter.attachView(this)
srl_my.setOnRefreshListener(this)
if (isResume) {
friendsLayout.visibility = View.GONE
} else {
friendsLayout.visibility = View.VISIBLE
}
initView()
initRecy()
}
......@@ -158,30 +165,30 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
override fun onResume() {
super.onResume()
// if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FRIENDS) {
if (!TextUtils.isEmpty(UserManager.getInstance().userID)) {
// 刷新分红数据
friendsPresenter.getFriendHallMsg()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FOUR || isResume) {
if (!TextUtils.isEmpty(UserManager.getInstance().userID)) {
// 刷新分红数据
friendsPresenter.getFriendHallMsg()
when (view_pager_friends.currentItem) {
0 -> {
friendsPresenter.getContributionBigLeaders()
}
1 -> {
friendsPresenter.getFriendsGiveTodayList()
}
2 -> {
friendsPresenter.getContributionLeaders()
when (view_pager_friends.currentItem) {
0 -> {
friendsPresenter.getContributionBigLeaders()
}
1 -> {
friendsPresenter.getFriendsGiveTodayList()
}
2 -> {
friendsPresenter.getContributionLeaders()
}
}
}
}
mFriendsHallMsgBean?.let {
if (it.button == "戳我分红") {
showRedbox(btn_get_bonus)
mFriendsHallMsgBean?.let {
if (it.button == "戳我分红") {
showRedbox(btn_get_bonus)
}
}
}
// }
}
override fun onPause() {
......
......@@ -31,7 +31,7 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
// private var newsFragment: Fragment? = null
private var xmlyGameFragment: Fragment? = null
private var liebaoGameFragment: Fragment? = null
// private var kuYinyueFragment: Fragment? = null
private var kuYinyueFragment: Fragment? = null
private var curPosition = 0//当前标签选中的下标
......@@ -76,7 +76,7 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
currentFragment = mainFragment
}
xtFragmentMoney.setxTabDisplayNum(4)
xtFragmentMoney.setxTabDisplayNum(5)
val newTab1 = xtFragmentMoney.newTab()
newTab1.text = "视频"
val newTab2 = xtFragmentMoney.newTab()
......@@ -87,11 +87,14 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
newTab4.text = "听书"
val newTab5 = xtFragmentMoney.newTab()
newTab5.text = "游戏"
val newTab6 = xtFragmentMoney.newTab()
newTab6.text = "来电秀"
xtFragmentMoney.addTab(newTab1)
xtFragmentMoney.addTab(newTab2)
// xtFragmentMoney.addTab(newTab3)
xtFragmentMoney.addTab(newTab4)
xtFragmentMoney.addTab(newTab5)
xtFragmentMoney.addTab(newTab6)
xtFragmentMoney.addOnTabSelectedListener(this)
} else {
......@@ -218,12 +221,12 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
}
addOrShowFragment(childFragmentManager, liebaoGameFragment!!, FRAGMENT_TAG_GAME)
}
// 3 -> {
// if (kuYinyueFragment == null) {
// kuYinyueFragment = KuYinYueFragment()
// }
// addOrShowFragment(childFragmentManager, kuYinyueFragment!!, FRAGMENT_TAG_KYL)
// }
4 -> {
if (kuYinyueFragment == null) {
kuYinyueFragment = KuYinYueFragment()
}
addOrShowFragment(childFragmentManager, kuYinyueFragment!!, FRAGMENT_TAG_KYL)
}
}
curPosition = tab.position
}
......
......@@ -8,6 +8,7 @@ import android.os.Bundle
import android.text.TextUtils
import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import com.mints.goodmoney.BuildConfig
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.download.CoralDownload
import com.mints.goodmoney.common.AppConfig
......@@ -179,6 +180,14 @@ class TaskCpdFragment : BaseFragment(), TaskView,
override fun getCpdModelSuc(dataBean: CpdModelBean.DataBean) {
for (material in dataBean.materials) {
// 校验包名、下载apk为空 跳过
if (TextUtils.isEmpty(material.app_apk_name) || TextUtils.isEmpty(material.app_url)) {
if (BuildConfig.DEBUG) {
LogUtil.d(TAG, "syd getCpdModelSuc 校验包名、下载apk为空 跳过${dataBean.uuid}")
}
continue
}
val tzTaskBean = TzTaskBean(material.icons, material.description, material.title, false, mCoin, 0, material.app_apk_name)
tzTaskBean.app_url = material.app_url
tzTaskBean.trackerBean = material.tracker
......@@ -245,8 +254,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
if (flag) {
// 添加未安装app
if (!TextUtils.isEmpty(mFakeTaskList[i].downLoadPkgName) &&
!DeviceInfo.instance.isLoadingPkg(mFakeTaskList[i].downLoadPkgName)) {
if (!TextUtils.isEmpty(mFakeTaskList[i].downLoadPkgName) && !DeviceInfo.instance.isLoadingPkg(mFakeTaskList[i].downLoadPkgName)) {
cpdLoadCountTime--
newPkgData.add(mFakeTaskList[i])
}
......
......@@ -18,7 +18,7 @@ import com.mints.goodmoney.mvp.views.BaseView
import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.mints.goodmoney.utils.ToastUtil
import kotlinx.android.synthetic.main.fragment_main_wz.*
import kotlinx.android.synthetic.main.header_layout.*
import kotlinx.android.synthetic.main.web_header_layout.*
import java.lang.StringBuilder
import java.util.HashMap
......@@ -35,13 +35,20 @@ class WzFragment(private var isResume: Boolean = false) : BaseFragment(), BaseVi
override fun getContentViewLayoutID() = R.layout.fragment_main_wz
override fun initViewsAndEvents() {
tv_title.text = "新闻分享"
iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
iv_left_icon.setOnClickListener {
tv_activity_title.text = "新闻分享"
tv_activity_back.setOnClickListener {
blTurntableWebview.goBack()
}
if (isResume) {
//包装页进入
iv_activity_quit.visibility = View.VISIBLE
iv_activity_quit.setOnClickListener {
activity?.finish()
}
} else {
iv_activity_quit.visibility = View.GONE
}
}
override fun onHiddenChanged(hidden: Boolean) {
......@@ -55,7 +62,7 @@ class WzFragment(private var isResume: Boolean = false) : BaseFragment(), BaseVi
override fun onResume() {
super.onResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FOUR||isResume) {
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FOUR || isResume) {
if (TextUtils.isEmpty(userManager?.userID)) {
// 游客登录
......
......@@ -4,48 +4,13 @@
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="20dp">
<ImageView
android:id="@+id/tv_activity_back"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:padding="10dp"
android:src="@mipmap/ic_arrow_back" />
<ImageView
android:id="@+id/iv_activity_quit"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/tv_activity_back"
android:padding="12dp"
android:src="@mipmap/ic_close" />
<TextView
android:id="@+id/tv_activity_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textColor="@color/color_121B32"
android:textSize="16sp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignParentBottom="true"
android:background="@color/color_E6E6E6" />
</RelativeLayout>
<include layout="@layout/web_header_layout" />
<ProgressBar
android:id="@+id/pb_web"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="2pt"
android:layout_height="2dp"
android:background="@null"
android:indeterminateOnly="false"
android:max="100"
......
......@@ -5,7 +5,9 @@
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/header_layout"
<include
android:id="@+id/friendsLayout"
layout="@layout/header_layout"
android:visibility="gone"/>
<com.scwang.smartrefresh.layout.SmartRefreshLayout
......
......@@ -7,7 +7,6 @@
<com.androidkun.xtablayout.XTabLayout
android:id="@+id/xtFragmentKyl"
android:paddingTop="14dp"
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
......
......@@ -4,7 +4,7 @@
android:orientation="vertical"
android:layout_height="match_parent">
<include layout="@layout/header_layout" />
<include layout="@layout/web_header_layout" />
<WebView
android:id="@+id/blTurntableWebview"
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="20dp">
<ImageView
android:id="@+id/tv_activity_back"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:padding="10dp"
android:src="@mipmap/ic_arrow_back" />
<ImageView
android:id="@+id/iv_activity_quit"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/tv_activity_back"
android:padding="12dp"
android:src="@mipmap/ic_close" />
<TextView
android:id="@+id/tv_activity_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textColor="@color/color_121B32"
android:textSize="16sp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignParentBottom="true"
android:background="@color/color_E6E6E6" />
</RelativeLayout>
\ 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