Commit 0cc75c25 authored by mengcuiguang's avatar mengcuiguang

添加饭补

parent 3ddf99ac
......@@ -412,88 +412,89 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
}
override fun onClick(v: View) {
when (v.id) {
R.id.ivAwardBack -> {
finish()
}
R.id.tvAwardHigh -> {
when (superTaskStatus) {
// 播放激励视频,注册安装监听
0 -> {
// 是否开启应用使用情况权限
if (AppUtil.isOpenUsageStats()) {
registerBroad()
awardVideo()
} else {
AppTryPlayManager.openAppUsageStats(this)
}
}
// 下载完成,点击去试玩
1 -> {
if (mCurrentPkg == null) {
showToast("任务异常,请重试~")
awardPresenter.setHighTaskType("0")
} else {
if (AppUtil.checkPackInfo(mContext, mCurrentPkg!!)) {
AppTryPlayManager.toTryPlay(mCurrentPkg!!)
} else {
showToast("未找到当前APP、可能被卸载,请重试~")
}
}
}
// 试玩时间不足,继续试玩
2 -> {
if (mCurrentPkg == null) {
showToast("任务异常,请重试~")
awardPresenter.setHighTaskType("0")
} else {
if (AppUtil.checkPackInfo(mContext, mCurrentPkg!!)) {
AppTryPlayManager.toTryPlay(mCurrentPkg!!)
} else {
showToast("未找到当前APP、可能被卸载,请重试~")
}
}
}
// 试玩完成,领取奖励
3 -> {
val vo = HashMap<String, Any>()
vo["carrierType"] = Constant.CARRIER_HIGH_ACTIVITY
awardPresenter.reportAddCoinMsg(vo)
readyGoThenKill(DrawcashActivity::class.java)
}
}
}
R.id.tvAwardNext -> {
// 普通视频奖励 走公共下载监听
AppConfig.isSuperTask = false
superTaskStatus = 4
when (carrierType) {
// 只有看视频才能领金币
Constant.CARRIER_OFFLINE_DOUBLE, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD,
Constant.CARRIER_CHALLENGE_TURN, Constant.CARRIER_CHALLENGE_CARD,
Constant.CARRIER_WALK_BUBBLE, Constant.CARRIER_EATMEAL_SUBSIDY,
Constant.CARRIER_WALK, Constant.CARRIER_HOMEWATER -> {
awardVideo()
}
Constant.CARRIER_BLESSINGBAG_DOUBLE, Constant.CARRIER_CHALLENGE_SHAREFRIEND_DOUBLE,
Constant.CARRIER_HOMEVEDIO_DOUBLE, Constant.CARRIER_SMALLHOMEVEDIO_DOUBLE,
Constant.CARRIER_RUISHINEWS_DOUBLE -> {
// 翻倍载体上送友盟
pushUmengEvent()
awardVideo()
}
Constant.CARRIER_NEW_VISITOR -> {
readyGoThenKill(WxLoginActivity::class.java)
}
else -> {
finish()
}
}
}
}
finish()
// when (v.id) {
// R.id.ivAwardBack -> {
// finish()
// }
// R.id.tvAwardHigh -> {
// when (superTaskStatus) {
// // 播放激励视频,注册安装监听
// 0 -> {
// // 是否开启应用使用情况权限
// if (AppUtil.isOpenUsageStats()) {
// registerBroad()
// awardVideo()
// } else {
// AppTryPlayManager.openAppUsageStats(this)
// }
// }
// // 下载完成,点击去试玩
// 1 -> {
// if (mCurrentPkg == null) {
// showToast("任务异常,请重试~")
// awardPresenter.setHighTaskType("0")
//
// } else {
// if (AppUtil.checkPackInfo(mContext, mCurrentPkg!!)) {
// AppTryPlayManager.toTryPlay(mCurrentPkg!!)
// } else {
// showToast("未找到当前APP、可能被卸载,请重试~")
// }
// }
// }
// // 试玩时间不足,继续试玩
// 2 -> {
// if (mCurrentPkg == null) {
// showToast("任务异常,请重试~")
// awardPresenter.setHighTaskType("0")
// } else {
// if (AppUtil.checkPackInfo(mContext, mCurrentPkg!!)) {
// AppTryPlayManager.toTryPlay(mCurrentPkg!!)
// } else {
// showToast("未找到当前APP、可能被卸载,请重试~")
// }
// }
// }
// // 试玩完成,领取奖励
// 3 -> {
// val vo = HashMap<String, Any>()
// vo["carrierType"] = Constant.CARRIER_HIGH_ACTIVITY
// awardPresenter.reportAddCoinMsg(vo)
//
// readyGoThenKill(DrawcashActivity::class.java)
// }
// }
// }
// R.id.tvAwardNext -> {
// // 普通视频奖励 走公共下载监听
// AppConfig.isSuperTask = false
// superTaskStatus = 4
//
// when (carrierType) {
// // 只有看视频才能领金币
// Constant.CARRIER_OFFLINE_DOUBLE, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD,
// Constant.CARRIER_CHALLENGE_TURN, Constant.CARRIER_CHALLENGE_CARD,
// Constant.CARRIER_WALK_BUBBLE, Constant.CARRIER_EATMEAL_SUBSIDY,
// Constant.CARRIER_WALK, Constant.CARRIER_HOMEWATER -> {
// awardVideo()
// }
// Constant.CARRIER_BLESSINGBAG_DOUBLE, Constant.CARRIER_CHALLENGE_SHAREFRIEND_DOUBLE,
// Constant.CARRIER_HOMEVEDIO_DOUBLE, Constant.CARRIER_SMALLHOMEVEDIO_DOUBLE,
// Constant.CARRIER_RUISHINEWS_DOUBLE -> {
// // 翻倍载体上送友盟
// pushUmengEvent()
// awardVideo()
// }
// Constant.CARRIER_NEW_VISITOR -> {
// readyGoThenKill(WxLoginActivity::class.java)
// }
// else -> {
// finish()
// }
// }
// }
// }
}
/**
......
package com.wenshu.aiyuebao.ui.fragment
import android.os.Bundle
import com.wenshu.aiyuebao.R
import com.wenshu.aiyuebao.common.Constant
import com.wenshu.aiyuebao.mvp.model.MealBean
import com.wenshu.aiyuebao.mvp.presenters.FoodSubsidyPresenter
import com.wenshu.aiyuebao.mvp.views.FoodSubsidyView
import com.wenshu.aiyuebao.ui.activitys.AwardActivity
import com.wenshu.aiyuebao.ui.fragment.base.BaseFragment
import com.wenshu.aiyuebao.ui.widgets.MealView
import com.wenshu.aiyuebao.ui.widgets.StepView
import kotlinx.android.synthetic.main.fragment_food_subsidy.*
class FoodSubsidyFragment : BaseFragment(), FoodSubsidyView, StepView.StepViewListener, MealView.MealViewListener {
private val foodSubsidyPresenter by lazy { FoodSubsidyPresenter() }
private var curCoin = 0//点击的汽泡金币
private var buttonCoin = 0//点击的汽泡金币
private var isCanClickVideo = false
override fun getContentViewLayoutID() = R.layout.fragment_food_subsidy
override fun initViewsAndEvents() {
foodSubsidyPresenter.attachView(this)
initListener()
}
override fun onResume() {
super.onResume()
// initExpress()
foodSubsidyPresenter.getMealMsg()
}
override fun onDestroy() {
super.onDestroy()
svWalk?.destoryAnim()
// flSubsidykAd?.removeAllViews()
foodSubsidyPresenter.detachView()
}
private fun initListener() {
svWalk.setMealViewListener(this)
}
override fun clickWater(water: Int, waterCoin: String) {
if (water == 0) {
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, buttonCoin)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_EATMEAL)
readyGo(AwardActivity::class.java, bundle)
} else {
if (isCanClickVideo) {
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, curCoin)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_EATMEAL_SUBSIDY)
readyGo(AwardActivity::class.java, bundle)
svWalk.setCancelAnim(water)
} else {
val bundle = Bundle()
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_EATMEAL_SUBSIDY_NOT)
readyGo(AwardActivity::class.java, bundle)
}
}
// 预加载信息流
// TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_EAT)
}
/**
* 初始化信息iyc
*/
private fun initExpress() {
// try {
// if (TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout != null) {
// if (flSubsidykAd != null) {
// flSubsidykAd.removeAllViews()
// flSubsidykAd.addView(TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout)
// }
// }
// } catch (e: Exception) {
// e.printStackTrace()
// }
}
override fun getFoodSubsidySuc(data: MealBean) {
svWalk.setThreeBtnGone()
curCoin = data.vedioCoin
buttonCoin = data.buttonCoin
this.isCanClickVideo = data.isCanClickVedio
for (i in 0 until data.vedioCount) {
svWalk.setWaterTextviewLayout(i + 1, 0)
}
// 是否可领取奖励
if (data.isCanClickButton) {
svWalk.setTvDrinkBtnEnable()
} else {
svWalk.setTvDrinkBtnNone()
}
svWalk.setTvDrinkBtnText(data.buttonMsg)
}
}
\ No newline at end of file
......@@ -26,78 +26,78 @@
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/tab_rl_one"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.0"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/tab_iv_one"
android:layout_width="25dp"
android:layout_height="25dp"
android:src="@drawable/tab_loan_btn" />
<TextView
android:id="@+id/tab_tv_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/bottom_tab_main"
android:textColor="@drawable/item_txt_sel"
android:textSize="11sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/tab_rl_two"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.0"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/tab_iv_two"
android:layout_width="25dp"
android:layout_height="25dp"
android:src="@drawable/tab_video_btn" />
<TextView
android:id="@+id/tab_tv_two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/bottom_tab_channel"
android:textColor="@drawable/item_txt_sel"
android:textSize="11sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/tab_rl_three"
android:layout_width="0dp"
android:layout_height="75dp"
android:layout_gravity="bottom"
android:layout_weight="1.0">
<ImageView
android:layout_width="match_parent"
android:layout_height="70dp"
android:src="@mipmap/tab_pan_btn_big" />
<!-- <ImageView-->
<!-- android:id="@+id/tab_iv_pan"-->
<!-- android:layout_width="25dp"-->
<!-- android:layout_height="25dp"-->
<!-- android:src="@drawable/tab_pan_btn" />-->
<!-- <TextView-->
<!-- android:id="@+id/tab_tv_pan"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="@string/bottom_tab_pan"-->
<!-- android:textColor="@drawable/item_txt_sel"-->
<!-- android:textSize="11sp" />-->
</LinearLayout>
<!-- <LinearLayout-->
<!-- android:id="@+id/tab_rl_one"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="match_parent"-->
<!-- android:layout_weight="1.0"-->
<!-- android:gravity="center"-->
<!-- android:orientation="vertical">-->
<!-- <ImageView-->
<!-- android:id="@+id/tab_iv_one"-->
<!-- android:layout_width="25dp"-->
<!-- android:layout_height="25dp"-->
<!-- android:src="@drawable/tab_loan_btn" />-->
<!-- <TextView-->
<!-- android:id="@+id/tab_tv_one"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="@string/bottom_tab_main"-->
<!-- android:textColor="@drawable/item_txt_sel"-->
<!-- android:textSize="11sp" />-->
<!-- </LinearLayout>-->
<!-- <LinearLayout-->
<!-- android:id="@+id/tab_rl_two"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="match_parent"-->
<!-- android:layout_weight="1.0"-->
<!-- android:gravity="center"-->
<!-- android:orientation="vertical">-->
<!-- <ImageView-->
<!-- android:id="@+id/tab_iv_two"-->
<!-- android:layout_width="25dp"-->
<!-- android:layout_height="25dp"-->
<!-- android:src="@drawable/tab_video_btn" />-->
<!-- <TextView-->
<!-- android:id="@+id/tab_tv_two"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="@string/bottom_tab_channel"-->
<!-- android:textColor="@drawable/item_txt_sel"-->
<!-- android:textSize="11sp" />-->
<!-- </LinearLayout>-->
<!-- <LinearLayout-->
<!-- android:id="@+id/tab_rl_three"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="75dp"-->
<!-- android:layout_gravity="bottom"-->
<!-- android:layout_weight="1.0">-->
<!-- <ImageView-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="70dp"-->
<!-- android:src="@mipmap/tab_pan_btn_big" />-->
<!-- <ImageView-->
<!-- android:id="@+id/tab_iv_pan"-->
<!-- android:layout_width="25dp"-->
<!-- android:layout_height="25dp"-->
<!-- android:src="@drawable/tab_pan_btn" />-->
<!-- <TextView-->
<!-- android:id="@+id/tab_tv_pan"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="@string/bottom_tab_pan"-->
<!-- android:textColor="@drawable/item_txt_sel"-->
<!-- android:textSize="11sp" />-->
<!-- </LinearLayout>-->
<LinearLayout
android:id="@+id/tab_rl_four"
......
<?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:id="@+id/ll_food"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="360dp"
android:background="@mipmap/bg_eat">
<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_food"
android:visibility="gone" />
<com.wenshu.aiyuebao.ui.widgets.MealView
android:id="@+id/svWalk"
android:layout_width="375dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="80dp" />
</FrameLayout>
<!-- <FrameLayout-->
<!-- android:id="@+id/flSubsidykAd"-->
<!-- android:layout_width="340dp"-->
<!-- android:layout_height="340dp"-->
<!-- android:layout_gravity="center_horizontal"-->
<!-- android:layout_marginTop="20dp"-->
<!-- android:background="@color/color_0000" />-->
</LinearLayout>
</ScrollView>
......@@ -27,42 +27,48 @@
android:overScrollMode="never">
<LinearLayout
android:id="@+id/llMyRoot"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include layout="@layout/item_fragment_main_my_title" />
<LinearLayout
android:id="@+id/llMyRoot"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include layout="@layout/item_fragment_main_my_clock" />
<include layout="@layout/item_fragment_main_my_title" />
<FrameLayout
android:id="@+id/fl_my_banner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:background="@drawable/shape_bg_award"
android:visibility="gone" />
<include layout="@layout/item_fragment_main_my_clock" />
<include layout="@layout/item_divider_gray" />
<!-- <FrameLayout-->
<!-- android:id="@+id/fl_my_banner"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginStart="12dp"-->
<!-- android:layout_marginEnd="12dp"-->
<!-- android:background="@drawable/shape_bg_award"-->
<!-- android:visibility="gone" />-->
<include layout="@layout/item_fragment_main_my_promotions" />
<!-- <include layout="@layout/item_divider_gray" />-->
<include layout="@layout/item_divider_gray" />
<!-- <include layout="@layout/item_fragment_main_my_promotions" />-->
<include layout="@layout/view_title" />
<!-- <include layout="@layout/item_divider_gray" />-->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recy_my"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:nestedScrollingEnabled="false"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
<!-- <include layout="@layout/view_title" />-->
</LinearLayout>
<!-- <androidx.recyclerview.widget.RecyclerView-->
<!-- android:id="@+id/recy_my"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginStart="15dp"-->
<!-- android:layout_marginEnd="15dp"-->
<!-- android:nestedScrollingEnabled="false"-->
<!-- app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />-->
<!-- <include layout="@layout/item_fragment_main_my_customer_service" />-->
<!-- <include layout="@layout/item_fragment_main_my_customer_service" />-->
</LinearLayout>
......
......@@ -39,6 +39,7 @@
android:layout_height="50dp"
android:background="@drawable/btn_my_friends"
android:paddingLeft="16dp"
android:visibility="gone"
android:paddingRight="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
......
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