完善个人资料,编辑页面调整,领取奖励页面构建

This commit is contained in:
18401019693 2023-05-10 15:30:36 +08:00
parent 229c8e72cf
commit 73b075b2a7
10 changed files with 490 additions and 143 deletions

View File

@ -1151,4 +1151,8 @@ Limited ride And limited avatar frame</string>
<string name="delete_account2">After clicking delete, it will take effect immediately and cannot be restored. Are you sure you want to continue?</string>
<string name="delete_account3">Confirm deletion</string>
<string name="complete_information">完整填寫領大禮</string>
<string name="complete_information_consumable">填寫“*”的選項可完成</string>
<string name="love_powder">真愛粉\n頭像框(7天)</string>
<string name="golden_beans_128">128金豆</string>
<string name="love_powder_medal">真愛粉\n勛章(7天)</string>
</resources>

View File

@ -93,9 +93,10 @@
<style name="edit_profile_group" parent="AppTheme">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">60dp</item>
<item name="android:layout_height">45dp</item>
<item name="android:paddingLeft">15dp</item>
<item name="android:paddingRight">15dp</item>
<item name="android:background">@color/white</item>
</style>
<style name="Theme.PayssionTrans" parent="Theme.AppCompat.Light">

View File

@ -2,8 +2,10 @@ package com.yunbao.main.activity;
import android.app.Dialog;
import android.content.Intent;
import android.graphics.Color;
import android.text.TextUtils;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
@ -33,7 +35,6 @@ import com.yunbao.common.utils.ProcessImageUtil;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.main.R;
import com.yunbao.main.http.MainHttpConsts;
import com.yunbao.main.http.MainHttpUtil;
@ -70,6 +71,9 @@ public class EditProfileActivity extends AbsActivity {
private boolean isInto = true;
private String isBind = "0", mobile = "";
private boolean isName = false;
private View viewProgress1, viewProgress2, viewProgress3;
private FrameLayout completeInformation1, completeInformation2, completeInformation3;
private TextView information1, information2, information3;
@Override
protected int getLayoutId() {
@ -86,7 +90,15 @@ public class EditProfileActivity extends AbsActivity {
mSex = (TextView) findViewById(R.id.sex);
mCity = (TextView) findViewById(R.id.city);
tv_bind_phone = (TextView) findViewById(R.id.tv_bind_phone);
viewProgress1 = findViewById(R.id.view_progress1);
viewProgress2 = findViewById(R.id.view_progress2);
viewProgress3 = findViewById(R.id.view_progress3);
completeInformation1 = findViewById(R.id.complete_information1);
completeInformation2 = findViewById(R.id.complete_information2);
completeInformation3 = findViewById(R.id.complete_information3);
information1 = findViewById(R.id.information1);
information2 = findViewById(R.id.information2);
information3 = findViewById(R.id.information3);
mImageUtil = new ProcessImageUtil(this);
mImageUtil.setImageResultCallback(new ImageResultCallback() {
@Override
@ -368,6 +380,60 @@ public class EditProfileActivity extends AbsActivity {
}
private void showData(UserBean u) {
int index = 0;
String birthday = u.getBirthday();
String location = u.getLocation();
String bindPhone = u.getMobile();
if (!TextUtils.isEmpty(bindPhone)) {
index = index + 1;
}
if (!TextUtils.isEmpty(location)) {
index = index + 1;
}
if (!TextUtils.isEmpty(birthday)) {
index = index + 1;
}
if (index == 0) {
completeInformation1.setBackgroundResource(R.mipmap.bg_complete_information_progress);
completeInformation2.setBackgroundResource(R.mipmap.bg_complete_information_progress);
completeInformation3.setBackgroundResource(R.mipmap.bg_complete_information_progress);
information1.setVisibility(View.INVISIBLE);
information2.setVisibility(View.INVISIBLE);
information3.setVisibility(View.INVISIBLE);
viewProgress1.setBackgroundColor(Color.parseColor("#DEE4F1"));
viewProgress2.setBackgroundColor(Color.parseColor("#DEE4F1"));
viewProgress3.setBackgroundColor(Color.parseColor("#DEE4F1"));
} else if (index == 1) {
information1.setVisibility(View.INVISIBLE);
information2.setVisibility(View.VISIBLE);
information3.setVisibility(View.VISIBLE);
completeInformation1.setBackgroundResource(R.mipmap.bg_complete_information_progress2);
completeInformation2.setBackgroundResource(R.mipmap.bg_complete_information_progress);
completeInformation3.setBackgroundResource(R.mipmap.bg_complete_information_progress);
viewProgress1.setBackgroundColor(Color.parseColor("#FFE5D0"));
viewProgress2.setBackgroundColor(Color.parseColor("#DEE4F1"));
viewProgress3.setBackgroundColor(Color.parseColor("#DEE4F1"));
} else if (index == 2) {
information1.setVisibility(View.INVISIBLE);
information2.setVisibility(View.INVISIBLE);
information3.setVisibility(View.VISIBLE);
completeInformation1.setBackgroundResource(R.mipmap.bg_complete_information_progress2);
completeInformation2.setBackgroundResource(R.mipmap.bg_complete_information_progress2);
completeInformation3.setBackgroundResource(R.mipmap.bg_complete_information_progress);
viewProgress1.setBackgroundColor(Color.parseColor("#FFE5D0"));
viewProgress2.setBackgroundColor(Color.parseColor("#FFE5D0"));
viewProgress3.setBackgroundColor(Color.parseColor("#DEE4F1"));
} else if (index == 3) {
information1.setVisibility(View.INVISIBLE);
information2.setVisibility(View.INVISIBLE);
information3.setVisibility(View.INVISIBLE);
completeInformation1.setBackgroundResource(R.mipmap.bg_complete_information_progress2);
completeInformation2.setBackgroundResource(R.mipmap.bg_complete_information_progress2);
completeInformation3.setBackgroundResource(R.mipmap.bg_complete_information_progress2);
viewProgress1.setBackgroundColor(Color.parseColor("#FFE5D0"));
viewProgress2.setBackgroundColor(Color.parseColor("#FFE5D0"));
viewProgress3.setBackgroundColor(Color.parseColor("#FFE5D0"));
}
ImgLoader.displayAvatar(mContext, u.getAvatar(), mAvatar);
mName.setText(u.getUserNiceName());
mSign.setText(u.getSignature());
@ -375,9 +441,9 @@ public class EditProfileActivity extends AbsActivity {
mSex.setText(u.getSex() == 1 ? R.string.sex_male : R.string.sex_female);
mCity.setText(u.getLocation());
if ("1".equals(u.getIs_bind())) {
tv_bind_phone.setText("");
isBind = "1";
mobile = u.getMobile();
tv_bind_phone.setText(mobile);
isBind = "1";
} else {
tv_bind_phone.setText(getResources().getString(R.string.bind_phone_text));
isBind = "0";
@ -467,9 +533,9 @@ public class EditProfileActivity extends AbsActivity {
@Override
public void callback(UserBean u) {
if (u != null && "1".equals(u.getIs_bind())) {
tv_bind_phone.setText("");
isBind = "1";
mobile = u.getMobile();
tv_bind_phone.setText(mobile);
isBind = "1";
} else {
tv_bind_phone.setText(getResources().getString(R.string.bind_phone_text));
isBind = "0";

View File

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:background="#F7F8F9"
android:orientation="vertical">
<include layout="@layout/view_title" />
@ -19,7 +19,7 @@
android:layout_centerVertical="true"
android:text="@string/edit_profile_avatar"
android:textColor="@color/textColor"
android:textSize="16sp" />
android:textSize="14sp" />
<com.makeramen.roundedimageview.RoundedImageView
@ -44,7 +44,8 @@
<View
style="@style/line2"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp" />
android:layout_marginRight="15dp"
android:visibility="gone" />
<RelativeLayout
android:id="@+id/btn_name"
@ -57,7 +58,7 @@
android:layout_centerVertical="true"
android:text="@string/edit_profile_nickname"
android:textColor="@color/textColor"
android:textSize="16sp" />
android:textSize="14sp" />
<TextView
android:id="@+id/name"
@ -69,8 +70,8 @@
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:textColor="@color/gray3"
android:textSize="16sp"
android:textColor="#353535"
android:textSize="14sp"
android:textStyle="bold" />
<ImageView
@ -85,127 +86,8 @@
<View
style="@style/line2"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp" />
<RelativeLayout
android:id="@+id/btn_sex"
style="@style/edit_profile_group"
android:onClick="editProfileClick">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="@string/edit_profile_sex"
android:textColor="@color/textColor"
android:textSize="16sp" />
<TextView
android:id="@+id/sex"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="25dp"
android:textColor="@color/gray3"
android:textSize="16sp"
android:textStyle="bold" />
<ImageView
android:layout_width="16dp"
android:layout_height="18dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@mipmap/icon_arrow_right" />
</RelativeLayout>
<View
style="@style/line2"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp" />
<RelativeLayout
android:id="@+id/btn_birthday"
style="@style/edit_profile_group"
android:onClick="editProfileClick">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="@string/edit_profile_birthday"
android:textColor="@color/textColor"
android:textSize="16sp" />
<TextView
android:id="@+id/birthday"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="70dp"
android:layout_marginRight="25dp"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:textColor="@color/gray3"
android:textSize="16sp"
android:textStyle="bold" />
<ImageView
android:layout_width="16dp"
android:layout_height="18dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@mipmap/icon_arrow_right" />
</RelativeLayout>
<View
style="@style/line2"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp" />
<RelativeLayout
android:id="@+id/btn_city"
style="@style/edit_profile_group"
android:onClick="editProfileClick">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="@string/edit_profile_city"
android:textColor="@color/textColor"
android:textSize="16sp" />
<TextView
android:id="@+id/city"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="70dp"
android:layout_marginRight="25dp"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:textColor="@color/gray3"
android:textSize="16sp"
android:textStyle="bold" />
<ImageView
android:layout_width="16dp"
android:layout_height="18dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@mipmap/icon_arrow_right" />
</RelativeLayout>
<View
style="@style/line2"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp" />
android:layout_marginRight="15dp"
android:visibility="gone" />
<RelativeLayout
android:id="@+id/btn_sign"
@ -218,7 +100,7 @@
android:layout_centerVertical="true"
android:text="@string/edit_profile_sign"
android:textColor="@color/textColor"
android:textSize="16sp" />
android:textSize="14sp" />
<TextView
android:id="@+id/sign"
@ -230,8 +112,8 @@
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:textColor="@color/gray3"
android:textSize="16sp"
android:textColor="#353535"
android:textSize="14sp"
android:textStyle="bold" />
<ImageView
@ -245,7 +127,160 @@
<View
style="@style/line2"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp" />
android:layout_marginRight="15dp"
android:visibility="gone" />
<RelativeLayout
android:id="@+id/btn_birthday"
style="@style/edit_profile_group"
android:onClick="editProfileClick">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="@string/edit_profile_birthday"
android:textColor="@color/textColor"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:layout_marginTop="10dp"
android:text="*"
android:textColor="#FF5730"
android:textSize="9sp" />
<TextView
android:id="@+id/birthday"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="70dp"
android:layout_marginRight="25dp"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:textColor="#353535"
android:textSize="14sp"
android:textStyle="bold" />
<ImageView
android:layout_width="16dp"
android:layout_height="18dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@mipmap/icon_arrow_right" />
</RelativeLayout>
<View
style="@style/line2"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:visibility="gone" />
<RelativeLayout
android:id="@+id/btn_sex"
style="@style/edit_profile_group"
android:onClick="editProfileClick">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="@string/edit_profile_sex"
android:textColor="@color/textColor"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:layout_marginTop="10dp"
android:text="*"
android:textColor="#FF5730"
android:textSize="9sp" />
<TextView
android:id="@+id/sex"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="25dp"
android:textColor="#353535"
android:textSize="14sp"
android:textStyle="bold" />
<ImageView
android:layout_width="16dp"
android:layout_height="18dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@mipmap/icon_arrow_right" />
</RelativeLayout>
<View
style="@style/line2"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:visibility="gone" />
<RelativeLayout
android:id="@+id/btn_city"
style="@style/edit_profile_group"
android:onClick="editProfileClick">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="@string/edit_profile_city"
android:textColor="@color/textColor"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="44dp"
android:layout_marginTop="10dp"
android:text="*"
android:textColor="#FF5730"
android:textSize="9sp" />
<TextView
android:id="@+id/city"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="70dp"
android:layout_marginRight="25dp"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:textColor="#353535"
android:textSize="14sp"
android:textStyle="bold" />
<ImageView
android:layout_width="16dp"
android:layout_height="18dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@mipmap/icon_arrow_right" />
</RelativeLayout>
<View
style="@style/line2"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:visibility="gone" />
<RelativeLayout
android:id="@+id/rt_bind_phone"
@ -258,7 +293,16 @@
android:layout_centerVertical="true"
android:text="@string/bind_phone"
android:textColor="@color/textColor"
android:textSize="16sp" />
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="58dp"
android:layout_marginTop="10dp"
android:text="*"
android:textColor="#FF5730"
android:textSize="9sp" />
<TextView
android:id="@+id/tv_bind_phone"
@ -271,8 +315,8 @@
android:gravity="right"
android:singleLine="true"
android:text="@string/bind_phone_text"
android:textColor="@color/gray3"
android:textSize="16sp"
android:textColor="#353535"
android:textSize="14sp"
android:textStyle="bold" />
<ImageView
@ -286,5 +330,237 @@
<View
style="@style/line2"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp" />
android:layout_marginRight="15dp"
android:visibility="gone" />
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="213.5dp"
android:layout_gravity="bottom"
android:background="@mipmap/bg_gift_completely"
android:orientation="vertical">
<LinearLayout
android:id="@+id/complete_information_top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="14.5dp"
android:layout_marginTop="24.5dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/complete_information"
android:textColor="#333333"
android:textSize="15sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="7dp"
android:text="@string/complete_information_consumable"
android:textColor="#999999"
android:textSize="13sp" />
</LinearLayout>
<FrameLayout
android:id="@+id/complete_information_top2"
android:layout_width="230dp"
android:layout_height="wrap_content"
android:layout_below="@id/complete_information_top"
android:layout_marginStart="14.5dp"
android:layout_marginTop="10.9dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="4dp"
android:layout_gravity="center_vertical">
<View
android:id="@+id/view_progress1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="7dp"
android:layout_marginEnd="1dp"
android:layout_weight="1"
android:background="#FFE5D0" />
<View
android:id="@+id/view_progress2"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="10dp"
android:layout_weight="1"
android:background="#FFE5D0" />
<View
android:id="@+id/view_progress3"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="12dp"
android:layout_weight="1"
android:background="#FFE5D0" />
</LinearLayout>
<FrameLayout
android:layout_width="15.5dp"
android:layout_height="15.5dp"
android:background="@mipmap/bg_complete_information_progress2">
</FrameLayout>
<FrameLayout
android:id="@+id/complete_information1"
android:layout_width="15.5dp"
android:layout_height="15.5dp"
android:layout_marginStart="70dp"
android:background="@mipmap/bg_complete_information_progress">
<TextView
android:id="@+id/information1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="2"
android:textColor="@color/white"
android:textSize="7.99sp" />
</FrameLayout>
<FrameLayout
android:id="@+id/complete_information2"
android:layout_width="15.5dp"
android:layout_height="15.5dp"
android:layout_marginStart="140dp"
android:background="@mipmap/bg_complete_information_progress">
<TextView
android:id="@+id/information2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="3"
android:textColor="@color/white"
android:textSize="7.99sp" />
</FrameLayout>
<FrameLayout
android:id="@+id/complete_information3"
android:layout_width="15.5dp"
android:layout_height="15.5dp"
android:layout_marginStart="215dp"
android:background="@mipmap/bg_complete_information_progress">
<TextView
android:id="@+id/information3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="4"
android:textColor="@color/white"
android:textSize="7.99sp" />
</FrameLayout>
</FrameLayout>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="15dp"
android:layout_marginTop="81.5dp"
android:layout_marginEnd="15dp"
android:layout_marginBottom="20dp"
app:cardBackgroundColor="#FDF3EB"
app:cardCornerRadius="8dp"
app:cardElevation="0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<!--头像 金豆 勋章-->
<ImageView
android:layout_width="49dp"
android:layout_height="49dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp"
android:src="@mipmap/icon_profile_photo" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="7.5dp"
android:gravity="center"
android:text="@string/love_powder"
android:textColor="#C7683C"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<ImageView
android:layout_width="49dp"
android:layout_height="49dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp"
android:src="@mipmap/icon_golden_bean" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="7.5dp"
android:gravity="center"
android:text="@string/golden_beans_128"
android:textColor="#C7683C"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<ImageView
android:layout_width="49dp"
android:layout_height="49dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp"
android:src="@mipmap/icon_medal" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="7.5dp"
android:gravity="center"
android:text="@string/love_powder_medal"
android:textColor="#C7683C"
android:textSize="10sp" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>
</LinearLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB