Commit 588a279e authored by jianglx's avatar jianglx

最新的会员模块

parent 1f09bb8e
...@@ -7,6 +7,7 @@ import android.os.Bundle; ...@@ -7,6 +7,7 @@ import android.os.Bundle;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.Toast;
import com.base.utils.tools.android.NetworkUtil; import com.base.utils.tools.android.NetworkUtil;
import com.ruiwenliu.wrapper.SPConstance; import com.ruiwenliu.wrapper.SPConstance;
...@@ -36,6 +37,8 @@ public class WelcomeActivity extends BaseActivity<CommonPresenter> { ...@@ -36,6 +37,8 @@ public class WelcomeActivity extends BaseActivity<CommonPresenter> {
private boolean isImInitOk = false; private boolean isImInitOk = false;
private boolean isInterval = false;
@Override @Override
public void onShowResult(int requestType, BaseBean result) { public void onShowResult(int requestType, BaseBean result) {
if (requestType == 0) { if (requestType == 0) {
...@@ -47,21 +50,13 @@ public class WelcomeActivity extends BaseActivity<CommonPresenter> { ...@@ -47,21 +50,13 @@ public class WelcomeActivity extends BaseActivity<CommonPresenter> {
config = bean.getData(); config = bean.getData();
AppConfig appConfig = AppConfig.initConfig(config); AppConfig appConfig = AppConfig.initConfig(config);
RvCache.getInstance().save(appConfig, CacheEnum.IM_CONFIG); RvCache.getInstance().save(appConfig, CacheEnum.IM_CONFIG);
if (isInterval && !isFinishing()) {
go();
}
} }
} }
} }
@Override
public void onShowError(String errorMsg, int errorType) {
AppConfig appConfig = (AppConfig) RvCache.getInstance().get(CacheEnum.IM_CONFIG);
if (appConfig == null) {
if (!NetworkUtil.isNetworkAvailable(getApplicationContext())) {
showToast("网络异常,im初始化失败,请退出重进");
}
return;
}
isImInitOk = true;
}
@Override @Override
protected int setLayout() { protected int setLayout() {
...@@ -71,8 +66,17 @@ public class WelcomeActivity extends BaseActivity<CommonPresenter> { ...@@ -71,8 +66,17 @@ public class WelcomeActivity extends BaseActivity<CommonPresenter> {
@Override @Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) { protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
showTitle(false);//隐藏菜单栏 showTitle(false);//隐藏菜单栏
interval();
AppConfig appConfig = (AppConfig) RvCache.getInstance().get(CacheEnum.IM_CONFIG);
if (appConfig == null) {
if (!NetworkUtil.isNetworkAvailable(getApplicationContext())) {
Toast.makeText(getApplicationContext(), "网络异常,im初始化失败,请退出重进", Toast.LENGTH_SHORT).show();
}
return;
} else {
isImInitOk = true;
}
interval();
LogUtil.d("start"); LogUtil.d("start");
} }
...@@ -97,36 +101,22 @@ public class WelcomeActivity extends BaseActivity<CommonPresenter> { ...@@ -97,36 +101,22 @@ public class WelcomeActivity extends BaseActivity<CommonPresenter> {
*/ */
private void interval() { private void interval() {
mDisposable = Flowable.interval(2, TimeUnit.SECONDS) mDisposable = Flowable.interval(2, TimeUnit.SECONDS)
.doOnNext(new Consumer<Long>() { .doOnNext(aLong -> {
@Override
public void accept(@NonNull Long aLong) throws Exception {
}
}) })
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<Long>() { .subscribe(aLong -> {
@Override isInterval = true;
public void accept(@NonNull Long aLong) { try {
try { String token = Cookie.getStringValue(getApplicationContext(), SPConstance.USER_JSON_TOKEN, "");
String token = Cookie.getStringValue(getApplicationContext(), SPConstance.USER_JSON_TOKEN, ""); String tokenTime = Cookie.getStringValue(getApplicationContext(), SPConstance.USER_JSON_TOKE_TIME, "");
String tokenTime = Cookie.getStringValue(getApplicationContext(), SPConstance.USER_JSON_TOKE_TIME, ""); if (!TextUtils.isEmpty(token)) {
if (!TextUtils.isEmpty(token)) { OkGoUtil.setToken(token, tokenTime);
OkGoUtil.setToken(token, tokenTime);
}
} catch (Exception e) {
e.printStackTrace();
}
if (isImInitOk) {
SharedPreferences preferences = getSharedPreferences("first_open", MODE_PRIVATE);
if (preferences.getBoolean("first", true)) {
preferences.edit().putBoolean("first", false).commit();
startActivity(GuideActivity.getIntent(mActivity));
} else {
startActivity(MainActivity.getIntent(mActivity));
}
mDisposable.dispose();
finish();
} }
} catch (Exception e) {
e.printStackTrace();
}
if (isImInitOk) {
go();
} }
}); });
...@@ -141,6 +131,18 @@ public class WelcomeActivity extends BaseActivity<CommonPresenter> { ...@@ -141,6 +131,18 @@ public class WelcomeActivity extends BaseActivity<CommonPresenter> {
} }
} }
private void go() {
SharedPreferences preferences = getSharedPreferences("first_open", MODE_PRIVATE);
if (preferences.getBoolean("first", true)) {
preferences.edit().putBoolean("first", false).commit();
startActivity(GuideActivity.getIntent(mActivity));
} else {
startActivity(MainActivity.getIntent(mActivity));
}
mDisposable.dispose();
finish();
}
@Override @Override
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
"title": "A" "title": "A"
}, { }, {
"lists": [{ "lists": [{
"name": "北京", "name": "北京",
"id": 110000 "id": 110100
}, { }, {
"name": "白银市", "name": "白银市",
"id": 620400 "id": 620400
...@@ -51,6 +51,9 @@ ...@@ -51,6 +51,9 @@
}, { }, {
"name": "巴中市", "name": "巴中市",
"id": 511900 "id": 511900
},{
"name": "北海市",
"id": 450500
}, { }, {
"name": "北海新区", "name": "北海新区",
"id": 371627 "id": 371627
...@@ -77,7 +80,7 @@ ...@@ -77,7 +80,7 @@
}, { }, {
"lists": [{ "lists": [{
"name": "重庆", "name": "重庆",
"id": 500000 "id": 500100
}, { }, {
"name": "成都市", "name": "成都市",
"id": 510100 "id": 510100
...@@ -640,8 +643,8 @@ ...@@ -640,8 +643,8 @@
"title": "R" "title": "R"
}, { }, {
"lists": [{ "lists": [{
"name": "上海", "name": "上海",
"id": 310000 "id": 310100
}, { }, {
"name": "深圳市", "name": "深圳市",
"id": 440300 "id": 440300
...@@ -719,7 +722,7 @@ ...@@ -719,7 +722,7 @@
}, { }, {
"lists": [{ "lists": [{
"name": "天津", "name": "天津",
"id": 120000 "id": 120100
}, { }, {
"name": "太原市", "name": "太原市",
"id": 140100 "id": 140100
...@@ -805,8 +808,8 @@ ...@@ -805,8 +808,8 @@
"name": "厦门市", "name": "厦门市",
"id": 350200 "id": 350200
}, { }, {
"name": "西安", "name": "西安",
"id": 220403 "id": 610100
}, { }, {
"name": "西宁市", "name": "西宁市",
"id": 630100 "id": 630100
...@@ -1173,10 +1176,10 @@ ...@@ -1173,10 +1176,10 @@
}, { }, {
"name": "中山区", "name": "中山区",
"id": 210202 "id": 210202
},{ }, {
"name": "中山市", "name": "中山市",
"id": 442000 "id": 442000
},{ }, {
"name": "钟山区", "name": "钟山区",
"id": 520201 "id": 520201
}, { }, {
......
...@@ -29,6 +29,7 @@ import java.lang.reflect.ParameterizedType; ...@@ -29,6 +29,7 @@ import java.lang.reflect.ParameterizedType;
public abstract class BaseActivity<P extends MvpPresenter> extends BaseWrapperActivity implements BaseView, NetWorkReceiver.NetChangListener { public abstract class BaseActivity<P extends MvpPresenter> extends BaseWrapperActivity implements BaseView, NetWorkReceiver.NetChangListener {
protected P mPresenter; protected P mPresenter;
private LoadingDialog mLoadingDialog; private LoadingDialog mLoadingDialog;
private boolean isLoadData = false;
@Override @Override
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
...@@ -44,7 +45,10 @@ public abstract class BaseActivity<P extends MvpPresenter> extends BaseWrapperAc ...@@ -44,7 +45,10 @@ public abstract class BaseActivity<P extends MvpPresenter> extends BaseWrapperAc
} }
mPresenter.attachView(this); mPresenter.attachView(this);
mLoadingDialog = createLoadingDialog(); mLoadingDialog = createLoadingDialog();
loadData(savedInstanceState, getIntent()); if (NetworkUtil.isNetworkAvailable(mActivity)) {
isLoadData = true;
loadData(savedInstanceState, getIntent());
}
NetWorkReceiver.getInstance().register(this); NetWorkReceiver.getInstance().register(this);
} }
...@@ -119,7 +123,10 @@ public abstract class BaseActivity<P extends MvpPresenter> extends BaseWrapperAc ...@@ -119,7 +123,10 @@ public abstract class BaseActivity<P extends MvpPresenter> extends BaseWrapperAc
@Override @Override
public void netAvailable() { public void netAvailable() {
loadData(null, getIntent()); if (!isLoadData) {
loadData(null, getIntent());
isLoadData = true;
}
} }
@Override @Override
......
...@@ -51,6 +51,9 @@ ...@@ -51,6 +51,9 @@
}, { }, {
"name": "巴中市", "name": "巴中市",
"id": 511900 "id": 511900
},{
"name": "北海市",
"id": 450500
}, { }, {
"name": "北海新区", "name": "北海新区",
"id": 371627 "id": 371627
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="30dp" />
<solid android:color="#464546" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="30dp" />
<solid android:color="#E7C48B" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="30dp" />
<solid android:color="#AAAEBA" />
</shape>
\ No newline at end of file
...@@ -4,12 +4,14 @@ import android.content.Context; ...@@ -4,12 +4,14 @@ import android.content.Context;
import android.graphics.Color; import android.graphics.Color;
import android.text.SpannableString; import android.text.SpannableString;
import android.text.Spanned; import android.text.Spanned;
import android.text.TextUtils;
import android.text.style.AbsoluteSizeSpan; import android.text.style.AbsoluteSizeSpan;
import android.text.style.ForegroundColorSpan; import android.text.style.ForegroundColorSpan;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.BaseAdapter; import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
...@@ -35,6 +37,11 @@ public class GridMemerAdapter extends BaseAdapter { ...@@ -35,6 +37,11 @@ public class GridMemerAdapter extends BaseAdapter {
this.mListener = listener; this.mListener = listener;
} }
public void setDate(List<MemberListBean.MemberCard> data) {
mData = data;
notifyDataSetChanged();
}
@Override @Override
public int getCount() { public int getCount() {
return mData.size(); return mData.size();
...@@ -61,7 +68,7 @@ public class GridMemerAdapter extends BaseAdapter { ...@@ -61,7 +68,7 @@ public class GridMemerAdapter extends BaseAdapter {
holder.tv_discount = view.findViewById(R.id.tv_discount); holder.tv_discount = view.findViewById(R.id.tv_discount);
holder.tv_free_day = view.findViewById(R.id.tv_free_day); holder.tv_free_day = view.findViewById(R.id.tv_free_day);
holder.tv_price = view.findViewById(R.id.tv_price); holder.tv_price = view.findViewById(R.id.tv_price);
holder.tv_type_icon = view.findViewById(R.id.tv_type_icon); holder.tv_type = view.findViewById(R.id.tv_type);
view.setTag(holder); view.setTag(holder);
} else { } else {
holder = (ViewHolder) view.getTag(); holder = (ViewHolder) view.getTag();
...@@ -69,30 +76,36 @@ public class GridMemerAdapter extends BaseAdapter { ...@@ -69,30 +76,36 @@ public class GridMemerAdapter extends BaseAdapter {
SpannableString s = new SpannableString("¥" + memberCard.getPrice()); SpannableString s = new SpannableString("¥" + memberCard.getPrice());
s.setSpan(new AbsoluteSizeSpan(12, true), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); s.setSpan(new AbsoluteSizeSpan(10, true), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
s.setSpan(new AbsoluteSizeSpan(18, true), 1, s.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); s.setSpan(new AbsoluteSizeSpan(18, true), 1, s.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
s.setSpan(new ForegroundColorSpan(Color.parseColor("#FFB74B")), 1, s.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
if (selecPosition == i) {
s.setSpan(new ForegroundColorSpan(Color.parseColor("#ffffff")), 0, s.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
} else {
s.setSpan(new ForegroundColorSpan(Color.parseColor("#999999")), 0, s.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
holder.tv_price.setText(s); holder.tv_price.setText(s);
holder.tv_discount.setText("永久" + memberCard.getDiscount() / 10 + "折租车"); holder.tv_discount.setText("永久" + memberCard.getDiscount() / 10 + "折租车");
holder.tv_free_day.setText(memberCard.getNumber() + "天免费租车"); holder.tv_free_day.setText(memberCard.getNumber() + "天免费租车");
holder.tv_type.setText(TextUtils.isEmpty(memberCard.getName()) ? " " : memberCard.getName());
holder.tv_type_icon.setText(memberCard.getName());
switch (memberCard.getLevel()) {
case 1:
holder.tv_type_icon.setBackgroundResource(R.drawable.member_icon_reg_members);
break;
case 2:
holder.tv_type_icon.setBackgroundResource(R.drawable.member_icon_gold_membership);
break;
case 3:
holder.tv_type_icon.setBackgroundResource(R.drawable.member_icon_dia_membership);
break;
}
if (selecPosition == i) { if (selecPosition == i) {
holder.rl_content.setBackgroundResource(R.drawable.shape_rv_bg_member_selected); if (i == 0) {
holder.rl_content.setBackgroundResource(R.drawable.bg_card_normal_member);
} else if (i == 1) {
holder.rl_content.setBackgroundResource(R.drawable.bg_card_gold_member);
} else if (i == 2) {
holder.rl_content.setBackgroundResource(R.drawable.bg_card_diamond_member);
}
holder.tv_type.setTextColor(Color.WHITE);
holder.tv_discount.setTextColor(Color.WHITE);
holder.tv_free_day.setTextColor(Color.WHITE);
} else { } else {
holder.rl_content.setBackgroundResource(R.drawable.shape_rv_bg_member_unselected); holder.rl_content.setBackgroundResource(R.drawable.bg_member_unselect);
holder.tv_type.setTextColor(Color.parseColor("#999999"));
holder.tv_discount.setTextColor(Color.parseColor("#999999"));
holder.tv_free_day.setTextColor(Color.parseColor("#999999"));
} }
holder.rl_content.setOnClickListener(new View.OnClickListener() { holder.rl_content.setOnClickListener(new View.OnClickListener() {
...@@ -107,10 +120,10 @@ public class GridMemerAdapter extends BaseAdapter { ...@@ -107,10 +120,10 @@ public class GridMemerAdapter extends BaseAdapter {
} }
private class ViewHolder { private class ViewHolder {
RelativeLayout rl_content; LinearLayout rl_content;
TextView tv_type;
TextView tv_price; TextView tv_price;
TextView tv_discount; TextView tv_discount;
TextView tv_free_day; TextView tv_free_day;
TextView tv_type_icon;
} }
} }
package com.rv.member.view;
import android.content.Context;
import android.graphics.Typeface;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.style.TextAppearanceSpan;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.base.utils.ui.image.round.RoundImageView;
import com.ruiwenliu.wrapper.bean.UserInfoBean;
import com.ruiwenliu.wrapper.util.glide.GlideManager;
import com.rv.component.utils.DisplayUtil;
import com.rv.member.R;
public class LoginView extends LinearLayout {
private LinearLayout llLogin;
private RoundImageView ivAvatar;
private TextView tvNickname;
private ImageView ivMemberLevel;
private TextView tvConsumeRecord;
private TextView tvFreeDay;
private TextView tvPurchaseRecord;
private UserInfoBean infoBean;
public LoginView(Context context) {
super(context);
initView();
}
public LoginView(Context context, AttributeSet attrs) {
super(context, attrs);
initView();
}
public void setData(UserInfoBean infoBean) {
this.infoBean = infoBean;
setViewData();
}
private void setViewData() {
if (infoBean != null) {
UserInfoBean.UserInfo info = infoBean.getData();
if (info != null) {
if (info.getIsMember() == 0) {
llLogin.setBackgroundResource(R.drawable.bg_normal_user);
ivMemberLevel.setVisibility(GONE);
} else {
switch (info.getMemberLevel()) {
case 1:
llLogin.setBackgroundResource(R.drawable.bg_normal_member);
break;
case 2:
llLogin.setBackgroundResource(R.drawable.bg_gold_member);
break;
case 3:
llLogin.setBackgroundResource(R.drawable.bg_diamond_member);
break;
default:
break;
}
}
GlideManager.getInstance(getContext()).loadImage(info.getHeadimgurl(), ivAvatar);
tvNickname.setText(!TextUtils.isEmpty(info.getNickname()) ? info.getNickname() : info.getUsername());
SpannableStringBuilder recordBuilder = new SpannableStringBuilder(info.getPayCount() + "\n 消费记录") ;
recordBuilder.setSpan(new TextAppearanceSpan(null, Typeface.NORMAL, DisplayUtil.sp2px(getContext(), 18), null, null), 0, String.valueOf(info.getPayCount()).length(), Spanned.SPAN_EXCLUSIVE_INCLUSIVE);
tvConsumeRecord.setText(recordBuilder);
SpannableStringBuilder rentBuilder = new SpannableStringBuilder(info.getRentFreeDays() + "\n 可免费租车 (天)") ;
rentBuilder.setSpan(new TextAppearanceSpan(null, Typeface.NORMAL, DisplayUtil.sp2px(getContext(), 18), null, null), 0, String.valueOf(info.getRentFreeDays()).length(), Spanned.SPAN_EXCLUSIVE_INCLUSIVE);
tvFreeDay.setText(rentBuilder);
SpannableStringBuilder bugBuilder = new SpannableStringBuilder(info.getBuyCount() + "\n 购买记录 (次)") ;
bugBuilder.setSpan(new TextAppearanceSpan(null, Typeface.NORMAL, DisplayUtil.sp2px(getContext(), 18), null, null), 0, String.valueOf(info.getBuyCount()).length(), Spanned.SPAN_EXCLUSIVE_INCLUSIVE);
tvPurchaseRecord.setText(bugBuilder);
if (!TextUtils.isEmpty(info.getIcon()))
GlideManager.getInstance(getContext()).loadImage(info.getIcon(), ivMemberLevel);
}
}
}
private void initView() {
View view = LayoutInflater.from(getContext()).inflate(R.layout.item_login_view, null);
llLogin = view.findViewById(R.id.ll_login);
ivAvatar = view.findViewById(R.id.iv_avatar);
tvNickname = view.findViewById(R.id.tv_nickname);
ivMemberLevel = view.findViewById(R.id.iv_member_level);
tvConsumeRecord = view.findViewById(R.id.tv_consume_record);
tvFreeDay = view.findViewById(R.id.tv_free_day);
tvPurchaseRecord = view.findViewById(R.id.tv_purchase_record);
addView(view);
}
}
...@@ -21,15 +21,21 @@ public class MemberCardView extends LinearLayout { ...@@ -21,15 +21,21 @@ public class MemberCardView extends LinearLayout {
private int type = 0; private int type = 0;
private int[] imgDiscounts = { private int[] imgDiscounts = {
R.drawable.member_discount_6, R.drawable.icon_vip_normal,
R.drawable.member_discount_7, R.drawable.icon_vip_gold,
R.drawable.member_discount_8 R.drawable.icon_vip_diamond
}; };
private int[] imgFreeDays = { private int[] imgFreeDays = {
R.drawable.member_free_day_5, R.drawable.icon_car_normal,
R.drawable.member_free_day_12, R.drawable.icon_car_gold,
R.drawable.member_free_day_28 R.drawable.icon_car_diamond
};
private int[] imgOutDoors = {
R.drawable.icon_outdoor_normal,
R.drawable.icon_outdoor_gold,
R.drawable.icon_outdoor_diamond
}; };
public MemberCardView(Context context, AttributeSet attrs) { public MemberCardView(Context context, AttributeSet attrs) {
...@@ -50,7 +56,7 @@ public class MemberCardView extends LinearLayout { ...@@ -50,7 +56,7 @@ public class MemberCardView extends LinearLayout {
text = "%d天免费用车"; text = "%d天免费用车";
} else if (type == 2) { } else if (type == 2) {
tvText.setText(R.string.tv_outdoors_act); tvText.setText(R.string.tv_outdoors_act);
imgIcon.setImageResource(R.drawable.member_icon_free); // imgIcon.setImageResource(imgOutDoors[]);
} }
addView(view); addView(view);
} }
...@@ -63,7 +69,7 @@ public class MemberCardView extends LinearLayout { ...@@ -63,7 +69,7 @@ public class MemberCardView extends LinearLayout {
if (tvText != null && imgIcon != null) { if (tvText != null && imgIcon != null) {
switch (type) { switch (type) {
case 0: case 0:
if (value == 60) { if (value == 80) {
res = imgDiscounts[0]; res = imgDiscounts[0];
} else if (value == 70) { } else if (value == 70) {
res = imgDiscounts[1]; res = imgDiscounts[1];
...@@ -81,6 +87,16 @@ public class MemberCardView extends LinearLayout { ...@@ -81,6 +87,16 @@ public class MemberCardView extends LinearLayout {
res = imgFreeDays[0]; res = imgFreeDays[0];
tvText.setText(String.format(text, value)); tvText.setText(String.format(text, value));
imgIcon.setImageResource(res); imgIcon.setImageResource(res);
break;
case 2:
if(value == 1){
imgIcon.setImageResource(imgOutDoors[0]);
}else if(value == 2){
imgIcon.setImageResource(imgOutDoors[1]);
}else if(value == 3){
imgIcon.setImageResource(imgOutDoors[2]);
}
break; break;
default: default:
break; break;
......
package com.rv.member.view;
import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.rv.member.MemberCenterActivity;
import com.rv.member.R;
import com.rv.member.bean.MemberListBean;
public class MemberItemView extends LinearLayout {
private TextView tv_member_type;
private MemberCardView mcv_discount, mcv_free_day, mcv_free_outdoors;
private TextView tv_describe;
private Button btn_buy;
private View viewLine;
private boolean hasAgree = false;
private MemberCenterActivity.PayListener listener;
private MemberListBean.MemberCard memberCard = null;
public MemberItemView(Context context) {
super(context);
initView();
}
public MemberItemView(Context context, AttributeSet attrs) {
super(context, attrs);
initView();
}
public void setHasAgree(boolean hasAgree) {
this.hasAgree = hasAgree;
}
public void setData(MemberListBean.MemberCard card) {
this.memberCard = card;
setData();
}
public void setListener(MemberCenterActivity.PayListener listener) {
this.listener = listener;
}
public void hiddenLine() {
if (viewLine != null) viewLine.setVisibility(GONE);
}
private void initView() {
View view = LayoutInflater.from(getContext()).inflate(R.layout.item_member_detail, null);
tv_member_type = view.findViewById(R.id.tv_member_type);
mcv_discount = view.findViewById(R.id.mcv_discount);
mcv_free_day = view.findViewById(R.id.mcv_free_day);
mcv_free_outdoors = view.findViewById(R.id.mcv_free_outdoors);
tv_describe = view.findViewById(R.id.tv_describe);
btn_buy = view.findViewById(R.id.btn_buy);
viewLine = view.findViewById(R.id.view_line);
addView(view);
}
private void setData() {
if (!TextUtils.isEmpty(memberCard.getName())) {
tv_member_type.setText(memberCard.getName());
btn_buy.setText("立即开通" + memberCard.getName());
if (memberCard.getLevel() == 1) {
btn_buy.setBackgroundResource(R.drawable.shape_rv_bg_open_normal_member);
} else if (memberCard.getLevel() == 2) {
btn_buy.setBackgroundResource(R.drawable.shape_rv_bg_open_gold_member);
} else {
btn_buy.setBackgroundResource(R.drawable.shape_rv_bg_open_diamond_member);
}
}
btn_buy.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (!hasAgree) {
Toast.makeText(getContext(), "需同意服务协议", Toast.LENGTH_SHORT).show();
return;
}
if (listener != null) {
listener.pay(memberCard);
}
}
});
if (!TextUtils.isEmpty(memberCard.getDescribe())) {
tv_describe.setText(memberCard.getDescribe());
}
mcv_discount.setValue(memberCard.getDiscount());
mcv_free_day.setValue(memberCard.getNumber());
mcv_free_outdoors.setValue(memberCard.getLevel());
}
}
package com.rv.member.view;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.rv.member.R;
public class UnLoginView extends RelativeLayout {
private TextView tvLogin;
private OnClickListener onClickListener;
public UnLoginView(Context context) {
super(context);
initView();
}
public UnLoginView(Context context, AttributeSet attrs) {
super(context, attrs);
initView();
}
public void setLoginListener(OnClickListener listener) {
this.onClickListener = listener;
}
private void initView() {
View view = LayoutInflater.from(getContext()).inflate(R.layout.item_unlogin_view, null);
tvLogin = view.findViewById(R.id.tv_login);
tvLogin.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (onClickListener != null) onClickListener.onClick(v);
}
});
addView(view);
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!--空心框 圆角 少量红-->
<corners android:radius="@dimen/size_30" />
<solid android:color="#FFC772" />
</shape>
\ No newline at end of file
...@@ -5,6 +5,6 @@ ...@@ -5,6 +5,6 @@
<gradient <gradient
android:startColor="#E5B895" android:startColor="#E5B895"
android:endColor="#F8D3B8" android:endColor="#F8D3B8"
android:angle="90" android:angle="0"
/> />
</shape> </shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout 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"
android:orientation="vertical"> android:orientation="vertical">
<ScrollView
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/size_15"
android:layout_marginRight="@dimen/dp_10"
android:layout_marginBottom="13dp"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/rl_unlogin"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="@drawable/shape_rv_bg_top_unlogin"
android:gravity="center"
android:orientation="horizontal">
<com.base.utils.ui.image.round.RoundImageView
android:id="@+id/iv_avatar_default"
android:layout_width="@dimen/size_60"
android:layout_height="@dimen/size_60"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/size_15"
android:src="@drawable/common_icon_avatar_default" />
<TextView
android:id="@+id/tv_login"
android:layout_width="@dimen/size_100"
android:layout_height="33.33dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_gravity="center"
android:layout_marginRight="@dimen/size_15"
android:background="@drawable/shape_rv_bg_circle_white"
android:gravity="center"
android:text="@string/tv_login"
android:textColor="@color/colorYellow"
android:textSize="@dimen/text_14" />
</RelativeLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_login"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/shape_rv_bg_top_unlogin"
android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout <com.rv.member.view.MemberTopView
android:id="@+id/member_top_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content" />
<com.base.utils.ui.image.round.RoundImageView
android:id="@+id/iv_avatar"
android:layout_width="@dimen/size_60"
android:layout_height="@dimen/size_60"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_margin="@dimen/dp_10"
android:src="@drawable/common_icon_avatar_default" />
<TextView
android:id="@+id/tv_nickname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/iv_avatar"
android:ellipsize="end"
android:maxLength="10"
android:text="xxxxxx"
android:textColor="@color/white"
android:textSize="@dimen/text_16" />
<ImageView
android:id="@+id/iv_member_level"
android:layout_width="@dimen/size_60"
android:layout_height="@dimen/size_60"
android:layout_alignParentRight="true"
android:layout_marginRight="@dimen/dp_40" />
</RelativeLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_10" android:background="#F2F2F2"
android:gravity="center_vertical" android:orientation="vertical">
android:orientation="horizontal"
android:paddingLeft="@dimen/size_15" <LinearLayout
android:paddingRight="@dimen/size_15"> android:layout_width="match_parent"
<TextView
android:id="@+id/tv_consume_record"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_weight="1"
android:gravity="center"
android:lines="2"
android:text="0 \n 消费记录 "
android:textColor="@color/white"
android:textSize="@dimen/sp_14" />
<View
android:layout_width="1px"
android:layout_height="match_parent"
android:background="@color/white" />
<TextView
android:id="@+id/tv_free_day"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_marginTop="@dimen/size_8"
android:layout_weight="1" android:layout_marginBottom="@dimen/size_8"
android:gravity="center" android:gravity="center"
android:lines="2" android:orientation="horizontal">
android:text="0 \n 可免费租车 (天) "
android:textColor="@color/white"
android:textSize="@dimen/sp_14" />
<View
android:layout_width="1px"
android:layout_height="match_parent"
android:background="@color/white" />
<TextView
android:id="@+id/tv_purchase_record"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_weight="1"
android:gravity="center_horizontal|bottom"
android:lines="2"
android:text="0 \n 购买记录 (次)"
android:textColor="@color/white"
android:textSize="@dimen/sp_14" />
</LinearLayout> <ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/member_icon_small_yellow_circle" />
</LinearLayout> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:text="会员特权"
android:textColor="@color/colorMain"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout> <ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/member_icon_small_yellow_circle" />
<!-- 记录模块 -->
<View </LinearLayout>
android:layout_width="match_parent"
android:layout_height="0.2dp"
android:layout_marginTop="@dimen/dp_10"
android:background="@color/colorGray" />
<android.support.v7.widget.RecyclerView <android.support.v7.widget.CardView
android:id="@+id/recyclerView" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" /> android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:background="@color/white"
app:cardCornerRadius="@dimen/dp_10">
<LinearLayout
android:id="@+id/ll_cardview_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
</android.support.v7.widget.CardView>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout> </LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.base.utils.ui.image.round.RoundImageView
android:id="@+id/iv_avatar"
android:layout_width="@dimen/size_60"
android:layout_height="@dimen/size_60"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_margin="@dimen/dp_10"
android:src="@drawable/common_icon_avatar_default" />
<TextView
android:id="@+id/tv_nickname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/iv_avatar"
android:ellipsize="end"
android:maxLength="10"
android:text="xxxxxx"
android:textColor="@color/white"
android:textSize="17sp" />
<ImageView
android:id="@+id/iv_member_level"
android:layout_width="@dimen/size_60"
android:layout_height="@dimen/size_60"
android:layout_alignParentRight="true"
android:layout_marginRight="@dimen/dp_40" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_10"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15">
<TextView
android:id="@+id/tv_consume_record"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_weight="1"
android:gravity="center"
android:lines="2"
android:text="0 \n 消费记录 "
android:textColor="@color/white"
android:textSize="@dimen/text_10" />
<View
android:layout_width="1px"
android:layout_height="match_parent"
android:background="@color/white" />
<TextView
android:id="@+id/tv_free_day"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_weight="1"
android:gravity="center"
android:lines="2"
android:text="0 \n 可免费租车 (天) "
android:textColor="@color/white"
android:textSize="@dimen/text_10" />
<View
android:layout_width="1px"
android:layout_height="match_parent"
android:background="@color/white" />
<TextView
android:id="@+id/tv_purchase_record"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_weight="1"
android:gravity="center_horizontal|bottom"
android:lines="2"
android:text="0 \n 购买记录 (次)"
android:textColor="@color/white"
android:textSize="@dimen/text_10" />
</LinearLayout>
</LinearLayout>
...@@ -6,92 +6,93 @@ ...@@ -6,92 +6,93 @@
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:layout_marginLeft="@dimen/dp_10"
android:textStyle="bold"
android:id="@+id/tv_member_type" android:id="@+id/tv_member_type"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/black" android:layout_marginLeft="@dimen/dp_10"
android:textSize="@dimen/size_18" /> android:layout_marginTop="@dimen/dp_10"
android:textColor="#333333"
android:textSize="@dimen/sp_14"
android:textStyle="bold" />
<RelativeLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_20" android:layout_marginTop="@dimen/size_5"
android:orientation="horizontal"> android:orientation="horizontal"
android:weightSum="3">
<com.rv.member.view.MemberCardView <RelativeLayout
android:id="@+id/mcv_discount" android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_weight="1">
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/size_20"
app:card_type="0" />
<com.rv.member.view.MemberCardView <com.rv.member.view.MemberCardView
android:id="@+id/mcv_free_day" android:id="@+id/mcv_discount"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:layout_marginLeft="@dimen/size_20" app:card_type="0" />
app:card_type="1" /> </RelativeLayout>
<com.rv.member.view.MemberCardView <RelativeLayout
android:id="@+id/mcv_free_outdoors" android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_weight="1">
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/size_20"
app:card_type="2" />
</RelativeLayout> <com.rv.member.view.MemberCardView
android:id="@+id/mcv_free_day"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
app:card_type="1" />
</RelativeLayout>
<LinearLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginTop="@dimen/size_20"
android:gravity="center|left"
android:orientation="horizontal">
<ImageView
android:id="@+id/img_icon"
android:layout_width="@dimen/size_20"
android:layout_height="@dimen/size_20" />
<TextView
android:textColor="@color/black"
android:id="@+id/tv_member_type_price_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="5dp" /> android:layout_weight="1">
<com.rv.member.view.MemberCardView
android:id="@+id/mcv_free_outdoors"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
app:card_type="2" />
</RelativeLayout>
</LinearLayout> </LinearLayout>
<TextView <TextView
android:layout_marginTop="@dimen/dp_10"
android:id="@+id/tv_describe" android:id="@+id/tv_describe"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_20" android:layout_marginLeft="@dimen/size_20"
android:layout_marginRight="@dimen/size_20" android:layout_marginRight="@dimen/size_20"
android:background="@drawable/shape_rv_bg_dark_gray" android:textColor="#666666"
android:minHeight="@dimen/size_120" android:textSize="@dimen/dp_10" />
android:padding="@dimen/dp_10" />
<Button <Button
android:id="@+id/btn_buy" android:id="@+id/btn_buy"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_40" android:layout_height="@dimen/dp_40"
android:layout_marginLeft="@dimen/size_20" android:layout_marginLeft="@dimen/size_20"
android:layout_marginTop="@dimen/size_15" android:layout_marginTop="13dp"
android:layout_marginRight="@dimen/size_20" android:layout_marginRight="@dimen/size_20"
android:layout_marginBottom="@dimen/size_20" android:layout_marginBottom="13dp"
android:background="@drawable/shape_rv_bg_dark_yellow" android:background="@drawable/shape_rv_bg_dark_yellow"
android:gravity="center" android:gravity="center"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/text_16" /> android:textSize="@dimen/text_16" />
<View
android:id="@+id/view_line"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="13dp"
android:layout_marginRight="13dp"
android:background="#cccccc" />
</LinearLayout> </LinearLayout>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/size_5" android:paddingLeft="@dimen/size_5"
android:paddingRight="@dimen/size_5" android:paddingRight="@dimen/size_5">
android:layout_weight="1">
<RelativeLayout <LinearLayout
android:id="@+id/rl_content" android:id="@+id/rl_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/size_150" android:layout_height="@dimen/size_150"
android:layout_marginTop="@dimen/size_15" android:background="@drawable/bg_card_normal_member"
android:background="@drawable/shape_rv_bg_member_unselected"> android:gravity="center_horizontal"
android:orientation="vertical">
<TextView <TextView
android:id="@+id/tv_price" android:id="@+id/tv_type"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true" android:layout_marginTop="@dimen/size_20"
android:layout_marginTop="@dimen/dp_40" android:textColor="@color/white"
android:gravity="center|bottom" android:textSize="16sp"
android:textStyle="bold" /> android:textStyle="bold" />
<LinearLayout <TextView
android:layout_width="match_parent" android:id="@+id/tv_discount"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_marginTop="@dimen/dp_10"
android:gravity="center_horizontal" android:layout_marginBottom="@dimen/size_5"
android:orientation="vertical"> android:textColor="@color/white"
android:textSize="@dimen/text_10" />
<TextView
android:id="@+id/tv_discount" <TextView
android:layout_width="wrap_content" android:id="@+id/tv_free_day"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:layout_marginBottom="@dimen/dp_10" android:layout_height="wrap_content"
android:textSize="@dimen/sp_14" /> android:textColor="@color/white"
android:textSize="@dimen/text_10" />
<TextView
android:id="@+id/tv_free_day"
android:layout_width="wrap_content" <TextView
android:layout_height="wrap_content" android:id="@+id/tv_price"
android:layout_marginBottom="@dimen/size_20" android:layout_width="match_parent"
android:textSize="@dimen/sp_14" /> android:layout_height="match_parent"
android:gravity="center"
</LinearLayout> android:textColor="@color/white"
android:textStyle="bold" />
</RelativeLayout> </LinearLayout>
<TextView </RelativeLayout>
android:id="@+id/tv_type_icon"
android:layout_width="@dimen/size_70"
android:layout_height="@dimen/size_30"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:textColor="@color/white" />
</FrameLayout>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_horizontal" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <ImageView
...@@ -15,9 +15,8 @@ ...@@ -15,9 +15,8 @@
android:id="@+id/tv_text" android:id="@+id/tv_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_12"
android:gravity="center" android:gravity="center"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="16sp" /> android:textSize="12sp" />
</LinearLayout> </LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_rv_bg_top_unlogin"
android:orientation="horizontal">
<com.base.utils.ui.image.round.RoundImageView
android:id="@+id/iv_avatar_default"
android:layout_width="@dimen/size_50"
android:layout_height="@dimen/size_50"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="13dp"
android:layout_marginTop="13dp"
android:layout_marginBottom="13dp"
android:src="@drawable/icon_default" />
<TextView
android:id="@+id/tv_login"
android:layout_width="@dimen/size_100"
android:layout_height="33.33dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_gravity="center"
android:layout_marginRight="@dimen/size_15"
android:background="@drawable/shape_rv_bg_circle_white"
android:gravity="center"
android:text="@string/tv_login"
android:textColor="@color/colorYellow"
android:textSize="@dimen/text_14" />
</RelativeLayout>
...@@ -5,43 +5,40 @@ ...@@ -5,43 +5,40 @@
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout <LinearLayout
android:id="@+id/rl_member_top" android:id="@+id/ll_member_top"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_20" android:orientation="horizontal"
android:visibility="gone"> android:visibility="gone"
android:weightSum="3">
<LinearLayout <LinearLayout
android:layout_width="@dimen/size_110" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_weight="1"
android:layout_marginLeft="@dimen/dp_10"
android:background="@drawable/shape_rv_bg_member_unselected"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <ImageView
android:id="@+id/img_discount_top" android:id="@+id/img_discount_top"
android:layout_width="@dimen/size_50" android:layout_width="@dimen/size_50"
android:layout_height="@dimen/size_50" android:layout_height="@dimen/size_50" />
android:layout_marginTop="13dp" />
<TextView <TextView
android:textColor="#333333"
android:id="@+id/tv_discount_top" android:id="@+id/tv_discount_top"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10" android:textSize="@dimen/text_12" />
android:textSize="@dimen/text_14"
android:textStyle="bold" />
<Button <Button
android:id="@+id/btn_disount_use" android:id="@+id/btn_disount_use"
android:layout_width="@dimen/size_80" android:layout_width="73dp"
android:layout_height="@dimen/size_28" android:layout_height="@dimen/size_28"
android:layout_marginTop="@dimen/dp_10" android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="@dimen/size_8" android:layout_marginBottom="@dimen/size_8"
android:background="@drawable/shape_rv_bg_member_top_purple" android:background="@drawable/shape_member_bg_btn_yellow"
android:gravity="center" android:gravity="center"
android:text="@string/tv_use_now" android:text="@string/tv_use_now"
android:textColor="@color/white" android:textColor="@color/white"
...@@ -51,36 +48,26 @@ ...@@ -51,36 +48,26 @@
<LinearLayout <LinearLayout
android:layout_width="@dimen/size_110" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_weight="1"
android:layout_marginLeft="@dimen/dp_10"
android:background="@drawable/shape_rv_bg_member_unselected"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<TextView <ImageView
android:id="@+id/img_freeday_top" android:id="@+id/img_freeday_top"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/size_50" android:layout_height="@dimen/size_50"
android:layout_marginTop="13dp"
android:background="@drawable/bg_member_free_day"
android:fontFamily="serif"
android:gravity="center"
android:minWidth="@dimen/size_50" android:minWidth="@dimen/size_50"
android:paddingLeft="@dimen/size_5" android:paddingLeft="@dimen/size_5"
android:paddingRight="@dimen/size_5" android:paddingRight="@dimen/size_5" />
android:textColor="@color/white"
android:textSize="@dimen/text_22"
android:textStyle="bold" />
<TextView <TextView
android:textColor="#333333"
android:id="@+id/tv_freeday_top" android:id="@+id/tv_freeday_top"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10" android:textSize="@dimen/text_12" />
android:textSize="@dimen/text_14"
android:textStyle="bold" />
<Button <Button
android:id="@+id/btn_freeday_use" android:id="@+id/btn_freeday_use"
...@@ -88,7 +75,7 @@ ...@@ -88,7 +75,7 @@
android:layout_height="@dimen/size_28" android:layout_height="@dimen/size_28"
android:layout_marginTop="@dimen/dp_10" android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="@dimen/size_8" android:layout_marginBottom="@dimen/size_8"
android:background="@drawable/shape_rv_bg_member_top_purple" android:background="@drawable/shape_member_bg_btn_yellow"
android:gravity="center" android:gravity="center"
android:text="@string/tv_use_now" android:text="@string/tv_use_now"
android:textColor="@color/white" android:textColor="@color/white"
...@@ -98,11 +85,9 @@ ...@@ -98,11 +85,9 @@
<LinearLayout <LinearLayout
android:layout_width="@dimen/size_110" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_weight="1"
android:layout_marginRight="@dimen/dp_10"
android:background="@drawable/shape_rv_bg_member_unselected"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
...@@ -110,17 +95,15 @@ ...@@ -110,17 +95,15 @@
android:id="@+id/img_free_top" android:id="@+id/img_free_top"
android:layout_width="@dimen/size_50" android:layout_width="@dimen/size_50"
android:layout_height="@dimen/size_50" android:layout_height="@dimen/size_50"
android:layout_marginTop="13dp"
android:src="@drawable/member_icon_free" /> android:src="@drawable/member_icon_free" />
<TextView <TextView
android:textColor="#333333"
android:id="@+id/tv_free_top" android:id="@+id/tv_free_top"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:text="@string/tv_outdoors_act" android:text="@string/tv_outdoors_act"
android:textSize="@dimen/text_14" android:textSize="@dimen/text_12" />
android:textStyle="bold" />
<Button <Button
android:layout_width="@dimen/size_80" android:layout_width="@dimen/size_80"
...@@ -136,14 +119,17 @@ ...@@ -136,14 +119,17 @@
</LinearLayout> </LinearLayout>
</RelativeLayout> </LinearLayout>
<ImageView <View
android:layout_width="160dp" android:id="@+id/view_line"
android:layout_height="@dimen/size_32" android:layout_width="match_parent"
android:layout_marginTop="@dimen/size_15" android:layout_height="1px"
android:src="@drawable/member_image_mem_privilege_title" /> android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="5dp"
android:layout_marginRight="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_10"
android:background="#CCCCCC" />
<GridView <GridView
...@@ -151,7 +137,6 @@ ...@@ -151,7 +137,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_5" android:layout_marginLeft="@dimen/size_5"
android:layout_marginTop="@dimen/size_20"
android:layout_marginRight="@dimen/size_5" android:layout_marginRight="@dimen/size_5"
android:orientation="horizontal" /> android:orientation="horizontal" />
...@@ -176,7 +161,8 @@ ...@@ -176,7 +161,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_30" android:layout_height="@dimen/size_30"
android:gravity="left|center_vertical" android:gravity="left|center_vertical"
android:text="@string/tv_agreement" /> android:text="@string/tv_agreement"
android:textSize="@dimen/text_10" />
</LinearLayout> </LinearLayout>
...@@ -184,14 +170,13 @@ ...@@ -184,14 +170,13 @@
<Button <Button
android:id="@+id/btn_buy" android:id="@+id/btn_buy"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_38" android:layout_height="@dimen/dp_40"
android:layout_marginLeft="@dimen/size_20" android:layout_marginLeft="@dimen/size_20"
android:layout_marginTop="@dimen/size_10" android:layout_marginTop="@dimen/size_10"
android:layout_marginRight="@dimen/size_20" android:layout_marginRight="@dimen/size_20"
android:layout_marginBottom="@dimen/size_20" android:layout_marginBottom="@dimen/size_20"
android:background="@drawable/shape_rv_bg_dark_yellow"
android:gravity="center" android:gravity="center"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/text_18" /> android:textSize="@dimen/sp_14" />
</LinearLayout> </LinearLayout>
<?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="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_login_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/size_10"
android:layout_marginRight="@dimen/dp_10"
android:layout_marginBottom="13dp"
android:orientation="vertical">
<com.rv.member.view.UnLoginView
android:id="@+id/unlogin_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone" />
<com.rv.member.view.LoginView
android:id="@+id/logined_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone" />
</LinearLayout>
<include layout="@layout/view_member_privilege" />
</LinearLayout>
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<string name="app_name">plugin_member</string> <string name="app_name">plugin_member</string>
<string name="tv_title_member_center">会员中心</string> <string name="tv_title_member_center">会员中心</string>
<string name="tv_outdoors_act">户外活动</string> <string name="tv_outdoors_act">沙龙讲座活动</string>
<string name="tv_agreement">同意滴房车 《会员服务协议会员规则</string> <string name="tv_agreement">同意 《会员服务协议</string>
<string name="tv_use_now">马上使用</string> <string name="tv_use_now">马上使用</string>
......
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