Commit c2dcd88d authored by jyx's avatar jyx

饭补页面

parent 95e8b401
......@@ -87,18 +87,18 @@
android:name="JPUSH_CHANNEL"
android:value="${JPUSH_CHANNEL}" />
<!-- <activity-->
<!-- android:configChanges="keyboard|orientation|screenSize"-->
<!-- android:windowSoftInputMode="adjustPan|stateHidden"-->
<!-- android:theme="@style/Theme.ActivitySplash"-->
<!-- android:name=".ui.activitys.SplashYlhActivity"-->
<!-- android:screenOrientation="portrait">-->
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.MAIN" />-->
<!-- <activity-->
<!-- android:configChanges="keyboard|orientation|screenSize"-->
<!-- android:windowSoftInputMode="adjustPan|stateHidden"-->
<!-- android:theme="@style/Theme.ActivitySplash"-->
<!-- android:name=".ui.activitys.SplashYlhActivity"-->
<!-- android:screenOrientation="portrait">-->
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.MAIN" />-->
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
<!-- </intent-filter>-->
<!-- </activity>-->
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
<!-- </intent-filter>-->
<!-- </activity>-->
<activity
android:name=".ui.activitys.SplashYlhActivity"
......@@ -145,6 +145,9 @@
<activity
android:name=".ui.activitys.WalkActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.FoodSubsidyActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.EraseActivity"
android:screenOrientation="portrait" />
......@@ -235,17 +238,17 @@
<!-- 优量汇广告 -->
<!-- <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>-->
<!-- <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>-->
<!-- 鱼丸盒子广告 -->
......@@ -269,12 +272,12 @@
android:name="com.bytedance.sdk.openadsdk.TTFileProvider"
android:authorities="${applicationId}.TTFileProvider"
android:exported="false"
tools:replace="android:authorities"
android:grantUriPermissions="true">
android:grantUriPermissions="true"
tools:replace="android:authorities">
<meta-data
tools:replace="android:resource"
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
android:resource="@xml/file_paths"
tools:replace="android:resource" />
</provider>
......@@ -296,8 +299,8 @@
<activity
android:name="com.qq.e.ads.LandscapeADActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
tools:replace="android:screenOrientation"
android:screenOrientation="landscape" />
android:screenOrientation="landscape"
tools:replace="android:screenOrientation" />
</application>
</manifest>
\ No newline at end of file
......@@ -62,8 +62,8 @@ object Constant {
* app应用首页 0-主页 1-横屏视频 2-pan 3-friends 4-我
*/
const val FRAGMENT_CLICK_MAIN = 0
const val FRAGMENT_CLICK_PAN = 1
const val FRAGMENT_CLICK_CHANNEL = 2
const val FRAGMENT_CLICK_CHANNEL = 1
const val FRAGMENT_CLICK_PAN = 2
const val FRAGMENT_CLICK_FRIENDS = 3
const val FRAGMENT_CLICK_MY = 4
......
package com.mints.goodmoney.mvp.model;
import java.io.Serializable;
public class MealBean implements Serializable {
/**
* buttonCoin : 200
* vedioCoin : 160
* canClickButton : true
* vedioCount : 5
* canClickVedio : true
* buttonMsg : 晚餐打卡
*/
private int buttonCoin;
private int vedioCoin;
private boolean canClickButton;
private int vedioCount;
private boolean canClickVedio;
private String buttonMsg;
public int getButtonCoin() {
return buttonCoin;
}
public void setButtonCoin(int buttonCoin) {
this.buttonCoin = buttonCoin;
}
public int getVedioCoin() {
return vedioCoin;
}
public void setVedioCoin(int vedioCoin) {
this.vedioCoin = vedioCoin;
}
public boolean isCanClickButton() {
return canClickButton;
}
public void setCanClickButton(boolean canClickButton) {
this.canClickButton = canClickButton;
}
public int getVedioCount() {
return vedioCount;
}
public void setVedioCount(int vedioCount) {
this.vedioCount = vedioCount;
}
public boolean isCanClickVedio() {
return canClickVedio;
}
public void setCanClickVedio(boolean canClickVedio) {
this.canClickVedio = canClickVedio;
}
public String getButtonMsg() {
return buttonMsg;
}
public void setButtonMsg(String buttonMsg) {
this.buttonMsg = buttonMsg;
}
}
package com.mints.goodmoney.mvp.presenters
import com.mints.goodmoney.manager.AppHttpManager
import com.mints.goodmoney.mvp.model.BaseResponse
import com.mints.goodmoney.mvp.model.MealBean
import com.mints.goodmoney.mvp.views.FoodSubsidyView
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
class FoodSubsidyPresenter : BasePresenter<FoodSubsidyView>() {
fun getMealMsg() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.mealMsg,
object : BaseSubscriber<BaseResponse<MealBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
view.showToast(e.message)
}
override fun onNext(baseResponse: BaseResponse<MealBean>) {
if (isLinkView) return
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> view.getFoodSubsidySuc(baseResponse.data)
else -> view.showToast(message)
}
}
})
}
}
\ No newline at end of file
......@@ -5,7 +5,6 @@ import com.mints.goodmoney.manager.AppHttpManager;
import com.mints.goodmoney.mvp.model.BaseResponse;
import com.mints.goodmoney.mvp.model.WalkBean;
import com.mints.goodmoney.mvp.views.WalkView;
import com.mints.goodmoney.mvp.views.WaterView;
import com.mints.library.net.neterror.BaseSubscriber;
import com.mints.library.net.neterror.Throwable;
......
package com.mints.goodmoney.mvp.views
import com.mints.goodmoney.mvp.model.MealBean
interface FoodSubsidyView : BaseView {
fun getFoodSubsidySuc(data: MealBean)
}
\ No newline at end of file
......@@ -12,6 +12,7 @@ import com.mints.goodmoney.mvp.model.FriendHallMsgBean;
import com.mints.goodmoney.mvp.model.FriendsTaskBean;
import com.mints.goodmoney.mvp.model.GoldRecordBean;
import com.mints.goodmoney.mvp.model.MainVedioMsgBean;
import com.mints.goodmoney.mvp.model.MealBean;
import com.mints.goodmoney.mvp.model.MyInfo;
import com.mints.goodmoney.mvp.model.SignCardBean;
import com.mints.goodmoney.mvp.model.UserBean;
......@@ -377,6 +378,14 @@ public interface LoanService {
@POST("api/getAutoUserHallBaseMsg")
Observable<BaseResponse<MyInfo>> getAutoUserHallBaseMsg();
/**
* 饭补
*
* @return
*/
@POST("api/getMealMsg")
Observable<BaseResponse<MealBean>> getMealMsg();
/**
* 默认http工厂
......
package com.mints.goodmoney.ui.activitys
import android.os.Bundle
import android.view.View
import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.TTNativeExpressManager
import com.mints.goodmoney.manager.TtCsjAdManager
import com.mints.goodmoney.mvp.model.MealBean
import com.mints.goodmoney.mvp.presenters.FoodSubsidyPresenter
import com.mints.goodmoney.mvp.views.FoodSubsidyView
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.widgets.StepView
import kotlinx.android.synthetic.main.activity_food_subsidy.*
/**
* 描述:饭补
* 作者:孟崔广
* 时间:2020/10/13 11:55
*/
class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyView, StepView.StepViewListener {
private val foodSubsidyPresenter by lazy { FoodSubsidyPresenter() }
private val ttNativeExpressManager by lazy { TTNativeExpressManager() }
private var curCoin = 0//点击的汽泡金币
override fun getContentViewLayoutID() = R.layout.activity_food_subsidy
override fun isApplyKitKatTranslucency() = false
override fun initViewsAndEvents() {
foodSubsidyPresenter.attachView(this)
initListener()
}
override fun onResume() {
super.onResume()
initExpress()
foodSubsidyPresenter.getMealMsg()
}
override fun onDestroy() {
super.onDestroy()
svWalk?.destoryAnim()
ttNativeExpressManager.onTTAdDestroy()
foodSubsidyPresenter.detachView()
}
private fun initListener() {
ivWalkBack.setOnClickListener(this)
svWalk.setStepViewListener(this)
}
override fun onClick(v: View) {
when (v.id) {
R.id.ivWalkBack -> {
finish()
}
}
}
override fun clickWater(water: Int, waterCoin: String) {
if (water == 0) {
// walkPresenter.clickForWalk()
} else {
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, curCoin)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_WALK_BUBBLE)
readyGo(AwardActivity::class.java, bundle)
}
}
/**
* 初始化信息iyc
*/
private fun initExpress() {
try {
ttNativeExpressManager.initTTAd(false)
ttNativeExpressManager.getNativeExpressInit(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WALK, flWalkAd, 320f, 0f)
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun getFoodSubsidySuc(data: MealBean) {
svWalk.setThreeBtnGone()
// curCoin = data.bubbleCoin
// for (i in 0 until data.bubbleCount) {
// svWalk.setWaterTextviewLayout(i + 1, 0)
// }
// svWalk.setWaterMaxProgress(data.maxWalk)
// svWalk.setWaterProgress(data.walk, data.maxWalk)
//
// // 是否可领取奖励
// if (data.isWalk) {
// svWalk.setTvDrinkBtnEnable()
// } else {
// svWalk.setTvDrinkBtnNone()
// }
// svWalk.setTvDrinkBtnText(data.walkText)
}
}
\ No newline at end of file
......@@ -65,7 +65,7 @@ class WalkActivity : BaseActivity(), View.OnClickListener, WalkView, StepView.St
override fun getWalkMsgSuc(data: WalkBean) {
svWalk.setThreeBtnGone()
curCoin = data.bubbleCoin
for (i in 0..data.bubbleCount - 1) {
for (i in 0 until data.bubbleCount) {
svWalk.setWaterTextviewLayout(i + 1, 0)
}
......@@ -104,8 +104,8 @@ class WalkActivity : BaseActivity(), View.OnClickListener, WalkView, StepView.St
*/
private fun initExpress() {
try {
ttNativeExpressManager.initTTAd( false)
ttNativeExpressManager.getNativeExpressInit( TtCsjAdManager.TT_AD_NATIVEEXPRESS_WALK, flWalkAd, 320f, 0f)
ttNativeExpressManager.initTTAd(false)
ttNativeExpressManager.getNativeExpressInit(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WALK, flWalkAd, 320f, 0f)
} catch (e: Exception) {
e.printStackTrace()
}
......
......@@ -14,17 +14,15 @@ import com.mints.goodmoney.mvp.presenters.HorizChannelPresenter
import com.mints.goodmoney.mvp.views.HorizChannelView
import com.mints.goodmoney.ui.activitys.AwardActivity
import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.mints.goodmoney.utils.LogUtil
import com.yilan.sdk.player.ylplayer.YLPlayerConfig
import com.yilan.sdk.player.ylplayer.callback.OnPlayerCallBack
import com.yilan.sdk.ui.category.ChannelFragment
import kotlinx.android.synthetic.main.fragment_horiz_channel.cdvvYilanTime
import kotlinx.android.synthetic.main.fragment_horiz_channel.vs_tips
import net.grandcentrix.tray.AppPreferences
import kotlinx.android.synthetic.main.fragment_horiz_channel.*
class HorizChannelFragment : BaseFragment(), HorizChannelView, View.OnClickListener {
private val TAG = HorizChannelFragment::class.java.simpleName
private val TAG = HorizChannelFragment::class.java.simpleName
class HorizChannelFragment : BaseFragment(), HorizChannelView, View.OnClickListener {
private val horizChannelPresenter by lazy { HorizChannelPresenter() }
......@@ -32,9 +30,6 @@ class HorizChannelFragment : BaseFragment(), HorizChannelView, View.OnClickListe
private var channelFragment: ChannelFragment? = null
private val videoMaxCount = 12 // 当前缓存视频id最大数
private val videoIdList by lazy { ArrayList<String>() }//记录播放的视频id
// 是否是第一次观看完视频
private var isFirstWatchVideo = true
private var isFirstLoadVideo = true // 首次加载视频初始化
......@@ -48,7 +43,6 @@ class HorizChannelFragment : BaseFragment(), HorizChannelView, View.OnClickListe
initChannelFragment()
initListener()
}
private fun initListener() {
......@@ -106,7 +100,6 @@ class HorizChannelFragment : BaseFragment(), HorizChannelView, View.OnClickListe
}
override fun onPause(p0: String?, p1: String?, p2: String?) {
LogUtil.d(TAG, "onPause pager:${p0}")
pauseDownloadTime()
}
......@@ -119,7 +112,6 @@ class HorizChannelFragment : BaseFragment(), HorizChannelView, View.OnClickListe
}
override fun onLoopComplete(pager: String?, videoID: String, taskID: String?, num: Int) {
addVedioIdList(videoID)
pauseDownloadTime()
}
......@@ -169,14 +161,12 @@ class HorizChannelFragment : BaseFragment(), HorizChannelView, View.OnClickListe
onResume()
}
super.onHiddenChanged(hidden)
channelFragment?.onHiddenChanged(hidden)
}
override fun onResume() {
super.onResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_CHANNEL) {
// 调用金币视频信息接口
horizChannelPresenter.getSmallHomeVedioBaseMsg()
......@@ -187,11 +177,12 @@ class HorizChannelFragment : BaseFragment(), HorizChannelView, View.OnClickListe
override fun onPause() {
super.onPause()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_CHANNEL) {
YLPlayerConfig.config().unRegisterPlayerCallback()
}
pauseDownloadTime()
channelFragment?.onPause()
// pauseDownloadTime()
}
/**
......@@ -201,27 +192,11 @@ class HorizChannelFragment : BaseFragment(), HorizChannelView, View.OnClickListe
cdvvYilanTime?.pause()
}
/**
* 将播放的id记录到list中
*/
private fun addVedioIdList(id: String) {
// 达到12个视频时 删除前10个记录
if (videoIdList.size >= videoMaxCount) {
videoIdList.subList(0, 10).clear()
}
if (!videoIdList.contains(id)) videoIdList.add(id)
}
/**
*用户主动暂时或网络异常结束后 重新加载倒计时红包
*/
private fun resumeDownloadTime(id: String) {
if (!TextUtils.isEmpty(id)) {
if (videoIdList.contains(id)) {
cdvvYilanTime?.pause()
return
}
if (!isAward) {
cdvvYilanTime?.resume()
}
......@@ -264,7 +239,6 @@ class HorizChannelFragment : BaseFragment(), HorizChannelView, View.OnClickListe
super.onDestroy()
cdvvYilanTime?.setCountDownVedioListener(null)
horizChannelPresenter.detachView()
}
......
......@@ -24,9 +24,14 @@ import com.mints.goodmoney.ui.widgets.PowerDialog
import com.mints.goodmoney.utils.LogUtil
import com.yilan.sdk.player.ylplayer.YLPlayerConfig
import com.yilan.sdk.player.ylplayer.callback.OnPlayerCallBack
import com.yilan.sdk.ui.configs.YLUIConfig
import com.yilan.sdk.ui.little.YLLittleVideoFragment
import com.yilan.sdk.ylad.YLAdListener
import kotlinx.android.synthetic.main.fragment_main_first.*
import net.grandcentrix.tray.AppPreferences
import kotlin.collections.ArrayList
private val TAG = MainFragment::class.java.simpleName
/**
* 描述:首页
......@@ -35,8 +40,6 @@ import net.grandcentrix.tray.AppPreferences
*/
class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
private val TAG = MainFragment::class.java.simpleName
private val homePresenter by lazy { HomePresenter() }
private val userManager by lazy { UserManager.getInstance() }
private val ps by lazy { AppPreferences(context) }
......@@ -78,6 +81,56 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
private fun initListener() {
cdvvYilanTime.setOnClickListener(this)
// 广告回调
YLUIConfig.getInstance().registerAdListener(object : YLAdListener {
override fun onSuccess(p0: String?, p1: Int, p2: String?, p3: String?) {
}
override fun onError(p0: String?, p1: Int, p2: String?, p3: Int, p4: String?, p5: String?) {
}
override fun onRenderError(p0: String?, p1: Int, p2: String?, p3: Int, p4: String?, p5: String?) {
}
override fun onShow(p0: String?, p1: Int, p2: String?, p3: String) {
resumeAdTime()
}
override fun onClick(p0: String?, p1: Int, p2: String?, p3: String?) {}
override fun onSkip(p0: String?, p1: Int, p2: String?, p3: String?) {}
override fun onTimeOver(p0: String?, p1: Int, p2: String?, p3: String?) {}
override fun onClose(p0: String?, p1: Int, p2: String?, p3: String?) {}
override fun onAdEmpty(p0: String?, p1: Int, p2: String?, p3: String?) {}
override fun onVideoStart(p0: String?, p1: Int, p2: String?, p3: String) {}
override fun onVideoPause(p0: String?, p1: Int, p2: String?, p3: String?) {
pauseDownloadTime()
}
override fun onVideoResume(p0: String?, p1: Int, p2: String?, p3: String?) {
resumeAdTime()
}
override fun onVideoComplete(p0: String?, p1: Int, p2: String?, p3: String?) {
pauseDownloadTime()
}
override fun onVideoError(p0: String?, p1: Int, p2: String?, p3: String?) {}
})
}
private fun resumeAdTime(){
// 视频未转满 且 界面切换时可继续加进度
if (!isAward) {
cdvvYilanTime?.resume()
}
}
override fun onHiddenChanged(hidden: Boolean) {
......@@ -117,9 +170,11 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
override fun onPause() {
super.onPause()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_MAIN) {
YLPlayerConfig.config().unRegisterPlayerCallback()
}
pauseDownloadTime()
littleVideoFragment?.onPause()
}
......@@ -132,6 +187,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
super.onDestroy()
cdvvYilanTime?.setCountDownVedioListener(null)
// 广告回调解绑
YLUIConfig.getInstance().unRegisterAdListener()
homePresenter.detachView()
}
......@@ -165,7 +222,6 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
AppConfig.ylhAdCount = data.vedioRules.ylH_VEDIO.surplus
LogUtil.d(TAG, "首页视频数:csjCount:${AppConfig.csjVedioAdCount} ylhCount:${AppConfig.ylhAdCount}")
// 调用金币视频信息接口
homePresenter.getHomeVedioMsg()
}
......@@ -234,30 +290,21 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
private fun registerPlayerCallBack() {
YLPlayerConfig.config().registerPlayerCallBack(object : OnPlayerCallBack {
override fun onStart(pager: String, videoid: String, p2: String?) {
if (TextUtils.equals(YLPlayerConfig.PAGE_LITTLE, "PAGE_LITTLE")) {
// 防止网络异常时, 第一次加载倒计时红包
if (isFirstLoadVedio) {
isFirstLoadVedio = false
initTimeview()
} else {
resumeDownloadTime(videoid)
}
LogUtil.d(TAG, "onStart videoid:${videoid}")
// 防止网络异常时, 第一次加载倒计时红包
if (isFirstLoadVedio) {
isFirstLoadVedio = false
initTimeview()
} else {
resumeDownloadTime(videoid)
}
}
override fun onPause(pager: String, p1: String?, p2: String?) {
LogUtil.d(TAG, "onPause pager:${pager}")
if (TextUtils.equals(YLPlayerConfig.PAGE_LITTLE, "PAGE_LITTLE")) {
pauseDownloadTime()
}
pauseDownloadTime()
}
override fun onResume(pager: String, videoid: String, p2: String?) {
if (TextUtils.equals(YLPlayerConfig.PAGE_LITTLE, "PAGE_LITTLE")) {
resumeDownloadTime(videoid)
}
resumeDownloadTime(videoid)
}
override fun onComplete(pager: String, videoid: String, p2: String?) {
......@@ -265,13 +312,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
override fun onLoopComplete(pager: String?, videoID: String, taskID: String?, num: Int) {
if (TextUtils.equals(YLPlayerConfig.PAGE_LITTLE, "PAGE_LITTLE")) {
addVedioIdList(videoID)
pauseDownloadTime()
LogUtil.d(TAG, "onLoopComplete pager:${pager} videoID:${videoID} taskID:${taskID} num:${num}")
}
addVedioIdList(videoID)
pauseDownloadTime()
}
override fun onStuckStart(pager: String, p1: String?, p2: String?) {
......@@ -281,17 +323,11 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
override fun onError(pager: String, p1: String?, p2: String?) {
if (TextUtils.equals(YLPlayerConfig.PAGE_LITTLE, "PAGE_LITTLE")) {
pauseDownloadTime()
}
pauseDownloadTime()
}
override fun onStop(pager: String, p1: String?, p2: String?) {
if (TextUtils.equals(YLPlayerConfig.PAGE_LITTLE, "PAGE_LITTLE")) {
pauseDownloadTime()
}
pauseDownloadTime()
}
})
}
......
......@@ -5,13 +5,9 @@ import androidx.viewpager.widget.ViewPager
import com.androidkun.xtablayout.XTabLayout
import com.mints.goodmoney.R
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.presenters.MyPresenter
import com.mints.goodmoney.ui.activitys.LoginActivity
import com.mints.goodmoney.ui.adapter.MessageFragAdapter
import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.mints.goodmoney.ui.fragment.base.LazyLoadBaseFragment
import com.mints.goodmoney.ui.widgets.tablayout.TabLayout
import com.mints.goodmoney.utils.LogUtil
import kotlinx.android.synthetic.main.fragment_main_money.*
import java.util.*
......@@ -24,7 +20,7 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
private var mainFragment: MainFragment? = null
private var curPosition = 0;//当前标签选中的下标
private var curPosition = 0//当前标签选中的下标
override fun getContentViewLayoutID() = R.layout.fragment_main_money
......@@ -59,12 +55,12 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
fragments.add(ZhangyueFragment())
//去除两侧应阴影
vpFragmentMoney.setOverScrollMode(ViewPager.OVER_SCROLL_NEVER)
vpFragmentMoney.overScrollMode = ViewPager.OVER_SCROLL_NEVER
vpFragmentMoney.offscreenPageLimit = tabs.size + 3
val adapter = MessageFragAdapter(childFragmentManager, fragments, tabs)
vpFragmentMoney.setAdapter(adapter)
vpFragmentMoney.adapter = adapter
xtFragmentMoney.setxTabDisplayNum(tabs.size)
xtFragmentMoney.setupWithViewPager(vpFragmentMoney)
xtFragmentMoney.addOnTabSelectedListener(this)
......@@ -81,10 +77,12 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
}
override fun onTabSelected(tab: XTabLayout.Tab) {
if (tab.position == 1 && !UserManager.getInstance().userIsLogin()) {
readyGo(LoginActivity::class.java)
vpFragmentMoney.currentItem = if (curPosition == 1) 0 else curPosition
return
if (tab.position == 1) {
if (!UserManager.getInstance().userIsLogin()) {
readyGo(LoginActivity::class.java)
vpFragmentMoney.currentItem = if (curPosition == 1) 0 else curPosition
return
}
}
// if (tab.position == 1) {
......
......@@ -411,50 +411,6 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
dataList.clear()
dataList.addAll(userConfig!!.autoList)
// // 跳转首页视频
// val task1 = TaskBean(R.mipmap.icon_my_coin, "分分钟赚金币,翻倍还能赚更多", "", "去赚钱", 1)
// // 邀好友赚金币
// var progressStrInvited = ""
// var btnStr = ""
// if (userConfig != null) {
// progressStrInvited = "(" + userConfig!!.taskShareFriend.complete + "/" + userConfig!!.taskShareFriend.max + ")"
// if (userConfig!!.taskShareFriend.complete == userConfig!!.taskShareFriend.max) {
// btnStr = "已完成"
// } else {
// btnStr = if (userConfig!!.taskShareFriend.status == 0) "去邀请" else "立即领取"
// }
// }
// val task2 = TaskBean(R.mipmap.icon_my_invite, "邀好友,赚金币", progressStrInvited, btnStr, 2)
// // 看福利视频赚金币
// var progressStrVideo = ""
// var task3Str = ""
// if (userConfig != null) {
// progressStrVideo = "(" + userConfig!!.taskVeido.complete + "/" + userConfig!!.taskVeido.max + ")"
// if (userConfig!!.taskVeido.complete == userConfig!!.taskVeido.max) {
// task3Str = "已完成"
// } else {
// task3Str = "赚金币"
// }
// }
// val task3 = TaskBean(R.mipmap.icon_my_video, "看福利视频赚金币", progressStrVideo, task3Str, 3)
// // 玩游戏,赚金币
// var task4Str = ""
// if (userConfig != null) {
// task4Str = if (userConfig!!.taskGame.status == 0) "赚金币" else (if (userConfig!!.taskGame.status == 1) "立即领取" else "已完成")
// }
// val task4 = TaskBean(R.mipmap.icon_my_game, "玩游戏,赚金币", "", task4Str, 4)
// // 小说免费看,金币大家赚
//// val task5 = TaskBean(R.mipmap.icon_my_fiction, "小说免费看,金币大家赚", "", "去阅读", 5)
// // 试玩平台
// val task6 = TaskBean(R.mipmap.icon_my_demo, "试玩平台", "", "赚金币", 5)
// dataList.add(task1)
// dataList.add(task2)
// dataList.add(task3)
// dataList.add(task4)
//// dataList.add(task5)
// dataList.add(task6)
mainMyAdapter?.notifyDataSetChanged()
}
......@@ -479,11 +435,6 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
// 邀好友赚金币
MainMyAdapter.APP_SHAREFRIEND -> {
if (taskBean.otherConfig != null) {
// if (taskBean.otherConfig.complete >= taskBean.otherConfig.max) {
// showToast("邀好友赚金币任务已完成,请明日再来")
// return
// }
when (taskBean.otherConfig.status) {
0 -> {
val wechatSp = ShareParams()
......@@ -502,12 +453,10 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
}
}
1 -> {
// if (taskBean.otherConfig.complete < taskBean.otherConfig.max) {
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, taskBean.otherConfig.coin)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CHALLENGE_SHAREFRIEND)
readyGo(AwardActivity::class.java, bundle)
// }
}
2 -> {
val wechatSp = ShareParams()
......@@ -538,10 +487,6 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
awardVedio(taskBean.otherConfig.coin)
}
// if (userConfig!!.taskVeido!!.complete >= userConfig!!.taskVeido!!.max) {
// showToast("看福利视频赚金币任务已完成,请明日再来")
// return
// }
}
// 玩游戏,赚金币
......@@ -562,14 +507,6 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
}
}
}
// if (taskBean.btnStr == "立即领取") {
// val bundle = Bundle()
// bundle.putInt(Constant.MAIN_CUR_COIN, userConfig?.taskGame?.coin!!)
// bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_GAME_ONLINE)
// readyGo(AwardActivity::class.java, bundle)
// } else {
// readyGo(LiebaoGameActivity::class.java)
// }
}
// 小说免费看,金币大家赚
// MainMyAdapter.TASK_TYPE_FICTION -> {
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/ic_video_enable" android:state_selected="true" />
<item android:drawable="@mipmap/ic_video_none" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:fadingEdge="none"
android:overScrollMode="never">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="@mipmap/bg_walk">
<ImageView
android:id="@+id/ivWalkBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:padding="15dp"
android:src="@drawable/yl_mp_ic_back_left" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="60dp"
android:src="@mipmap/ic_font_water" />
<com.mints.goodmoney.ui.widgets.MealView
android:id="@+id/svWalk"
android:layout_width="375dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="120dp" />
</FrameLayout>
<FrameLayout
android:id="@+id/flWalkAd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:background="@color/full_transparent">
</FrameLayout>
</LinearLayout>
</ScrollView>
......@@ -61,7 +61,7 @@
android:id="@+id/tab_iv_channel"
android:layout_width="25dp"
android:layout_height="25dp"
android:src="@drawable/tab_pan_btn" />
android:src="@drawable/tab_video_btn" />
<TextView
android:id="@+id/tab_tv_channel"
......
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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="match_parent"
android:background="@color/white"
......@@ -23,14 +22,14 @@
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:padding="15dp"
android:src="@drawable/yl_mp_ic_back_left"></ImageView>
android:src="@drawable/yl_mp_ic_back_left" />
<ImageView
android:layout_width="wrap_content"
android:src="@mipmap/ic_font_water"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="60dp"
android:layout_height="wrap_content"/>
android:src="@mipmap/ic_font_water" />
<com.mints.goodmoney.ui.widgets.StepView
android:id="@+id/svWalk"
......@@ -43,10 +42,10 @@
<FrameLayout
android:id="@+id/flWalkAd"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:background="@color/full_transparent">
</FrameLayout>
......
<?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"
android:layout_width="375dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="60dp"
android:layout_marginRight="60dp"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/tv_step"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textColor="#00895B"
android:textSize="24sp" />
<com.mints.goodmoney.ui.widgets.seekbar.BubbleSeekBar
android:id="@+id/bs_step"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
app:bsb_auto_adjust_section_mark="true"
app:bsb_max="6000"
app:bsb_min="0"
app:bsb_progress="0"
app:bsb_second_track_color="#00895B"
app:bsb_section_count="4"
app:bsb_section_text_position="below_section_mark"
app:bsb_show_section_mark="true"
app:bsb_show_section_text="true"
app:bsb_show_thumb_text="true"
app:bsb_thumb_text_size="18sp"
app:bsb_touch_to_seek="true"
app:bsb_track_color="@color/white"
app:bsb_track_size="4dp" />
</LinearLayout>
<RelativeLayout
android:id="@+id/rl_water_next"
android:layout_width="125dp"
android:layout_height="35dp"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginRight="2dp"
android:layout_marginBottom="15dp"
android:background="@drawable/shape_tv_app_write">
<TextView
android:id="@+id/tv_water_next"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="2dp"
android:background="@drawable/shape_water_btn"
android:gravity="center"
android:text="继续努力"
android:textColor="@color/color_8F6D21"
android:textSize="12sp" />
</RelativeLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="240dp">
<LinearLayout
android:id="@+id/ll_water_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="15dp"
android:orientation="vertical"
android:visibility="invisible">
<TextView
android:id="@+id/tv_water_one"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@mipmap/ic_water"
android:gravity="center"
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="3dp"
android:text="金币奖励"
android:visibility="gone"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_water_two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="10dp"
android:layout_marginRight="20dp"
android:orientation="vertical"
android:visibility="invisible">
<TextView
android:id="@+id/tv_water_two"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@mipmap/ic_water"
android:gravity="center"
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="3dp"
android:visibility="gone"
android:text="金币奖励"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_water_three"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="152dp"
android:orientation="vertical"
android:visibility="invisible">
<TextView
android:id="@+id/tv_water_three"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@mipmap/ic_water"
android:gravity="center"
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="3dp"
android:visibility="gone"
android:text="金币奖励"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_water_four"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="150dp"
android:layout_marginRight="10dp"
android:orientation="vertical"
android:visibility="invisible">
<TextView
android:id="@+id/tv_water_four"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
android:background="@mipmap/ic_water"
android:gravity="center"
android:textColor="@color/white"
android:textSize="10sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="3dp"
android:text="金币奖励"
android:visibility="gone"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
</FrameLayout>
<ImageView
android:layout_width="wrap_content"
android:src="@mipmap/ic_walk"
android:layout_gravity="center_horizontal"
android:layout_marginTop="100dp"
android:layout_height="wrap_content"/>
</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