Commit 93a4e04d authored by mengcuiguang's avatar mengcuiguang

代码优化

parent e6ac82fb
......@@ -127,7 +127,7 @@
<!-- </activity>-->
<activity
android:name=".ui.activitys.SplashYlhActivity"
android:name=".ui.activitys.SplashActivity"
android:screenOrientation="portrait"
android:theme="@style/NormalSplash">
<intent-filter>
......
package com.mints.goodmoney.ui.fragment
import android.os.Bundle
import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant
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.AwardActivity
import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.mints.goodmoney.ui.widgets.MealView
import com.mints.goodmoney.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
......@@ -101,37 +101,37 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
return;
}
if (count == 0) {
// LogUtil.d("ForegroundOrBackground", System.currentTimeMillis() - leaveTime + " onActivityStarted");
// 60秒后打开应用 显示开屏广告
if (System.currentTimeMillis() - leaveTime >= 60000) {
if (isYlhSplash) {
isYlhSplash = false;
if (ylhIntent == null) {
// 优量汇广告
ylhIntent = new Intent(activity, SplashADActivity.class);
}
activity.startActivity(ylhIntent);
} else {
isYlhSplash = true;
if (csjIntent == null) {
// 快手广告
csjIntent = new Intent(activity, SplashCsjADActivity.class);
}
activity.startActivity(csjIntent);
// if (ksIntent == null) {
// if (count == 0) {
//// LogUtil.d("ForegroundOrBackground", System.currentTimeMillis() - leaveTime + " onActivityStarted");
// // 60秒后打开应用 显示开屏广告
// if (System.currentTimeMillis() - leaveTime >= 60000) {
//
// if (isYlhSplash) {
// isYlhSplash = false;
//
// if (ylhIntent == null) {
// // 优量汇广告
// ylhIntent = new Intent(activity, SplashADActivity.class);
// }
// activity.startActivity(ylhIntent);
// } else {
// isYlhSplash = true;
//
// if (csjIntent == null) {
// // 快手广告
// ksIntent = new Intent(activity, SplashKsADActivity.class);
// csjIntent = new Intent(activity, SplashCsjADActivity.class);
// }
// activity.startActivity(ksIntent);
}
}
}
// activity.startActivity(csjIntent);
//
//// if (ksIntent == null) {
//// // 快手广告
//// ksIntent = new Intent(activity, SplashKsADActivity.class);
//// }
//// activity.startActivity(ksIntent);
// }
//
// }
// }
count++;
}
......
......@@ -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.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="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,55 +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" />
<include layout="@layout/item_divider_gray" />
<include layout="@layout/item_fragment_main_my_clock" />
<include layout="@layout/item_fragment_main_my_promotions" />
<!-- <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_divider_gray" />
<!-- <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" />-->
<com.mints.goodmoney.ui.widgets.BannerView
android:id="@+id/banner_view"
android:layout_width="match_parent"
android:layout_height="150dp"
android:visibility="gone"
app:bannerAnimDuration="1500"
app:bannerAnimScroll="true"
app:bannerAutoScroll="true"
app:bannerPageAlpha="0"
app:bannerPageMargin="0dp"
app:bannerPagePercent="1"
app:bannerScrollDuration="5000"/>
<include layout="@layout/view_title" />
<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_divider_gray" />-->
<!-- <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>
......
......@@ -35,6 +35,7 @@
app:layout_constraintTop_toTopOf="parent" />
<RelativeLayout
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:background="@drawable/btn_my_friends"
......@@ -52,6 +53,7 @@
android:drawableTop="@mipmap/ic_friends"
android:text="平台分红"
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="bold" />
</RelativeLayout>
......
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