Commit ccc34aaf authored by jyx's avatar jyx

领取分红弹框优化

parent 09f487aa
...@@ -49,6 +49,10 @@ public class UserManager { ...@@ -49,6 +49,10 @@ public class UserManager {
* 用户金币 * 用户金币
*/ */
private static final String USER_GOLD = "user_gold"; private static final String USER_GOLD = "user_gold";
/**
* 用户总金币
*/
private static final String USER_SUM_GOLD = "user_sum_gold";
/** /**
* 用户零钱 * 用户零钱
*/ */
...@@ -130,6 +134,7 @@ public class UserManager { ...@@ -130,6 +134,7 @@ public class UserManager {
ps.putString(ALIPAY_ACCOUNT, user.getAlipay_account()); ps.putString(ALIPAY_ACCOUNT, user.getAlipay_account());
ps.putString(USER_GOLD, String.valueOf(user.getCoin())); ps.putString(USER_GOLD, String.valueOf(user.getCoin()));
ps.putString(USER_CASH, String.format("%.2f", user.getSurplus())); ps.putString(USER_CASH, String.format("%.2f", user.getSurplus()));
ps.putString(USER_SUM_GOLD, String.valueOf(user.getSumCoin()));
ps.putBoolean(USER_OLD, !user.isFirstSignInApp()); ps.putBoolean(USER_OLD, !user.isFirstSignInApp());
ps.putString(WX_NAME, user.getNickName()); ps.putString(WX_NAME, user.getNickName());
...@@ -265,6 +270,10 @@ public class UserManager { ...@@ -265,6 +270,10 @@ public class UserManager {
ps.putString(ALIPAY_ACCOUNT, alipay); ps.putString(ALIPAY_ACCOUNT, alipay);
} }
public String getUserSumGold() {
return ps.getString(USER_SUM_GOLD);
}
/** /**
* 获取用户金币/积分 * 获取用户金币/积分
*/ */
......
...@@ -36,6 +36,16 @@ public class UserBean implements Serializable { ...@@ -36,6 +36,16 @@ public class UserBean implements Serializable {
private String alipay_account; private String alipay_account;
private String idcode; private String idcode;
private String gameInfo; private String gameInfo;
public String getSumCoin() {
return sumCoin;
}
public void setSumCoin(String sumCoin) {
this.sumCoin = sumCoin;
}
private String sumCoin;
private double surplus;//余额 private double surplus;//余额
private int coin;// 积分 private int coin;// 积分
private long pk_id;// 用户id private long pk_id;// 用户id
......
...@@ -33,6 +33,7 @@ import com.scwang.smartrefresh.layout.listener.OnRefreshListener ...@@ -33,6 +33,7 @@ import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import kotlinx.android.synthetic.main.fragment_main_friends.* import kotlinx.android.synthetic.main.fragment_main_friends.*
import kotlinx.android.synthetic.main.header_layout.* import kotlinx.android.synthetic.main.header_layout.*
import net.grandcentrix.tray.AppPreferences import net.grandcentrix.tray.AppPreferences
import java.math.BigDecimal
/** /**
* 描述:邀请好友 * 描述:邀请好友
...@@ -368,7 +369,7 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC ...@@ -368,7 +369,7 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
// 第一次邀请提示弹框 // 第一次邀请提示弹框
firstWeChatInvite() firstWeChatInvite()
} else { } else {
shareImgBounsDialog() shareImgDialog()
} }
} }
...@@ -491,9 +492,16 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC ...@@ -491,9 +492,16 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
} else { } else {
title = "Hi,我是" + userManager.wxName title = "Hi,我是" + userManager.wxName
} }
var sumCoin = if (TextUtils.isEmpty(userManager.userSumGold)) {
"0"
} else {
val allcoinBig = BigDecimal(userManager.userSumGold)
val rateBig = BigDecimal("1000")
allcoinBig.divide(rateBig).setScale(2, BigDecimal.ROUND_DOWN).toString()
}
val content = SpanUtils() val content = SpanUtils()
.append("我已在好赚钱赚了") .append("我已在好赚钱赚了")
.append("100").setFontSize(BubbleUtils.dp2px(10)).setForegroundColor(resources.getColor(R.color.color_E72C2B)) .append(sumCoin).setFontSize(BubbleUtils.dp2px(10)).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.append("元 ,快来跟我一起赚钱吧,满") .append("元 ,快来跟我一起赚钱吧,满")
.append("0.3").setFontSize(BubbleUtils.dp2px(10)).setForegroundColor(resources.getColor(R.color.color_E72C2B)) .append("0.3").setFontSize(BubbleUtils.dp2px(10)).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.append("元就可以提现") .append("元就可以提现")
......
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:bottom="-10dp"
android:left="-10dp"
android:right="-10dp">
<shape>
<stroke
android:width="10dp"
android:color="@color/color_F8F8F8" />
</shape>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 边 --> <!-- 边 -->
<item> <!-- <item>-->
<shape android:shape="rectangle"> <!-- <shape android:shape="rectangle">-->
<padding android:top="1dp" /> <!-- <padding android:top="1dp" />-->
<solid android:color="#00CCCCCC" /> <!-- <solid android:color="#00CCCCCC" />-->
<corners <!-- <corners-->
android:topLeftRadius="20dp" <!-- android:topLeftRadius="20dp"-->
android:topRightRadius="20dp" /> <!-- android:topRightRadius="20dp" />-->
</shape> <!-- </shape>-->
</item> <!-- </item>-->
<item> <!-- <item>-->
<shape android:shape="rectangle"> <!-- <shape android:shape="rectangle">-->
<padding android:top="1dp" /> <!-- <padding android:top="1dp" />-->
<solid android:color="#10CCCCCC" /> <!-- <solid android:color="#10CCCCCC" />-->
<corners <!-- <corners-->
android:topLeftRadius="20dp" <!-- android:topLeftRadius="20dp"-->
android:topRightRadius="20dp" /> <!-- android:topRightRadius="20dp" />-->
</shape> <!-- </shape>-->
</item> <!-- </item>-->
<item> <!-- <item>-->
<shape android:shape="rectangle"> <!-- <shape android:shape="rectangle">-->
<padding android:top="1dp" /> <!-- <padding android:top="1dp" />-->
<solid android:color="#20CCCCCC" /> <!-- <solid android:color="#20CCCCCC" />-->
<corners <!-- <corners-->
android:topLeftRadius="20dp" <!-- android:topLeftRadius="20dp"-->
android:topRightRadius="20dp" /> <!-- android:topRightRadius="20dp" />-->
</shape> <!-- </shape>-->
</item> <!-- </item>-->
<item> <item>
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<padding <padding
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
app:xTabDisplayNum="2" app:xTabDisplayNum="2"
app:xTabIndicatorColor="#FB560C" app:xTabIndicatorColor="#FB560C"
app:xTabIndicatorHeight="3dp" app:xTabIndicatorHeight="3dp"
app:xTabIndicatorRoundX="50dp"
app:xTabIndicatorRoundY="50dp"
app:xTabIndicatorWidth="30dp" app:xTabIndicatorWidth="30dp"
app:xTabMode="fixed" app:xTabMode="fixed"
app:xTabSelectedTextColor="#FB560C" app:xTabSelectedTextColor="#FB560C"
......
...@@ -402,6 +402,7 @@ ...@@ -402,6 +402,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:background="@drawable/shape_tab_friends" android:background="@drawable/shape_tab_friends"
android:elevation="4dip"
app:xTabIndicatorColor="#FB560C" app:xTabIndicatorColor="#FB560C"
app:xTabIndicatorHeight="4dp" app:xTabIndicatorHeight="4dp"
app:xTabIndicatorRoundX="50dp" app:xTabIndicatorRoundX="50dp"
......
...@@ -34,21 +34,18 @@ ...@@ -34,21 +34,18 @@
<include layout="@layout/item_fragment_main_my_clock" /> <include layout="@layout/item_fragment_main_my_clock" />
<include layout="@layout/item_divider_gray" />
<FrameLayout <FrameLayout
android:id="@+id/fl_my_banner" android:id="@+id/fl_my_banner"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginLeft="4dp" android:layout_marginLeft="4dp"
android:layout_marginTop="4dp"
android:layout_marginRight="4dp" android:layout_marginRight="4dp"
android:background="@drawable/shape_border_top"
android:visibility="gone" /> android:visibility="gone" />
<include <include layout="@layout/item_divider_gray" />
android:id="@+id/item_divider"
layout="@layout/item_divider_gray" />
<include layout="@layout/item_fragment_main_my_promotions" /> <include layout="@layout/item_fragment_main_my_promotions" />
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout 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_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
...@@ -8,7 +9,7 @@ ...@@ -8,7 +9,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<RelativeLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:layout_gravity="bottom"
...@@ -21,18 +22,27 @@ ...@@ -21,18 +22,27 @@
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginEnd="6dp" /> app:layout_constraintBottom_toBottomOf="@+id/item_iv_qrcode"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_toEndOf="@id/item_iv_avatar" android:layout_toEndOf="@id/item_iv_avatar"
android:orientation="vertical"> android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/item_iv_qrcode"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toEndOf="@+id/item_iv_avatar"
app:layout_constraintTop_toTopOf="parent">
<TextView <TextView
android:id="@+id/item_tv_name" android:id="@+id/item_tv_name"
android:layout_width="90dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end" android:ellipsize="end"
android:lines="1" android:lines="1"
...@@ -41,7 +51,7 @@ ...@@ -41,7 +51,7 @@
<TextView <TextView
android:id="@+id/item_tv_info" android:id="@+id/item_tv_info"
android:layout_width="100dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="2dp" android:layout_marginTop="2dp"
android:layout_marginBottom="2dp" android:layout_marginBottom="2dp"
...@@ -54,9 +64,12 @@ ...@@ -54,9 +64,12 @@
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_centerVertical="true" /> android:layout_centerVertical="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</RelativeLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</com.mints.goodmoney.ui.widgets.CornerView> </com.mints.goodmoney.ui.widgets.CornerView>
......
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