Commit 896814b5 authored by mengcuiguang's avatar mengcuiguang

修改早起打卡,代码优化

parent 495d7baf
......@@ -202,11 +202,11 @@ dependencies {
// TalkingDada
implementation files('libs/SaaS_AppAnalytics_Android_SDK_V4.0.36.jar')
// 一览视频
implementation("com.yilan.sdk:ui:2.8.0.12") {
implementation("com.yilan.sdk:ui:3.0.0.3") {
exclude group: 'com.yilan.sdk', module: 'toutiao'
exclude group: 'com.yilan.sdk', module: 'gdt'
}
implementation ("com.yilan.sdk:ad:2.8.0.12"){
implementation ("com.yilan.sdk:ad:3.0.0.3"){
exclude group: 'com.yilan.sdk', module: 'toutiao'
exclude group: 'com.yilan.sdk', module: 'gdt'
}
......
......@@ -19,6 +19,8 @@ import com.mints.goodmoney.utils.MD5;
import com.mints.goodmoney.utils.SPUtil;
import com.mints.library.utils.json.JsonUtil;
import net.grandcentrix.tray.AppPreferences;
import java.util.HashMap;
/**
......@@ -27,7 +29,7 @@ import java.util.HashMap;
public class CsjVedioAdManager extends BaseVideoAd {
private static CsjVedioAdManager _inst;
private SPUtil spUtil;
private AppPreferences ps;
private int curCoin;
private String extraId;
private CsjVedioAdPresenter csjVedioAdPresenter;
......@@ -57,7 +59,7 @@ public class CsjVedioAdManager extends BaseVideoAd {
private void init(Activity activity) {
this.activity = activity;
spUtil = SPUtil.getInstance();
ps = new AppPreferences(activity);
userManager = UserManager.getInstance();
TTNativeExpressManager ttNativeExpressManager = new TTNativeExpressManager();
......@@ -234,8 +236,8 @@ public class CsjVedioAdManager extends BaseVideoAd {
vo.put("adtype", Constant.ADTYPE_VEDIO);
vo.put("tid", tid);
vo.put("adsource", Constant.AD_SOURCE_CSJ);
if (spUtil != null) {
vo.put("ip", spUtil.getString(Constant.CSJ_VEDIO_APPIP));
if (ps != null) {
vo.put("ip", ps.getString(Constant.CSJ_VEDIO_APPIP, ""));
}
switch (carrierType) {
......
......@@ -25,7 +25,7 @@ public class FriendHallMsgBean implements Serializable {
private String periods;
private String cashMsg;
private double contribution_today;
private String cash;
private double cash;
private int status;
private int friendCount;
private int directFriendsCount;
......@@ -123,11 +123,11 @@ public class FriendHallMsgBean implements Serializable {
this.contribution_today = contribution_today;
}
public String getCash() {
public double getCash() {
return cash;
}
public void setCash(String cash) {
public void setCash(double cash) {
this.cash = cash;
}
......
......@@ -128,6 +128,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
}
Constant.CARRIER_SIGNIN_HOMEPAGE_AWARD -> {
tvAwardContent.setText("签到奖励" + curCoin + "金币")
tvAwardNext.setText("看视频最高可得3倍金币奖励")
}
Constant.CARRIER_EATMEAL_SUBSIDY_NOT -> {
tvAwardContent.setText("还未到吃饭时间")
......@@ -141,7 +142,11 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
}
tvAwardNext.setText("我知道了")
}
Constant.CARRIER_SIGNIN_HOMEPAGE_CARD,
Constant.CARRIER_SIGNIN_HOMEPAGE_CARD -> {
tvAwardContent.text = "奖励金币已发放"
tvAwardNext.visibility = View.GONE
tvAwardHint.visibility = View.GONE
}
Constant.CARRIER_CHALLENGE_TURN, Constant.CARRIER_CHALLENGE_CARD,
Constant.CARRIER_WALK_BUBBLE, Constant.CARRIER_EATMEAL_SUBSIDY,
Constant.CARRIER_WALK, Constant.CARRIER_HOMEWATER -> {
......
......@@ -14,8 +14,6 @@ import com.mints.goodmoney.mvp.views.MorningClockView
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.adapter.MorningClockAdapter
import kotlinx.android.synthetic.main.activity_morning_clock.*
import kotlinx.android.synthetic.main.activity_water.*
import kotlinx.android.synthetic.main.header_layout.*
/**
* 描述:早起打卡
......@@ -69,15 +67,21 @@ class MorningClockActivity : BaseActivity()
override fun getUpEarlySignMsgSuc(data: MorningClockBean) {
morningClockList = data.targetList
tvMorningClockClick.isEnabled = data.isCanClick
tvMorningClockClick.text=data.buttonMsg
if (data.isCanClick) {
tvMorningClockClick.setBackground(resources.getDrawable(R.drawable.shape_water_btn))
tvMorningClockClick.isEnabled = true
} else {
tvMorningClockClick.setBackground(resources.getDrawable(R.drawable.shape_tv_gold_none))
tvMorningClockClick.isEnabled = false
}
tvMorningClockClick.text = data.buttonMsg
initRvView()
}
private fun initRvView() {
if (morningClockList != null && morningClockList!!.size > 0) {
val gridLayoutManager = GridLayoutManager(this, 4)
val gridLayoutManager = GridLayoutManager(this, 2)
rvMorningClock.layoutManager = gridLayoutManager
morningClockAdapter = MorningClockAdapter(morningClockList!!)
rvMorningClock.adapter = morningClockAdapter
......
......@@ -18,7 +18,6 @@ class MorningClockAdapter(val morningClockList: MutableList<MorningClockBean.Mor
lateinit var mOnItemClickListener: OnItemClickListener
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val rlMorningClockItemRoot: LinearLayout = view.findViewById(R.id.rlMorningClockItemRoot)
val tvMorningClockItemDay: TextView = view.findViewById(R.id.tvMorningClockItemDay)
val tvMorningClockItemCoin: TextView = view.findViewById(R.id.tvMorningClockItemCoin)
val tvMorningClockItemStatus: TextView = view.findViewById(R.id.tvMorningClockItemStatus)
......@@ -33,7 +32,7 @@ class MorningClockAdapter(val morningClockList: MutableList<MorningClockBean.Mor
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val morningClockBean = morningClockList[position]
holder.tvMorningClockItemDay.text = morningClockBean.needDays.toString()
holder.tvMorningClockItemDay.text = "${morningClockBean.needDays}天\n连续打卡"
holder.tvMorningClockItemCoin.text = "${morningClockBean.coin}金币"
holder.tvMorningClockItemStatus.text = morningClockBean.buttonMsg
......
......@@ -204,15 +204,12 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
}
private fun generateData(data: FriendHallMsgBean) {
if (TextUtils.isEmpty(data.button)) {
btn_get_bonus.text = "结算中"
}
friends_sum.text = "" + data.friendCount
friends_directly_sum.text = "" + data.directFriendsCount
friends_indirect_sum.text = "" + data.indirectFriendsCount
btn_get_bonus.isEnabled = data.status == 0 && data.cash.toInt() > 0
btn_get_bonus.text = data.button
btn_get_bonus.isEnabled = data.status == 0 && data.cash > 0
tv_bonus_date.text = data.periods
......
......@@ -18,8 +18,6 @@ import com.mints.goodmoney.mvp.model.UserTaskMsgBean
import com.mints.goodmoney.mvp.presenters.HomePresenter
import com.mints.goodmoney.mvp.views.HomeView
import com.mints.goodmoney.ui.activitys.AwardActivity
import com.mints.goodmoney.ui.activitys.LoginActivity
import com.mints.goodmoney.ui.activitys.MainActivity
import com.mints.goodmoney.ui.activitys.WebActivity
import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.mints.goodmoney.ui.widgets.DialogListener
......@@ -33,7 +31,6 @@ 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
/**
* 描述:首页
......@@ -213,21 +210,26 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
userMsgBean = data
// 保存Ip,用于穿山甲回调校验
ps.put(Constant.CSJ_VEDIO_APPIP, "")
// 放到个人中心展示 防止首页红包转动异常
// 新人福利
if (data.userMsg.firstGiveCoin > 0) {
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, data.userMsg.firstGiveCoin)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_NEW_USER)
readyGo(AwardActivity::class.java, bundle)
} else {
// 离线收益
if (data.offlineBean.offlineIncome > 0) {
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, data.offlineBean.offlineIncome)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_OFFLINE_DOUBLE)
readyGo(AwardActivity::class.java, bundle)
}
}
// if (data.userMsg.firstGiveCoin > 0) {
// val bundle = Bundle()
// bundle.putInt(Constant.MAIN_CUR_COIN, data.userMsg.firstGiveCoin)
// bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_NEW_USER)
// readyGo(AwardActivity::class.java, bundle)
// } else {
// // 离线收益
// if (data.offlineBean.offlineIncome > 0) {
// val bundle = Bundle()
// bundle.putInt(Constant.MAIN_CUR_COIN, data.offlineBean.offlineIncome)
// bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_OFFLINE_DOUBLE)
// readyGo(AwardActivity::class.java, bundle)
// }
// }
// 设置视频权限
vedioAdingManager?.initAdWeight(data.vedioRules.csJ_VEDIO.rate, data.vedioRules.ylH_VEDIO.rate)
......
......@@ -67,6 +67,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
private var hotList: List<BannerBean.ListBean>? = arrayListOf()
// 当天签到金币
private var carrierType = ""
private var curSignCoin = 50
// 签到信息
......@@ -338,26 +339,10 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
val finalSignStatus = signStatus
item_clock_signview.setSignViewListener { day ->
if (nowDate == day) {
RxPermissions(requireActivity())
.request(Manifest.permission.READ_PHONE_STATE, Manifest.permission.READ_EXTERNAL_STORAGE)
.subscribe { granted: Boolean ->
if (granted) {
// if (userManager.adShowFlag) {
// if (finalSignStatus == 0) {
// myPresenter.signInHomePage()
// } else
if (finalSignStatus == 1) {
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, curSignCoin * 2)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD)
readyGo(AwardActivity::class.java, bundle)
}
// }
} else {
showMissingPermissionDialog("设备、储存")
}
}
if (finalSignStatus == 1) {
carrierType = Constant.CARRIER_SIGNIN_HOMEPAGE_CARD
awardVedio(curSignCoin * 2, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD)
}
}
}
}
......@@ -487,7 +472,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
return
}
awardVedio(taskBean.otherConfig.coin)
awardVedio(taskBean.otherConfig.coin, Constant.CARRIER_VERSUS_VIDEO)
}
}
......@@ -635,7 +620,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
/**
* 获取激励视频
*/
private fun awardVedio(coin: Int) {
private fun awardVedio(coin: Int, carrierType: String) {
if (vedioAdingManager.vedioFinishFlag) {
showToast("今日视频已看完,请明天再来吧")
return
......@@ -644,7 +629,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
showLoading("加载中...")
val bean = VedioAdingBean()
bean.carrierType = Constant.CARRIER_VERSUS_VIDEO
bean.carrierType = carrierType
bean.curCoin = coin
loadVedio(vedioAdingManager, bean, true)
......@@ -686,13 +671,18 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
private fun vedioAdingSuccess(adType: String) {
val bundle = Bundle()
if (TextUtils.equals(carrierType, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD)) {
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD)
readyGo(AwardActivity::class.java, bundle)
return
}
for (autoListBean in userConfig!!.autoList) {
if (autoListBean.baseConfig.taskId == MainMyAdapter.APP_VEDIO) {
if (autoListBean.otherConfig != null) {
bundle.putInt(Constant.MAIN_CUR_COIN, autoListBean.otherConfig.coin)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_VERSUS_VIDEO)
readyGo(AwardActivity::class.java, bundle)
return
}
}
......
......@@ -20,7 +20,7 @@ public class MyViewPager extends ViewPager
// TODO Auto-generated constructor stub
}
private boolean isCanScroll = true;
private boolean isCanScroll = false;
public void setCanScroll(boolean isCanScroll)
{
......
......@@ -2,7 +2,7 @@
<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:background="@color/order_hint_color"
android:fadingEdge="none"
android:overScrollMode="never">
......@@ -12,10 +12,9 @@
android:orientation="vertical">
<FrameLayout
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="340dp"
android:background="@mipmap/bg_walk">
android:background="@mipmap/bg_morning_clock">
<ImageView
android:id="@+id/ivMorningClockBack"
......@@ -29,32 +28,66 @@
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" />
android:layout_marginTop="50dp"
android:src="@mipmap/ic_font_morning_clock" />
<RelativeLayout
android:layout_width="140dp"
android:layout_height="40dp"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginBottom="20dp"
android:background="@drawable/shape_tv_app_write">
<TextView
android:id="@+id/tvMorningClockClick"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="2dp"
android:background="@drawable/shape_tv_gold_none"
android:enabled="false"
android:gravity="center"
android:textColor="@color/water_hint_btn"
android:textSize="14sp" />
</RelativeLayout>
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:layout_marginRight="10dp"
android:background="@drawable/shape_bg_write"
android:orientation="vertical">
<TextView
android:id="@+id/tvMorningClockClick"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="200dp"
android:enabled="false"></TextView>
android:layout_margin="14dp"
android:drawablePadding="6dp"
android:gravity="center_vertical"
android:text="打卡领金币"
android:textColor="@color/black"
android:textSize="14sp" />
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvMorningClock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="14dp"
android:layout_marginRight="14dp"
android:layout_marginBottom="14dp"
android:background="@null"
android:overScrollMode="never" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvMorningClock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:background="@null"
android:overScrollMode="never" />
</LinearLayout>
<FrameLayout
android:id="@+id/flMorningClockAd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_gravity="center_horizontal"
android:background="@color/full_transparent">
......
......@@ -122,15 +122,15 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/dot"
android:textSize="16sp" />
android:textSize="14sp" />
<TextView
android:id="@+id/tv_bonus_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:textSize="14sp" />
android:textSize="12sp" />
</RelativeLayout>
......@@ -186,7 +186,8 @@
android:id="@+id/tv_yesterday_bonus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:gravity="right"
android:paddingRight="10dp"
android:text="@string/dot"
android:textSize="20sp" />
......@@ -194,7 +195,8 @@
android:id="@+id/tv_today_bonus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:gravity="right"
android:paddingRight="10dp"
android:text="@string/dot"
android:textSize="20sp" />
......@@ -234,7 +236,8 @@
android:layout_marginStart="20dp"
android:layout_marginEnd="5dp"
android:background="@drawable/btn_friends_selectored"
android:text="提现"
android:text="结算中"
android:enabled="false"
android:textColor="@drawable/btn_friends_text_color_selectored"
android:textSize="12sp" />
......
......@@ -2,44 +2,63 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/rlMorningClockItemRoot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:background="@drawable/shape_morning_clock"
android:layout_gravity="center_horizontal"
android:layout_margin="6dp"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/tvMorningClockItemDay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:textSize="12sp"
android:textColor="@color/ban_transparent"
android:text="7天" />
<TextView
android:id="@+id/tvMorningClockItemCoin"
<LinearLayout
android:background="@mipmap/bg_item_morning_clock_top"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:gravity="center"
android:textColor="@color/black"
android:textSize="14sp"
android:text="1600金币" />
android:orientation="horizontal">
<TextView
android:id="@+id/tvMorningClockItemStatus"
<TextView
android:id="@+id/tvMorningClockItemDay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="7天\n连续打卡"
android:gravity="center"
android:textColor="@color/color_FCCCAC"
android:textSize="12sp" />
<View
android:layout_width="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_height="24dp"
android:background="@color/red"></View>
<TextView
android:id="@+id/tvMorningClockItemCoin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="1600金币"
android:textColor="@color/color_FCCCAC"
android:textSize="12sp" />
</LinearLayout>
<RelativeLayout
android:background="@mipmap/bg_item_morning_clock_bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginBottom="14dp"
android:textSize="14sp"
android:textColor="@color/black"
android:text="领取" />
android:layout_height="wrap_content">
<TextView
android:layout_centerInParent="true"
android:id="@+id/tvMorningClockItemStatus"
android:layout_width="wrap_content"
android:gravity="center"
android:layout_marginTop="6dp"
android:layout_marginBottom="6dp"
android:layout_height="wrap_content"
android:text="领取"
android:background="@mipmap/bg_item_morning_clock_status"
android:textColor="@color/color_994B23"
android:textSize="12sp" />
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
......@@ -101,7 +101,7 @@
<color name="main_nor_color">#BEC2CC</color>
<color name="person_hint_color">#D4D5DE</color>
<color name="loan_hint_color">#B8BAC6</color>
<color name="order_hint_color">#E8E8E8</color>
<color name="order_hint_color">#50E8E8E8</color>
<color name="loan_year_color">#FF2326</color>
<color name="dialog_text_color">#030303</color>
<color name="mian_text_color">#D4D5DE</color>
......@@ -136,4 +136,6 @@
<color name="color_FAF6E8">#FAF6E8</color>
<color name="color_F3E7C5">#F3E7C5</color>
<color name="color_E1B867">#E1B867</color>
<color name="color_FCCCAC">#FCCCAC</color>
<color name="color_994B23">#994B23</color>
</resources>
\ 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