Commit a82f2c24 authored by fengruiyu's avatar fengruiyu

Merge branch 'master' of http://gitlab.mints-id.com/android/android_goodnews_best into fry_dev

 Conflicts:
	.gitignore
	library_base/version.properties
parents e0fb1ad6 be7112e4
......@@ -13,4 +13,5 @@
/captures
.externalNativeBuild
.cxx
/.idea/shelf/
/library_ad/build/
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="11" />
<bytecodeTargetLevel target="1.8" />
</component>
</project>
\ No newline at end of file
......@@ -67,6 +67,15 @@ dependencies {
// androidTestImplementation 'androidx.test.ext:junit:1.1.1'
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
//下拉刷新
implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-alpha-26'
implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.1.0-alpha-26'
// xtablayout
implementation 'com.androidkun:XTabLayout:1.1.5'
//类似sharedPreference
implementation 'net.grandcentrix.tray:tray:0.12.0'
//util
implementation 'com.blankj:utilcodex:1.26.0'
api project(':library_base')
api project(':library_ad')
......
......@@ -103,6 +103,7 @@ private fun ViewPager2.initMain(activity: FragmentActivity): ViewPager2 {
3 -> {
//任务中心
TakeFragment()
}
4 -> {
//个人中心
......
package com.mints.goodnews.main.task
import android.annotation.SuppressLint
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager.widget.ViewPager
import com.blankj.utilcode.util.SpanUtils
import com.fry.base.base.BaseFragment
import com.mints.goodmoney.ui.adapter.FriendsPagerAdapter
import com.mints.goodmoney.ui.adapter.InvitedAdapter
import com.mints.goodnews.BR
import com.mints.goodnews.R
import com.mints.goodnews.databinding.FragmentTakeBinding
import com.mints.goodnews.main.task.bean.FriendHallMsgBean
import com.mints.goodnews.main.task.manager.UserManager
import kotlinx.android.synthetic.main.fragment_take.*
import kotlinx.android.synthetic.main.header_layout.*
import me.goldze.mvvmhabit.utils.AppUtils
import net.grandcentrix.tray.AppPreferences
/**
* Created by 冯瑞雨 on 2021/7/2.
* 任务中心页面
*/
class TakeFragment:BaseFragment<FragmentTakeBinding,TakeViewModel>() {
@SuppressLint("SetTextI18n")//未知
class TakeFragment (private var isResume: Boolean = false): BaseFragment<FragmentTakeBinding, TakeViewModel>(),View.OnClickListener{
//网络数据舒心(涉及到网络请求数据)
private val userManager by lazy { UserManager.INSTANCE }
private var viewPagerAdapter: FriendsPagerAdapter? = null
private var mFriendsHallMsgBean: FriendHallMsgBean? = null
private val ps by lazy { AppPreferences(context) }
// private var rope: YoYo.YoYoString? = null
// 收益总榜数据
private var allData: MutableList<FriendHallMsgBean.ListBean> = mutableListOf()
private var allAdapter: InvitedAdapter? = null
// 今日贡献榜数据
private var todayData: MutableList<FriendHallMsgBean.ListBean> = mutableListOf()
private var todayAdapter: InvitedAdapter? = null
// 昨日收益榜数据
private var yesterdayData: MutableList<FriendHallMsgBean.ListBean> = mutableListOf()
private var yesterdayAdapter: InvitedAdapter? = null
private val recyList: MutableList<RecyclerView> = mutableListOf()
override fun initContentView(inflater: LayoutInflater?,
container: ViewGroup?,
savedInstanceState: Bundle?) = R.layout.fragment_take
override fun initVariableId()=BR.viewModel
override fun initVariableId() = BR.viewModel
override fun initData() {
super.initData()
// srl_my.setOnRefreshListener(this)
if (isResume) {
friendsLayout.visibility = View.GONE
} else {
friendsLayout.visibility = View.VISIBLE
}
initView()
initRecy()
}
@SuppressLint("ClickableViewAccessibility")
private fun initView() {
tv_right_subtitle.visibility = View.VISIBLE
tv_right_subtitle.text = "玩法规则"
tv_right_subtitle.setTextColor(ContextCompat.getColor(context!!, R.color.color_666))
tv_right_subtitle.setOnClickListener { }
tv_title.text = "瓜分百万现金福利"
btn_get_bonus.setOnClickListener(this)
tv_right_subtitle.setOnClickListener(this)
btn_invite.setOnClickListener(this)
tv_detail.setOnClickListener(this)
tv_friends_directly.setOnClickListener(this)
tv_friends_indirect.setOnClickListener(this)
}
private fun initRecy() {
val recyAll = View.inflate(context, R.layout.item_friends_recy, null) as RecyclerView
val recyToday = View.inflate(context, R.layout.item_friends_recy, null) as RecyclerView
val recyYesterday = View.inflate(context, R.layout.item_friends_recy, null) as RecyclerView
recyAll.addItemDecoration(DividerItemDecoration(context, DividerItemDecoration.VERTICAL))
recyToday.addItemDecoration(DividerItemDecoration(context, DividerItemDecoration.VERTICAL))
recyYesterday.addItemDecoration(DividerItemDecoration(context, DividerItemDecoration.VERTICAL))
allAdapter = InvitedAdapter(context!!, allData)
yesterdayAdapter = InvitedAdapter(context!!, yesterdayData)
todayAdapter = InvitedAdapter(context!!, todayData)
recyAll.adapter = allAdapter
recyToday.adapter = todayAdapter
recyYesterday.adapter = yesterdayAdapter
recyList.add(recyAll)
recyList.add(recyToday)
recyList.add(recyYesterday)
val titleList = arrayListOf("总收益榜", "今日贡献榜", "昨日收益榜")
viewPagerAdapter = FriendsPagerAdapter(titleList, recyList)
view_pager_friends.adapter = viewPagerAdapter
view_pager_friends.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
}
override fun onPageSelected(position: Int) {
when (view_pager_friends.currentItem) {
0 -> {
// friendsPresenter.getContributionBigLeaders()
}
1 -> {
// friendsPresenter.getFriendsGiveTodayList()
}
2 -> {
// friendsPresenter.getContributionLeaders()
}
else -> {
}
}
}
override fun onPageScrollStateChanged(state: Int) {
}
})
tab_friends.setupWithViewPager(view_pager_friends)
}
// override fun onRefresh(refreshLayout: RefreshLayout) {//请求网络数据
// if (!TextUtils.isEmpty(userManager.getUserID())) {
//// requestTaskViewModel.getAutoUserHallBaseMsg()
// } else {
// // 游客登录
//// requestTaskViewModel.visitorLogin()
// }
// }
override fun onHiddenChanged(hidden: Boolean) {
if (hidden) { // 不在最前端界面显示
onPause()
} else { // 重新显示到最前端中
onResume()
}
super.onHiddenChanged(hidden)
}
override fun onResume() {
super.onResume()
// if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FOUR || isResume) {
// if (!TextUtils.isEmpty(UserManager.INSTANCE.getUserID())) {
// // 刷新分红数据
//// friendsPresenter.getFriendHallMsg()
//
// when (view_pager_friends.currentItem) {
// 0 -> {
//// friendsPresenter.getContributionBigLeaders()
// }
// 1 -> {
//// friendsPresenter.getFriendsGiveTodayList()
// }
// 2 -> {
//// friendsPresenter.getContributionLeaders()
// }
// }
// }
//
// mFriendsHallMsgBean?.let {
// if (it.button == "戳我分红") {
// showRedbox(btn_get_bonus)
// }
// }
// }
}
/**
* 显示红包动画
*/
fun showRedbox(view: View?) {
// rope = null
// rope = YoYo.with(Techniques.Pulse).duration(1200)
// .interpolate(AccelerateDecelerateInterpolator())
// .repeat(-1)
// .playOn(view)
}
override fun onPause() {
super.onPause()
mFriendsHallMsgBean?.let {
if (it.button == "戳我分红") {
stopRedbox()
}
}
}
fun stopRedbox() {
// if (rope != null) {
// rope?.stop()
// }
}
override fun onDestroy() {
super.onDestroy()
// friendsPresenter.detachView()
// if (rope != null) {
// rope?.stop()
// rope = null
// }
}
private fun generateData(data: FriendHallMsgBean) {
friends_sum.text = "" + data.friendCount
friends_directly_sum.text = "" + data.directFriendsCount
friends_indirect_sum.text = "" + data.indirectFriendsCount
btn_get_bonus.text = data.button
btn_get_bonus.isEnabled = data.status == 0 && data.cash > 0
if (data.button == "戳我分红") {
btn_get_bonus.isEnabled = true
btn_get_bonus.setTextColor(ContextCompat.getColor(context!!, R.color.white))
btn_get_bonus.setBackgroundResource(R.drawable.shape_btn_friends_unenabled)
showRedbox(btn_get_bonus)
} else {
stopRedbox()
}
tv_bonus_date.text = data.periods
tv_bonus_sum.text = SpanUtils()
.append("今日奖池 ").setForegroundColor(ContextCompat.getColor(context!!, R.color.black))
.append(data.titleMsg).setFontSize(AppUtils.dp2Px(context,28f)).setForegroundColor(ContextCompat.getColor(context!!, R.color.color_E72C2B))
.append(" 元").setForegroundColor(ContextCompat.getColor(context!!, R.color.black))
.create()
tv_yesterday_bonus.text = SpanUtils()
.append(data.contribution_yesterday.toString()).setForegroundColor(ContextCompat.getColor(context!!, R.color.color_FF7C00))
.create()
tv_today_bonus.text = SpanUtils()
.append(data.contribution_today.toString()).setForegroundColor(ContextCompat.getColor(context!!, R.color.color_E72C2B))
.create()
tv_bonus_money.text = SpanUtils()
.append(data.cash.toString()).setForegroundColor(ContextCompat.getColor(context!!, R.color.color_E72C2B))
.append("元").setFontSize(AppUtils.dp2Px(context,28f)).setForegroundColor(ContextCompat.getColor(context!!, R.color.color_E72C2B))
.create()
tv_bonus_rate.text = SpanUtils()
.append("昨日汇率:").setForegroundColor(ContextCompat.getColor(context!!, R.color.black))
.append(data.rate).setForegroundColor(ContextCompat.getColor(context!!, R.color.color_E72C2B))
.create()
tv_bonus_hint.text = data.remark
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.tv_detail -> {
// 亲友团详情
// readyGo(FriendsActivity::class.java)
}
R.id.tv_friends_directly -> {
// 直接亲友弹框
// hintDialog(true)
}
R.id.tv_friends_indirect -> {
// 间接亲友弹框
// hintDialog(false)
}
R.id.btn_invite -> {
// 邀请好友
// if (!UserManager.INSTANCE.userIsLogin()) {
//// readyGo(WxLoginActivity::class.java)
// return
// }
// if (!ps.getBoolean(Constant.FIRST_SHARE_INVITED, false)) {
// // 第一次邀请提示弹框
// firstWeChatInvite()
// } else {
// shareImgDialog()
// }
}
R.id.tv_right_subtitle -> {
// 玩法规则
// ruleDialog()
}
R.id.btn_get_bonus -> {
// 领取收益
mFriendsHallMsgBean?.let {
if (it.cash.toInt() > 0 && it.status == 0) {
// shareImgBounsDialog()
} else {
if (it.button == "戳我分红") {
// 玩法规则
// ruleDialog()
} else {
// showToast("您的贡献值未达到提现要求")
}
}
}
}
}
}
// // 总收益榜
// override fun getContributionBigLeadersSuc(data: FriendHallMsgBean) {
// srl_my.finishRefresh(true)
//
// allData.clear()
// allData.addAll(data.list)
// allAdapter?.notifyDataSetChanged()
// }
//
// override fun getFriendsHallMsgSuc(data: FriendHallMsgBean) {
// srl_my.finishRefresh(true)
// mFriendsHallMsgBean = data
// generateData(data)
// }
//
// // 昨日收益榜
// override fun getContributionLeadersSuc(data: FriendHallMsgBean) {
// srl_my.finishRefresh(true)
//
// yesterdayData.clear()
// yesterdayData.addAll(data.list)
// yesterdayAdapter?.notifyDataSetChanged()
// }
//
// // 今日贡献榜
// override fun getFriendsGiveTodayListSuc(data: FriendHallMsgBean) {
// srl_my.finishRefresh(true)
//
// todayData.clear()
// todayData.addAll(data.list)
// todayAdapter?.notifyDataSetChanged()
// }
//
// // 提现成功
// override fun getContributionOutToCashSuc() {
// DialogUtils.showBonusDialog(mContext, "提示", "收益已领取成功", "去查看", object : DialogListener() {
// override fun onClick(dialog: Dialog?, v: View?) {
// when (v?.id) {
// R.id.btn_submit -> {
// if (activity != null && !activity!!.isFinishing && dialog != null && dialog.isShowing) {
// readyGo(DrawcashActivity::class.java)
// dialog.dismiss()
// }
// }
// }
// }
// })
// }
/**
* 图片分享
*/
// private fun shareImgDialog() {
// val shareDialog = ShareDialog(requireActivity())
// val title: String
// if (userManager.getWxName().isEmpty()) {
// var mobile = userManager.getMobile()
// if (mobile.isNotEmpty()) {
// mobile = mobile.substring(0, 3) + "****" + mobile.substring(mobile.length - 4, mobile.length)
// }
// title = "Hi,我是$mobile"
// } else {
// title = "Hi,我是" + userManager.getWxName()
// }
// val content = "送你一个赚钱的新模式,\r\n快点加入跟我一起赚钱吧"
// shareDialog.run {
// setShareAvatar(userManager.getWxHeader())
// setShareTitle(title)
// setShareContent(content)
// show()
// }
// }
/**
* 领取分红分享
*/
// private fun shareImgBounsDialog() {
// val shareDialog = ShareDialog(requireActivity())
// val title: String
// if (userManager.getWxName().isEmpty()) {
// var mobile = userManager.getMobile()
// if (mobile.isNotEmpty()) {
// mobile = mobile.substring(0, 3) + "****" + mobile.substring(mobile.length - 4, mobile.length)
// }
// title = "Hi,我是$mobile"
// } else {
// title = "Hi,我是" + userManager.getWxName()
// }
// val sumCoin = if (TextUtils.isEmpty(userManager.getUserSumGold())) {
// "0"
// } else {
// val allcoinBig = BigDecimal(userManager.getUserSumGold())
// val rateBig = BigDecimal("1000")
// allcoinBig.divide(rateBig).setScale(2, BigDecimal.ROUND_DOWN).toString()
// }
// val content = SpanUtils()
// .append("我已在喜闻赚了")
// .append(sumCoin).setFontSize(AppUtils.dp2Px(context,10f)).setForegroundColor(ContextCompat.getColor(context!!, R.color.color_E72C2B))
// .append("元 ,快来跟我一起赚钱吧,满")
// .append("0.3").setFontSize(BubbleUtils.dp2px(10)).setForegroundColor(ContextCompat.getColor(context!!, R.color.color_E72C2B))
// .append("元就可以提现")
// .create()
// shareDialog.run {
// setOnShareCompleteListener(object : ShareDialog.OnShareCompleteListener {
// override fun onShareComplete() {
// // 去提现
//// friendsPresenter.getContributionOutToCash()
// }
// })
// setShareAvatar(userManager.getWxHeader())
// setShareTitle(title)
// setShareTips("Tips:分享朋友圈成功后领取分红收益")
// setShareWithNoWechatFavoiter(true)
// setShareContent(content)
// show()
// }
// }
/**
* 第一次微信分享弹框
*/
// private fun firstWeChatInvite() {
// DialogUtils.showDialog(context!!, "提示", "被邀请人成功提现0.5元后发放贡献", "取消", "打开微信", object : DialogListener() {
// override fun onClick(dialog: Dialog?, v: View?) {
// dialog?.dismiss()
//
// when (v?.id) {
// R.id.dialog_btn_right -> {
// if (activity != null && !activity!!.isFinishing) {
// ps.put(Constant.FIRST_SHARE_INVITED, true)
//
// shareImgDialog()
// }
// }
// }
// }
// })
// }
}
\ No newline at end of file
package com.mints.goodmoney.ui.adapter
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager.widget.PagerAdapter
class FriendsPagerAdapter(titltStr: List<String>, recyList: MutableList<RecyclerView>)
: PagerAdapter() {
private val mRecyList: MutableList<RecyclerView> = recyList
private val mTitleList: List<String> = titltStr
override fun getItemPosition(`object`: Any): Int {
// 处理notify方法失效
return POSITION_NONE
}
override fun getCount() = mTitleList.size
override fun isViewFromObject(view: View, `object`: Any): Boolean {
return view === `object`
}
override fun instantiateItem(container: ViewGroup, position: Int): Any {
val recyclerView = mRecyList[position]
container.addView(mRecyList[position])
return recyclerView
}
override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
container.removeView(`object` as View?)
}
override fun getPageTitle(position: Int): CharSequence? {
return mTitleList[position]
}
}
\ No newline at end of file
package com.mints.goodmoney.ui.adapter
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.mints.goodmoney.ui.adapter.listener.OnItemClickListener
import com.mints.goodnews.R
import com.mints.goodnews.main.task.utils.GlideUtils
import com.mints.goodnews.main.task.bean.FriendHallMsgBean
class InvitedAdapter(context: Context, invitedData: MutableList<FriendHallMsgBean.ListBean>) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
companion object {
const val HOLDER_TYPE_EMPTY = 0
const val HOLDER_TYPE_INVITED = 1
}
private var mContext: Context = context
private var invitedData: List<FriendHallMsgBean.ListBean> = invitedData
private var mOnItemClickListener: OnItemClickListener? = null
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
if (viewType == HOLDER_TYPE_EMPTY) {
val emptyView = LayoutInflater.from(parent.context).inflate(R.layout.item_empty, parent, false)
return EmptyHolder(emptyView)
}
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_recy_invited, parent, false)
return InvitedHolder(view)
}
override fun getItemCount(): Int {
return if (invitedData.isEmpty()) {
1
} else {
invitedData.size
}
}
override fun getItemViewType(position: Int): Int {
if (invitedData.isEmpty()) {
return HOLDER_TYPE_EMPTY
}
return HOLDER_TYPE_INVITED
}
override fun onBindViewHolder(viewHolder: RecyclerView.ViewHolder, position: Int) {
if (viewHolder is EmptyHolder) {
return
}
val holder = viewHolder as InvitedHolder
when (position) {
0 -> {
holder.tvNum.visibility = View.GONE
holder.ivRanking.visibility = View.VISIBLE
holder.ivRanking.setImageResource(R.mipmap.icon_ranking_first)
}
1 -> {
holder.tvNum.visibility = View.GONE
holder.ivRanking.visibility = View.VISIBLE
holder.ivRanking.setImageResource(R.mipmap.icon_ranking_second)
}
2 -> {
holder.tvNum.visibility = View.GONE
holder.ivRanking.visibility = View.VISIBLE
holder.ivRanking.setImageResource(R.mipmap.icon_ranking_third)
}
else -> {
holder.tvNum.visibility = View.VISIBLE
holder.ivRanking.visibility = View.GONE
holder.tvNum.text = "" + (position + 1)
}
}
val data = invitedData[position]
GlideUtils.loadCircleImageView(mContext, data.head, holder.ivAvatar, R.mipmap.ic_avatar_ph, R.mipmap.ic_avatar_ph)
holder.tvName.text = data.name
holder.tvCoin.text = "" + data.contribution
holder.tvStr.text = "" + data.unit
holder.itemView.setOnClickListener {
mOnItemClickListener?.onItemClick(holder.itemView, position)
}
}
inner class EmptyHolder(itemView: View) : RecyclerView.ViewHolder(itemView)
inner class InvitedHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val tvNum: TextView = itemView.findViewById(R.id.item_invited_tv_num)
val ivAvatar: ImageView = itemView.findViewById(R.id.item_invited_iv_avatar)
val ivRanking: ImageView = itemView.findViewById(R.id.item_invite_iv_ranking)
val tvName: TextView = itemView.findViewById(R.id.item_invited_tv_name)
val tvCoin: TextView = itemView.findViewById(R.id.item_invited_tv_coin)
val tvStr: TextView = itemView.findViewById(R.id.item_invited_tv_str)
}
fun setOnItemClickListener(listener: OnItemClickListener) {
mOnItemClickListener = listener
}
}
\ No newline at end of file
package com.mints.goodmoney.ui.adapter.listener
import android.view.View
//define interface
interface OnItemClickListener {
fun onItemClick(view: View?, position: Int)
}
\ No newline at end of file
package com.mints.goodnews.main.task.bean;
import java.io.Serializable;
import java.util.List;
public class FriendHallMsgBean implements Serializable {
/**
* titleMsg : 6元
* button :
* rate : 1:?
* contribution_yesterday : 0.18
* periods : 第20201113期
* cashMsg : 未达目标,今日加油
* list : [{"id":6,"sid":2031418094401000000,"date":"2020-11-14","level":2,"contribution":0.2,"status":0,"name":"186****1558","head":null}]
* contribution_today : 0.2
* cash : 0
* status : 1
*/
private String titleMsg;
private String button;
private String rate;
private double contribution_yesterday;
private String periods;
private String cashMsg;
private double contribution_today;
private double cash;
private int status;
private int friendCount;
private int directFriendsCount;
private int indirectFriendsCount;
private String rules;
private String remark;
public String getRules() {
return rules;
}
public void setRules(String rules) {
this.rules = rules;
}
public int getDirectFriendsCount() {
return directFriendsCount;
}
public void setDirectFriendsCount(int directFriendsCount) {
this.directFriendsCount = directFriendsCount;
}
public int getIndirectFriendsCount() {
return indirectFriendsCount;
}
public void setIndirectFriendsCount(int indirectFriendsCount) {
this.indirectFriendsCount = indirectFriendsCount;
}
public int getFriendCount() {
return friendCount;
}
public void setFriendCount(int friendCount) {
this.friendCount = friendCount;
}
private List<ListBean> list;
public String getTitleMsg() {
return titleMsg;
}
public void setTitleMsg(String titleMsg) {
this.titleMsg = titleMsg;
}
public String getButton() {
return button;
}
public void setButton(String button) {
this.button = button;
}
public String getRate() {
return rate;
}
public void setRate(String rate) {
this.rate = rate;
}
public double getContribution_yesterday() {
return contribution_yesterday;
}
public void setContribution_yesterday(double contribution_yesterday) {
this.contribution_yesterday = contribution_yesterday;
}
public String getPeriods() {
return periods;
}
public void setPeriods(String periods) {
this.periods = periods;
}
public String getCashMsg() {
return cashMsg;
}
public void setCashMsg(String cashMsg) {
this.cashMsg = cashMsg;
}
public double getContribution_today() {
return contribution_today;
}
public void setContribution_today(double contribution_today) {
this.contribution_today = contribution_today;
}
public double getCash() {
return cash;
}
public void setCash(double cash) {
this.cash = cash;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public List<ListBean> getList() {
return list;
}
public void setList(List<ListBean> list) {
this.list = list;
}
public class ListBean implements Serializable {
/**
* id : 6
* sid : 2031418094401000000
* date : 2020-11-14
* level : 2
* contribution : 0.2
* status : 0
* name : 186****1558
* head : null
*/
private int id;
private long sid;
private String date;
private int level;
private double contribution;
private int status;
private String name;
private String createTime;
private String head = null;
private String unit;
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public long getSid() {
return sid;
}
public void setSid(long sid) {
this.sid = sid;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
public double getContribution() {
return contribution;
}
public void setContribution(double contribution) {
this.contribution = contribution;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getHead() {
return head;
}
public void setHead(String head) {
this.head = head;
}
}
}
package com.mints.goodnews.main.task.bean
import java.io.Serializable
/**
* 描述:用户信息
* 作者:孟崔广
* 时间:2019/10/29 18:42
* 邮箱:mengcga@163.com
*/
class UserBean : Serializable {
val token: String? = null
val toKeepAnAccount: String? = null
val consumer: ConsumerBean? = null
inner class ConsumerBean : Serializable {
val head: String? = null
val openid: String? = null
val nickname: String? = null
val mobile: String? = null
val real_name: String? = null
val alipay_account: String? = null
val idcode: String? = null
val gameInfo: String? = null
var sumCoin: String? = null
val surplus //余额
= 0.0
val coin // 积分
= 0
val pk_id // 用户id
: Long = 0
val isFirstSignInApp // 首次登录app true:首次
= false
}
}
package com.mints.goodnews.main.task.manager
import android.text.TextUtils
import com.mints.goodnews.main.task.bean.UserBean
import com.tencent.mmkv.MMKV
/**
* 描述:管理用户信息
* 作者:孟崔广
* 时间:2019/10/28 13:54
*/
class UserManager {
companion object {
/**
* 游客 or 登录用户
*/
private const val IS_TEMP_USER = "is_temp_user"
/**
* 用户ID
*/
private const val USER_ID = "userId"
/**
* 用户CODE_ID
*/
private const val CODE_ID = "codeId"
/**
* 登陆状态ID
*/
private const val TOKEN_ID = "tokenId"
/**
* 手机号
*/
private const val MOBILE = "mobile"
/**
* 姓名
*/
private const val REAL_NAME = "realName"
/**
* 支付宝
*/
private const val ALIPAY_ACCOUNT = "alipay_account"
/**
* 用户金币
*/
private const val USER_GOLD = "user_gold"
/**
* 用户总金币
*/
private const val USER_SUM_GOLD = "user_sum_gold"
/**
* 用户零钱
*/
private const val USER_CASH = "user_cash"
/**
* 是否老用户 true-老用户
*/
private const val USER_OLD = "user_old"
/**
* 猎豹游戏info
*/
private const val GAME_INFO = "game_info"
/**
* 广告隐藏标识
*/
private const val AD_SHOW_FLAG = "ad_show_flag"
/**
* 微信名称
*/
private const val WX_NAME = "wx_name"
/**
* 微信头像
*/
private const val WX_HEADER = "wx_header"
/**
* 微信id
*/
private const val WX_OPENID = "wx_openid"
val INSTANCE: UserManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
UserManager()
}
}
init {
// TODO 初始化穿山甲
}
/**
* 保存用户信息
*
* @param userInfo
*/
fun saveUserInfo(userInfo: UserBean) {
val user = userInfo.consumer
val token = userInfo.token
if (token != null) {
MMKV.mmkvWithID(TOKEN_ID).encode(TOKEN_ID, token)
}
if (user != null) {
val mobile: String? = user.mobile
val openid: String? = user.openid
if (mobile == null && openid == null) {
MMKV.mmkvWithID(IS_TEMP_USER).remove(IS_TEMP_USER)
} else {
MMKV.mmkvWithID(IS_TEMP_USER).encode(IS_TEMP_USER, mobile + openid)
}
MMKV.mmkvWithID(USER_ID).encode(USER_ID, user.pk_id.toString())
MMKV.mmkvWithID(CODE_ID).encode(CODE_ID, user.idcode.toString())
MMKV.mmkvWithID(MOBILE).encode(MOBILE, mobile)
MMKV.mmkvWithID(ALIPAY_ACCOUNT)
.encode(ALIPAY_ACCOUNT, user.alipay_account.toString())
MMKV.mmkvWithID(USER_GOLD).encode(USER_GOLD, user.coin.toString())
MMKV.mmkvWithID(USER_CASH)
.encode(USER_CASH, String.format("%.2f", user.surplus))
MMKV.mmkvWithID(USER_SUM_GOLD).encode(USER_SUM_GOLD, user.sumCoin.toString())
MMKV.mmkvWithID(USER_OLD).encode(USER_OLD, !user.isFirstSignInApp)
MMKV.mmkvWithID(WX_NAME).encode(WX_NAME, user.nickname.toString())
MMKV.mmkvWithID(WX_HEADER).encode(WX_HEADER, user.head)
MMKV.mmkvWithID(WX_OPENID).encode(WX_OPENID, openid)
MMKV.mmkvWithID(GAME_INFO).encode(GAME_INFO, user.gameInfo)
MMKV.mmkvWithID(REAL_NAME).encode(REAL_NAME, user.real_name)
}
}
/**
* 单独获取用户id
*/
fun getMobile(): String {
val kv = MMKV.mmkvWithID(MOBILE)
return kv.decodeString(MOBILE, "")
}
/**
* 判断用户是否已登录
*
* @return true为已登录 false 为未登录
*/
fun userIsLogin(): Boolean {
val kv = MMKV.mmkvWithID(IS_TEMP_USER).decodeString(IS_TEMP_USER, "")
return !TextUtils.isEmpty(kv)
}
/**
* 单独获取用户id
*/
fun getUserID(): String {
val kv = MMKV.mmkvWithID(USER_ID)
return kv.decodeString(USER_ID, "")
}
/**
* 获取用户登陆状态
*/
fun getTokenID(): String {
val kv = MMKV.mmkvWithID(TOKEN_ID)
return kv.decodeString(TOKEN_ID, "")
}
/**
* 获取用户邀请码
*/
fun getCodeID(): String {
val kv = MMKV.mmkvWithID(CODE_ID)
return kv.decodeString(CODE_ID, "")
}
/**
* 获取真实姓名
*/
fun getRealName(): String {
val kv = MMKV.mmkvWithID(REAL_NAME)
return kv.decodeString(REAL_NAME, "")
}
/**
* 设置真实姓名
*
* @param name
*/
fun setRealName(name: String?) {
val kv = MMKV.mmkvWithID(REAL_NAME)
kv.encode(REAL_NAME, name)
}
/**
* 是否老用户 true-老用户
*/
fun getUserOld(): Boolean {
val kv = MMKV.mmkvWithID(USER_OLD)
return kv.decodeBool(USER_OLD, false)
}
fun getAdShowFlag(): Boolean {
val kv = MMKV.mmkvWithID(AD_SHOW_FLAG)
return kv.decodeBool(AD_SHOW_FLAG, false)
}
/**
* 设置真实姓名
*
* @param userOld
*/
fun setUserOld(userOld: Boolean) {
val kv = MMKV.mmkvWithID(USER_OLD)
kv.encode(USER_OLD, userOld)
}
/**
* 获取支付宝账户
*/
fun getAlipayAccount(): String {
val kv = MMKV.mmkvWithID(ALIPAY_ACCOUNT)
return kv.decodeString(ALIPAY_ACCOUNT, "")
}
/**
* 设置支付宝账户
*
* @param alipay
*/
fun setAlipayAccount(alipay: String?) {
val kv = MMKV.mmkvWithID(ALIPAY_ACCOUNT)
kv.encode(ALIPAY_ACCOUNT, alipay)
}
fun getUserSumGold(): String {
val kv = MMKV.mmkvWithID(USER_SUM_GOLD)
return kv.decodeString(USER_SUM_GOLD, "")
}
/**
* 获取用户金币/积分
*/
fun getUserGold(): String {
val kv = MMKV.mmkvWithID(USER_GOLD)
return kv.decodeString(USER_GOLD, "")
}
/**
* 设置用户金币/积分
*
* @param gold
*/
fun setUserGold(gold: String?) {
val kv = MMKV.mmkvWithID(USER_GOLD)
kv.encode(USER_GOLD, gold)
}
/**
* 获取用户零钱
*/
fun getUserCash(): String {
val kv = MMKV.mmkvWithID(USER_CASH)
return kv.decodeString(USER_CASH, "")
}
fun getGameInfo(): String {
val kv = MMKV.mmkvWithID(GAME_INFO)
return kv.decodeString(GAME_INFO, "")
}
fun getWxName(): String {
val kv = MMKV.mmkvWithID(WX_NAME)
return kv.decodeString(WX_NAME, "")
}
fun getWxHeader(): String {
val kv = MMKV.mmkvWithID(WX_HEADER)
return kv.decodeString(WX_HEADER, "")
}
fun getWxOpenid(): String {
val kv = MMKV.mmkvWithID(WX_OPENID)
return kv.decodeString(WX_OPENID, "")
}
/**
* 设置用户零钱
*
* @param cash
*/
fun setUserCash(cash: String?) {
val kv = MMKV.mmkvWithID(USER_CASH)
kv.encode(WX_OPENID, cash)
}
fun setGameInfo(gameInfo: String?) {
val kv = MMKV.mmkvWithID(GAME_INFO)
kv.encode(GAME_INFO, gameInfo)
}
fun setWxName(wxName: String?) {
val kv = MMKV.mmkvWithID(WX_NAME)
kv.encode(WX_NAME, wxName)
}
fun setWxHeader(wxHeader: String?) {
val kv = MMKV.mmkvWithID(WX_HEADER)
kv.encode(WX_HEADER, wxHeader)
}
/**
* mobile
*
* @param mobile
*/
fun setMobile(mobile: String?) {
val kv = MMKV.mmkvWithID(MOBILE)
kv.encode(MOBILE, mobile)
}
fun setAdShowFlag(adShowFlag: Boolean) {
val kv = MMKV.mmkvWithID(AD_SHOW_FLAG)
kv.encode(AD_SHOW_FLAG, adShowFlag)
}
fun userLogout() {
MMKV.mmkvWithID(USER_ID).remove(USER_ID)
MMKV.mmkvWithID(CODE_ID).remove(CODE_ID)
MMKV.mmkvWithID(TOKEN_ID).remove(TOKEN_ID)
MMKV.mmkvWithID(REAL_NAME).remove(REAL_NAME)
MMKV.mmkvWithID(IS_TEMP_USER).remove(IS_TEMP_USER)
MMKV.mmkvWithID(ALIPAY_ACCOUNT).remove(ALIPAY_ACCOUNT)
MMKV.mmkvWithID(USER_GOLD).remove(USER_GOLD)
MMKV.mmkvWithID(USER_CASH).remove(USER_CASH)
MMKV.mmkvWithID(USER_OLD).remove(USER_OLD)
MMKV.mmkvWithID(WX_OPENID).remove(WX_OPENID)
MMKV.mmkvWithID(WX_NAME).remove(WX_NAME)
MMKV.mmkvWithID(WX_HEADER).remove(WX_HEADER)
// MMKV.mmkvWithID(GAME_INFO).remove(GAME_INFO)
}
}
\ No newline at end of file
package com.mints.goodnews.main.task.utils;
import android.content.Context;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.signature.ObjectKey;
/**
* 描述:GlideUtils
* 作者:孟崔广
* 时间:2018/1/10 17:51
* 邮箱:mengcga@163.com
*/
public class GlideUtils {
/**
* Glide特点
* 使用简单
* 可配置度高,自适应程度高
* 支持常见图片格式 Jpg png gif webp
* 支持多种数据源 网络、本地、资源、Assets 等
* 高效缓存策略 支持Memory和Disk图片缓存 默认Bitmap格式采用RGB_565内存使用至少减少一半
* 生命周期集成 根据Activity/Fragment生命周期自动管理请求
* 高效处理Bitmap 使用Bitmap Pool使Bitmap复用,主动调用recycle回收需要回收的Bitmap,减小系统回收压力
* 这里默认支持Context,Glide支持Context,Activity,Fragment,FragmentActivity
*/
//默认加载
public static void loadImageView(Context mContext, String path, ImageView mImageView) {
Glide.with(mContext).load(path).into(mImageView);
}
//默认加载
public static void loadImageViewNoAnim(Context mContext, String path, ImageView mImageView) {
Glide.with(mContext).load(path).dontAnimate().into(mImageView);
}
//设置加载中图片
public static void loadImageViewLoding(Context mContext, String path, ImageView mImageView, int lodingImage) {
RequestOptions requestOptions = new RequestOptions();
requestOptions.placeholder(lodingImage);
Glide.with(mContext).load(path).apply(requestOptions).into(mImageView);
}
//设置加载中以及加载失败图片
public static void loadImageViewLoding(Context mContext, String path, ImageView mImageView, int lodingImage, int errorImageView) {
RequestOptions requestOptions = new RequestOptions();
requestOptions.placeholder(lodingImage);
requestOptions.error(errorImageView);
Glide.with(mContext).load(path).apply(requestOptions).into(mImageView);
}
//设置加载中以及加载失败圆形图片
public static void loadCircleImageView(Context mContext, String path, ImageView mImageView, int lodingImage, int errorImageView) {
RequestOptions requestOptions = new RequestOptions();
requestOptions.placeholder(lodingImage);
requestOptions.error(errorImageView);
requestOptions.circleCrop();
Glide.with(mContext).load(path).apply(requestOptions).into(mImageView);
}
//加载Gif
public static void loadImageViewGif(Context mContext, int drawable, ImageView imageView) {
Glide.with(mContext).load(drawable).into(imageView);
}
//加载Gif
public static void loadImageViewGifUrl(Context mContext, ImageView view, String url) {
RequestOptions options = (new RequestOptions())
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
.timeout(60000)
.signature(new ObjectKey(System.currentTimeMillis()))
.priority(Priority.HIGH);
Glide.with(mContext).load(url).apply(options).into(view);
}
}
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="300"
android:fromYDelta="100%p"
android:toYDelta="0" />
<alpha
android:duration="500"
android:fromAlpha="0.0"
android:toAlpha="1.0" />
</set>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="750"
android:fromYDelta="0"
android:toYDelta="100%p" />
<alpha
android:duration="300"
android:fromAlpha="1.0"
android:toAlpha="0.0" />
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2015 [1076559197@qq.com | tchen0707@gmail.com]
~
~ Licensed under the Apache License, Version 2.0 (the "License”);
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<alpha
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromAlpha="0.0"
android:toAlpha="1.0" />
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2015 [1076559197@qq.com | tchen0707@gmail.com]
~
~ Licensed under the Apache License, Version 2.0 (the "License”);
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<alpha
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromAlpha="1.0"
android:toAlpha="0.0" />
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!--
author:Remex Huang
website:feelyou.info
-->
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromXDelta="-100%p"
android:fromYDelta="0"
android:toXDelta="0"
android:toYDelta="0" >
</translate>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!--
author:Remex Huang
website:feelyou.info
-->
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromXDelta="100%p"
android:fromYDelta="0"
android:toXDelta="0"
android:toYDelta="0" >
</translate>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) 2015 [1076559197@qq.com | tchen0707@gmail.com]
~
~ Licensed under the Apache License, Version 2.0 (the "License”);
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromXDelta="-100%p"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:toXDelta="0" />
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) 2015 [1076559197@qq.com | tchen0707@gmail.com]
~
~ Licensed under the Apache License, Version 2.0 (the "License”);
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromXDelta="0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:toXDelta="100%p" />
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!--
author:Remex Huang
website:feelyou.info
-->
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromXDelta="0"
android:fromYDelta="0"
android:toXDelta="-100%p"
android:toYDelta="0" >
</translate>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!--
author:Remex Huang
website:feelyou.info
-->
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromXDelta="0"
android:fromYDelta="0"
android:toXDelta="100%p"
android:toYDelta="0" >
</translate>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="200"
android:fromYDelta="100%p"
android:toYDelta="0" />
<alpha
android:duration="200"
android:fromAlpha="0.0"
android:toAlpha="1.0" />
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="200"
android:fromYDelta="0"
android:toYDelta="50%p" />
<alpha
android:duration="200"
android:fromAlpha="1.0"
android:toAlpha="0.0" />
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2015 [1076559197@qq.com | tchen0707@gmail.com]
~
~ Licensed under the Apache License, Version 2.0 (the "License”);
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<translate
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:fromXDelta="100%p"
android:toXDelta="0"/>
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) 2015 [1076559197@qq.com | tchen0707@gmail.com]
~
~ Licensed under the Apache License, Version 2.0 (the "License”);
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromXDelta="0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:toXDelta="-100%p" />
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) 2015 [1076559197@qq.com | tchen0707@gmail.com]
~
~ Licensed under the Apache License, Version 2.0 (the "License”);
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<scale xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fillAfter="false"
android:fromXScale="0.0"
android:fromYScale="0.0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1"
android:toYScale="1" />
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) 2015 [1076559197@qq.com | tchen0707@gmail.com]
~
~ Licensed under the Apache License, Version 2.0 (the "License”);
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromAlpha="1.0"
android:toAlpha="0" />
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2015 [1076559197@qq.com | tchen0707@gmail.com]
~
~ Licensed under the Apache License, Version 2.0 (the "License”);
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<translate
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromYDelta="-100%p"
android:toYDelta="0"/>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2015 [1076559197@qq.com | tchen0707@gmail.com]
~
~ Licensed under the Apache License, Version 2.0 (the "License”);
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<translate
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromYDelta="0"
android:toYDelta="-100%p"/>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<!--折叠状态下的阴影-->
<item app:state_collapsed="true">
<objectAnimator
android:propertyName="elevation"
android:valueTo="1.5dp"
android:valueType="floatType" />
</item>
<!--展开状态下的阴影-->
<item app:state_collapsed="false">
<objectAnimator
android:propertyName="elevation"
android:valueTo="1.5dp"
android:valueType="floatType" />
</item>
</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: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"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/color_FFC7C7" />
<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">
<solid android:color="@color/color_FF9837" />
<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"
android:shape="rectangle">
<solid android:color="#ffff9837" />
<corners android:radius="25dp" />
<gradient
android:angle="90"
android:endColor="#ffffb032"
android:startColor="#ffff7f2c"
android:type="linear"
android:useLevel="true" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#ffffffff" />
<corners android:radius="10dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?><!-- 中心背景 -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 实心 -->
<solid android:color="#ffffff" />
<corners
android:topLeftRadius="20dp"
android:topRightRadius="20dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<!-- <item android:duration="100">-->
<!-- <clip-->
<!-- android:clipOrientation="horizontal"-->
<!-- android:drawable="@mipmap/loading_u0"-->
<!-- android:gravity="left" />-->
<!-- </item>-->
<item android:duration="100">
<clip
android:clipOrientation="horizontal"
android:drawable="@mipmap/loading_u1"
android:gravity="left" />
</item>
<item android:duration="100">
<clip
android:clipOrientation="horizontal"
android:drawable="@mipmap/loading_u2"
android:gravity="left" />
</item>
<item android:duration="100">
<clip
android:clipOrientation="horizontal"
android:drawable="@mipmap/loading_u3"
android:gravity="left" />
</item>
<item android:duration="100">
<clip
android:clipOrientation="horizontal"
android:drawable="@mipmap/loading_u4"
android:gravity="left" />
</item>
<item android:duration="100">
<clip
android:clipOrientation="horizontal"
android:drawable="@mipmap/loading_u5"
android:gravity="left" />
</item>
<item android:duration="100">
<clip
android:clipOrientation="horizontal"
android:drawable="@mipmap/loading_u6"
android:gravity="left" />
</item>
</animation-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="ViewModel"
type="com.mints.goodnews.main.task.TakeViewModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="@+id/friendsLayout"
layout="@layout/header_layout"
android:visibility="gone" />
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/srl_my"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srlAccentColor="@color/gray"
app:srlPrimaryColor="@color/white">
<com.scwang.smartrefresh.layout.header.ClassicsHeader
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/color_F8F8F8"
android:stateListAnimator="@animator/appbar_elevation">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_scrollFlags="scroll">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/img_invite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:src="@mipmap/bg_invite_friends" />
<ImageView
android:id="@+id/img_yellow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/img_invite"
android:layout_centerHorizontal="true"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="-50dp"
android:scaleType="fitXY"
android:src="@mipmap/bg_invite_friends_yellow" />
<ImageView
android:id="@+id/img_red"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/img_yellow"
android:layout_centerHorizontal="true"
android:scaleType="centerCrop"
android:src="@mipmap/bg_invite_friends_red" />
<TextView
android:id="@+id/tv_bonus_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/img_yellow"
android:layout_centerHorizontal="true"
android:layout_marginTop="4dp"
android:text="@string/dot"
android:textColor="@color/white" />
<TextView
android:id="@+id/tv_bonus_sum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/img_red"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:text="@string/dot"
android:textSize="14sp" />
</RelativeLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="15dp"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_gold_card"
android:elevation="2dip"
android:padding="15dp">
<TextView
android:id="@+id/tv_bonus_rate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/dot"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_bonus_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/dot"
android:textSize="12sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/linearLayout2"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:background="@mipmap/bg_invite_friends_left"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/rl_wrap"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_bonus_rate"
app:layout_constraintVertical_bias="0.0">
<TextView
android:id="@+id/textView2"
android:layout_width="0dp"
android:layout_height="0dp"
android:gravity="center|end"
android:text="昨日贡献值"
android:textColor="@color/color_AF6F36"
android:textSize="12sp"
app:layout_constraintBottom_toTopOf="@id/textView3"
app:layout_constraintEnd_toStartOf="@id/tv_yesterday_bonus"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_weight="1" />
<TextView
android:id="@+id/textView3"
android:layout_width="0dp"
android:layout_height="0dp"
android:gravity="center|end"
android:text="今日贡献值"
android:textColor="@color/color_912C36"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/tv_today_bonus"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toStartOf="parent"
android:text="任务中心"
app:layout_constraintTop_toBottomOf="@+id/textView2"
app:layout_constraintVertical_weight="1" />
<TextView
android:id="@+id/tv_yesterday_bonus"
android:layout_width="0dp"
android:layout_height="0dp"
android:gravity="center"
android:paddingEnd="10dp"
android:text="@string/dot"
android:textSize="22sp"
app:layout_constraintBottom_toTopOf="@id/tv_today_bonus"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toEndOf="@id/textView2"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_weight="1" />
<TextView
android:id="@+id/tv_today_bonus"
android:layout_width="0dp"
android:layout_height="0dp"
android:gravity="center"
android:paddingEnd="10dp"
android:text="@string/dot"
android:textSize="22sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toEndOf="@id/textView3"
app:layout_constraintTop_toBottomOf="@id/tv_yesterday_bonus"
app:layout_constraintVertical_weight="1" />
</androidx.constraintlayout.widget.ConstraintLayout>
<RelativeLayout
android:id="@+id/rl_wrap"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="5dp"
android:layout_marginTop="10dp"
android:background="@mipmap/bg_invite_friends_right"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toEndOf="@id/linearLayout2"
app:layout_constraintTop_toBottomOf="@+id/tv_bonus_hint">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginTop="15dp"
android:text="分红收益"
android:textColor="@color/color_CF7E7E" />
<TextView
android:id="@+id/tv_bonus_money"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginTop="40dp"
android:text="@string/dot"
android:textSize="22sp" />
<Button
android:id="@+id/btn_get_bonus"
android:layout_width="60dp"
android:layout_height="26dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="5dp"
android:background="@drawable/btn_friends_selectored"
android:text="结算中"
android:textColor="@drawable/btn_friends_text_color_selectored"
android:textSize="12sp" />
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_gold_card"
android:elevation="2dip"
android:padding="15dp">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="亲友团成员"
android:textColor="@color/black"
android:textSize="39dp"
/>
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@+id/line"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_detail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="详情 >"
app:layout_constraintBottom_toBottomOf="@+id/textView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/textView" />
<View
android:id="@+id/line"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="15dp"
android:background="@color/color_F8F8F8"
app:layout_constraintTop_toBottomOf="@id/textView" />
<TextView
android:id="@+id/friends_sum"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:gravity="center"
android:text="@string/dot"
android:textColor="@color/black"
android:textSize="20sp"
app:layout_constraintEnd_toStartOf="@id/friends_directly_sum"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/line" />
<TextView
android:id="@+id/friends_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="总人数"
app:layout_constraintEnd_toEndOf="@+id/friends_sum"
app:layout_constraintStart_toStartOf="@+id/friends_sum"
app:layout_constraintTop_toBottomOf="@id/friends_sum" />
<TextView
android:id="@+id/friends_directly_sum"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:gravity="center"
android:text="@string/dot"
android:textColor="@color/black"
android:textSize="20sp"
app:layout_constraintEnd_toStartOf="@id/friends_indirect_sum"
app:layout_constraintStart_toEndOf="@id/friends_sum"
app:layout_constraintTop_toBottomOf="@id/line" />
<TextView
android:id="@+id/tv_friends_directly"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:drawableEnd="@mipmap/ic_question"
android:drawablePadding="6dp"
android:text="直接亲友"
app:layout_constraintEnd_toEndOf="@+id/friends_directly_sum"
app:layout_constraintStart_toStartOf="@+id/friends_directly_sum"
app:layout_constraintTop_toBottomOf="@id/friends_directly_sum" />
<TextView
android:id="@+id/friends_indirect_sum"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:gravity="center"
android:text="@string/dot"
android:textColor="@color/black"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/friends_directly_sum"
app:layout_constraintTop_toBottomOf="@id/line" />
<TextView
android:id="@+id/tv_friends_indirect"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:drawablePadding="6dp"
android:text="间接亲友"
app:drawableEndCompat="@mipmap/ic_question"
app:layout_constraintEnd_toEndOf="@+id/friends_indirect_sum"
app:layout_constraintStart_toStartOf="@+id/friends_indirect_sum"
app:layout_constraintTop_toBottomOf="@id/friends_indirect_sum" />
<Button
android:id="@+id/btn_invite"
android:layout_width="160dp"
android:layout_height="40dp"
android:layout_marginTop="15dp"
android:layout_marginBottom="6dp"
android:background="@drawable/shape_btn_switch"
android:text="邀请亲友"
android:textColor="@color/white"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_friends_directly" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<com.androidkun.xtablayout.XTabLayout
android:id="@+id/tab_friends"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@drawable/shape_tab_friends"
android:elevation="4dip"
app:xTabIndicatorColor="#FB560C"
app:xTabIndicatorHeight="4dp"
app:xTabIndicatorRoundX="50dp"
app:xTabIndicatorRoundY="50dp"
app:xTabIndicatorWidth="36dp"
app:xTabMode="fixed"
app:xTabSelectedTextColor="#FB560C"
app:xTabSelectedTextSize="18sp"
app:xTabTextColor="#666666"
app:xTabTextSize="15sp" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager.widget.ViewPager
android:id="@+id/view_pager_friends"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<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="70dp"
android:paddingTop="20dp">
<ImageView
android:id="@+id/iv_left_icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:padding="10dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_left_subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:lines="1"
android:maxLength="12"
android:padding="8dp"
android:textColor="@color/black"
android:textSize="18sp"
android:textStyle="bold"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:lines="1"
android:maxLength="12"
android:textColor="@color/color_121B32"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_right_icon2"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="10dp"
android:scaleType="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/iv_right_icon"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_right_icon"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="10dp"
android:scaleType="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_right_subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:textColor="@color/color_121B32"
android:textSize="16sp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
style="@style/view_line_E6E6E6"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/iv_right_icon" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@mipmap/ic_record_empty" />
</FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/recy_friends"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="10dp">
<ImageView
android:id="@+id/item_invite_iv_ranking"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginTop="3dp"
android:visibility="gone" />
<TextView
android:id="@+id/item_invited_tv_num"
android:layout_width="30dp"
android:layout_height="30dp"
android:gravity="center"
android:textColor="@color/color_333"
android:textSize="16dp"
android:visibility="gone" />
<ImageView
android:id="@+id/item_invited_iv_avatar"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginStart="10dp" />
<TextView
android:id="@+id/item_invited_tv_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:textColor="@color/color_333"
android:textSize="16sp" />
<TextView
android:id="@+id/item_invited_tv_coin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/color_FB560C"
android:textSize="22sp" />
<TextView
android:id="@+id/item_invited_tv_str"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textColor="@color/color_FB560C"
android:textSize="14sp" />
</LinearLayout>
\ No newline at end of file
......@@ -3,4 +3,70 @@
<color name="colorPrimary">#ffffffff</color>
<color name="colorPrimaryDark">#ffffffff</color>
<color name="colorAccent">#FF4081</color>
<color name="color_FF9837">#FF9837</color>
<color name="color_50FF9837">#50FF9837</color>
<color name="white">#FFFFFF</color>
<color name="black">#000000</color>
<color name="gray">#808080</color>
<color name="color_3D5AFE">#3D5AFE</color>
<color name="color_cb4a39">#cb4a39</color>
<color name="color_0000FF">#0000FF</color>
<color name="color_ccc">#cccccc</color>
<color name="color_AAA">#AAAAAA</color>
<color name="color_0000">#00000000</color>
<color name="color_20000000">#20000000</color>
<color name="color_60000000">#60000000</color>
<color name="color_50000000">#50000000</color>
<color name="color_2B3238">#2B3238</color>
<color name="color_002444">#002444</color>
<color name="color_600c224b">#600c224b</color>
<color name="color_fcf16e">#fcf16e</color>
<color name="color_F18542">#F18542</color>
<color name="color_FEEBC8">#FEEBC8</color>
<color name="color_63A0B9">#63A0B9</color>
<color name="color_7EE2FF">#7EE2FF</color>
<color name="color_255186">#255186</color>
<color name="color_A7BCFE">#A7BCFE</color>
<color name="color_666">#666666</color>
<color name="color_454A69">#454A69</color>
<color name="color_333">#333333</color>
<color name="color_4BB93F">#4BB93F</color>
<color name="color_FEB63D">#FEB63D</color>
<color name="color_FF5E5E">#FF5E5E</color>
<color name="color_172B54">#172B54</color>
<color name="color_707A8D">#707A8D</color>
<color name="color_121B32">#121B32</color>
<color name="color_F9F9F9">#F9F9F9</color>
<color name="color_63677E">#63677E</color>
<color name="color_BEC2CC">#BEC2CC</color>
<color name="color_50E8E8E8">#50E8E8E8</color>
<color name="color_FF2326">#FF2326</color>
<color name="color_93B7D9">#93B7D9</color>
<color name="color_E6E6E6">#E6E6E6</color>
<color name="color_F9FAFB">#F9FAFB</color>
<color name="color_F8F8F8">#F8F8F8</color>
<color name="color_343C4F">#343C4F</color>
<color name="color_FB560C">#FB560C</color>
<color name="color_EBB20D">#EBB20D</color>
<color name="color_999">#999999</color>
<color name="color_555">#555555</color>
<color name="color_F5F">#F5F5F5</color>
<color name="color_F8F">#F8F8F8</color>
<color name="color_D81B60">#D81B60</color>
<color name="color_00895B">#00895B</color>
<color name="color_8F6D21">#8F6D21</color>
<color name="color_FFDD0C">#FFDD0C</color>
<color name="color_CF7E7E">#CF7E7E</color>
<color name="color_FF4A4A">#FF4A4A</color>
<color name="color_AF6F36">#AF6F36</color>
<color name="color_912C36">#912C36</color>
<color name="color_E72C2B">#E72C2B</color>
<color name="color_FFC7C7">#FFC7C7</color>
<color name="color_FF7C00">#FF7C00</color>
<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>
<color name="color_F28335">#F28335</color>
</resources>
\ No newline at end of file
......@@ -25,15 +25,121 @@
<item name="android:windowExitAnimation">@anim/slide_out_to_right</item>-->
</style>
<style name="line_3">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">1px</item>
<item name="android:background">#E8E8F0</item>
</style>
<!--浅灰色line-->
<style name="view_line_E6E6E6">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">1dp</item>
<item name="android:background">@color/color_E6E6E6</item>
</style>
<style name="line_3">
<style name="dialog" parent="@android:style/Theme.Dialog">
<item name="android:windowBackground">@color/color_0000</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">false</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:background">@null</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:gravity">bottom</item>
</style>
<style name="dialog_two" parent="@android:style/Theme.Dialog">
<item name="android:windowBackground">@color/color_0000</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">false</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:background">@null</item>
<item name="android:backgroundDimEnabled">true</item>
</style>
<style name="loading_small" parent="@android:style/Widget.ProgressBar.Small">
<item name="android:indeterminateDrawable">@drawable/ufo_loading</item>
<item name="android:layout_width">25dip</item>
<item name="android:layout_height">25dip</item>
<item name="android:layout_gravity">center</item>
</style>
<!-- activity 切换 anim -->
<style name="FeelyouWindowAnimTheme" parent="@android:style/Animation.Activity">
<item name="android:activityOpenEnterAnimation">@anim/in_from_right</item>
<item name="android:activityOpenExitAnimation">@anim/out_from_left</item>
<item name="android:activityCloseEnterAnimation">@anim/in_from_left</item>
<item name="android:activityCloseExitAnimation">@anim/out_from_right</item>
</style>
<style name="notice_dialog" parent="android:style/Theme.Dialog">
<item name="android:background">#00000000</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:layout_gravity">center</item>
<item name="android:gravity">center</item>
</style>
<style name="NotificationTitle">
<item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:textStyle">bold</item>
</style>
<style name="Theme.Light" parent="Theme.AppCompat.Light">
<item name="android:windowBackground">@color/white</item>
</style>
<style name="NotificationText">
<item name="android:textColor">?android:attr/textColorPrimary</item>
</style>
<style name="erect_2">
<item name="android:layout_width">0.8dip</item>
<item name="android:layout_height">match_parent</item>
<item name="android:background">#EEEEEE</item>
</style>
<style name="DialogAnimBottom" parent="@android:style/Animation">
<item name="android:windowEnterAnimation">@anim/dialog_bottom_in</item>
<item name="android:windowExitAnimation">@anim/dialog_bottom_out</item>
</style>
<style name="AppTheme.BottomSheet" parent="android:Theme.Dialog">
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowAnimationStyle">@null
</item><!-- 为了避免在有 NavigationBar 的手机上 Dialog 从 NavigationBar 底部上来。去掉 Dialog 的动画,使用 View 的动画。-->
<item name="android:layout_width">match_parent</item>
</style>
<style name="MyTitleStyle" parent="@android:style/Widget.TextView">
<item name="android:textSize">24sp</item>
<item name="android:textColor">#cb4a39</item>
<item name="android:fontFamily">sans-serif-condensed</item>
</style>
<!--设置Tablayout字体加粗-->
<style name="TabLayoutTextStyle">
<item name="android:textStyle">bold</item>
</style>
<style name="line_1">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">1px</item>
<item name="android:background">#E8E8F0</item>
<item name="android:background">#d3d3d3</item>
</style>
</resources>
\ No newline at end of file
......@@ -115,8 +115,7 @@ public abstract class HabitBaseFragment<V extends ViewDataBinding, VM extends Ba
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
//私有的ViewModel与View的契约事件回调逻辑
registorUIChangeLiveDataCallBack();
//页面数据初始化方法
registorUIChangeLiveDataCallBack(); //页面数据初始化方法
initData();
//页面事件监听的方法,一般用于ViewModel层转到View层的事件注册
initViewObservable();
......
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