Commit fde0f721 authored by jyx's avatar jyx

任务列表UI修改

parent 46e96719
......@@ -4,7 +4,6 @@ import android.app.Activity
import android.os.Handler
import android.os.Looper
import android.text.TextUtils
import android.util.Log
import android.view.KeyEvent
import android.view.View
import android.view.ViewGroup
......@@ -21,7 +20,6 @@ import com.mints.library.utils.CommonUtils
import com.qq.e.ads.splash.SplashAD
import com.qq.e.ads.splash.SplashADListener
import com.qq.e.comm.util.AdError
import kotlinx.android.synthetic.main.activity_splash_ylh.*
import net.grandcentrix.tray.AppPreferences
/**
......
......@@ -33,9 +33,9 @@ class FriendsPagerAdapter(recyList: MutableList<RecyclerView>)
override fun getPageTitle(position: Int): CharSequence? {
return if (position == 0) {
"贡献榜"
"昨日贡献榜"
} else {
"收益榜"
"今日收益榜"
}
}
}
\ No newline at end of file
......@@ -80,11 +80,7 @@ class InvitedAdapter(context: Context, invitedData: MutableList<FriendHallMsgBea
}
val data = invitedData[position]
GlideUtils.loadCircleImageView(mContext, data.head, holder.ivAvatar, R.mipmap.ic_avatar_ph, R.mipmap.ic_avatar_ph)
if (data.name != null) {
holder.tvName.text = data.name.substring(0, data.name.length - 1) + "*"
} else {
holder.tvName.text = data.name
}
holder.tvCoin.text = "" + data.contribution
......
......@@ -6,6 +6,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.ProgressBar
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.mints.goodmoney.R
......@@ -54,12 +55,14 @@ class MainMyAdapter(context: Context, taskData: MutableList<TaskBean>) : Recycle
mOnItemChildClickListener?.onItemChildClick(it2, position)
}
holder.itemTaskTitle.text = taskBean.title
holder.itemTaskImg.setImageDrawable(mContext.resources.getDrawable(taskBean.imageSrc))
holder.itemTaskContent.text = taskBean.title
// holder.itemTaskImg.setImageDrawable(mContext.resources.getDrawable(taskBean.imageSrc))
if (taskBean.btnStr.isEmpty()) {
holder.itemTaskClick.visibility = View.GONE
} else {
holder.itemTaskClick.visibility = View.VISIBLE
holder.itemTaskClick.text = taskBean.btnStr
holder.itemTaskPb.progress = 10
when (taskBean.btnStr) {
"立即领取" -> {
holder.itemTaskClick.setBackgroundResource(R.drawable.shape_btn_orange_complete)
......@@ -89,10 +92,12 @@ class MainMyAdapter(context: Context, taskData: MutableList<TaskBean>) : Recycle
}
private inner class TaskHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val itemTaskImg: ImageView = itemView.findViewById(R.id.item_title_img)
// val itemTaskImg: ImageView = itemView.findViewById(R.id.item_title_img)
val itemTaskTitle: TextView = itemView.findViewById(R.id.item_task_title)
val itemTaskProgress: TextView = itemView.findViewById(R.id.item_task_progress)
val itemTaskClick: TextView = itemView.findViewById(R.id.item_task_click)
val itemTaskContent: TextView = itemView.findViewById(R.id.item_task_content)
val itemTaskPb: ProgressBar = itemView.findViewById(R.id.item_task_pb)
}
fun setOnItemChildClickListener(listener: OnItemChildClickListener) {
......
......@@ -18,7 +18,6 @@ import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.mints.goodmoney.utils.SpanUtils
import com.scwang.smartrefresh.layout.api.RefreshLayout
import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import kotlinx.android.synthetic.main.banner_view.*
import kotlinx.android.synthetic.main.fragment_main_friends.*
import kotlinx.android.synthetic.main.header_layout.*
......@@ -147,15 +146,18 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
}
private fun generateData(data: FriendHallMsgBean) {
if (data.button != null) {
btn_get_bonus.text = data.button
if (TextUtils.isEmpty(data.button)) {
btn_get_bonus.text = "结算中"
}
tv_bonus_date.text = "分红福利奖池-" + data.periods
btn_get_bonus.isEnabled = data.status == 0 && data.cash.toInt() > 0
tv_bonus_date.text = data.periods
tv_bonus_sum.text = SpanUtils()
.append("预计总分红 ").setFontSize(32).setForegroundColor(resources.getColor(R.color.black))
.append("预计总分红 ").setForegroundColor(resources.getColor(R.color.black))
.append(data.titleMsg).setFontSize(52).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.append(" 元").setFontSize(32).setForegroundColor(resources.getColor(R.color.black))
.append(" 元").setForegroundColor(resources.getColor(R.color.black))
.create()
tv_yesterday_bonus.text = SpanUtils()
......@@ -163,7 +165,7 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
.create()
tv_today_bonus.text = SpanUtils()
.append(data.contribution_today.toString()).setForegroundColor(resources.getColor(R.color.color_FF7C00))
.append(data.contribution_today.toString()).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.create()
tv_bonus_money.text = SpanUtils()
......@@ -172,8 +174,8 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
.create()
tv_bonus_rate.text = SpanUtils()
.append("昨日汇率:").setFontSize(32).setForegroundColor(resources.getColor(R.color.black))
.append(data.rate).setFontSize(32).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.append("昨日汇率:").setForegroundColor(resources.getColor(R.color.black))
.append(data.rate).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.create()
}
......
package com.mints.goodmoney.ui.fragment
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.text.TextUtils
import android.view.View
import android.widget.ImageView
import androidx.fragment.app.FragmentTransaction
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.video.VedioAdingManager
......@@ -21,9 +22,9 @@ import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.mints.goodmoney.ui.widgets.DialogListener
import com.mints.goodmoney.ui.widgets.PowerDialog
import com.mints.goodmoney.utils.LogUtil
import com.mints.library.utils.json.JsonUtil
import com.yilan.sdk.player.UserCallback
import com.yilan.sdk.ui.littlevideo.LittleVideoFragment
import com.yilan.sdk.player.ylplayer.YLPlayerConfig
import com.yilan.sdk.player.ylplayer.callback.OnPlayerCallBack
import com.yilan.sdk.ui.little.YLLittleVideoFragment
import kotlinx.android.synthetic.main.fragment_main_first.*
import net.grandcentrix.tray.AppPreferences
......@@ -44,7 +45,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
// 视频相关
private var bigRewardCoin = 0 // 大红包
private var smallRewardCoin = 0 // 小红包
private var littleVideoFragment: LittleVideoFragment? = null
private var littleVideoFragment: YLLittleVideoFragment? = null
private val VEDIO_MAX_COUNT = 12 // 当前缓存视频id最大数
private val vedioIdList by lazy { ArrayList<String>() }//记录播放的视频id
private var isFirstLoadVedio = true // 首次加载视频初始化
......@@ -132,7 +133,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
super.onDestroy()
cdvvYilanTime?.setCountDownVedioListener(null)
littleVideoFragment?.setUserCallBack(null)
// littleVideoFragment?.setUserCallBack(null)
YLPlayerConfig.config().unRegisterPlayerCallback()
homePresenter.detachView()
}
......@@ -231,43 +233,86 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
private fun showLittle() {
val transaction: FragmentTransaction = supportFragmentManager.beginTransaction()
if (littleVideoFragment == null) {
littleVideoFragment = LittleVideoFragment.newInstance()
transaction.add(R.id.yilan_fragment_frame_container, littleVideoFragment!!, LittleVideoFragment::class.java.simpleName)
littleVideoFragment = YLLittleVideoFragment.newInstance()
transaction.add(R.id.yilan_fragment_frame_container, littleVideoFragment!!, YLLittleVideoFragment::class.java.simpleName)
// 设置点击的item播放状态,callback返回true标识用户已经处理了event,返回false,标识使用播放器内部逻辑处理event。
littleVideoFragment!!.setUserCallBack { type, data, _ -> //播放状态 type
//播放的数据,可能为null data
//哪个播放器ß playerHash
when (type) {
com.yilan.sdk.player.utils.Constant.STATE_PREPARED -> {
YLPlayerConfig.config().registerPlayerCallBack(object : OnPlayerCallBack {
override fun onStart(p0: String?, videoid: String, p2: String?) {
// 防止网络异常时, 第一次加载倒计时红包
if (isFirstLoadVedio) {
isFirstLoadVedio = false
initTimeview()
}
vedioId = data.videoId
vedioId = videoid
}
com.yilan.sdk.player.utils.Constant.STATE_ERROR -> {
override fun onPause(p0: String?, p1: String?, p2: String?) {
pauseDownloadTime()
}
com.yilan.sdk.player.utils.Constant.STATE_PLAYING -> {
resumeDownloadTime(data.videoId)
override fun onResume(p0: String?, videoid: String, p2: String?) {
resumeDownloadTime(videoid)
}
com.yilan.sdk.player.utils.Constant.STATE_COMPLETE -> {
addVedioIdList(data.videoId)
override fun onComplete(p0: String?, videoid: String, p2: String?) {
addVedioIdList(videoid)
pauseDownloadTime()
}
com.yilan.sdk.player.utils.Constant.STATE_PAUSED -> {
pauseDownloadTime()
override fun onLoopComplete(p0: String?, p1: String, p2: String?, p3: Int) {
}
override fun onStuckStart(p0: String?, p1: String?, p2: String?) {
}
override fun onStuckEnd(p0: String?, p1: String?, p2: String?) {
}
override fun onError(p0: String?, p1: String?, p2: String?) {
pauseDownloadTime()
}
false
override fun onStop(p0: String?, p1: String?, p2: String?) {
}
})
// littleVideoFragment!!.setUserCallBack { type, data, _ -> //播放状态 type
// //播放的数据,可能为null data
// //哪个播放器ß playerHash
// when (type) {
// com.yilan.sdk.player.utils.Constant.STATE_PREPARED -> {
// // 防止网络异常时, 第一次加载倒计时红包
// if (isFirstLoadVedio) {
// isFirstLoadVedio = false
// initTimeview()
// }
//
// vedioId = data.videoId
// }
// com.yilan.sdk.player.utils.Constant.STATE_ERROR -> {
//
// pauseDownloadTime()
// }
// com.yilan.sdk.player.utils.Constant.STATE_PLAYING -> {
//
// resumeDownloadTime(data.videoId)
// }
//
// com.yilan.sdk.player.utils.Constant.STATE_COMPLETE -> {
//
// addVedioIdList(data.videoId)
// pauseDownloadTime()
// }
// com.yilan.sdk.player.utils.Constant.STATE_PAUSED -> {
//
// pauseDownloadTime()
// }
// }
// false
// }
} else {
transaction.show(littleVideoFragment!!)
}
......@@ -326,11 +371,11 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
private fun initTimeview() {
cdvvYilanTime.setCountDownVedioListener {
if (isFristWacthVideo) {
// 第一次观看完视频提醒用户
val vs = vs_tips.inflate()
val ivTipsClose = vs.findViewById<ImageView>(R.id.iv_tips_close)
ivTipsClose.setOnClickListener {
Handler(Looper.getMainLooper()).postDelayed({
vs.visibility = View.GONE
}
}, 3000)
isFristWacthVideo = false
}
......
......@@ -22,7 +22,6 @@ import com.mints.goodmoney.ad.video.VedioAdingManager
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.BxmManager
import com.mints.goodmoney.manager.LiebaoManager
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.*
import com.mints.goodmoney.mvp.presenters.MyPresenter
......
package com.mints.goodmoney.utils
import androidx.core.content.FileProvider
public class GDTFileProvider : FileProvider() {
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/shape_btn_friends_enabled" android:state_enabled="true" />
<item android:drawable="@drawable/shape_btn_friends_unenabled" android:state_enabled="false" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/color_E72C2B" android:state_enabled="true" />
<item android:color="@android:color/white" android:state_enabled="false" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!--3个层的顺序即为显示时的叠加顺序-->
<!--背景色-->
<item android:id="@android:id/background">
<shape>
<corners android:radius="20dip" />
<solid android:color="@color/white" />
<stroke
android:width="1dp"
android:color="@color/grayc" />
</shape>
</item>
<!--一级进度条的颜色,也可以直接替换成图片-->
<item android:id="@android:id/progress">
<clip>
<shape>
<corners android:radius="20dip" />
<solid android:color="@color/main_mints" />
</shape>
</clip>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/graygai" />
<corners android:radius="100dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="10dp" />
<corners android:radius="6dp" />
<solid android:color="@color/white_transparent" />
</shape>
\ No newline at end of file
......@@ -27,9 +27,9 @@
android:layout="@layout/layout_watchvideo_tips" />
<LinearLayout
android:layout_marginTop="30dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:orientation="vertical">
<ImageView
......
......@@ -92,7 +92,8 @@
android:layout_below="@id/img_red"
android:layout_centerHorizontal="true"
android:layout_marginTop="12dp"
android:text="@string/dot" />
android:text="@string/dot"
android:textSize="14sp" />
</RelativeLayout>
......@@ -103,7 +104,8 @@
android:layout_marginStart="20dp"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
android:text="@string/dot" />
android:text="@string/dot"
android:textSize="16sp" />
<LinearLayout
android:layout_width="match_parent"
......@@ -201,15 +203,15 @@
<Button
android:id="@+id/btn_get_bonus"
android:layout_width="50dp"
android:layout_height="28dp"
android:layout_width="60dp"
android:layout_height="30dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginStart="20dp"
android:layout_marginEnd="5dp"
android:background="@drawable/shape_btn_friends"
android:background="@drawable/btn_friends_selectored"
android:text="提现"
android:textColor="@color/color_E72C2B"
android:textColor="@drawable/btn_friends_text_color_selectored"
android:textSize="12sp" />
</RelativeLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout 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="60dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/item_title_img"
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_gravity="center_vertical" />
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp"
android:layout_weight="1">
android:padding="10dp">
<!-- <ImageView-->
<!-- android:id="@+id/item_title_img"-->
<!-- android:layout_width="40dp"-->
<!-- android:layout_height="40dp"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent" />-->
<TextView
android:id="@+id/item_task_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginBottom="6dp"
android:textColor="@color/black"
android:textSize="15sp" />
android:textSize="15sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/item_task_progress"
android:id="@+id/item_task_money"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="6dp"
android:layout_toEndOf="@+id/item_task_title"
android:gravity="center_vertical"
android:textColor="@color/black"
android:textSize="15sp" />
</RelativeLayout>
android:text=" +100金币"
android:textColor="@color/main_mints"
android:textSize="15sp"
app:layout_constraintStart_toEndOf="@id/item_task_title"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/item_task_content"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:textColor="@color/grayc"
android:textSize="15sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/item_task_title" />
<ProgressBar
android:id="@+id/item_task_pb"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="100dp"
android:layout_height="12dp"
android:layout_marginTop="6dp"
android:progress="20"
android:progressDrawable="@drawable/progressbar_versus_changevedio_bg"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/item_task_content" />
<TextView
android:id="@+id/item_task_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:textColor="@color/loan_green"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@id/item_task_pb"
app:layout_constraintStart_toEndOf="@id/item_task_pb"
app:layout_constraintTop_toTopOf="@id/item_task_pb" />
<TextView
android:id="@+id/item_task_click"
android:layout_width="wrap_content"
android:layout_height="32dp"
android:layout_gravity="center_vertical"
android:background="@drawable/shape_btn_orange"
android:gravity="center"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:textColor="@color/my_color_orange"
android:textSize="14sp" />
</LinearLayout>
\ No newline at end of file
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -48,7 +48,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="金币"
android:text="贡献值"
android:textColor="@color/my_color_orange"
android:textSize="14sp" />
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_tips"
android:orientation="vertical"
android:padding="2dp">
<ImageView
android:id="@+id/iv_tips_close"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@mipmap/ic_close" />
android:elevation="2dp"
android:padding="5dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:text="点击红包可以领取金币哦~"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
\ No newline at end of file
</FrameLayout>
\ No newline at end of file
......@@ -16,19 +16,19 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
buildToolsVersion '26.0.2'
buildToolsVersion '29.0.2'
}
dependencies {
compile files('libs/MobCommons-2018.0523.1925.jar')
compile files('libs/MobTools-2018.0523.1923.jar')
compile files('libs/ShareSDK-Alipay-3.2.0.jar')
compile files('libs/ShareSDK-Alipay-Core-3.2.0.jar')
compile files('libs/ShareSDK-Alipay-Moments-3.2.0.jar')
compile files('libs/ShareSDK-Core-3.2.0.jar')
compile files('libs/ShareSDK-QQ-3.2.0.jar')
compile files('libs/ShareSDK-Wechat-3.2.0.jar')
compile files('libs/ShareSDK-Wechat-Core-3.2.0.jar')
compile files('libs/ShareSDK-Wechat-Favorite-3.2.0.jar')
compile files('libs/ShareSDK-Wechat-Moments-3.2.0.jar')
api files('libs/MobCommons-2018.0523.1925.jar')
api files('libs/MobTools-2018.0523.1923.jar')
api files('libs/ShareSDK-Alipay-3.2.0.jar')
api files('libs/ShareSDK-Alipay-Core-3.2.0.jar')
api files('libs/ShareSDK-Alipay-Moments-3.2.0.jar')
api files('libs/ShareSDK-Core-3.2.0.jar')
api files('libs/ShareSDK-QQ-3.2.0.jar')
api files('libs/ShareSDK-Wechat-3.2.0.jar')
api files('libs/ShareSDK-Wechat-Core-3.2.0.jar')
api files('libs/ShareSDK-Wechat-Favorite-3.2.0.jar')
api files('libs/ShareSDK-Wechat-Moments-3.2.0.jar')
}
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