Commit 2e55c5bd authored by mengcuiguang's avatar mengcuiguang

代码优化,解决冲突

parent 0631366d
...@@ -155,7 +155,8 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -155,7 +155,8 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
when (carrierType) { when (carrierType) {
Constant.CARRIER_HOMEVEDIO_CHALLENGE, Constant.CARRIER_MINIVEDIO_CHALLENGE, Constant.CARRIER_HOMEVEDIO_CHALLENGE, Constant.CARRIER_MINIVEDIO_CHALLENGE,
Constant.CARRIER_GAME_ONLINE, Constant.CARRIER_EATMEAL, Constant.CARRIER_GAME_ONLINE, Constant.CARRIER_EATMEAL,
Constant.CARRIER_RUISHINEWS_CHALLANGE, Constant.CARRIER_ZHANGYUE_CHALLENGE -> { Constant.CARRIER_RUISHINEWS_CHALLANGE, Constant.CARRIER_ZHANGYUE_CHALLENGE,
Constant.CARRIER_XMLY_CHALLENGE -> {
val vo = HashMap<String, Any>() val vo = HashMap<String, Any>()
vo["carrierType"] = carrierType vo["carrierType"] = carrierType
awardPresenter.reportAddCoinMsg(vo) awardPresenter.reportAddCoinMsg(vo)
......
...@@ -150,6 +150,12 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener { ...@@ -150,6 +150,12 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
} }
} }
fun selectXmly() {
moneyFragment?.let {
(it as MoneyFragment).selectXmly()
}
}
/** /**
* 点击第二个tab * 点击第二个tab
*/ */
......
...@@ -8,6 +8,8 @@ import androidx.recyclerview.widget.DividerItemDecoration ...@@ -8,6 +8,8 @@ import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.mints.goodmoney.MintsApplication import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.goodmoney.ad.express.TTPreLoadExpressXmlyManager
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.manager.TrackManager import com.mints.goodmoney.manager.TrackManager
import com.mints.goodmoney.manager.UserManager import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.presenters.XmlyPlayPresenter import com.mints.goodmoney.mvp.presenters.XmlyPlayPresenter
...@@ -111,7 +113,7 @@ class XmlyPlayActivity : BaseActivity(), View.OnClickListener, XmlyPlayAdapter.O ...@@ -111,7 +113,7 @@ class XmlyPlayActivity : BaseActivity(), View.OnClickListener, XmlyPlayAdapter.O
mPlayerManager.removeOnConnectedListerner(this) mPlayerManager.removeOnConnectedListerner(this)
mPlayerManager.playMode = XmPlayListControl.PlayMode.PLAY_MODEL_LIST_LOOP mPlayerManager.playMode = XmPlayListControl.PlayMode.PLAY_MODEL_LIST_LOOP
Toast.makeText(this@XmlyPlayActivity, "播放器初始化成功", Toast.LENGTH_SHORT).show() // Toast.makeText(this@XmlyPlayActivity, "播放器初始化成功", Toast.LENGTH_SHORT).show()
loadUnlockMsg() loadUnlockMsg()
loadData() loadData()
...@@ -119,6 +121,13 @@ class XmlyPlayActivity : BaseActivity(), View.OnClickListener, XmlyPlayAdapter.O ...@@ -119,6 +121,13 @@ class XmlyPlayActivity : BaseActivity(), View.OnClickListener, XmlyPlayAdapter.O
}) })
} }
override fun onResume() {
super.onResume()
// 刷新喜马拉雅信息流
TTPreLoadExpressXmlyManager.getInstance().loadTtFrameLayout()
}
private fun loadUnlockMsg() { private fun loadUnlockMsg() {
xmlyPlayPresenter.getXmlyUnlockMsg(userManager.userID, mCategoryId.toString(), mAlbumId.toString()) xmlyPlayPresenter.getXmlyUnlockMsg(userManager.userID, mCategoryId.toString(), mAlbumId.toString())
} }
...@@ -140,7 +149,7 @@ class XmlyPlayActivity : BaseActivity(), View.OnClickListener, XmlyPlayAdapter.O ...@@ -140,7 +149,7 @@ class XmlyPlayActivity : BaseActivity(), View.OnClickListener, XmlyPlayAdapter.O
tv_title.text = p0.albumTitle tv_title.text = p0.albumTitle
GlideUtils.loadImageView(this@XmlyPlayActivity, p0.coverUrlMiddle, sound_cover) GlideUtils.loadImageView(this@XmlyPlayActivity, p0.coverUrlMiddle, sound_cover)
} }
control_bar.visibility = View.VISIBLE
getDataSuc(p0.tracks) getDataSuc(p0.tracks)
} }
...@@ -420,10 +429,16 @@ class XmlyPlayActivity : BaseActivity(), View.OnClickListener, XmlyPlayAdapter.O ...@@ -420,10 +429,16 @@ class XmlyPlayActivity : BaseActivity(), View.OnClickListener, XmlyPlayAdapter.O
return return
} }
} }
// 广告解锁
if (AppConfig.xmlyAdFlag) {
readyGo(XmlyAwardActivity::class.java) readyGo(XmlyAwardActivity::class.java)
xmlyPlayPresenter.pushXmlyUnlockMsg(userManager.userID, mCategoryId.toString(), mAlbumId.toString(), (position + 1).toString()) xmlyPlayPresenter.pushXmlyUnlockMsg(userManager.userID, mCategoryId.toString(), mAlbumId.toString(), (position + 1).toString())
mUnlockList.add((position + 1).toString()) mUnlockList.add((position + 1).toString())
xmlyPlayAdapter.notifyItemChanged(position) xmlyPlayAdapter.notifyItemChanged(position)
} else {
showToast("解锁失败,请重试")
}
} }
override fun getXmlyUnlockMsgSuc(list: List<String>) { override fun getXmlyUnlockMsgSuc(list: List<String>) {
......
...@@ -42,6 +42,9 @@ class MainMyAdapter(context: Context, taskData: MutableList<MyInfo.AutoListBean> ...@@ -42,6 +42,9 @@ class MainMyAdapter(context: Context, taskData: MutableList<MyInfo.AutoListBean>
// 电魂 // 电魂
const val TO_DHGAME = "TO_DHGAME" const val TO_DHGAME = "TO_DHGAME"
// 喜马拉雅
const val TO_XMLY = "TO_XMLY"
} }
private var mContext: Context = context private var mContext: Context = context
......
...@@ -144,6 +144,13 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener { ...@@ -144,6 +144,13 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
addOrShowFragment(childFragmentManager, bookStoreFragment!!, FRAGMENT_TAG_BOOKSTORE) addOrShowFragment(childFragmentManager, bookStoreFragment!!, FRAGMENT_TAG_BOOKSTORE)
} }
fun selectXmly() {
if (xmlyGameFragment == null) {
xmlyGameFragment = XmlyFragment()
}
addOrShowFragment(childFragmentManager, xmlyGameFragment!!, FRAGMENT_TAG_XMLY)
}
override fun onTabReselected(tab: XTabLayout.Tab) { override fun onTabReselected(tab: XTabLayout.Tab) {
} }
......
...@@ -564,6 +564,13 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi ...@@ -564,6 +564,13 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
readyGo(DhGameActivity::class.java) readyGo(DhGameActivity::class.java)
} }
MainMyAdapter.TO_XMLY -> {
val activity: MainActivity? = activity as MainActivity?
activity?.let {
it.clickTab1Layout()
it.selectXmly()
}
}
} }
} }
} }
...@@ -661,8 +668,6 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi ...@@ -661,8 +668,6 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
} }
Constant.HOT_ACTIVITY_LIEBAO -> { Constant.HOT_ACTIVITY_LIEBAO -> {
readyGo(LiebaoGameActivity::class.java) readyGo(LiebaoGameActivity::class.java)
// readyGo(XmlyActivity::class.java)
// readyGo(XmlyAwardActivity::class.java)
} }
Constant.HOT_ACTIVITY_MORNINGCLOCK -> { Constant.HOT_ACTIVITY_MORNINGCLOCK -> {
TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_MORNINGCLOCK) TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_MORNINGCLOCK)
......
...@@ -7,14 +7,14 @@ import com.mints.goodmoney.ui.activitys.XmlyPlayActivity ...@@ -7,14 +7,14 @@ import com.mints.goodmoney.ui.activitys.XmlyPlayActivity
import com.mints.goodmoney.ui.adapter.XmlyPageAdapter import com.mints.goodmoney.ui.adapter.XmlyPageAdapter
import com.mints.goodmoney.ui.fragment.base.LazyLoadBaseFragment import com.mints.goodmoney.ui.fragment.base.LazyLoadBaseFragment
import com.mints.goodmoney.utils.LogUtil import com.mints.goodmoney.utils.LogUtil
import com.ximalaya.ting.android.opensdk.constants.DTransferConstants
import com.ximalaya.ting.android.opensdk.datatrasfer.CommonRequest
import com.ximalaya.ting.android.opensdk.datatrasfer.IDataCallBack
import com.ximalaya.ting.android.opensdk.model.album.AlbumList
import com.scwang.smartrefresh.layout.api.RefreshLayout import com.scwang.smartrefresh.layout.api.RefreshLayout
import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener
import com.scwang.smartrefresh.layout.listener.OnRefreshListener import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import com.ximalaya.ting.android.opensdk.constants.DTransferConstants
import com.ximalaya.ting.android.opensdk.datatrasfer.CommonRequest
import com.ximalaya.ting.android.opensdk.datatrasfer.IDataCallBack
import com.ximalaya.ting.android.opensdk.model.album.Album import com.ximalaya.ting.android.opensdk.model.album.Album
import com.ximalaya.ting.android.opensdk.model.album.AlbumList
import kotlinx.android.synthetic.main.fragment_main_xmly_page.* import kotlinx.android.synthetic.main.fragment_main_xmly_page.*
/** /**
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<include layout="@layout/header_layout" /> <include layout="@layout/header_layout" />
<RelativeLayout <RelativeLayout
android:visibility="invisible"
android:id="@+id/control_bar" android:id="@+id/control_bar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="116dp" android:layout_height="116dp"
......
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