Commit 2a4dcffe authored by jianglx's avatar jianglx

合并 1.5.1的版本;刷新失败优化

parents e743e5e1 4792c921
......@@ -8,8 +8,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
flavorDimensions "default"
versionCode 154
versionName "1.5.4"
versionCode 155
versionName "1.5.5"
multiDexEnabled true
......
......@@ -69,8 +69,10 @@ public class RvClientApplication extends FrameApp {
ShareInstall.getInstance().init(this);
ShareInstall.getInstance().reportRegister();
}
LogUtil.setLogEnable(true, getApplicationContext());
CrashHandler.getInstance().init(getApplicationContext());
if(BuildConfig.DEBUG){
LogUtil.setLogEnable(true, getApplicationContext());
CrashHandler.getInstance().init(getApplicationContext());
}
// 在使用 SDK 各组间之前初始化 context 信息,传入 ApplicationContext
SDKInitializer.initialize(this);
//自4.3.0起,百度地图SDK所有接口均支持百度坐标和国测局坐标,用此方法设置您使用的坐标类型.
......
apply plugin: 'com.android.library'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
......@@ -77,7 +76,6 @@ android {
//api 'com.just.agentweb:filechooser:4.0.3-beta'
//api 'com.just.agentweb:download:4.0.3-beta'
//百度定位
api files('libs/BaiduLBS_Android.jar')
//bugly
......
......@@ -32,6 +32,7 @@ public class PickerPresenter extends CommonPresenter {
public final int TYPE_CAMERA_CROP_CODE = 1003;//照相并裁剪
public final int TYPE_ALBUM_CROP_CODE = 1004;//相册并裁剪
public final int TYPE_CROP_CODE = 1005;//裁剪后的结果
private String cameraUrl;
private File imageFile;
private Uri cropUri;
......
package com.ruiwenliu.wrapper.bean;
import com.google.gson.annotations.SerializedName;
import com.ruiwenliu.wrapper.base.BaseBean;
import java.io.Serializable;
......@@ -46,8 +45,14 @@ public class UserInfoBean extends BaseBean implements Serializable {
private String wxOpenid;
//微信unionid
private String unionid;
// 微信
private String wxNickname ;
//qq
private String openid;
// QQ昵称
private String qqNickname ;
// 支付宝昵称
private String aliPayNickName ;
//状态:0-启用,1-禁用
private Integer status;
//身份证号
......@@ -86,6 +91,8 @@ public class UserInfoBean extends BaseBean implements Serializable {
private String positionName;// 职位名称
private boolean isBindAliPay; //是否绑定支付宝
private boolean isBindWx ; // 是否绑定过微信
private boolean isBindQQ ; // 是否绑定过QQ;
public Integer getId() {
......@@ -311,5 +318,45 @@ public class UserInfoBean extends BaseBean implements Serializable {
public void setBindAliPay(boolean bindAliPay) {
isBindAliPay = bindAliPay;
}
public String getWxNickname() {
return wxNickname;
}
public void setWxNickname(String wxNickname) {
this.wxNickname = wxNickname;
}
public String getQqNickname() {
return qqNickname;
}
public void setQqNickname(String qqNickname) {
this.qqNickname = qqNickname;
}
public String getAliPayNickName() {
return aliPayNickName;
}
public void setAliPayNickName(String aliPayNickName) {
this.aliPayNickName = aliPayNickName;
}
public boolean isBindWx() {
return isBindWx;
}
public void setBindWx(boolean bindWx) {
isBindWx = bindWx;
}
public boolean isBindQQ() {
return isBindQQ;
}
public void setBindQQ(boolean bindQQ) {
isBindQQ = bindQQ;
}
}
}
......@@ -241,9 +241,9 @@ public class DateUtils {
* @return 失败返回-1 ,所以尽量是datetime1大于datetime2
*/
public static long compareDateSecond2(String datetime1, String datetime2) {
String date1=formatDate7(datetime1);
String date2=formatDate7(datetime2);
return compareDateSecond(date1,date2);
String date1 = formatDate7(datetime1);
String date2 = formatDate7(datetime2);
return compareDateSecond(date1, date2);
}
/**
......@@ -264,6 +264,24 @@ public class DateUtils {
}
}
/**
* 比较两个时间相差多少秒 datetime1-datetime2
*
* @param datetime1 yyyy-MM-dd HH:mm
* @param datetime2 yyyy-MM-dd HH:mm
* @return 失败返回-1 ,所以尽量是datetime1大于datetime2
*/
public static long compareDateSecond3(String datetime1, String datetime2) {
try {
Date date1 = sdf7.parse(datetime1);
Date date2 = sdf7.parse(datetime2);
return compareDateSecond(date1.getTime(), date2.getTime());
} catch (Exception e) {
e.printStackTrace();
return -1;
}
}
/**
* 比较两个时间相差多少秒 datetime1-datetime2
*
......@@ -430,8 +448,9 @@ public class DateUtils {
/**
* yyyy-MM 转化成 yyyy年MM月
*
* @param dateStr yyyy-MM
* @return yyyy年MM月
* @return yyyy年MM月
*/
public static String formatDate8To9(String dateStr) {
String day = "";
......@@ -567,6 +586,31 @@ public class DateUtils {
return day;
}
/**
* 给时间加上几个小时
*
* @param dateStr 当前时间 格式:yyyy-MM-dd HH:mm
* @param hour 需要加的时间
* @return
*/
public static String formatDate28(String dateStr, int hour) {
Date date = null;
try {
date = sdf7.parse(dateStr);
} catch (Exception ex) {
ex.printStackTrace();
}
if (date == null)
return "";
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(Calendar.HOUR, hour);// 24小时制
date = cal.getTime();
cal = null;
return sdf7.format(date);
}
/**
* 将yyyy-MM-dd HH:mm格式成yy-MM-dd HH:mm
......@@ -593,7 +637,7 @@ public class DateUtils {
String day = "";
try {
long time = sdf12.parse(dateStr).getTime();
time +=30*60*1000;
time += 30 * 60 * 1000;
Date da = new Date(time);
day = sdf12.format(da);
} catch (Exception e) {
......@@ -609,7 +653,7 @@ public class DateUtils {
String day = "";
try {
long time = sdf12.parse(dateStr).getTime();
time -=30*60*1000;
time -= 30 * 60 * 1000;
Date da = new Date(time);
day = sdf12.format(da);
} catch (Exception e) {
......@@ -619,14 +663,13 @@ public class DateUtils {
}
/**
* 把时分转成毫秒
*/
public static long formatDate20(String dateStr) {
long time =0;
long time = 0;
try {
time = sdf12.parse(dateStr).getTime();
time = sdf12.parse(dateStr).getTime();
} catch (Exception e) {
e.printStackTrace();
}
......@@ -823,7 +866,6 @@ public class DateUtils {
}
/**
* 获取网络时间
*
......@@ -851,13 +893,14 @@ public class DateUtils {
/**
* 获取手机当前时间yyMMddHHmmss
*
* @return
*/
public static String getPhoneCurTime(){
String timeStr="";
public static String getPhoneCurTime() {
String timeStr = "";
try {
Date date=new Date(System.currentTimeMillis());
timeStr=sdf3.format(date);
Date date = new Date(System.currentTimeMillis());
timeStr = sdf3.format(date);
} catch (Exception e) {
e.printStackTrace();
}
......
......@@ -41,4 +41,24 @@ public class IsAppInstall {
}
return false;
}
/**
* 判断qq是否可用
*
* @param context
* @return
*/
public static boolean isZfbClientAvailable(Context context) {
final PackageManager packageManager = context.getPackageManager();
List<PackageInfo> pinfo = packageManager.getInstalledPackages(0);
if (pinfo != null) {
for (int i = 0; i < pinfo.size(); i++) {
String pn = pinfo.get(i).packageName;
if (pn.equals("com.eg.android.AlipayGphone")) {
return true;
}
}
}
return false;
}
}
......@@ -163,6 +163,12 @@ public class CampFragment extends BaseFragment<CampPresenter> implements BaseQui
}
}
@Override
public void onShowError(String errorMsg, int errorType) {
super.onShowError(errorMsg, errorType);
mSimpleRefreshLayout.onRefreshComplete();
}
@OnClick({R2.id.tv_camp_type, R2.id.iv_camp_map, R2.id.v_shadow})
public void onViewClicked(View view) {
int id = view.getId();
......
......@@ -213,6 +213,12 @@ public class PatFragment extends BaseFragment<DiscoveryPresenter> implements Sim
}
}
@Override
public void onShowError(String errorMsg, int errorType) {
super.onShowError(errorMsg, errorType);
mSimpleRefreshLayout.onRefreshComplete();
}
private void setIMData(DiscoveryIMTokenBean bean) {
if ("0".equals(itemDatabean.getIsPraise())) {//0:未点赞 1:已点赞
Map<String, Object> map = new LinkedHashMap<>();
......
......@@ -146,7 +146,11 @@ public class QuestionAndAnswerFragment extends BaseFragment<DiscoveryPresenter>
onFresh();
break;
}
}
@Override
public void onShowError(String errorMsg, int errorType) {
super.onShowError(errorMsg, errorType);
mSimpleRefreshLayout.onRefreshComplete();
}
@Override
......
......@@ -198,6 +198,12 @@ public class RecommendFragment extends BaseFragment<DiscoveryPresenter> implemen
}
}
@Override
public void onShowError(String errorMsg, int errorType) {
super.onShowError(errorMsg, errorType);
mSimpleRefreshLayout.onRefreshComplete();
}
private void setIMData(DiscoveryIMTokenBean bean) {
if ("0".equals(itemDatabean.getIsPraise())) {//0:未点赞 1:已点赞
Map<String, Object> map = new LinkedHashMap<>();
......
......@@ -168,6 +168,12 @@ public class ShortVideoFragment extends BaseFragment<DiscoveryPresenter> impleme
processData((DiscoveryRecommendBean) result);
}
@Override
public void onShowError(String errorMsg, int errorType) {
super.onShowError(errorMsg, errorType);
mSimpleRefreshLayout.onRefreshComplete();
}
private void processData(DiscoveryRecommendBean bean) {
if (mPage == 1) {
countPage = bean.getData().getTotalPage();
......
......@@ -173,4 +173,10 @@ public class ApiConfig {
public static String HTTP_URL_CALENDAR_UNAUTH_PRICE = RvFrameConfig.HOST + "/vehicle/vehicle_model/calendar_price/app/unauth/app/price";
public static String HTTP_URL_PRERENT_DAYS = RvFrameConfig.HOST + "/api/app/cofig/app/unauth/types?types=999";
public static String HTTP_URL_CHECK_MOBILE_CODE = RvFrameConfig.HOST + "/api/admin/api/app/unauth/checkMobilecode";
public static String HTTP_URL_UPDATE_PHONE = RvFrameConfig.HOST + "/api/auth/jwt/updUsername";
public static String HTTP_URL_USER_BIND = RvFrameConfig.HOST + "/api/admin/app/user/bind";
}
......@@ -175,6 +175,7 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
onFresh();
}
@Override
public void onShowResult(int requestType, BaseBean result) {
mSimpleRefreshLayout.onRefreshComplete();
......@@ -192,6 +193,12 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
}
}
@Override
public void onShowError(String errorMsg, int errorType) {
super.onShowError(errorMsg, errorType);
mSimpleRefreshLayout.onRefreshComplete();
}
private void initData(CarAttributeListBean data) {
attributeListBean = data;
......
......@@ -262,19 +262,12 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
mSimpleRefreshLayout.setOnSimpleRefreshListener(this);
permissionProcess();
setBanner();
tvDay.setText(String.format("%1$s%2$s", copyDay, getContext().getString(R.string.rv_days)));
Drawable drawable = getResources().getDrawable(R.drawable.icon_day_times);
drawable.setBounds(0, 0, DisplayUtil.dip2px(getContext(), 25), DisplayUtil.dip2px(getContext(), 5));
tvDay.setCompoundDrawables(null, null, null, drawable);
begDate = MyUtils.getFetureDate(1) + " 09:00";
tvGetTime.setText(DateUtils.formatDate66(begDate));
tvGetWeek.setText("周" + MyUtils.getWeek(MyUtils.getFetureDate(1)));
endDate = MyUtils.getFetureDate(2) + " 18:00";
tvOutTime.setText(DateUtils.formatDate66(endDate));
tvOutWeek.setText("周" + MyUtils.getWeek(MyUtils.getFetureDate(2)));
copyDay = DateUtils.compareDateDay(MyUtils.getFetureDate(1), DateUtils.getCurDate()) + 1;
setDefaultTime();
llItemHotRvtour.setSelected(true);
tvItemRvTour.setSelected(true);
hotType = "2";
......@@ -443,6 +436,38 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
});
}
/**
* 设置默认时间
*/
private void setDefaultTime() {
String time = DateUtils.formatDate28(DateUtils.timestampToString1(DateUtils.getCurTimeMillis()), 2);
String hh = DateUtils.formatDate21(time);
String mm = DateUtils.formatDate22(time);
String begTime = "";
if (Double.valueOf(mm) > 30) { //判断当前分钟是否已经超过30,如果超过了取整加30分钟
begTime = DateUtils.formatDate19(hh + ":30");
} else {
begTime = hh + ":30";
}
if (DateUtils.formatDate20(begTime) > DateUtils.formatDate20("19:30")) { //如果当前时间大于 19:30,日期往后加一,时间改成早上8:00
begDate = MyUtils.getFetureDate(1) + " " + "08:00";
endDate = MyUtils.getFetureDate(3) + " " + "08:00";
} else {
begDate = MyUtils.getFetureDate(0) + " " + begTime;
endDate = MyUtils.getFetureDate(2) + " " + begTime;
}
tvGetTime.setText(DateUtils.formatDate66(begDate));
tvGetWeek.setText("周" + MyUtils.getWeek(DateUtils.formatDate16(begDate)));
tvOutTime.setText(DateUtils.formatDate66(endDate));
tvOutWeek.setText("周" + MyUtils.getWeek(DateUtils.formatDate16(endDate)));
copyDay = getCountDay(begDate, endDate);
tvDay.setText(String.format("%1$s%2$s", copyDay, getContext().getString(R.string.rv_days)));
}
@Override
public void onRefresh() {
......@@ -989,7 +1014,10 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
} else if (resultCode == 200 && requestCode == 108) {
begDate = data.getStringExtra("begDate");
endDate = data.getStringExtra("endDate");
copyDay = DateUtils.compareDateDay(endDate, begDate) + 1;
copyDay = getCountDay(begDate, endDate); //天数
// copyDay = DateUtils.compareDateDay(endDate, begDate) + 1;
if (tvGetTime != null) {
tvGetTime.setText(DateUtils.formatDate66(begDate));
}
......@@ -1008,6 +1036,26 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
}
}
/**
* 计算天数
*
* @param endDate2
* @param begDate2
* @return
*/
private long getCountDay(String begDate2, String endDate2) {
long second = DateUtils.compareDateSecond3(endDate2, begDate2); //两个时间相差的秒数
long day = (long) second / 86400; //天数
long remainder = (long) second % 86400; //余数 秒
if (day == 0) { //不够24小时也算一天
day = day + 1;
} else if (remainder > 14400) { //4小时内天数不增加,否则加一
day = day + 1;
}
return day;
}
/**
* 设置返回结果参数
......@@ -1028,15 +1076,16 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
case 3:
rvTourLatitude = lat;
rvTourLongitude = lon;
if (tvRvCity != null) {
if (tvRvCity != null && !TextUtils.isEmpty(data)) {
tvRvCity.setText(data);
}
break;
case 4:
if(travelCityText != null && !TextUtils.isEmpty(data))
travelCityText.setText(data);
// headTvGetCity.setText(data);
// headTvOutCity.setText(data);
if (tvRvCity != null) {
if (tvRvCity != null && !TextUtils.isEmpty(data)) {
tvRvCity.setText(data);
}
getShopList(false);
......
......@@ -195,10 +195,15 @@ public class SelectShopActivity extends BaseStatusActivity<CommonPresenter> impl
mAdapter.addData(bean.getData().getData());
mAdapter.loadMoreComplete();
}
}
}
@Override
public void onShowError(String errorMsg, int errorType) {
super.onShowError(errorMsg, errorType);
mSimpleRefreshLayout.onRefreshComplete();
}
/**
* 获取通用空布局
*
......
......@@ -228,6 +228,12 @@ public class AllOrderFragment extends BaseFragment<CommonPresenter> implements B
}
}
@Override
public void onShowError(String errorMsg, int errorType) {
super.onShowError(errorMsg, errorType);
mSimpleRefreshLayout.onRefreshComplete();
}
/**
* 支付类型选择
......
......@@ -181,5 +181,11 @@ public class CompletedFragment extends BaseFragment<CommonPresenter> implements
}
}
@Override
public void onShowError(String errorMsg, int errorType) {
super.onShowError(errorMsg, errorType);
mSimpleRefreshLayout.onRefreshComplete();
}
}
......@@ -273,6 +273,13 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements
}
}
@Override
public void onShowError(String errorMsg, int errorType) {
super.onShowError(errorMsg, errorType);
if (mPage == 1)
mSimpleRefreshLayout.onRefreshComplete();
}
/**
* 支付类型选择
*/
......
......@@ -38,7 +38,7 @@ import io.reactivex.schedulers.Schedulers;
* Desc:已出行
*/
public class HaveToTravelFragment extends BaseFragment<CommonPresenter>implements BaseQuickAdapter.RequestLoadMoreListener, SimpleRefreshLayout.OnSimpleRefreshListener {
public class HaveToTravelFragment extends BaseFragment<CommonPresenter> implements BaseQuickAdapter.RequestLoadMoreListener, SimpleRefreshLayout.OnSimpleRefreshListener {
@BindView(R2.id.recyclerView)
RecyclerView recyclerView;
@BindView(R2.id.refresh)
......@@ -73,9 +73,9 @@ public class HaveToTravelFragment extends BaseFragment<CommonPresenter>implement
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
OrderListBean.DataBeanX.DataBean dataBean = (OrderListBean.DataBeanX.DataBean) adapter.getItem(position);
if (1 ==dataBean.getType()) {
if (1 == dataBean.getType()) {
startActivityForResult(OrderDetailActivity.getIntent(_mActivity, dataBean.getNo()), 1);
}else if (2== dataBean.getType()){
} else if (2 == dataBean.getType()) {
startActivityForResult(TravelOrderDetailsActivity.getIntent(_mActivity, dataBean.getNo()), 2);
}
}
......@@ -85,9 +85,9 @@ public class HaveToTravelFragment extends BaseFragment<CommonPresenter>implement
@Override
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
int id = view.getId();
if (id == R.id.tv_process){
if (id == R.id.tv_process) {
OrderListBean.DataBeanX.DataBean dataBean = (OrderListBean.DataBeanX.DataBean) adapter.getItem(position);
startActivity(PickUpTheCarQRCodeActivity.getIntent(_mActivity,dataBean.getNo()));
startActivity(PickUpTheCarQRCodeActivity.getIntent(_mActivity, dataBean.getNo()));
}
}
});
......@@ -177,4 +177,11 @@ public class HaveToTravelFragment extends BaseFragment<CommonPresenter>implement
mAdapter.loadMoreComplete();
}
}
@Override
public void onShowError(String errorMsg, int errorType) {
super.onShowError(errorMsg, errorType);
if (mPage == 1)
mSimpleRefreshLayout.onRefreshComplete();
}
}
\ No newline at end of file
......@@ -201,4 +201,11 @@ public class ToTravelFragment extends BaseFragment<CommonPresenter> implements B
mAdapter.loadMoreComplete();
}
}
@Override
public void onShowError(String errorMsg, int errorType) {
super.onShowError(errorMsg, errorType);
if (mPage == 1)
mSimpleRefreshLayout.onRefreshComplete();
}
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
package="com.rv.rvmine">
<application>
<activity android:name=".fragment.MyReleasePatFragment"></activity>
<activity android:name=".fragment.MyReleasePatFragment" />
<activity
android:name=".personal.IDCardCertificationShowActivity"
android:screenOrientation="portrait" />
......@@ -13,7 +13,9 @@
<activity
android:name=".traveler.MyReleaseActivity"
android:screenOrientation="portrait" />
<activity android:name="com.rv.version.activity.UpdateAppActivity" />
<activity android:name=".traveler.AccountSafeActivity" />
<activity android:name=".traveler.BindPhoneActivity" />
<activity android:name=".traveler.AlterNickNameActivity"></activity>
</application>
</manifest>
\ No newline at end of file
......@@ -4,10 +4,15 @@ import android.annotation.SuppressLint;
import android.app.ActivityOptions;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.style.AbsoluteSizeSpan;
import android.text.style.ForegroundColorSpan;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
......@@ -93,7 +98,7 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
TextView tvLogin;
@BindView(R2.id.tv_verified)
TextView tvVerified;
// @BindView(R2.id.tv_membership_level)
// @BindView(R2.id.tv_membership_level)
// TextView tvMembershipLevel;
@BindView(R2.id.tv_member_hint)
TextView tvMemberHint;
......@@ -115,14 +120,16 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
Banner mineBanner;
@BindView(R2.id.refresh)
SimpleRefreshLayout mSimpleRefreshLayout;
@BindView(R2.id.tv_user_identity)
TextView tvUserIdentity;
// @BindView(R2.id.tv_user_identity)
// TextView tvUserIdentity;
@BindView(R2.id.tv_integral)
TextView tvIntegral;
@BindView(R2.id.tv_wallet)
TextView tvWallet;
@BindView(R2.id.tv_coupon)
TextView tvCoupon;
@BindView(R2.id.tv_capacity)
TextView tvCapacity;
private UserInfoBean.UserInfo info;
......@@ -149,14 +156,14 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
if (TextUtils.isEmpty(OkGoUtil.getToken())) {
tvNickname.setVisibility(View.GONE);
((View) ivMember.getParent()).setVisibility(View.GONE);
((View) ivMember.getParent().getParent()).setVisibility(View.GONE);
tvLogin.setVisibility(View.VISIBLE);
tvVerified.setVisibility(View.GONE);
tvViewPrivileges.setText("查看会员特权");
mSimpleRefreshLayout.setPullDownEnable(false);
} else {
tvNickname.setVisibility(View.VISIBLE);
((View) ivMember.getParent()).setVisibility(View.VISIBLE);
((View) ivMember.getParent().getParent()).setVisibility(View.VISIBLE);
// ivMember.setVisibility(View.VISIBLE);
tvLogin.setVisibility(View.GONE);
tvVerified.setVisibility(View.VISIBLE);
......@@ -171,6 +178,7 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
tvNickname.setText(userInfo.getNickname());
setMember(userInfo);
}
}
private void initRefresh() {
......@@ -254,7 +262,7 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
@OnClick({R2.id.iv_avatar, R2.id.tv_login, R2.id.tv_verified, R2.id.rl_item_to_be_paid, R2.id.rl_item_staying, R2.id.iv_item_message,
R2.id.rl_item_traveling, R2.id.rl_item_completed, R2.id.rl_item_collection, R2.id.rl_item_my_release,
R2.id.iv_item_setting, R2.id.ll_item_view_privileges, R2.id.rl_item_order_all, R2.id.ll_item_integral, R2.id.ll_item_wallet,
R2.id.ll_item_coupon, R2.id.ll_item_promotion, R2.id.rl_item_check_in, R2.id.rl_item_travel_management})
R2.id.ll_item_coupon, R2.id.ll_item_promotion, R2.id.rl_item_check_in, R2.id.rl_item_travel_management,R2.id.tv_nickname})
public void onViewClicked(View view) {
int id = view.getId();
if (id == R.id.iv_item_setting) {
......@@ -265,7 +273,7 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
if (isLogin()) return;
showToast("该功能还在开发中。。。");
} else if (id == R.id.iv_avatar) {
} else if (id == R.id.iv_avatar || id == R.id.tv_nickname) {
//头像
if (isLogin()) return;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
......@@ -382,16 +390,21 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
ivAvatar.setBackgroundResource(0);
ivAvatar.setImageResource(R.drawable.common_icon_avatar_default);
tvNickname.setVisibility(View.GONE);
((View) ivMember.getParent()).setVisibility(View.GONE);
((View) ivMember.getParent().getParent()).setVisibility(View.GONE);
// ivMember.setVisibility(View.GONE);
tvLogin.setVisibility(View.VISIBLE);
tvVerified.setVisibility(View.GONE);
tvUserIdentity.setVisibility(View.GONE);
// tvUserIdentity.setVisibility(View.GONE);
tvViewPrivileges.setText("查看会员特权");
// tvMembershipLevel.setText("会员中心");
tvMemberHint.setText("免费用车- -天");
tvIntegral.setText("0");
tvWallet.setText("0");
SpannableString s = new SpannableString("¥ 0");
s.setSpan(new AbsoluteSizeSpan(10, true), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
s.setSpan(new AbsoluteSizeSpan(20, true), 1, s.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
s.setSpan(new ForegroundColorSpan(Color.parseColor("#171413")), 0, s.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
tvWallet.setText(s);
tvCoupon.setText("0");
mSimpleRefreshLayout.setPullDownEnable(false);
}
......@@ -512,6 +525,12 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
}
}
@Override
public void onShowError(String errorMsg, int errorType) {
super.onShowError(errorMsg, errorType);
mSimpleRefreshLayout.onRefreshComplete();
}
/**
* 用户收益
*
......@@ -520,7 +539,12 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
private void profitData(InfoProfitBean bean) {
if (bean != null && bean.getData() != null) {
tvIntegral.setText(bean.getData().getTotalPoint());
tvWallet.setText(bean.getData().getBalance());
SpannableString s = new SpannableString("¥ "+bean.getData().getBalance());
s.setSpan(new AbsoluteSizeSpan(10, true), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
s.setSpan(new AbsoluteSizeSpan(20, true), 1, s.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
s.setSpan(new ForegroundColorSpan(Color.parseColor("#171413")), 0, s.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
tvWallet.setText(s);
tvCoupon.setText(bean.getData().getCouponNumber());
}
}
......@@ -532,6 +556,11 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
if (info != null) {
GlideManager.getInstance(_mActivity).loadImage(info.getHeadimgurl(), ivAvatar);
tvNickname.setText(info.getNickname());
if(!TextUtils.isEmpty(info.getPositionName())){
tvCapacity.setText(info.getPositionName());
tvCapacity.setVisibility(View.VISIBLE);
}
//更新实名信息
UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_USERINFO, JSON.toJSONString(info)).commit();
if (info.getCertificationStatus() == 0) { //实名认证状态:0-未认证,1-已认证
......@@ -546,26 +575,25 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
} else {
ivMember.setVisibility(View.GONE);
}
if (TextUtils.isEmpty(info.getPositionName())) {
tvUserIdentity.setVisibility(View.GONE);
} else {
tvUserIdentity.setText(info.getPositionName());
tvUserIdentity.setVisibility(View.VISIBLE);
}
// if (TextUtils.isEmpty(info.getPositionName())) {
// tvUserIdentity.setVisibility(View.GONE);
// } else {
// tvUserIdentity.setText(info.getPositionName());
// tvUserIdentity.setVisibility(View.VISIBLE);
//
// }
setMember(info);
}
if (TextUtils.isEmpty(OkGoUtil.getToken())) {
tvNickname.setVisibility(View.GONE);
((View) ivMember.getParent()).setVisibility(View.GONE);
((View) ivMember.getParent().getParent()).setVisibility(View.GONE);
// ivMember.setVisibility(View.GONE);
tvLogin.setVisibility(View.VISIBLE);
tvVerified.setVisibility(View.GONE);
} else {
tvNickname.setVisibility(View.VISIBLE);
((View) ivMember.getParent()).setVisibility(View.VISIBLE);
((View) ivMember.getParent().getParent()).setVisibility(View.VISIBLE);
// ivMember.setVisibility(View.VISIBLE);
tvLogin.setVisibility(View.GONE);
tvVerified.setVisibility(View.VISIBLE);
......
package com.rv.rvmine;
public interface SwitchFragmentListener {
void setTitle(String title) ;
void next();
void changeSuccess(String phone);
}
package com.rv.rvmine.bean;
public class AccountBindDto {
private String openId;
private String unionId;
private String nickName;
private String type;
private String code;
public String getOpenId() {
return openId;
}
public void setOpenId(String openId) {
this.openId = openId;
}
public String getUnionId() {
return unionId;
}
public void setUnionId(String unionId) {
this.unionId = unionId;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public AccountBindDto(String openId, String unionId, String nickName, String type, String code) {
this.openId = openId;
this.unionId = unionId;
this.nickName = nickName;
this.type = type;
this.code = code;
}
public AccountBindDto(String openId, String unionId, String nickName, String type) {
this.openId = openId;
this.unionId = unionId;
this.nickName = nickName;
this.type = type;
}
}
package com.rv.rvmine.bean;
import com.ruiwenliu.wrapper.base.BaseBean;
public class BindCallBackBean extends BaseBean {
private String data ;
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
}
package com.rv.rvmine.fragment;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseFragment;
import com.ruiwenliu.wrapper.base.presenter.CommonPresenter;
import com.rv.rvmine.R;
import com.rv.rvmine.R2;
import com.rv.rvmine.SwitchFragmentListener;
import butterknife.BindView;
public class BindPhoneFirstFragment extends BaseFragment<CommonPresenter> {
@BindView(R2.id.tv_phone)
TextView tvPhone;
@BindView(R2.id.btn_update_phone)
Button btnUpdatePhone;
private String phone;
@Override
public int getViewLayout() {
return R.layout.fragment_bind_phone_first;
}
@Override
protected void initView(Bundle savedInstanceState) {
((SwitchFragmentListener) _mActivity).setTitle("绑定手机号");
phone = getArguments().getString("phone");
if (!TextUtils.isEmpty(phone))
tvPhone.setText(phone);
btnUpdatePhone.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
((SwitchFragmentListener) _mActivity).next();
}
});
}
@Override
protected void loadData(Bundle savedInstanceState) {
}
@Override
public void onShowResult(int requestType, BaseBean result) {
}
}
package com.rv.rvmine.fragment;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.base.utils.tools.android.NetworkUtil;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseFragment;
import com.ruiwenliu.wrapper.base.presenter.CommonPresenter;
import com.ruiwenliu.wrapper.util.RxJavaManager;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.ui.login.bean.SendCodeBean;
import com.rv.rvmine.R;
import com.rv.rvmine.R2;
import com.rv.rvmine.SwitchFragmentListener;
import java.util.LinkedHashMap;
import java.util.Map;
import butterknife.BindView;
import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
public class BindPhoneSecondFragment extends BaseFragment<CommonPresenter> {
@BindView(R2.id.tv_phone)
TextView tvPhone;
@BindView(R2.id.tv_get_code)
TextView tvGetCode;
@BindView(R2.id.et_phone_code)
EditText etPhoneCode;
@BindView(R2.id.btn_next)
Button btnNext;
private String phone;
private Disposable mDisposable;
@Override
public int getViewLayout() {
return R.layout.fragment_bind_phone_second;
}
@Override
protected void initView(Bundle savedInstanceState) {
((SwitchFragmentListener) _mActivity).setTitle("验证手机号");
phone = getArguments().getString("phone");
if (!TextUtils.isEmpty(phone))
tvPhone.setText(phone);
etPhoneCode.addTextChangedListener(watcher);
tvGetCode.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (TextUtils.isEmpty(getPhone())) {
showToast(getString(com.rv.home.R.string.rv_phone_hint));
return;
}
if (getPhone().length() != 11) {
showToast("手机号码不正确");
return;
}
sendCode();
}
});
btnNext.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (TextUtils.isEmpty(getPhone()) || getPhone().length() != 11) {
showToast("手机号码不正确");
return;
}
if (TextUtils.isEmpty(getCode())) {
showToast("短信验证码为空");
return;
}
checkMobilecode();
}
});
}
/**
* 获得手机号
*
* @return
*/
private String getPhone() {
return phone;
}
private String getCode() {
return etPhoneCode.getText().toString().trim();
}
/**
* 发送验证码
*/
private void sendCode() {
Map<String, Object> map = new LinkedHashMap<>();
map.put("username", getPhone());
map.put("type", 4);
mPresenter.postData(0, ApiConfig.HTTP_URL_SEND_CODE, SendCodeBean.class, map, true);
}
/**
* 发送验证码
*/
private void checkMobilecode() {
Map<String, Object> map = new LinkedHashMap<>();
map.put("phone", getPhone());
map.put("mobilecode", getCode());
mPresenter.getData(1, ApiConfig.HTTP_URL_CHECK_MOBILE_CODE, BaseBean.class, map, true);
}
@Override
protected void loadData(Bundle savedInstanceState) {
}
@Override
public void onShowResult(int requestType, BaseBean result) {
if (requestType == 0) {
showToast(getString(com.rv.home.R.string.rv_phone_code_toast));
sendCode(60);
} else if (requestType == 1) {
((SwitchFragmentListener) _mActivity).next();
}
}
@Override
public void onShowError(String errorMsg, int errorType) {
if (getContext() != null && !NetworkUtil.isNetworkAvailable(getContext())) {
showToast("网络异常,请检察您的网络");
return;
}
if (!TextUtils.isEmpty(errorMsg))
showToast(errorMsg);
}
/**
* 发送验证码
*
* @param timeLong 验证码时长
*/
private void sendCode(final int timeLong) {
RxJavaManager.getInstance().sendCode(timeLong, new Consumer<Disposable>() {
@Override
public void accept(Disposable disposable) throws Exception {
tvGetCode.setEnabled(false);
}
}, new Observer<Long>() {
@Override
public void onSubscribe(Disposable d) {
mDisposable = d;
}
@Override
public void onNext(Long aLong) {
tvGetCode.setText("" + aLong + "s");
}
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
tvGetCode.setEnabled(true);
tvGetCode.setText(getString(com.rv.home.R.string.rv_login_rest));
}
});
}
/**
* 停止计时
*/
public void stopCarousel() {
if (mDisposable != null && !mDisposable.isDisposed()) {
mDisposable.dispose();
}
}
@Override
public void onDestroyView() {
super.onDestroyView();
stopCarousel();
}
private TextWatcher watcher = new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (!TextUtils.isEmpty(getCode()) && getCode().length() >= 4) {
btnNext.setBackgroundResource(R.drawable.shape_rv_bg_fdc349);
} else {
btnNext.setBackgroundResource(R.drawable.shape_rv_bg_fde6b5);
}
}
@Override
public void afterTextChanged(Editable s) {
}
};
}
package com.rv.rvmine.fragment;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.base.utils.tools.android.NetworkUtil;
import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseFragment;
import com.ruiwenliu.wrapper.base.presenter.CommonPresenter;
import com.ruiwenliu.wrapper.util.RxJavaManager;
import com.rv.component.utils.DateUtils;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.ui.login.bean.SendCodeBean;
import com.rv.rvmine.R;
import com.rv.rvmine.R2;
import com.rv.rvmine.SwitchFragmentListener;
import com.rv.rvmine.bean.BindCallBackBean;
import com.yuyife.okgo.OkGoUtil;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import butterknife.BindView;
import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
public class BindPhoneThirdFragment extends BaseFragment<CommonPresenter> {
@BindView(R2.id.et_phone)
EditText etPhone;
@BindView(R2.id.et_phone_code)
EditText etPhoneCode;
@BindView(R2.id.tv_get_code)
TextView tvGetCode;
@BindView(R2.id.btn_next)
Button btnNext;
private String oldPhone;
private Disposable mDisposable;
@Override
public int getViewLayout() {
return R.layout.fragment_bind_phone_third;
}
@Override
protected void initView(Bundle savedInstanceState) {
oldPhone = getArguments().getString("phone");
((SwitchFragmentListener) _mActivity).setTitle("验证手机号");
etPhoneCode.addTextChangedListener(watcher);
etPhone.addTextChangedListener(watcher);
tvGetCode.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// 获取短信验证码
if (TextUtils.isEmpty(getPhone())) {
showToast(getString(com.rv.home.R.string.rv_phone_hint));
return;
}
if (getPhone().length() != 11) {
showToast("手机号码不正确");
return;
}
if (getPhone().equals(oldPhone)) {
showToast("新号码不能与旧号码一样");
return;
}
sendCode();
}
});
btnNext.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (TextUtils.isEmpty(getPhone()) || getPhone().length() != 11) {
showToast("手机号码不正确");
return;
}
if (TextUtils.isEmpty(getCode())) {
showToast("短信验证码为空");
return;
}
updateMobile();
// ((SwitchFragmentListener) _mActivity).changeSuccess(oldPhone);
}
});
}
@Override
protected void loadData(Bundle savedInstanceState) {
}
@Override
public void onShowResult(int requestType, BaseBean result) {
if (requestType == 0) {
showToast(getString(com.rv.home.R.string.rv_phone_code_toast));
sendCode(60);
} else if (requestType == 1) {
showToast("手机号更改成功");
BindCallBackBean bean = (BindCallBackBean) result;
if (!TextUtils.isEmpty(bean.getData()))
OkGoUtil.setToken(bean.getData(), DateUtils.getCurDate());
((SwitchFragmentListener) _mActivity).changeSuccess(getPhone());
}
}
@Override
public void onShowError(String errorMsg, int errorType) {
if (getContext() != null && !NetworkUtil.isNetworkAvailable(getContext())) {
showToast("网络异常,请检察您的网络");
return;
}
if (!TextUtils.isEmpty(errorMsg))
showToast(errorMsg);
}
/**
* 获得手机号
*
* @return
*/
private String getPhone() {
return etPhone.getText().toString().trim();
}
private String getCode() {
return etPhoneCode.getText().toString().trim();
}
/**
* 发送验证码
*
* @param timeLong 验证码时长
*/
private void sendCode(final int timeLong) {
RxJavaManager.getInstance().sendCode(timeLong, new Consumer<Disposable>() {
@Override
public void accept(Disposable disposable) throws Exception {
tvGetCode.setEnabled(false);
}
}, new Observer<Long>() {
@Override
public void onSubscribe(Disposable d) {
mDisposable = d;
}
@Override
public void onNext(Long aLong) {
tvGetCode.setText("" + aLong + "s");
}
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
tvGetCode.setEnabled(true);
tvGetCode.setText(getString(com.rv.home.R.string.rv_login_rest));
}
});
}
/**
* 发送验证码
*/
private void sendCode() {
Map<String, Object> map = new LinkedHashMap<>();
map.put("username", getPhone());
mPresenter.postData(0, ApiConfig.HTTP_URL_SEND_CODE, SendCodeBean.class, map, true);
}
private void updateMobile() {
if (!TextUtils.isEmpty(OkGoUtil.getToken())) {
Map<String, String> head = new HashMap<>();
head.put("Authorization", OkGoUtil.getToken());
Map<String, String> body = new HashMap<>();
body.put("username", getPhone());
body.put("mobilecode", getCode());
mPresenter.postData(RvFrameConfig.HOST, 1, ApiConfig.HTTP_URL_UPDATE_PHONE, BindCallBackBean.class, body, head, true);
}
}
/**
* 停止计时
*/
public void stopCarousel() {
if (mDisposable != null && !mDisposable.isDisposed()) {
mDisposable.dispose();
}
}
@Override
public void onDestroyView() {
super.onDestroyView();
stopCarousel();
}
private TextWatcher watcher = new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (!TextUtils.isEmpty(getPhone()) && getPhone().length() == 11 && !TextUtils.isEmpty(getCode()) && getCode().length() >= 4) {
btnNext.setBackgroundResource(R.drawable.shape_rv_bg_fdc349);
} else {
btnNext.setBackgroundResource(R.drawable.shape_rv_bg_fde6b5);
}
}
@Override
public void afterTextChanged(Editable s) {
}
};
}
......@@ -158,6 +158,12 @@ public class MyReleaseAskFragment extends BaseFragment<CommonPresenter> implemen
}
}
@Override
public void onShowError(String errorMsg, int errorType) {
super.onShowError(errorMsg, errorType);
mSimpleRefreshLayout.onRefreshComplete();
}
private void processData(MyReleaseAskBean bean) {
if (mPage == 1) {
countPage = bean.getData().getPageSize();
......
......@@ -194,6 +194,12 @@ public class MyReleasePatFragment extends BaseFragment<CommonPresenter> implemen
}
}
@Override
public void onShowError(String errorMsg, int errorType) {
super.onShowError(errorMsg, errorType);
mSimpleRefreshLayout.onRefreshComplete();
}
private void processData(MyReleaseBean bean) {
if (mPage == 1) {
countPage = bean.getData().getPageSize();
......
......@@ -188,6 +188,12 @@ public class MyReleaseVideoFragment extends BaseFragment<CommonPresenter> implem
}
}
@Override
public void onShowError(String errorMsg, int errorType) {
super.onShowError(errorMsg, errorType);
mSimpleRefreshLayout.onRefreshComplete();
}
private void deleteData() {
if (OkGoUtil.getToken() != null) {
Map<String, Object> header = new LinkedHashMap<>();
......
package com.rv.rvmine.traveler;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;
import android.widget.EditText;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseStatusActivity;
import com.ruiwenliu.wrapper.base.presenter.CommonPresenter;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.rvmine.R;
import com.rv.rvmine.R2;
import butterknife.BindView;
public class AlterNickNameActivity extends BaseStatusActivity<CommonPresenter> {
@BindView(R2.id.et_nickname)
EditText etNickname;
@Override
protected int setLayout() {
return R.layout.activity_alter_nick_name;
}
@Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
titleView.setTitle("个人资料");
titleView.setText(R.id.tv_title_right, "保存");
titleView.setTextColor(R.id.tv_title_right, Color.parseColor("#666666"));
titleView.setChildClickListener(R.id.tv_title_right, new View.OnClickListener() {
@Override
public void onClick(View v) {
upUserinfo();
}
});
String nickName = intent.getStringExtra("nick");
if (!TextUtils.isEmpty(nickName)) {
etNickname.setText(nickName);
if (nickName.length() <= 32) {
etNickname.setSelection(nickName.length());
} else {
etNickname.setSelection(32);
}
}
}
private void upUserinfo() {
if (TextUtils.isEmpty(getNickName())) {
showToast("昵称不能为空");
return;
}
Intent intent = new Intent();
intent.putExtra("nick", getNickName());
setResult(RESULT_OK, intent);
finish();
}
private String getNickName() {
return etNickname.getText().toString().trim();
}
@Override
public void onShowResult(int requestType, BaseBean result) {
}
}
package com.rv.rvmine.traveler;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.KeyEvent;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseStatusActivity;
import com.ruiwenliu.wrapper.base.presenter.CommonPresenter;
import com.ruiwenliu.wrapper.bean.UserInfoBean;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.utils.CacheEnum;
import com.rv.component.utils.RvCache;
import com.rv.rvmine.R;
import com.rv.rvmine.SwitchFragmentListener;
import com.rv.rvmine.fragment.BindPhoneFirstFragment;
import com.rv.rvmine.fragment.BindPhoneSecondFragment;
import com.rv.rvmine.fragment.BindPhoneThirdFragment;
public class BindPhoneActivity extends BaseStatusActivity<CommonPresenter> implements SwitchFragmentListener {
private int currentPage = 1;
private UserInfoBean bean;
private BindPhoneFirstFragment firstFragment;
private BindPhoneSecondFragment secondFragment;
private BindPhoneThirdFragment thirdFragment;
private boolean isChanged;
@Override
protected int setLayout() {
return R.layout.activity_bind_phone;
}
@Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
bean = (UserInfoBean) intent.getSerializableExtra("user");
firstFragment = new BindPhoneFirstFragment();
if (bean != null) {
Bundle bundle = new Bundle();
bundle.putString("phone", bean.getData().getUsername());
firstFragment.setArguments(bundle);
}
getSupportFragmentManager().beginTransaction().replace(R.id.fl_content, firstFragment)
.addToBackStack(null).commit();
}
@Override
public void onShowResult(int requestType, BaseBean result) {
}
@Override
public void setTitle(String title) {
if (!TextUtils.isEmpty(title))
titleView.setTitle(title);
}
@Override
public void next() {
switch (currentPage) {
case 1:
secondFragment = new BindPhoneSecondFragment();
if (bean != null) {
Bundle bundle = new Bundle();
bundle.putString("phone", bean.getData().getUsername());
secondFragment.setArguments(bundle);
}
getSupportFragmentManager().beginTransaction().replace(R.id.fl_content, secondFragment)
.addToBackStack(null).commit();
currentPage = 2;
break;
case 2:
thirdFragment = new BindPhoneThirdFragment();
if (bean != null) {
Bundle bundle = new Bundle();
bundle.putString("phone", bean.getData().getUsername());
thirdFragment.setArguments(bundle);
}
getSupportFragmentManager().beginTransaction().replace(R.id.fl_content, thirdFragment)
.addToBackStack(null).commit();
currentPage = 3;
break;
}
}
@Override
public void changeSuccess(String phone) {
isChanged = true;
bean.getData().setUsername(phone);
RvCache.getInstance().save(bean, CacheEnum.USER);
Bundle bundle = new Bundle();
bundle.putString("phone", bean.getData().getUsername());
firstFragment.setArguments(bundle);
getSupportFragmentManager().beginTransaction().replace(R.id.fl_content, firstFragment)
.addToBackStack(null).commit();
currentPage = 1;
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
finish();
return true;
}
return super.onKeyDown(keyCode, event);
}
@Override
public void finish() {
if (currentPage > 1) {
getSupportFragmentManager().popBackStack();
currentPage -= 1;
} else {
if (isChanged) {
Intent intent = new Intent();
intent.putExtra("phone", bean.getData().getUsername());
setResult(RESULT_OK,intent);
}
super.finish();
}
}
}
......@@ -76,10 +76,10 @@ public class SettingActivity extends BaseStatusActivity<CommonPresenter> impleme
if (TextUtils.isEmpty(OkGoUtil.getToken())) {
tvOutSign.setText("立即登录");
tvOutSign.setBackgroundResource(R.drawable.shape_rv_bg_shallow_dark_yellow_circle);
// tvOutSign.setBackgroundResource(R.drawable.shape_rv_bg_shallow_dark_yellow_circle);
} else {
tvOutSign.setText("退出登录");
tvOutSign.setBackgroundResource(R.drawable.shape_rv_button_light_gray);
// tvOutSign.setBackgroundResource(R.drawable.shape_rv_button_light_gray);
}
DownListenerManager.getInstance().addDownListener(this);
......@@ -99,7 +99,7 @@ public class SettingActivity extends BaseStatusActivity<CommonPresenter> impleme
@Override
public void onNext(LoginSuccessfulEvent event) {
tvOutSign.setText("退出登录");
tvOutSign.setBackgroundResource(R.drawable.shape_rv_button_light_gray);
// tvOutSign.setBackgroundResource(R.drawable.shape_rv_button_light_gray);
}
});
}
......@@ -142,18 +142,20 @@ public class SettingActivity extends BaseStatusActivity<CommonPresenter> impleme
DownListenerManager.getInstance().removeDownListener(this);
}
@OnClick({R2.id.rl_item_change_password, R2.id.ll_item_app_push, R2.id.rl_item_clear_cache, R2.id.rl_item_check_for_updates, R2.id.rl_item_about_us, R2.id.tv_out_sign})
@OnClick({R2.id.rl_item_account_safe, R2.id.ll_item_app_push, R2.id.rl_item_clear_cache, R2.id.rl_item_check_for_updates, R2.id.rl_item_about_us, R2.id.tv_out_sign})
public void onViewClicked(View view) {
int id = view.getId();
if (id == R.id.rl_item_change_password) {
if (id == R.id.rl_item_account_safe) {
//修改密码
if (TextUtils.isEmpty(OkGoUtil.getToken())) {
startActivity(LoginRvActivity.getIntent(mActivity, 0));
return;
}
startActivity(RegisteredActivity.getIntent(mActivity, 1, 0));
startActivity(new Intent(mActivity, AccountSafeActivity.class));
// startActivity(RegisteredActivity.getIntent(mActivity, 1, 0));
} else if (id == R.id.ll_item_app_push) {
//App推送消息
......
package com.rv.rvmine.view;
import android.support.annotation.IntDef;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Locale;
/**
* <br>Email:1006368252@qq.com
* <br>QQ:1006368252
* <br><a href="https://github.com/JustinRoom/WheelViewDemo" target="_blank">https://github.com/JustinRoom/WheelViewDemo</a>
*
* @author jiangshicheng
*/
public class DateItem implements IWheel {
public static final int TYPE_YEAR = 0;
public static final int TYPE_MONTH = 1;
public static final int TYPE_DAY = 2;
public static final int TYPE_HOUR = 3;
public static final int TYPE_MINUTE = 4;
@IntDef({TYPE_YEAR, TYPE_MONTH, TYPE_DAY, TYPE_HOUR, TYPE_MINUTE})
@Retention(RetentionPolicy.SOURCE)
public @interface DateType {
}
private int type;
private int value;
public DateItem() {
}
public DateItem(int value) {
this(TYPE_YEAR, value);
}
public DateItem(@DateType int type, int value) {
this.type = type;
this.value = value;
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
@Override
public String getShowText() {
return String.format(Locale.CHINA, getFormatStringByType(), (value < 10 ? "0" + value : "" + value));
}
private String getFormatStringByType() {
String result = "";
switch (type) {
case TYPE_YEAR:
result = "%s年";
break;
case TYPE_MONTH:
result = "%s月";
break;
case TYPE_DAY:
result = "%s日";
break;
case TYPE_HOUR:
result = "%s时";
break;
case TYPE_MINUTE:
result = "%s分";
break;
}
return result;
}
}
package com.rv.rvmine.view;
public interface IWheel {
String getShowText();
}
package com.rv.rvmine.view;
import android.support.annotation.ColorInt;
public interface IWheelViewSetting {
void setTextSize(float textSize);
void setTextColor(@ColorInt int textColor);
void setShowCount(int showCount);
void setTotalOffsetX(int totalOffsetX);
void setItemVerticalSpace(int itemVerticalSpace);
void setItems(IWheel[] items);
int getSelectedIndex();
void setSelectedIndex(int targetIndexPosition);
void setSelectedIndex(int targetIndexPosition, boolean withAnimation);
void setOnSelectedListener(WheelView.OnSelectedListener onSelectedListener);
boolean isScrolling();
}
package com.rv.rvmine.view;
public class WheelItem implements IWheel {
String label;
public WheelItem(String label) {
this.label = label;
}
@Override
public String getShowText() {
return label;
}
}
package com.rv.rvmine.view;
import android.content.Context;
import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.ViewGroup;
import android.widget.FrameLayout;
public class WheelItemView extends FrameLayout implements IWheelViewSetting {
private WheelView wheelView;
private WheelMaskView wheelMaskView;
public WheelItemView(@NonNull Context context) {
super(context);
initAttr(context, null, 0);
}
public WheelItemView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
initAttr(context, attrs, 0);
}
public WheelItemView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initAttr(context, attrs, defStyleAttr);
}
private void initAttr(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
wheelView = new WheelView(context);
wheelView.initAttr(context, attrs, defStyleAttr);
wheelMaskView = new WheelMaskView(context);
wheelMaskView.initAttr(context, attrs, defStyleAttr);
addView(wheelView, new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
addView(wheelMaskView, new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
ViewGroup.LayoutParams params = wheelMaskView.getLayoutParams();
params.height = wheelView.getMeasuredHeight();
wheelMaskView.setLayoutParams(params);
wheelMaskView.updateMask(wheelView.getShowCount(), wheelView.getItemHeight());
}
@Override
public void setTextSize(float textSize) {
wheelView.setTextSize(textSize);
}
@Override
public void setTextColor(@ColorInt int textColor) {
wheelView.setTextColor(textColor);
}
@Override
public void setShowCount(int showCount) {
wheelView.setShowCount(showCount);
}
@Override
public void setTotalOffsetX(int totalOffsetX) {
wheelView.setTotalOffsetX(totalOffsetX);
}
@Override
public void setItemVerticalSpace(int itemVerticalSpace) {
wheelView.setItemVerticalSpace(itemVerticalSpace);
}
@Override
public void setItems(IWheel[] items) {
wheelView.setItems(items);
}
@Override
public int getSelectedIndex() {
return wheelView.getSelectedIndex();
}
@Override
public void setSelectedIndex(int targetIndexPosition) {
setSelectedIndex(targetIndexPosition, true);
}
@Override
public void setSelectedIndex(int targetIndexPosition, boolean withAnimation) {
wheelView.setSelectedIndex(targetIndexPosition, withAnimation);
}
@Override
public void setOnSelectedListener(WheelView.OnSelectedListener onSelectedListener) {
wheelView.setOnSelectedListener(onSelectedListener);
}
public void setMaskLineColor(@ColorInt int color) {
wheelMaskView.setLineColor(color);
}
@Override
public boolean isScrolling() {
return wheelView.isScrolling();
}
public WheelView getWheelView() {
return wheelView;
}
public WheelMaskView getWheelMaskView() {
return wheelMaskView;
}
}
package com.rv.rvmine.view;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.support.annotation.ColorInt;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import com.rv.rvmine.R;
public class WheelMaskView extends View {
private Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
private int top = 0;
private int bottom = 0;
private int lineColor = 0xFFEEEEEE;
public WheelMaskView(Context context) {
super(context);
initAttr(context, null, 0);
}
public WheelMaskView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
initAttr(context, attrs, 0);
}
public WheelMaskView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initAttr(context, attrs, defStyleAttr);
}
public void initAttr(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.WheelMaskView, defStyleAttr, 0);
lineColor = a.getColor(R.styleable.WheelMaskView_wheelMaskLineColor, 0xFFEEEEEE);
a.recycle();
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(1);
}
public void updateMask(int heightCount, int itemHeight) {
if (heightCount > 0) {
int centerIndex = heightCount / 2;
top = centerIndex * itemHeight;
bottom = top + itemHeight;
} else {
top = 0;
bottom = 0;
}
invalidate();
}
public void setLineColor(@ColorInt int lineColor) {
this.lineColor = lineColor;
invalidate();
}
@Override
protected void onDraw(Canvas canvas) {
if (top > 0 && bottom > 0) {
paint.setColor(lineColor);
canvas.drawLine(0, top, getWidth(), top, paint);
canvas.drawLine(0, bottom, getWidth(), bottom, paint);
}
}
}
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#ffffffff" />
<stroke android:width="1dp" android:color="#ffcccccc" />
<corners android:topLeftRadius="80dp" android:topRightRadius="80dp" android:bottomLeftRadius="80dp" android:bottomRightRadius="80dp" />
</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="@dimen/dp_10" />
<solid android:color="#f2f2f2" />
</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="@dimen/dp_40" />
<solid android:color="#F3EADC" />
</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="@dimen/size_30" />
<solid android:color="#fbf9e8" />
</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="@dimen/size_100" />
<solid android:color="#fdc349" />
</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="@dimen/size_100" />
<solid android:color="#fde6b5" />
</shape>
\ 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="match_parent"
android:background="@color/colorLine"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorWrite"
android:orientation="vertical"
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15">
<RelativeLayout
android:id="@+id/rl_item_phone"
android:layout_width="match_parent"
android:layout_height="@dimen/size_50">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="手机号"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16" />
<TextView
android:id="@+id/tv_phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:contentDescription="手机号"
android:textColor="@color/colorMain"
android:drawablePadding="8dp"
android:drawableRight="@drawable/common_icon_rig_black_gray"
android:textSize="@dimen/sp_16" />
</RelativeLayout>
<include layout="@layout/common_line" />
<RelativeLayout
android:id="@+id/rl_update_pwd"
android:layout_width="match_parent"
android:layout_height="@dimen/size_50">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="登录密码"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16" />
<ImageView
android:id="@+id/tv_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@drawable/common_icon_rig_black_gray" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:background="@color/colorWrite"
android:orientation="vertical"
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15">
<RelativeLayout
android:id="@+id/rl_qq"
android:layout_width="match_parent"
android:layout_height="@dimen/size_50">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="QQ"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16" />
<TextView
android:id="@+id/tv_qq"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:drawableRight="@drawable/common_icon_rig_black_gray"
android:drawablePadding="8dp"
android:text="去授权绑定QQ"
android:textColor="#CCCCCC"
android:textSize="@dimen/sp_16" />
</RelativeLayout>
<include layout="@layout/common_line" />
<RelativeLayout
android:id="@+id/rl_wx"
android:layout_width="match_parent"
android:layout_height="@dimen/size_50">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="微信"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16" />
<TextView
android:id="@+id/tv_wx"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:drawableRight="@drawable/common_icon_rig_black_gray"
android:drawablePadding="8dp"
android:text="去授权绑定微信"
android:textColor="#CCCCCC"
android:textSize="@dimen/sp_16" />
</RelativeLayout>
<include layout="@layout/common_line" />
<RelativeLayout
android:id="@+id/rl_zfb"
android:layout_width="match_parent"
android:layout_height="@dimen/size_50">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="支付宝"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16" />
<TextView
android:id="@+id/tv_zfb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:drawableRight="@drawable/common_icon_rig_black_gray"
android:drawablePadding="8dp"
android:text="去授权绑定支付宝"
android:textColor="#CCCCCC"
android:textSize="@dimen/sp_16" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F5F5F5"
tools:context=".traveler.AlterNickNameActivity">
<EditText
android:id="@+id/et_nickname"
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_marginTop="@dimen/dp_10"
android:background="@color/colorWrite"
android:ellipsize="end"
android:hint="请输入昵称"
android:maxLength="32"
android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10"
android:singleLine="true"
android:textColor="@color/colorMain"
android:textColorHint="@color/colorGray"
android:textSize="@dimen/sp_14" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".traveler.BindPhoneActivity">
<FrameLayout
android:id="@+id/fl_content"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
\ No newline at end of file
......@@ -129,24 +129,51 @@
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="@dimen/size_15"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/text_10"
android:orientation="horizontal"
android:gravity="center_vertical"
android:visibility="gone">
<ImageView
android:id="@+id/iv_member"
android:layout_width="@dimen/size_15"
android:layout_height="@dimen/size_15" />
<LinearLayout
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_rv_bg_fbf9e8"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_member"
android:layout_width="@dimen/size_15"
android:layout_height="@dimen/size_15" />
<TextView
android:id="@+id/tv_member"
android:layout_width="wrap_content"
android:layout_height="@dimen/size_15"
android:layout_marginLeft="@dimen/size_2"
android:gravity="center"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_10" />
</LinearLayout>
<TextView
android:id="@+id/tv_member"
android:visibility="gone"
android:id="@+id/tv_capacity"
android:layout_width="wrap_content"
android:layout_height="@dimen/size_15"
android:layout_marginLeft="@dimen/size_2"
android:gravity="center"
android:textColor="@color/colorMain"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@drawable/shape_rv_bg_f3eadc"
android:paddingLeft="5dp"
android:paddingTop="1dp"
android:paddingRight="5dp"
android:paddingBottom="1dp"
android:textColor="#ffd6b263"
android:textSize="@dimen/text_10" />
</LinearLayout>
<TextView
......
......@@ -14,7 +14,7 @@
android:paddingRight="@dimen/size_15">
<RelativeLayout
android:id="@+id/rl_item_change_password"
android:id="@+id/rl_item_account_safe"
android:layout_width="match_parent"
android:layout_height="@dimen/size_50">
......@@ -22,7 +22,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="修改密码"
android:text="账号与安全"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16" />
......@@ -31,7 +31,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@drawable/common_icon_rig_black" />
android:src="@drawable/common_icon_rig_black_gray" />
</RelativeLayout>
<include layout="@layout/common_line" />
......@@ -78,7 +78,7 @@
android:paddingRight="@dimen/size_15">
<RelativeLayout
android:id="@+id/rl_item_clear_cache"
android:id="@+id/rl_item_check_for_updates"
android:layout_width="match_parent"
android:layout_height="@dimen/size_50">
......@@ -86,22 +86,26 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="清除缓存"
android:text="检查更新"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16" />
<ImageView
<TextView
android:id="@+id/tv_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@drawable/common_icon_rig_black" />
android:drawableRight="@drawable/common_icon_rig_black_gray"
android:drawablePadding="8dp"
android:textColor="#171413"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
<include layout="@layout/common_line" />
<RelativeLayout
android:id="@+id/rl_item_check_for_updates"
android:id="@+id/rl_item_clear_cache"
android:layout_width="match_parent"
android:layout_height="@dimen/size_50">
......@@ -109,19 +113,16 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="检查更新"
android:text="清除缓存"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16" />
<TextView
android:id="@+id/tv_version"
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:drawablePadding="@dimen/size_3"
android:textColor="#999999"
android:textSize="@dimen/sp_12" />
android:src="@drawable/common_icon_rig_black_gray" />
</RelativeLayout>
<include layout="@layout/common_line" />
......@@ -144,7 +145,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@drawable/common_icon_rig_black" />
android:src="@drawable/common_icon_rig_black_gray" />
</RelativeLayout>
</LinearLayout>
......@@ -153,13 +154,12 @@
android:id="@+id/tv_out_sign"
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:layout_marginLeft="@dimen/size_20"
android:layout_marginTop="@dimen/size_70"
android:layout_marginRight="@dimen/size_20"
android:background="@drawable/shape_rv_button_light_gray"
android:layout_marginTop="@dimen/size_15"
android:background="@color/colorWrite"
android:gravity="center"
android:text="退出登录"
android:textColor="@color/colorWrite" />
android:textColor="@color/colorMain"
android:textSize="@dimen/sp_16" />
</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="match_parent"
android:background="@color/white"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/size_100"
android:layout_height="@dimen/size_100"
android:layout_marginTop="@dimen/size_50"
android:src="@drawable/icon_bind_phone" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="17dp"
android:text="绑定的手机号码"
android:textColor="#666666"
android:textSize="@dimen/sp_14" />
<TextView
android:id="@+id/tv_phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:textColor="@color/colorMain"
android:textSize="@dimen/sp_16" />
<Button
android:id="@+id/btn_update_phone"
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_marginLeft="27dp"
android:layout_marginTop="52dp"
android:layout_marginRight="27dp"
android:background="@drawable/shape_rv_bg_bind_phone_button"
android:gravity="center"
android:text="更换手机号"
android:textColor="@color/colorMain"
android:textSize="@dimen/sp_16" />
</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="match_parent"
android:orientation="vertical"
android:paddingLeft="@dimen/size_20"
android:paddingRight="@dimen/size_20">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_20"
android:text="更换手机号前,需先验证当前绑定手机号"
android:textColor="@color/text_Gray"
android:textSize="@dimen/sp_14" />
<TextView
android:id="@+id/tv_phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="13dp"
android:textColor="@color/colorMain"
android:textSize="@dimen/sp_14" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_marginTop="26sp"
android:background="@drawable/shape_rv_bg_f2f2f2"
android:orientation="horizontal">
<EditText
android:layout_marginLeft="@dimen/dp_10"
android:id="@+id/et_phone_code"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/colorGrayBg"
android:gravity="center_vertical|left"
android:hint="请输入验证码"
android:inputType="number"
android:maxLength="6"
android:paddingLeft="3dp"
android:textColor="@color/colorMain"
android:textColorHint="@color/colorGray"
android:textSize="@dimen/sp_14" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/size_12"
android:layout_marginBottom="@dimen/text_12"
android:background="@color/text_Gray" />
<TextView
android:id="@+id/tv_get_code"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="13dp"
android:layout_marginRight="13dp"
android:gravity="center"
android:text="获取验证码"
android:textColor="@color/colorMain"
android:textSize="14sp" />
</LinearLayout>
<Button
android:id="@+id/btn_next"
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_marginTop="31dp"
android:background="@drawable/shape_rv_bg_fde6b5"
android:gravity="center"
android:text="下一步"
android:textColor="@color/colorWrite"
android:textSize="@dimen/sp_16" />
</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="match_parent"
android:orientation="vertical"
android:paddingLeft="@dimen/size_20"
android:paddingRight="@dimen/size_20">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_marginTop="@dimen/size_30"
android:background="@drawable/shape_rv_bg_f2f2f2"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="13dp"
android:gravity="center"
android:text="+86"
android:textColor="#3A3938"
android:textSize="@dimen/sp_14" />
<EditText
android:id="@+id/et_phone"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginRight="@dimen/dp_10"
android:layout_weight="1"
android:background="@color/colorGrayBg"
android:gravity="center_vertical|left"
android:hint="请输入新绑定的手机号"
android:inputType="phone"
android:maxLength="11"
android:paddingLeft="13dp"
android:textColor="@color/colorMain"
android:textColorHint="@color/colorGray"
android:textSize="@dimen/sp_14" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_marginTop="26sp"
android:background="@drawable/shape_rv_bg_f2f2f2"
android:orientation="horizontal">
<EditText
android:maxLength="8"
android:id="@+id/et_phone_code"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp_10"
android:layout_weight="1"
android:background="@color/colorGrayBg"
android:gravity="center_vertical|left"
android:hint="请输入验证码"
android:inputType="number"
android:paddingLeft="3dp"
android:textColor="@color/colorMain"
android:textColorHint="@color/colorGray"
android:textSize="@dimen/sp_14" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/size_12"
android:layout_marginBottom="@dimen/text_12"
android:background="@color/text_Gray" />
<TextView
android:id="@+id/tv_get_code"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="13dp"
android:layout_marginRight="13dp"
android:gravity="center"
android:text="获取验证码"
android:textColor="@color/colorMain"
android:textSize="14sp" />
</LinearLayout>
<Button
android:id="@+id/btn_next"
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_marginTop="@dimen/dp_40"
android:background="@drawable/shape_rv_bg_fde6b5"
android:gravity="center"
android:text="完成"
android:textColor="@color/colorWrite"
android:textSize="@dimen/sp_16" />
</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="match_parent"
android:layout_marginLeft="@dimen/size_30"
android:layout_marginRight="@dimen/size_30"
android:background="@drawable/shape_rv_bg_write"
android:orientation="vertical">
<TextView
android:textStyle="bold"
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:gravity="center"
android:text="生日"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_20" />
<include layout="@layout/common_line" />
<LinearLayout
android:id="@+id/wheel_id_picker_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" />
<Button
android:id="@+id/btn_confirm"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_40"
android:layout_marginLeft="@dimen/size_20"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/size_20"
android:layout_marginBottom="@dimen/size_20"
android:background="@drawable/shape_rv_bg_fdc349"
android:gravity="center"
android:text="确定"
android:textColor="@color/white"
android:textSize="@dimen/sp_16" />
</LinearLayout>
\ No newline at end of file
......@@ -8,4 +8,13 @@
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="WheelDialog" parent="android:style/Theme.Dialog">
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:background">@android:color/transparent</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="WheelView">
<attr name="wheelTextColor" format="color"/>
<attr name="wheelTextSize" format="dimension"/>
<attr name="wheelShowCount" format="integer"/>
<attr name="wheelTotalOffsetX" format="dimension"/>
<attr name="wheelItemVerticalSpace" format="dimension"/>
<attr name="wheelRotationX" format="float"/>
<attr name="wheelVelocityUnits" format="integer"/>
</declare-styleable>
<declare-styleable name="WheelMaskView">
<attr name="wheelMaskLineColor" format="color"/>
</declare-styleable>
</resources>
\ No newline at end of file
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