Commit 67cd831c authored by jianglx's avatar jianglx

个人中心优化

parent 84e5c9a2
......@@ -1077,15 +1077,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);
......
......@@ -550,7 +550,11 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
if (info != null) {
GlideManager.getInstance(_mActivity).loadImage(info.getHeadimgurl(), ivAvatar);
tvNickname.setText(info.getNickname());
tvCapacity.setText(info.getPositionName());
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-已认证
......
......@@ -192,8 +192,8 @@ public class BindPhoneSecondFragment extends BaseFragment<CommonPresenter> {
}
@Override
public void onStop() {
super.onStop();
public void onDestroyView() {
super.onDestroyView();
stopCarousel();
}
......
......@@ -205,8 +205,8 @@ public class BindPhoneThirdFragment extends BaseFragment<CommonPresenter> {
}
@Override
public void onStop() {
super.onStop();
public void onDestroyView() {
super.onDestroyView();
stopCarousel();
}
......
......@@ -224,18 +224,6 @@ public class AccountSafeActivity extends BaseStatusActivity<CommonPresenter> imp
}
private void setQqInfo() {
hasBindWX = bean.getData().isBindWx();
if (hasBindWX) {
String wx = bean.getData().getWxNickname();
tvWx.setTextColor(Color.parseColor("#171413"));
tvWx.setText(!TextUtils.isEmpty(wx) ? wx : "已绑定");
} else {
tvWx.setTextColor(Color.parseColor("#cccccc"));
tvWx.setText("去授权绑定QQ");
}
}
private void setWxInfo() {
hasBindQQ = bean.getData().isBindQQ();
if (hasBindQQ) {
String qq = bean.getData().getQqNickname();
......@@ -243,7 +231,19 @@ public class AccountSafeActivity extends BaseStatusActivity<CommonPresenter> imp
tvQQ.setText(!TextUtils.isEmpty(qq) ? qq : "已绑定");
} else {
tvQQ.setTextColor(Color.parseColor("#cccccc"));
tvQQ.setText("去授权绑定微信");
tvQQ.setText("去授权绑定QQ");
}
}
private void setWxInfo() {
hasBindWX = bean.getData().isBindWx();
if (hasBindWX) {
String wx = bean.getData().getWxNickname();
tvWx.setTextColor(Color.parseColor("#171413"));
tvWx.setText(!TextUtils.isEmpty(wx) ? wx : "已绑定");
} else {
tvWx.setTextColor(Color.parseColor("#cccccc"));
tvWx.setText("去授权绑定微信");
}
}
......
......@@ -53,6 +53,7 @@ public class AlterNickNameActivity extends BaseStatusActivity<CommonPresenter> {
private void upUserinfo() {
if (TextUtils.isEmpty(getNickName())) {
showToast("昵称不能为空");
return;
}
Intent intent = new Intent();
intent.putExtra("nick", getNickName());
......
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.
......@@ -161,6 +161,7 @@
</LinearLayout>
<TextView
android:visibility="gone"
android:id="@+id/tv_capacity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......
<?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