Commit 8face6ae authored by jianglx's avatar jianglx

Merge branch 'master' of http://113.105.137.151:22280/lify/rvapp into dev-member-john

# Conflicts:
#	settings.gradle
parents 3dfa4f57 2ff9794d
......@@ -42,6 +42,8 @@ public class OkGoUtil {
//把Token保存到SP文件中的Key
final private static String SP_KEY_TOKEN = "sp_key_token";
final private static String SP_KEY_USERINFO ="userinfo";
//保存Token
public static void setToken(String token) {
if (application == null) return;
......@@ -72,7 +74,7 @@ public class OkGoUtil {
}
@SuppressLint("StaticFieldLeak")
private static Context application = null;
public static Context application = null;
private static boolean addToken = false;
public static void initOkGo(Application app, boolean addToken) {
......
......@@ -9,6 +9,7 @@ package com.frame.rv.config;
public interface RvFrameConfig extends RvFrameConstant {
String HOST = "https://xxtest.upyuns.com";
// String HOST = "http://10.1.37.192:8765";
// String HOST = "http://10.1.37.248:8765";
// String HOST = "http://10.1.37.244:9527";
String ADMIN_POST =HOST + "/api/admin/";
......
......@@ -12,6 +12,7 @@ public interface RvFrameConstant {
int HTTP_STATE_NOT_REGISTERED = 1003;//用户未注册
int HTTP_STATE_USER_SP = 1002;//用户已存在
int HTTP_STATE_SUCCESS = 200;//请求成功
int HTTP_STATE_DATA_ALREADY_EXISTS = 1001;
/**
* 请求错误类型
*/
......
......@@ -17,7 +17,6 @@ import android.widget.LinearLayout;
import com.base.animset.util.NiftyEffects;
import com.base.utils.base.BaseFragment;
import com.base.utils.tools.android.IntentUtil;
import com.base.utils.tools.android.KeyboardUtil;
import com.base.utils.ui.datetime.selector.util.TextUtil;
import com.frame.base.browse.ActivityImageBrowseUrl;
import com.frame.rv.widget.BaseTipsLayout;
......@@ -185,7 +184,6 @@ public class TravelFragmentMain extends BaseFragment {
private boolean isQueryMode = false;
public void getRimData(String queryInput) {
KeyboardUtil.hideKeyboard(getActivity());
query = queryInput;
isQueryMode = !TextUtil.isEmpty(query);
setRim();
......
......@@ -9,4 +9,5 @@ public final class SPConstance {
public static final String USER_JSON_IMTOKEN ="imToken";
public static final String USER_JSON_IMUSERID ="imUserId";
public static final String USER_JSON_ISCERTIFICATIONSTATUS ="CertificationStatus";
public static final String USER_JSON_USERINFO ="userinfo";
}
......@@ -53,6 +53,8 @@ public class RxRequestResult<T extends BaseBean, V extends BaseView<T>> extends
case RvFrameConstant.HTTP_STATE_NOT_REGISTERED:
baseView.onShowError("", RvFrameConstant.HTTP_STATE_NOT_REGISTERED);
break;
case RvFrameConstant.HTTP_STATE_DATA_ALREADY_EXISTS:
break;
default:
baseView.onShowError(bean.message, bean.status);
break;
......
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rv.component.control" />
package com.rv.component.control;
import android.animation.Animator;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.os.Build;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Checkable;
/**
* SwitchButton.
*/
public class SwitchButton extends View implements Checkable {
private static final int DEFAULT_WIDTH = dp2pxInt(58);
private static final int DEFAULT_HEIGHT = dp2pxInt(36);
/**
* 动画状态:
* 1.静止
* 2.进入拖动
* 3.处于拖动
* 4.拖动-复位
* 5.拖动-切换
* 6.点击切换
**/
private final int ANIMATE_STATE_NONE = 0;
private final int ANIMATE_STATE_PENDING_DRAG = 1;
private final int ANIMATE_STATE_DRAGING = 2;
private final int ANIMATE_STATE_PENDING_RESET = 3;
private final int ANIMATE_STATE_PENDING_SETTLE = 4;
private final int ANIMATE_STATE_SWITCH = 5;
public SwitchButton(Context context) {
super(context);
init(context, null);
}
public SwitchButton(Context context, AttributeSet attrs) {
super(context, attrs);
init(context, attrs);
}
public SwitchButton(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context, attrs);
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public SwitchButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
init(context, attrs);
}
@Override
public final void setPadding(int left, int top, int right, int bottom) {
super.setPadding(0, 0, 0, 0);
}
/**
* 初始化参数
*/
private void init(Context context, AttributeSet attrs) {
TypedArray typedArray = null;
if (attrs != null) {
typedArray = context.obtainStyledAttributes(attrs, R.styleable.SwitchButton);
}
shadowEffect = optBoolean(typedArray,
R.styleable.SwitchButton_sb_shadow_effect,
true);
uncheckCircleColor = optColor(typedArray,
R.styleable.SwitchButton_sb_uncheckcircle_color,
0XffAAAAAA);//0XffAAAAAA;
uncheckCircleWidth = optPixelSize(typedArray,
R.styleable.SwitchButton_sb_uncheckcircle_width,
dp2pxInt(1.5f));//dp2pxInt(1.5f);
uncheckCircleOffsetX = dp2px(10);
uncheckCircleRadius = optPixelSize(typedArray,
R.styleable.SwitchButton_sb_uncheckcircle_radius,
dp2px(4));//dp2px(4);
checkedLineOffsetX = dp2px(4);
checkedLineOffsetY = dp2px(4);
shadowRadius = optPixelSize(typedArray,
R.styleable.SwitchButton_sb_shadow_radius,
dp2pxInt(2.5f));//dp2pxInt(2.5f);
shadowOffset = optPixelSize(typedArray,
R.styleable.SwitchButton_sb_shadow_offset,
dp2pxInt(1.5f));//dp2pxInt(1.5f);
shadowColor = optColor(typedArray,
R.styleable.SwitchButton_sb_shadow_color,
0X33000000);//0X33000000;
uncheckColor = optColor(typedArray,
R.styleable.SwitchButton_sb_uncheck_color,
0XffDDDDDD);//0XffDDDDDD;
checkedColor = optColor(typedArray,
R.styleable.SwitchButton_sb_checked_color,
0Xff51d367);//0Xff51d367;
borderWidth = optPixelSize(typedArray,
R.styleable.SwitchButton_sb_border_width,
dp2pxInt(1));//dp2pxInt(1);
checkLineColor = optColor(typedArray,
R.styleable.SwitchButton_sb_checkline_color,
Color.WHITE);//Color.WHITE;
checkLineWidth = optPixelSize(typedArray,
R.styleable.SwitchButton_sb_checkline_width,
dp2pxInt(1f));//dp2pxInt(1.0f);
checkLineLength = dp2px(6);
int buttonColor = optColor(typedArray,
R.styleable.SwitchButton_sb_button_color,
Color.WHITE);//Color.WHITE;
int effectDuration = optInt(typedArray,
R.styleable.SwitchButton_sb_effect_duration,
300);//300;
isChecked = optBoolean(typedArray,
R.styleable.SwitchButton_sb_checked,
false);
showIndicator = optBoolean(typedArray,
R.styleable.SwitchButton_sb_show_indicator,
true);
background = optColor(typedArray,
R.styleable.SwitchButton_sb_background,
Color.WHITE);//Color.WHITE;
enableEffect = optBoolean(typedArray,
R.styleable.SwitchButton_sb_enable_effect,
true);
if (typedArray != null) {
typedArray.recycle();
}
paint = new Paint(Paint.ANTI_ALIAS_FLAG);
buttonPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
buttonPaint.setColor(buttonColor);
if (shadowEffect) {
buttonPaint.setShadowLayer(
shadowRadius,
0, shadowOffset,
shadowColor);
}
viewState = new ViewState();
beforeState = new ViewState();
afterState = new ViewState();
valueAnimator = ValueAnimator.ofFloat(0f, 1f);
valueAnimator.setDuration(effectDuration);
valueAnimator.setRepeatCount(0);
valueAnimator.addUpdateListener(animatorUpdateListener);
valueAnimator.addListener(animatorListener);
super.setClickable(true);
this.setPadding(0, 0, 0, 0);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
setLayerType(LAYER_TYPE_SOFTWARE, null);
}
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
final int widthMode = MeasureSpec.getMode(widthMeasureSpec);
final int heightMode = MeasureSpec.getMode(heightMeasureSpec);
if (widthMode == MeasureSpec.UNSPECIFIED
|| widthMode == MeasureSpec.AT_MOST) {
widthMeasureSpec = MeasureSpec.makeMeasureSpec(DEFAULT_WIDTH, MeasureSpec.EXACTLY);
}
if (heightMode == MeasureSpec.UNSPECIFIED
|| heightMode == MeasureSpec.AT_MOST) {
heightMeasureSpec = MeasureSpec.makeMeasureSpec(DEFAULT_HEIGHT, MeasureSpec.EXACTLY);
}
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
float viewPadding = Math.max(shadowRadius + shadowOffset, borderWidth);
height = h - viewPadding - viewPadding;
width = w - viewPadding - viewPadding;
viewRadius = height * .5f;
buttonRadius = viewRadius - borderWidth;
left = viewPadding;
top = viewPadding;
right = w - viewPadding;
bottom = h - viewPadding;
centerX = (left + right) * .5f;
centerY = (top + bottom) * .5f;
buttonMinX = left + viewRadius;
buttonMaxX = right - viewRadius;
if (isChecked()) {
setCheckedViewState(viewState);
} else {
setUncheckViewState(viewState);
}
isUiInited = true;
postInvalidate();
}
/**
* @param viewState
*/
private void setUncheckViewState(ViewState viewState) {
viewState.radius = 0;
viewState.checkStateColor = uncheckColor;
viewState.checkedLineColor = Color.TRANSPARENT;
viewState.buttonX = buttonMinX;
}
/**
* @param viewState
*/
private void setCheckedViewState(ViewState viewState) {
viewState.radius = viewRadius;
viewState.checkStateColor = checkedColor;
viewState.checkedLineColor = checkLineColor;
viewState.buttonX = buttonMaxX;
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
paint.setStrokeWidth(borderWidth);
paint.setStyle(Paint.Style.FILL);
//绘制白色背景
paint.setColor(background);
drawRoundRect(canvas,
left, top, right, bottom,
viewRadius, paint);
//绘制关闭状态的边框
paint.setStyle(Paint.Style.STROKE);
paint.setColor(uncheckColor);
drawRoundRect(canvas,
left, top, right, bottom,
viewRadius, paint);
//绘制小圆圈
if (showIndicator) {
drawUncheckIndicator(canvas);
}
//绘制开启背景色
float des = viewState.radius * .5f;//[0-backgroundRadius*0.5f]
paint.setStyle(Paint.Style.STROKE);
paint.setColor(viewState.checkStateColor);
paint.setStrokeWidth(borderWidth + des * 2f);
drawRoundRect(canvas,
left + des, top + des, right - des, bottom - des,
viewRadius, paint);
//绘制按钮左边绿色长条遮挡
paint.setStyle(Paint.Style.FILL);
paint.setStrokeWidth(1);
drawArc(canvas,
left, top,
left + 2 * viewRadius, top + 2 * viewRadius,
90, 180, paint);
canvas.drawRect(
left + viewRadius, top,
viewState.buttonX, top + 2 * viewRadius,
paint);
//绘制小线条
if (showIndicator) {
drawCheckedIndicator(canvas);
}
//绘制按钮
drawButton(canvas, viewState.buttonX, centerY);
}
/**
* 绘制选中状态指示器
*
* @param canvas
*/
protected void drawCheckedIndicator(Canvas canvas) {
drawCheckedIndicator(canvas,
viewState.checkedLineColor,
checkLineWidth,
left + viewRadius - checkedLineOffsetX, centerY - checkLineLength,
left + viewRadius - checkedLineOffsetY, centerY + checkLineLength,
paint);
}
/**
* 绘制选中状态指示器
*
* @param canvas
* @param color
* @param lineWidth
* @param sx
* @param sy
* @param ex
* @param ey
* @param paint
*/
protected void drawCheckedIndicator(Canvas canvas,
int color,
float lineWidth,
float sx, float sy, float ex, float ey,
Paint paint) {
paint.setStyle(Paint.Style.STROKE);
paint.setColor(color);
paint.setStrokeWidth(lineWidth);
canvas.drawLine(
sx, sy, ex, ey,
paint);
}
/**
* 绘制关闭状态指示器
*
* @param canvas
*/
private void drawUncheckIndicator(Canvas canvas) {
drawUncheckIndicator(canvas,
uncheckCircleColor,
uncheckCircleWidth,
right - uncheckCircleOffsetX, centerY,
uncheckCircleRadius,
paint);
}
/**
* 绘制关闭状态指示器
*
* @param canvas
* @param color
* @param lineWidth
* @param centerX
* @param centerY
* @param radius
* @param paint
*/
protected void drawUncheckIndicator(Canvas canvas,
int color,
float lineWidth,
float centerX, float centerY,
float radius,
Paint paint) {
paint.setStyle(Paint.Style.STROKE);
paint.setColor(color);
paint.setStrokeWidth(lineWidth);
canvas.drawCircle(centerX, centerY, radius, paint);
}
/**
* @param canvas
* @param left
* @param top
* @param right
* @param bottom
* @param startAngle
* @param sweepAngle
* @param paint
*/
private void drawArc(Canvas canvas,
float left, float top,
float right, float bottom,
float startAngle, float sweepAngle,
Paint paint) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
canvas.drawArc(left, top, right, bottom,
startAngle, sweepAngle, true, paint);
} else {
rect.set(left, top, right, bottom);
canvas.drawArc(rect,
startAngle, sweepAngle, true, paint);
}
}
/**
* @param canvas
* @param left
* @param top
* @param right
* @param bottom
* @param backgroundRadius
* @param paint
*/
private void drawRoundRect(Canvas canvas,
float left, float top,
float right, float bottom,
float backgroundRadius,
Paint paint) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
canvas.drawRoundRect(left, top, right, bottom,
backgroundRadius, backgroundRadius, paint);
} else {
rect.set(left, top, right, bottom);
canvas.drawRoundRect(rect,
backgroundRadius, backgroundRadius, paint);
}
}
/**
* @param canvas
* @param x px
* @param y px
*/
private void drawButton(Canvas canvas, float x, float y) {
canvas.drawCircle(x, y, buttonRadius, buttonPaint);
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(1);
paint.setColor(0XffDDDDDD);
canvas.drawCircle(x, y, buttonRadius, paint);
}
@Override
public void setChecked(boolean checked) {
if (checked == isChecked()) {
postInvalidate();
return;
}
toggle(enableEffect, false);
}
@Override
public boolean isChecked() {
return isChecked;
}
@Override
public void toggle() {
toggle(true);
}
/**
* 切换状态
*
* @param animate
*/
public void toggle(boolean animate) {
toggle(animate, true);
}
private void toggle(boolean animate, boolean broadcast) {
if (!isEnabled()) {
return;
}
if (isEventBroadcast) {
throw new RuntimeException("should NOT switch the state in method: [onCheckedChanged]!");
}
if (!isUiInited) {
isChecked = !isChecked;
if (broadcast) {
broadcastEvent();
}
return;
}
if (valueAnimator.isRunning()) {
valueAnimator.cancel();
}
if (!enableEffect || !animate) {
isChecked = !isChecked;
if (isChecked()) {
setCheckedViewState(viewState);
} else {
setUncheckViewState(viewState);
}
postInvalidate();
if (broadcast) {
broadcastEvent();
}
return;
}
animateState = ANIMATE_STATE_SWITCH;
beforeState.copy(viewState);
if (isChecked()) {
//切换到unchecked
setUncheckViewState(afterState);
} else {
setCheckedViewState(afterState);
}
valueAnimator.start();
}
/**
*
*/
private void broadcastEvent() {
if (onCheckedChangeListener != null) {
isEventBroadcast = true;
onCheckedChangeListener.onCheckedChanged(this, isChecked());
}
isEventBroadcast = false;
}
@Override
public boolean onTouchEvent(MotionEvent event) {
if (!isEnabled()) {
return false;
}
int actionMasked = event.getActionMasked();
switch (actionMasked) {
case MotionEvent.ACTION_DOWN: {
isTouchingDown = true;
touchDownTime = System.currentTimeMillis();
//取消准备进入拖动状态
removeCallbacks(postPendingDrag);
//预设100ms进入拖动状态
postDelayed(postPendingDrag, 100);
break;
}
case MotionEvent.ACTION_MOVE: {
float eventX = event.getX();
if (isPendingDragState()) {
//在准备进入拖动状态过程中,可以拖动按钮位置
float fraction = eventX / getWidth();
fraction = Math.max(0f, Math.min(1f, fraction));
viewState.buttonX = buttonMinX
+ (buttonMaxX - buttonMinX)
* fraction;
} else if (isDragState()) {
//拖动按钮位置,同时改变对应的背景颜色
float fraction = eventX / getWidth();
fraction = Math.max(0f, Math.min(1f, fraction));
viewState.buttonX = buttonMinX
+ (buttonMaxX - buttonMinX)
* fraction;
viewState.checkStateColor = (int) argbEvaluator.evaluate(
fraction,
uncheckColor,
checkedColor
);
postInvalidate();
}
break;
}
case MotionEvent.ACTION_UP: {
isTouchingDown = false;
//取消准备进入拖动状态
removeCallbacks(postPendingDrag);
if (System.currentTimeMillis() - touchDownTime <= 300) {
//点击时间小于300ms,认为是点击操作
toggle();
} else if (isDragState()) {
//在拖动状态,计算按钮位置,设置是否切换状态
float eventX = event.getX();
float fraction = eventX / getWidth();
fraction = Math.max(0f, Math.min(1f, fraction));
boolean newCheck = fraction > .5f;
if (newCheck == isChecked()) {
pendingCancelDragState();
} else {
isChecked = newCheck;
pendingSettleState();
}
} else if (isPendingDragState()) {
//在准备进入拖动状态过程中,取消之,复位
pendingCancelDragState();
}
break;
}
case MotionEvent.ACTION_CANCEL: {
isTouchingDown = false;
removeCallbacks(postPendingDrag);
if (isPendingDragState()
|| isDragState()) {
//复位
pendingCancelDragState();
}
break;
}
}
return true;
}
/**
* 是否在动画状态
*
* @return
*/
private boolean isInAnimating() {
return animateState != ANIMATE_STATE_NONE;
}
/**
* 是否在进入拖动或离开拖动状态
*
* @return
*/
private boolean isPendingDragState() {
return animateState == ANIMATE_STATE_PENDING_DRAG
|| animateState == ANIMATE_STATE_PENDING_RESET;
}
/**
* 是否在手指拖动状态
*
* @return
*/
private boolean isDragState() {
return animateState == ANIMATE_STATE_DRAGING;
}
/**
* 设置是否启用阴影效果
*
* @param shadowEffect true.启用
*/
public void setShadowEffect(boolean shadowEffect) {
if (this.shadowEffect == shadowEffect) {
return;
}
this.shadowEffect = shadowEffect;
if (this.shadowEffect) {
buttonPaint.setShadowLayer(
shadowRadius,
0, shadowOffset,
shadowColor);
} else {
buttonPaint.setShadowLayer(
0,
0, 0,
0);
}
}
public void setEnableEffect(boolean enable) {
this.enableEffect = enable;
}
/**
* 开始进入拖动状态
*/
private void pendingDragState() {
if (isInAnimating()) {
return;
}
if (!isTouchingDown) {
return;
}
if (valueAnimator.isRunning()) {
valueAnimator.cancel();
}
animateState = ANIMATE_STATE_PENDING_DRAG;
beforeState.copy(viewState);
afterState.copy(viewState);
if (isChecked()) {
afterState.checkStateColor = checkedColor;
afterState.buttonX = buttonMaxX;
afterState.checkedLineColor = checkedColor;
} else {
afterState.checkStateColor = uncheckColor;
afterState.buttonX = buttonMinX;
afterState.radius = viewRadius;
}
valueAnimator.start();
}
/**
* 取消拖动状态
*/
private void pendingCancelDragState() {
if (isDragState() || isPendingDragState()) {
if (valueAnimator.isRunning()) {
valueAnimator.cancel();
}
animateState = ANIMATE_STATE_PENDING_RESET;
beforeState.copy(viewState);
if (isChecked()) {
setCheckedViewState(afterState);
} else {
setUncheckViewState(afterState);
}
valueAnimator.start();
}
}
/**
* 动画-设置新的状态
*/
private void pendingSettleState() {
if (valueAnimator.isRunning()) {
valueAnimator.cancel();
}
animateState = ANIMATE_STATE_PENDING_SETTLE;
beforeState.copy(viewState);
if (isChecked()) {
setCheckedViewState(afterState);
} else {
setUncheckViewState(afterState);
}
valueAnimator.start();
}
@Override
public final void setOnClickListener(OnClickListener l) {
}
@Override
public final void setOnLongClickListener(OnLongClickListener l) {
}
public void setOnCheckedChangeListener(OnCheckedChangeListener l) {
onCheckedChangeListener = l;
}
public interface OnCheckedChangeListener {
void onCheckedChanged(SwitchButton view, boolean isChecked);
}
/*******************************************************/
private static float dp2px(float dp) {
Resources r = Resources.getSystem();
return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics());
}
private static int dp2pxInt(float dp) {
return (int) dp2px(dp);
}
private static int optInt(TypedArray typedArray,
int index,
int def) {
if (typedArray == null) {
return def;
}
return typedArray.getInt(index, def);
}
private static float optPixelSize(TypedArray typedArray,
int index,
float def) {
if (typedArray == null) {
return def;
}
return typedArray.getDimension(index, def);
}
private static int optPixelSize(TypedArray typedArray,
int index,
int def) {
if (typedArray == null) {
return def;
}
return typedArray.getDimensionPixelOffset(index, def);
}
private static int optColor(TypedArray typedArray,
int index,
int def) {
if (typedArray == null) {
return def;
}
return typedArray.getColor(index, def);
}
private static boolean optBoolean(TypedArray typedArray,
int index,
boolean def) {
if (typedArray == null) {
return def;
}
return typedArray.getBoolean(index, def);
}
/*******************************************************/
/**
* 阴影半径
*/
private int shadowRadius;
/**
* 阴影Y偏移px
*/
private int shadowOffset;
/**
* 阴影颜色
*/
private int shadowColor;
/**
* 背景半径
*/
private float viewRadius;
/**
* 按钮半径
*/
private float buttonRadius;
/**
* 背景高
*/
private float height;
/**
* 背景宽
*/
private float width;
/**
* 背景位置
*/
private float left;
private float top;
private float right;
private float bottom;
private float centerX;
private float centerY;
/**
* 背景底色
*/
private int background;
/**
* 背景关闭颜色
*/
private int uncheckColor;
/**
* 背景打开颜色
*/
private int checkedColor;
/**
* 边框宽度px
*/
private int borderWidth;
/**
* 打开指示线颜色
*/
private int checkLineColor;
/**
* 打开指示线宽
*/
private int checkLineWidth;
/**
* 打开指示线长
*/
private float checkLineLength;
/**
* 关闭圆圈颜色
*/
private int uncheckCircleColor;
/**
* 关闭圆圈线宽
*/
private int uncheckCircleWidth;
/**
* 关闭圆圈位移X
*/
private float uncheckCircleOffsetX;
/**
* 关闭圆圈半径
*/
private float uncheckCircleRadius;
/**
* 打开指示线位移X
*/
private float checkedLineOffsetX;
/**
* 打开指示线位移Y
*/
private float checkedLineOffsetY;
/**
* 按钮最左边
*/
private float buttonMinX;
/**
* 按钮最右边
*/
private float buttonMaxX;
/**
* 按钮画笔
*/
private Paint buttonPaint;
/**
* 背景画笔
*/
private Paint paint;
/**
* 当前状态
*/
private ViewState viewState;
private ViewState beforeState;
private ViewState afterState;
private RectF rect = new RectF();
/**
* 动画状态
*/
private int animateState = ANIMATE_STATE_NONE;
/**
*
*/
private ValueAnimator valueAnimator;
private final android.animation.ArgbEvaluator argbEvaluator
= new android.animation.ArgbEvaluator();
/**
* 是否选中
*/
private boolean isChecked;
/**
* 是否启用动画
*/
private boolean enableEffect;
/**
* 是否启用阴影效果
*/
private boolean shadowEffect;
/**
* 是否显示指示器
*/
private boolean showIndicator;
/**
* 收拾是否按下
*/
private boolean isTouchingDown = false;
/**
*
*/
private boolean isUiInited = false;
/**
*
*/
private boolean isEventBroadcast = false;
private OnCheckedChangeListener onCheckedChangeListener;
/**
* 手势按下的时刻
*/
private long touchDownTime;
private Runnable postPendingDrag = new Runnable() {
@Override
public void run() {
if (!isInAnimating()) {
pendingDragState();
}
}
};
private ValueAnimator.AnimatorUpdateListener animatorUpdateListener
= new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float value = (Float) animation.getAnimatedValue();
switch (animateState) {
case ANIMATE_STATE_PENDING_SETTLE: {
}
case ANIMATE_STATE_PENDING_RESET: {
}
case ANIMATE_STATE_PENDING_DRAG: {
viewState.checkedLineColor = (int) argbEvaluator.evaluate(
value,
beforeState.checkedLineColor,
afterState.checkedLineColor
);
viewState.radius = beforeState.radius
+ (afterState.radius - beforeState.radius) * value;
if (animateState != ANIMATE_STATE_PENDING_DRAG) {
viewState.buttonX = beforeState.buttonX
+ (afterState.buttonX - beforeState.buttonX) * value;
}
viewState.checkStateColor = (int) argbEvaluator.evaluate(
value,
beforeState.checkStateColor,
afterState.checkStateColor
);
break;
}
case ANIMATE_STATE_SWITCH: {
viewState.buttonX = beforeState.buttonX
+ (afterState.buttonX - beforeState.buttonX) * value;
float fraction = (viewState.buttonX - buttonMinX) / (buttonMaxX - buttonMinX);
viewState.checkStateColor = (int) argbEvaluator.evaluate(
fraction,
uncheckColor,
checkedColor
);
viewState.radius = fraction * viewRadius;
viewState.checkedLineColor = (int) argbEvaluator.evaluate(
fraction,
Color.TRANSPARENT,
checkLineColor
);
break;
}
default:
case ANIMATE_STATE_DRAGING: {
}
case ANIMATE_STATE_NONE: {
break;
}
}
postInvalidate();
}
};
private Animator.AnimatorListener animatorListener
= new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
switch (animateState) {
case ANIMATE_STATE_DRAGING: {
break;
}
case ANIMATE_STATE_PENDING_DRAG: {
animateState = ANIMATE_STATE_DRAGING;
viewState.checkedLineColor = Color.TRANSPARENT;
viewState.radius = viewRadius;
postInvalidate();
break;
}
case ANIMATE_STATE_PENDING_RESET: {
animateState = ANIMATE_STATE_NONE;
postInvalidate();
break;
}
case ANIMATE_STATE_PENDING_SETTLE: {
animateState = ANIMATE_STATE_NONE;
postInvalidate();
broadcastEvent();
break;
}
case ANIMATE_STATE_SWITCH: {
isChecked = !isChecked;
animateState = ANIMATE_STATE_NONE;
postInvalidate();
broadcastEvent();
break;
}
default:
case ANIMATE_STATE_NONE: {
break;
}
}
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
};
/*******************************************************/
/**
* 保存动画状态
*/
private static class ViewState {
/**
* 按钮x位置[buttonMinX-buttonMaxX]
*/
float buttonX;
/**
* 状态背景颜色
*/
int checkStateColor;
/**
* 选中线的颜色
*/
int checkedLineColor;
/**
* 状态背景的半径
*/
float radius;
ViewState() {
}
private void copy(ViewState source) {
this.buttonX = source.buttonX;
this.checkStateColor = source.checkStateColor;
this.checkedLineColor = source.checkedLineColor;
this.radius = source.radius;
}
}
}
<resources>
<string name="app_name">component_control</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="SwitchButton">
<attr name="sb_shadow_radius" format="reference|dimension"/> 阴影半径
<attr name="sb_shadow_offset" format="reference|dimension"/> 阴影偏移
<attr name="sb_shadow_color" format="reference|color"/> 阴影颜色
<attr name="sb_uncheck_color" format="reference|color"/> 关闭颜色
<attr name="sb_checked_color" format="reference|color"/> 开启颜色
<attr name="sb_border_width" format="reference|dimension"/> 边框宽度
<attr name="sb_checkline_color" format="reference|color"/> 开启指示器颜色
<attr name="sb_checkline_width" format="reference|dimension"/> 开启指示器线宽
<attr name="sb_uncheckcircle_color" format="reference|color"/> 关闭指示器颜色
<attr name="sb_uncheckcircle_width" format="reference|dimension"/> 关闭指示器线宽
<attr name="sb_uncheckcircle_radius" format="reference|dimension"/>关闭指示器半径
<attr name="sb_checked" format="reference|boolean"/> 是否选中
<attr name="sb_shadow_effect" format="reference|boolean"/> 是否启用阴影
<attr name="sb_effect_duration" format="reference|integer"/> 动画时间,默认300ms
<attr name="sb_button_color" format="reference|color"/> 按钮颜色
<attr name="sb_show_indicator" format="reference|boolean"/> 是否显示指示器,默认true:显示
<attr name="sb_background" format="reference|color"/> 背景色,默认白色
<attr name="sb_enable_effect" format="reference|boolean"/> 是否启用特效,默认true
</declare-styleable>
</resources>
\ 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="@color/colorBgYellow" />
</shape>
\ No newline at end of file
package com.base.utils.tools.android;
package com.rv.component.utils;
import android.app.Activity;
import android.content.Context;
......
package com.rv.camp;
import android.Manifest;
import android.graphics.Rect;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
......@@ -8,11 +10,16 @@ import android.support.v7.widget.RecyclerView;
import android.view.View;
import com.alibaba.android.arouter.launcher.ARouter;
import com.baidu.location.BDAbstractLocationListener;
import com.baidu.location.BDLocation;
import com.baidu.mapapi.model.LatLng;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.frame.base.url.Constance;
import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseFragment;
import com.ruiwenliu.wrapper.util.LocationManager;
import com.ruiwenliu.wrapper.util.permission.RxPermission;
import com.rv.camp.adapter.CampListAdapter;
import com.rv.camp.adapter.CampTypeListAdapter;
import com.rv.camp.api.CampApi;
......@@ -27,6 +34,7 @@ import java.util.Map;
import butterknife.BindView;
import butterknife.OnClick;
import io.reactivex.functions.Consumer;
/**
* 营地
......@@ -46,6 +54,10 @@ public class CampFragment extends BaseFragment<CampPresenter> implements BaseQui
private int mPage;
private int countPage;
private String type = null;
private double latLatitude = 0;
private double lonLongitude;
private LatLng mLatLng;//当前城市经纬度
private LocationManager locationManager;
public static CampFragment getInstance(int type) {
......@@ -64,6 +76,7 @@ public class CampFragment extends BaseFragment<CampPresenter> implements BaseQui
@Override
protected void initView(Bundle savedInstanceState) {
permissionProcess();
campAdapter = new CampListAdapter();
rvContent.setLayoutManager(new GridLayoutManager(_mActivity, 2));
rvContent.addItemDecoration(new AbSpacesItemDecoration(15));// 分割线。
......@@ -94,8 +107,8 @@ public class CampFragment extends BaseFragment<CampPresenter> implements BaseQui
ARouter.getInstance()
.build(Constance.ACTIVITY_URL_CAMPDETAIL)
.withString("id", data.getId())
.withString("longitude", data.getLongitude())
.withString("latitude", data.getLatitude())
.withString("longitude", String.valueOf(lonLongitude))
.withString("latitude",String.valueOf(latLatitude))
.navigation();
}
});
......@@ -210,6 +223,65 @@ public class CampFragment extends BaseFragment<CampPresenter> implements BaseQui
}
}
/**
* 定位权限处理
*/
private void permissionProcess() {
/**
* 6.0以上手机做权限处理
*/
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
new RxPermission(getActivity()).request(
Manifest.permission.ACCESS_COARSE_LOCATION,
Manifest.permission.ACCESS_FINE_LOCATION
).subscribe(new Consumer<Boolean>() {
@Override
public void accept(Boolean aBoolean) throws Exception {
if (aBoolean == true) {
initGps();
} else {
getActivity().finish();
}
}
});
} else {
initGps();
}
}
/**
* 初始化定位
*/
public void initGps() {
locationManager = new LocationManager(getContext());
locationManager.getLocationDetail(new BDAbstractLocationListener() {
@Override
public void onReceiveLocation(BDLocation location) {
//此处的BDLocation为定位结果信息类,通过它的各种get方法可获取定位相关的全部结果
//以下只列举部分获取经纬度相关(常用)的结果信息
//更多结果信息获取说明,请参照类参考中BDLocation类中的说明
//获取定位精度,默认值为0.0f
float radius = location.getRadius();
//获取经纬度坐标类型,以LocationClientOption中设置过的坐标类型为准
String coorType = location.getCoorType();
//获取定位类型、定位错误返回码,具体信息可参照类参考中BDLocation类中的说明
int errorCode = location.getLocType();
// setGpsContent("count=:",String.valueOf(count));
// setGpsContent("latitude:",String.valueOf(location.getLatitude()));
// setGpsContent("longitude:",String.valueOf(location.getLongitude()));
// setGpsContent("城市:",location.getCity());
// setGpsContent("街道:",location.getAddrStr());
// setGpsContent("当前位置:",location.getLocationDescribe());
latLatitude = location.getLatitude();
lonLongitude = location.getLongitude();
mLatLng = new LatLng(location.getLatitude(), location.getLongitude());
locationManager.stopLocation();
}
});
}
public class AbSpacesItemDecoration extends RecyclerView.ItemDecoration {
......
......@@ -39,10 +39,12 @@ dependencies {
api project(':component_resource')
api project(':component_dialog')
api project(':component_utils')
api project(':component_control')
api project(':plugin_search')
api project(':RvWrapper')
// api project(':RvTravel')
annotationProcessor'com.alibaba:arouter-compiler:1.1.4'
implementation 'com.alibaba:fastjson:1.2.21'
}
......@@ -48,6 +48,7 @@ public class ApiConfig {
public static String HTTP_URL_GETTOURUSERLIST = RvFrameConfig.VEHICLE_TOURUSER + "tourUser/app/unauth/getTourUserList";//获得全部出游人信息
public static String HTTP_URL_ADDANDUPDATE = RvFrameConfig.VEHICLE_TOURUSER + "tourUser/app/addAndUpdate";//添加和更新出游人信息
public static String HTTP_URL_CAR_TYPE_NOTICE = RvFrameConfig.HOST + "/h5/appHtml/view/notice.html";//预定须知
public static String HTTP_URL_COLLECTONLIST = RvFrameConfig.ADMIN_POST + "app/user/collect/page";//我的收藏列表
public static String HTTP_URL_SCORE = RvFrameConfig.HOST + "/vehicle/vehicleUserScore/score";//订单评价保存
......
......@@ -6,17 +6,20 @@ import android.os.Bundle;
import android.support.annotation.Nullable;
import com.alibaba.android.arouter.launcher.ARouter;
import com.alibaba.fastjson.JSON;
import com.frame.base.bus.LoginSuccessfulEvent;
import com.frame.base.bus.RxBus;
import com.frame.base.url.Constance;
import com.frame.rv.OnModuleEventListener;
import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.SPConstance;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.presenter.MvpPresenter;
import com.ruiwenliu.wrapper.util.UtilsManager;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.home.R;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.basic.bean.BeanUserInfo;
import com.rv.home.rv.module.ui.login.bean.RegisteredBean;
import com.rv.home.rv.module.ui.main.home.CarDetailActivity;
import com.umeng.socialize.UMAuthListener;
......@@ -81,6 +84,11 @@ public abstract class BaseLoginActivity<P extends MvpPresenter> extends BaseStat
UMShareAPI.get(mActivity).getPlatformInfo(mActivity, share_media, this);
}
public void setDataUser(BeanUserInfo data) {
UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_USERINFO, JSON.toJSONString(data.getData())).commit();
}
/**
* 第三方登录
*
......@@ -109,21 +117,27 @@ public abstract class BaseLoginActivity<P extends MvpPresenter> extends BaseStat
}
public void processLoginData(RegisteredBean bean) {
RegisteredBean registeredBean = bean;
UtilsManager.getInstance(mActivity).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_NAME, registeredBean.getData().getUsername()).commit();
UtilsManager.getInstance(mActivity).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_HEADERURL, registeredBean.getData().getHeaderurl()).commit();
UtilsManager.getInstance(mActivity).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_USERID, registeredBean.getData().getUserId()).commit();
UtilsManager.getInstance(mActivity).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_TOKEN, registeredBean.getToken()).commit();
UtilsManager.getInstance(mActivity).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_IMUSERID, registeredBean.getData().getImUserId()).commit();
UtilsManager.getInstance(mActivity).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_IMTOKEN, registeredBean.getData().getImToken()).commit();
UtilsManager.getInstance(mActivity).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_ISCERTIFICATIONSTATUS, registeredBean.getData().getCertificationStatus()).commit();
RegisteredBean registeredBean = bean;
UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_NAME, registeredBean.getData().getUsername()).commit();
UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_HEADERURL, registeredBean.getData().getHeaderurl()).commit();
UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_USERID, registeredBean.getData().getUserId()).commit();
UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_TOKEN, registeredBean.getToken()).commit();
UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_IMUSERID, registeredBean.getData().getImUserId()).commit();
UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_IMTOKEN, registeredBean.getData().getImToken()).commit();
UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_ISCERTIFICATIONSTATUS, registeredBean.getData().getCertificationStatus()).commit();
Map<String, Object> headMap = new LinkedHashMap<>();
if (registeredBean.getToken() != null) {
headMap.put("Authorization", registeredBean.getToken());
mPresenter.getDataHead(RvFrameConfig.ADMIN_POST, 10, ApiConfig.HTTP_URL_APP_USER_INFO, BeanUserInfo.class, headMap, false);
}
OkGoUtil.setToken(registeredBean.getToken());
switch (RvFrameConfig.RvFrameInfo.TYPE_LOGIN) {
case 1:
if ("0".equals(bean.getData().getCertificationStatus())){ //实名认证状态:0-未认证,1-已认证
if ("0".equals(bean.getData().getCertificationStatus())) { //实名认证状态:0-未认证,1-已认证
ARouter.getInstance().build(Constance.ACTIVITY_URL_IDCARDCERTIFICATION).navigation();
}else {
} else {
startActivity(CarDetailActivity.getIntent(mActivity, 1));
}
break;
......@@ -136,4 +150,4 @@ public abstract class BaseLoginActivity<P extends MvpPresenter> extends BaseStat
finish();
}
}
}
......@@ -12,6 +12,7 @@ import com.ruiwenliu.wrapper.weight.webview.SafeWebView;
import com.rv.home.R;
import com.rv.home.rv.module.basic.presenter.PickerPresenter;
import com.rv.home.R2;
import butterknife.BindView;
public class WebActivity extends BaseStatusActivity<PickerPresenter> {
......@@ -21,8 +22,14 @@ public class WebActivity extends BaseStatusActivity<PickerPresenter> {
@BindView(R2.id.lay_web)
LinearLayout mRoot;
String title;
String url;
int type;
public static Intent getIntent(Context context, String title, String url) {
return new Intent(context, WebActivity.class).putExtra("title", title).putExtra("url", url);
return new Intent(context, WebActivity.class)
.putExtra("title", title)
.putExtra("url", url);
}
......@@ -40,7 +47,12 @@ public class WebActivity extends BaseStatusActivity<PickerPresenter> {
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
titleView.setTitle(intent.getStringExtra("title"));
String url = intent.getStringExtra("url");
if (0 == type) {
mWebView.loadUrl(url);
} else {
String baseUrl = url + "?type=" + type;
mWebView.loadUrl(baseUrl);
}
}
@Override
......@@ -49,7 +61,6 @@ public class WebActivity extends BaseStatusActivity<PickerPresenter> {
}
@Override
public void onResume() {
super.onResume();
......
package com.rv.home.rv.module.basic.bean;
import com.ruiwenliu.wrapper.base.BaseBean;
import java.io.Serializable;
/**
* 获取用户信息
*/
public class BeanUserInfo extends BaseBean {
private UserInfo data;
private boolean rel;
public UserInfo getData() {
return data;
}
public void setData(UserInfo data) {
this.data = data;
}
public boolean isRel() {
return rel;
}
public void setRel(boolean rel) {
this.rel = rel;
}
public static class UserInfo implements Serializable {
private Integer id;
//用户id
private Integer userid;
//imid
private Integer imUserid;
///账号(手机号)
private String username;
//微信openid
private String wxOpenid;
//微信unionid
private String unionid;
//qq
private String openid;
//状态:0-启用,1-禁用
private Integer status;
//身份证号
private String idNumber;
//实名认证状态:0-未认证,1-已认证
private Integer certificationStatus;
//会员
private Integer isMember; // 是否为会员 0-普通用户 1-会员
//昵称
private String nickname;
//真实姓名
private String realname;
//头像
private String headimgurl;
//邮箱
private String email;
//性别 0-女,1-男
private Integer sex;
//生日
private String birthday;
//个性签名
private String personSign;
//备注
private String remark;
// 剩余天数
private int rentFreeDays ;
// 会员消费次数
private int payCount;
// 购买会员册数
private int buyCount ;
// 会员等级
private int memberLevel;
private int discount;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUserid() {
return userid;
}
public void setUserid(Integer userid) {
this.userid = userid;
}
public Integer getImUserid() {
return imUserid;
}
public void setImUserid(Integer imUserid) {
this.imUserid = imUserid;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getWxOpenid() {
return wxOpenid;
}
public void setWxOpenid(String wxOpenid) {
this.wxOpenid = wxOpenid;
}
public String getUnionid() {
return unionid;
}
public void setUnionid(String unionid) {
this.unionid = unionid;
}
public String getOpenid() {
return openid;
}
public void setOpenid(String openid) {
this.openid = openid;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getIdNumber() {
return idNumber;
}
public void setIdNumber(String idNumber) {
this.idNumber = idNumber;
}
public Integer getCertificationStatus() {
return certificationStatus;
}
public void setCertificationStatus(Integer certificationStatus) {
this.certificationStatus = certificationStatus;
}
public Integer getIsMember() {
return isMember;
}
public void setIsMember(Integer isMember) {
this.isMember = isMember;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public String getRealname() {
return realname;
}
public void setRealname(String realname) {
this.realname = realname;
}
public String getHeadimgurl() {
return headimgurl;
}
public void setHeadimgurl(String headimgurl) {
this.headimgurl = headimgurl;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Integer getSex() {
return sex;
}
public void setSex(Integer sex) {
this.sex = sex;
}
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
public String getPersonSign() {
return personSign;
}
public void setPersonSign(String personSign) {
this.personSign = personSign;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public int getRentFreeDays() {
return rentFreeDays;
}
public void setRentFreeDays(int rentFreeDays) {
this.rentFreeDays = rentFreeDays;
}
public int getPayCount() {
return payCount;
}
public void setPayCount(int payCount) {
this.payCount = payCount;
}
public int getBuyCount() {
return buyCount;
}
public void setBuyCount(int buyCount) {
this.buyCount = buyCount;
}
public int getMemberLevel() {
return memberLevel;
}
public void setMemberLevel(int memberLevel) {
this.memberLevel = memberLevel;
}
public int getDiscount() {
return discount;
}
public void setDiscount(int discount) {
this.discount = discount;
}
}
}
......@@ -18,6 +18,7 @@ import com.rv.home.R;
import com.rv.home.R2;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.basic.BaseLoginActivity;
import com.rv.home.rv.module.basic.bean.BeanUserInfo;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.home.rv.module.ui.login.bean.CheckLoginBean;
import com.rv.home.rv.module.ui.login.bean.RegisteredBean;
......@@ -117,6 +118,9 @@ public class BingPhoneActivity extends BaseLoginActivity<CommonPresenter> {
case 2:
processLoginData((RegisteredBean) result);
break;
case 10:
setDataUser((BeanUserInfo)result);
break;
}
}
......
......@@ -17,6 +17,7 @@ import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.util.listener.TextChangedListener;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.home.rv.module.basic.BaseLoginActivity;
import com.rv.home.rv.module.basic.bean.BeanUserInfo;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.home.rv.module.ui.login.bean.RegisteredBean;
import com.umeng.socialize.bean.SHARE_MEDIA;
......@@ -99,6 +100,8 @@ public class ConfirmPwdActivity extends BaseLoginActivity<CommonPresenter> {
public void onShowResult(int requestType, BaseBean result) {
if (requestType == 2) {
processLoginData((RegisteredBean) result);
}else if (requestType == 10){
setDataUser((BeanUserInfo)result);
}
}
......
......@@ -26,6 +26,7 @@ import com.rv.home.R2;
import com.frame.rv.config.RvFrameConfig;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.basic.BaseLoginActivity;
import com.rv.home.rv.module.basic.bean.BeanUserInfo;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.home.rv.module.ui.login.bean.RegisteredBean;
import com.rv.home.rv.module.ui.login.bean.SendCodeBean;
......@@ -115,6 +116,9 @@ public class LoginRvActivity extends BaseLoginActivity<CommonPresenter> {
case 2:
processLoginData((RegisteredBean) result);
break;
case 10:
setDataUser((BeanUserInfo)result);
break;
}
}
......
......@@ -18,6 +18,7 @@ import com.rv.home.R;
import com.rv.home.R2;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.basic.BaseLoginActivity;
import com.rv.home.rv.module.basic.bean.BeanUserInfo;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.home.rv.module.ui.login.bean.RegisteredBean;
import com.umeng.socialize.bean.SHARE_MEDIA;
......@@ -71,6 +72,8 @@ public class PwdLoginActivity extends BaseLoginActivity<CommonPresenter> {
public void onShowResult(int requestType, BaseBean result) {
if (requestType == 0) {
processLoginData((RegisteredBean) result);
}else if (requestType == 10){
setDataUser((BeanUserInfo)result);
}
}
......
......@@ -22,6 +22,7 @@ import com.rv.home.R;
import com.rv.home.R2;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.basic.BaseLoginActivity;
import com.rv.home.rv.module.basic.bean.BeanUserInfo;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.home.rv.module.ui.login.bean.RegisteredBean;
import com.rv.home.rv.module.ui.login.bean.SendCodeBean;
......@@ -106,6 +107,9 @@ public class RegisteredActivity extends BaseLoginActivity<CommonPresenter> {
case 1:
processLoginData((RegisteredBean) result);
break;
case 10:
setDataUser((BeanUserInfo) result);
break;
}
}
......@@ -239,7 +243,7 @@ public class RegisteredActivity extends BaseLoginActivity<CommonPresenter> {
* @return
*/
private String getAgainPwd() {
return etPwd.getText().toString().trim();
return etAgainPwd.getText().toString().trim();
}
;
......
......@@ -87,7 +87,7 @@ public class CarDetailActivity extends BaseStatusActivity<CommonPresenter> {
tvTitleCenter.setText("车辆详情");
webUrl = ApiConfig.HTTP_URL_CAR_TYPE_DETAIL + "?id=" + mCarBean.getVehicleModel().getId() + "&companyId=" + mCarBean.getCompany().getId();
initWeb();
initShare(webUrl, mCarBean.getVehicleModel().getName(), mCarBean.getCompany().getAddrDetail(), mCarBean.getVehicleModel().getPicture());
initShare(webUrl, mCarBean.getVehicleModel().getName(), mCarBean.getCompany().getAddrDetail(), mCarBean.getVehicleModel().getIcon());
}
@Override
......
......@@ -229,32 +229,6 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
}
showSelected(multiList);
}
// switch (view.getId()) {
// case R.id.rl_brand:
// setMenuSelect(0, view, attributeListBean.getData().getCata().get(0).getChildren(), tvBrand.getText().toString().trim());
// break;
// case R.id.rl_price:
// setMenuSelect(1, view, attributeListBean.getData().getCata().get(1).getChildren(), tvPrice.getText().toString().trim());
// break;
// case R.id.rl_seat:
// setMenuSelect(2, view, attributeListBean.getData().getCata().get(2).getChildren(), tvSeat.getText().toString().trim());
// break;
// case R.id.rl_selected:
// setMenuSelect(3, view, null, null);
// List<MultiItemBean> multiList = new ArrayList<>();
// for (CarAttributeListBean.DataBean.CataBean bean : attributeListBean.getData().getCata()) {
// multiList.add(bean);
// for (CarAttributeListBean.DataBean.CataBean.ChildrenBean childrenBean : bean.getChildren()) {
// if (listScreeningId != null && listScreeningId.size() > 0) {
// childrenBean.isSelect = listScreeningId.indexOf(childrenBean.getId()) > -1 ? 1 : 0;
// }
// multiList.add(childrenBean);
// }
// }
// showSelected(multiList);
// break;
// }
}
......
......@@ -18,21 +18,27 @@ import android.widget.PopupWindow;
import android.widget.RatingBar;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.base.utils.ui.datetime.selector.util.TextUtil;
import com.frame.base.bus.PaymentFailedEvent;
import com.frame.base.bus.PaymentSuccessfulEvent;
import com.frame.base.bus.RxBus;
import com.frame.rv.config.RvFrameConfig;
import com.google.gson.Gson;
import com.ruiwenliu.wrapper.SPConstance;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.util.UtilsManager;
import com.ruiwenliu.wrapper.util.ViewHolder;
import com.ruiwenliu.wrapper.util.glide.GlideManager;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.frame.base.bus.PaymentFailedEvent;
import com.frame.base.bus.PaymentSuccessfulEvent;
import com.frame.base.bus.RxBus;
import com.rv.component.control.SwitchButton;
import com.rv.component.dialog.PaymentTypeSelection;
import com.rv.home.R;
import com.rv.home.R2;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.basic.BaseStatusActivity;
import com.rv.home.rv.module.basic.WebActivity;
import com.rv.home.rv.module.basic.bean.BeanUserInfo;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.home.rv.module.ui.main.home.bean.CarTypeListBean;
import com.rv.home.rv.module.ui.main.home.bean.ConfirmOrderBean;
......@@ -52,6 +58,7 @@ import java.util.LinkedHashMap;
import java.util.Map;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
......@@ -72,16 +79,6 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
RatingBar ratingBar;
@BindView(R2.id.tv_price)
TextView tvPrice;
@BindView(R2.id.tv_get_time)
TextView tvGetTime;
@BindView(R2.id.tv_get_week)
TextView tvGetWeek;
@BindView(R2.id.tv_day)
TextView tvDay;
@BindView(R2.id.tv_out_time)
TextView tvOutTime;
@BindView(R2.id.tv_out_week)
TextView tvOutWeek;
@BindView(R2.id.tv_get_car_address)
TextView tvGetCarAddress;
@BindView(R2.id.tv_out_car_address)
......@@ -94,16 +91,10 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
LinearLayout llAddDriving;
@BindView(R2.id.tv_deposit)
TextView tvDeposit;
@BindView(R2.id.tv_give_car_info)
TextView tvGiveCarInfo;
@BindView(R2.id.tv_give_car_content)
TextView tvGiveCarContent;
@BindView(R2.id.tv_car_not_hurt)
TextView tvCarNotHurt;
@BindView(R2.id.tv_car_not_hurt_money)
TextView tvCarNotHurtMoney;
@BindView(R2.id.tv_car_not_hurt_content)
TextView tvCarNotHurtContent;
@BindView(R2.id.tv_passenger_know)
CheckBox tvPassengerKnow;
@BindView(R2.id.tv_contract_agreement)
......@@ -120,18 +111,43 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
TextView tvIdCard;
@BindView(R2.id.ll_bottom)
LinearLayout llBottom;
@BindView(R2.id.tv_layout_service_fee)
TextView tvLayoutServiceFee;
@BindView(R2.id.ll_layout_clean_fee)
LinearLayout llLayoutCleanFee;
@BindView(R2.id.swbtn_member)
SwitchButton swbtnMember;
@BindView(R2.id.tv_event_date)
TextView tvEventDate;
@BindView(R2.id.tv_activity_day)
TextView tvActivityDay;
@BindView(R2.id.tv_lab3)
CheckBox tvLab3;
@BindView(R2.id.tv_layout_member_hint)
TextView tvLayoutMemberHint;
@BindView(R2.id.ll_layout_member_hint)
LinearLayout llLayoutMemberHint;
@BindView(R2.id.tv_free_car_days)
TextView tvFreeCarDays;
@BindView(R2.id.tv_xin_driving_price)
TextView tvXinDrivingPrice;
private final int TYPE_REQUEST_DRIVING = 3;
private boolean serviceFeeShow = true;
private boolean cleanFeeShow = true;
private OrderDataBean dataBean;
private CarTypeListBean.DataBeanX.DataBean mCarBean;
private DrivingListBean.DataBeanX.DataBean drivingListBean;
private int drivingType;//驾驶证类型1、欣新驾驶员2、自驾
private int drivingType ;//驾驶证类型1、欣新驾驶员2、自驾
private OrderPriceDetailPw detailPw;//显示订单价格明细弹窗
private OrderPriceDetailBean orderPriceDetailBean;//订单价格明细实体类
private IWXAPI api;
private int payType;//选择支付类型
private OrderPriceBean priceBean;
BeanUserInfo.UserInfo info = null;
private int deductiblePriceType;
public static Intent getIntent(Context context, OrderDataBean bean, CarTypeListBean.DataBeanX.DataBean carBean, String startTime, String endTime) {
return new Intent(context, ConfirmOrderActivity.class)
......@@ -154,6 +170,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
mCarBean = (CarTypeListBean.DataBeanX.DataBean) intent.getSerializableExtra("carBean");
intiView();
initRxBus();
}
@SuppressLint("CheckResult")
......@@ -191,9 +208,11 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
switch (requestType) {
case 0:
priceBean = (OrderPriceBean) result;
tvPayMoney.setText(String.format("¥%1$s", priceBean.getData().getOrderAmount()));
tvXinDrivingPrice.setText(String.format("(¥%1$s%2$s", priceBean.getData().getDriverPrice(), "/天)"));
tvCarNotHurtMoney.setText(String.format("¥%1$s%2$s", priceBean.getData().getDamageSafePrice(), "/天"));
tvDeposit.setText(String.format("¥%1$s%2$s", priceBean.getData().getDeposit(), mActivity.getString(R.string.rv_rb)));
orderPriceDetailBean = new Gson().fromJson(priceBean.getData().getCostDetail(), OrderPriceDetailBean.class);
getPayMoney();
break;
case 1:
ConfirmOrderBean orderBean = (ConfirmOrderBean) result;
......@@ -231,23 +250,16 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
}
@OnClick({R2.id.rl_goods, R2.id.tv_get_time, R2.id.tv_get_week, R2.id.tv_out_time, R2.id.tv_out_week, R2.id.tv_get_car_address, R2.id.tv_out_car_address, R2.id.iv_add_driving, R2.id.tv_give_car_info,
R2.id.tv_give_car_content, R2.id.tv_detail, R2.id.tv_confirm_order, R2.id.tv_delete, R2.id.rb_xin_driving, R2.id.rb_user_driving,R2.id.tv_contract_agreement})
@OnClick({R2.id.rl_goods, R2.id.tv_get_car_address, R2.id.tv_out_car_address, R2.id.iv_add_driving,
R2.id.tv_detail, R2.id.tv_confirm_order, R2.id.tv_delete, R2.id.rb_xin_driving,
R2.id.rb_user_driving, R2.id.tv_contract_agreement, R2.id.tv_service_fee_show, R2.id.tv_vehicle_cleaning_fee_show, R2.id.tv_lab3})
public void onViewClicked(View view) {
int i = view.getId();
if (i == R.id.rl_goods) {
} else if (i == R.id.tv_get_time) {
} else if (i == R.id.tv_get_week) {
} else if (i == R.id.tv_out_time) {
} else if (i == R.id.tv_out_week) {
} else if (i == R.id.tv_get_car_address) {
} else if (i == R.id.tv_out_car_address) {
} else if (i == R.id.iv_add_driving) {
startActivityForResult(DrivingListActivity.getIntent(mActivity,drivingListBean), TYPE_REQUEST_DRIVING);
} else if (i == R.id.tv_give_car_info) {
} else if (i == R.id.tv_give_car_content) {
startActivityForResult(DrivingListActivity.getIntent(mActivity, drivingListBean), TYPE_REQUEST_DRIVING);
} else if (i == R.id.tv_detail) {
showOrderDetail(llBottom);
......@@ -263,8 +275,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
rbUserDriving.setChecked(false);
llAddDriving.setVisibility(View.GONE);
rbXinDriving.setChecked(true);
getOrderPrice();
getPayMoney();
} else if (i == R.id.rb_user_driving) {
drivingType = 2;
rbXinDriving.setChecked(false);
......@@ -272,26 +283,33 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
if (drivingListBean != null) {
llAddDriving.setVisibility(View.VISIBLE);
}
getOrderPrice();
}else if (i == R.id.tv_contract_agreement){
getPayMoney();
} else if (i == R.id.tv_contract_agreement) {
startActivity(WebActivity.getIntent(mActivity, mActivity.getString(R.string.rv_contract_agreement), ApiConfig.HTTP_URL_CAR_TYPE_NOTICE));
} else if (i == R.id.tv_service_fee_show) {
if (serviceFeeShow) {
tvLayoutServiceFee.setVisibility(View.VISIBLE);
} else {
tvLayoutServiceFee.setVisibility(View.GONE);
}
serviceFeeShow = !serviceFeeShow;
} else if (i == R.id.tv_vehicle_cleaning_fee_show) {
if (cleanFeeShow) {
llLayoutCleanFee.setVisibility(View.VISIBLE);
} else {
llLayoutCleanFee.setVisibility(View.GONE);
}
cleanFeeShow = !cleanFeeShow;
} else if (i == R.id.tv_lab3) {
if (tvLab3.isChecked()) {
deductiblePriceType = 1;
dataBean.setDamageSafe(1);
} else {
dataBean.setDamageSafe(0);
deductiblePriceType = 0;
}
getPayMoney();
}
// if(view.getId()==R.id.iv_add_driving){
// startActivityForResult(DrivingListActivity.getIntent(mActivity), TYPE_REQUEST_DRIVING);
// }else if(view.getId()==R.id.tv_detail){
// showOrderDetail(llBottom);
// }else if(view.getId()==R.id.tv_confirm_order){
// confirmOrder();
// }else if(view.getId()==R.id.tv_delete){
// drivingListBean = null;
// llAddDriving.setVisibility(View.GONE);
// }else if(view.getId()==R.id.iv_add_driving){
//
// }else if(view.getId()==R.id.iv_add_driving){
//
// }
}
/**
......@@ -317,10 +335,10 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
@Override
public void onClick(View v) {
int i = v.getId();
if (i ==R.id.iv_close){
if (i == R.id.iv_close) {
dismiss();
createOrder(3);
}else if (i == R.id.ll_item_wechat) {
} else if (i == R.id.ll_item_wechat) {
payType = 1;
helper.setChecked(R.id.rb_wechat, true);
helper.setChecked(R.id.rb_alipay, false);
......@@ -337,7 +355,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
}
}
},R.id.iv_close, R.id.ll_item_wechat, R.id.ll_item_alipay, R.id.tv_pay_immediately);
}, R.id.iv_close, R.id.ll_item_wechat, R.id.ll_item_alipay, R.id.tv_pay_immediately);
}
}.show();
}
......@@ -349,7 +367,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
Map<String, Object> headMap = new LinkedHashMap<>();
if (OkGoUtil.getToken() != null)
headMap.put("Authorization", OkGoUtil.getToken());
Log.i("confirmorderactivity", "createOrder: " +dataBean.toString());
Log.i("confirmorderactivity", "createOrder: " + dataBean.toString());
mPresenter.postBodyData(RvFrameConfig.VEHICLE_ORDER, payType, ApiConfig.HTTP_URL_CONFIRM_ORDER, ConfirmOrderBean.class, dataBean, headMap, true);
}
......@@ -358,7 +376,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
*/
private void getOrderPrice() {
Map<String, Object> map = new LinkedHashMap<>();
map.put("driverType", drivingType);
map.put("driverType", 1);
map.put("modelId", dataBean.getModelId());
map.put("startTime", dataBean.getStartTime());
map.put("endTime", dataBean.getEndTime());
......@@ -373,10 +391,6 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
Map<String, Object> headMap = new LinkedHashMap<>();
if (OkGoUtil.getToken() != null)
headMap.put("Authorization", OkGoUtil.getToken());
// Map<String, Object> map = new LinkedHashMap<>();
// map.put("orderNo",orderNo);
// map.put("payWay",payWay);
// map.put("type",type);
mPresenter.postBodyData(RvFrameConfig.VEHICLE_ORDER, 2, ApiConfig.HTTP_URL_PAY_THE_CALLBACK, OrderPayBean.class, new payBody(orderNo, payWay, type), headMap, true);
}
......@@ -385,20 +399,60 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
* 初始化View
*/
private void intiView() {
drivingType = dataBean.getDriverType();
rbXinDriving.setChecked(drivingType == 1 ? true : false);
GlideManager.getInstance(mActivity).loadImage(mCarBean.getVehicleModel().getPicture(), ivGoods);
GlideManager.getInstance(mActivity).loadImage(mCarBean.getVehicleModel().getIcon(), ivGoods);
tvName.setText(mCarBean.getVehicleModel().getName());
tvContent.setText(mCarBean.getVehicleModel().getKeyword());
ratingBar.setRating((float) mCarBean.getVehicleModel().getPoint());
tvDay.setText(String.format("%1$s%2$s", dataBean.getDayNum(), mActivity.getString(R.string.rv_days)));
tvPrice.setText(String.format("%1$s%2$s", mCarBean.getVehicleModel().getPrice(), mActivity.getString(R.string.rv_day)));
tvGetTime.setText(getIntent().getStringExtra("startTime"));
tvOutTime.setText(getIntent().getStringExtra("endTime"));
tvPrice.setText(String.format("%1$s%2$s", mCarBean.getVehicleModel().getSum(), mActivity.getString(R.string.rv_day)));
tvEventDate.setText(getIntent().getStringExtra("startTime") + "~" + getIntent().getStringExtra("endTime"));
tvActivityDay.setText(String.format("%1$s%2$s", dataBean.getDayNum(), mActivity.getString(R.string.rv_days)));
tvGetCarAddress.setText(dataBean.getStartAddr());
tvOutCarAddress.setText(dataBean.getEndAddr());
String spStringCode = UtilsManager.getInstance(OkGoUtil.application).getSPStringCode(SPConstance.USER_JSON, SPConstance.USER_JSON_USERINFO);
if (!TextUtil.isEmpty(spStringCode)) {
info = JSON.parseObject(spStringCode, BeanUserInfo.UserInfo.class);
}
if (info != null) {
if (0 == info.getIsMember()) {
tvLayoutMemberHint.setVisibility(View.GONE);
llLayoutMemberHint.setVisibility(View.GONE);
} else if (1 == info.getIsMember()) {
tvLayoutMemberHint.setVisibility(View.VISIBLE);
llLayoutMemberHint.setVisibility(View.VISIBLE);
tvFreeCarDays.setText("(剩余" + info.getRentFreeDays() + "天)");
}
}
swbtnMember.setOnCheckedChangeListener(new SwitchButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(SwitchButton view, boolean isChecked) {
if (isChecked) {
dataBean.setRentFreeDay(1);
} else {
dataBean.setRentFreeDay(0);
}
}
});
}
/**
* 支付价格计算
*/
private void getPayMoney() {
double payMoney = 0.00;
double dayPrice = mCarBean.getVehicleModel().getSum();
int dayNum = dataBean.getDayNum();
payMoney = dayPrice * dayNum + priceBean.getData().getDeposit(); //租车和押金价格
if (drivingType == 1) {
payMoney = payMoney + priceBean.getData().getDriverAmount(); // + 专职司机
}
if (deductiblePriceType ==1){
payMoney = payMoney +priceBean.getData().getDamageSafePrice() * dayNum; //+免赔付价格
}
tvPayMoney.setText(String.format("¥%1$s", payMoney));
}
private String getContent(String name, String card) {
return String.format("%1$s <font color='#666666'>%2$s</font>", name, card);
......@@ -486,6 +540,13 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation
ButterKnife.bind(this);
}
public class payBody {
private String orderNo;
private int payWay;
......
......@@ -31,6 +31,12 @@ import com.alibaba.android.arouter.launcher.ARouter;
import com.baidu.location.BDAbstractLocationListener;
import com.baidu.location.BDLocation;
import com.baidu.mapapi.model.LatLng;
import com.baidu.mapapi.search.core.SearchResult;
import com.baidu.mapapi.search.geocode.GeoCodeOption;
import com.baidu.mapapi.search.geocode.GeoCodeResult;
import com.baidu.mapapi.search.geocode.GeoCoder;
import com.baidu.mapapi.search.geocode.OnGetGeoCoderResultListener;
import com.baidu.mapapi.search.geocode.ReverseGeoCodeResult;
import com.base.utils.ui.datetime.selector.util.TextUtil;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.frame.base.url.Constance;
......@@ -48,6 +54,7 @@ import com.rv.component.utils.ObservableScrollView;
import com.rv.home.R;
import com.rv.home.R2;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.basic.WebActivity;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.home.rv.module.ui.main.home.adapter.HotCarTypeAdapter;
import com.rv.home.rv.module.ui.main.home.adapter.RVEnthusiastAdapter;
......@@ -193,6 +200,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
private Map<String, Integer> mapGetTime;
private Map<String, Integer> mapOutTime;
private LocationManager locationManager;
private GeoCoder geoCoder;
private List<HomePopularBrigade.DataBean> hotData; //热门标签
private double rvTourLatitude = 0;
......@@ -430,9 +438,15 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
mRvTourAdapter.setNewData(hotData);
mRvTourLabelAdapter.setNewData(hotData);
}
@OnClick({R2.id.travel_city_layout, R2.id.ll_item_search,R2.id.tv_item_rv_tour, R2.id.tv_item_renting_a_car, R2.id.tv_get_city, R2.id.tv_out_city, R2.id.tv_get_address, R2.id.tv_out_address, R2.id.ll_item_get_time, R2.id.ll_item_alsotime, R2.id.tv_select_car, R2.id.ll_item_rv_city, R2.id.tv_book_now, R2.id.ll_item_rv_hot_label1, R2.id.ll_item_rv_hot_label2, R2.id.ll_item_rv_hot_label3, R2.id.ll_item_hot_rvtour, R2.id.ll_item_hot_entertainment_camp, R2.id.ll_item_hot_car_rental, R2.id.tv_see_more_popular, R2.id.ll_item_top})
@OnClick({R2.id.travel_city_layout, R2.id.ll_item_search,R2.id.tv_item_rv_tour, R2.id.tv_item_renting_a_car, R2.id.tv_get_city,
R2.id.tv_out_city, R2.id.tv_get_address, R2.id.tv_out_address, R2.id.ll_item_get_time, R2.id.ll_item_alsotime, R2.id.tv_select_car,
R2.id.ll_item_rv_city, R2.id.tv_book_now, R2.id.ll_item_rv_hot_label1, R2.id.ll_item_rv_hot_label2, R2.id.ll_item_rv_hot_label3,
R2.id.ll_item_hot_rvtour, R2.id.ll_item_hot_entertainment_camp, R2.id.ll_item_hot_car_rental, R2.id.tv_see_more_popular,
R2.id.ll_item_top, R2.id.tv_car_rental_guide})
public void onViewClicked(View view) {
int id = view.getId();
if (id == R.id.travel_city_layout) {
......@@ -638,6 +652,9 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
scrollview.fullScroll(View.FOCUS_UP);
}else if (id == R.id.travel_server_image){
showToast("亲,该功能还在开发中。。。");
}else if (id == R.id.tv_car_rental_guide){
//租车指南
startActivity(WebActivity.getIntent(_mActivity, _mActivity.getString(R.string.rv_contract_agreement), ApiConfig.HTTP_URL_CAR_TYPE_NOTICE));
}
}
......@@ -710,9 +727,11 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
tvRvCity.setText(data);
break;
case 4:
travelCityLatitude = lat;
travelCityLongitude = lon;
travelCityText.setText(data);
geoCoder.geocode(new GeoCodeOption()
.city(data)
.address(data));
break;
}
}
......@@ -1008,6 +1027,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
public void accept(Boolean aBoolean) throws Exception {
if (aBoolean == true) {
initGps();
initCity();
} else {
getActivity().finish();
}
......@@ -1015,7 +1035,34 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
});
} else {
initGps();
initCity();
}
}
private void initCity() {
geoCoder = GeoCoder.newInstance();
geoCoder.setOnGetGeoCodeResultListener(new OnGetGeoCoderResultListener() {
@Override
public void onGetGeoCodeResult(GeoCodeResult result) {
if (result == null || result.error != SearchResult.ERRORNO.NO_ERROR) {
//没有检索到结果
} else {
latLatitude = result.getLocation().latitude;
lonLongitude = result.getLocation().longitude;
}
//获取地理编码结果
}
@Override
public void onGetReverseGeoCodeResult(ReverseGeoCodeResult result) {
if (result == null || result.error != SearchResult.ERRORNO.NO_ERROR) {
//没有找到检索结果
}else {
latLatitude = result.getLocation().latitude;
lonLongitude = result.getLocation().longitude;
}
}
});
}
/**
......@@ -1054,4 +1101,10 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
}
});
}
@Override
public void onDestroy() {
super.onDestroy();
geoCoder.destroy();
}
}
......@@ -66,7 +66,7 @@ public class ShareImageActivity extends SwipeBackActivity<CommonPresenter> {
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
showTitle(false);
mCarBean = (CarTypeListBean.DataBeanX.DataBean) getIntent().getSerializableExtra("carBean");
GlideManager.getInstance(this).loadImage(mCarBean.getVehicleModel().getPicture(), ivGoods);
GlideManager.getInstance(this).loadImage(mCarBean.getVehicleModel().getIcon(), ivGoods);
tvName.setText(mCarBean.getVehicleModel().getName());
tvContent.setText(mCarBean.getVehicleModel().getKeyword());
tvPrice.setText(String.format("%1$s%2$s", mCarBean.getVehicleModel().getPrice(), this.getString(R.string.rv_day)));
......
......@@ -27,7 +27,7 @@ public class CarRentalListAdapter extends BaseQuickAdapter<CarTypeListBean.DataB
helper.setText(R.id.tv_name,item.getVehicleModel().getName());
helper.setText(R.id.tv_context,item.getVehicleModel().getKeyword());
helper.setText(R.id.tv_point,String.valueOf(item.getVehicleModel().getPoint()));
helper.loadImage(mContext,item.getVehicleModel().getPicture(), (ImageView) helper.getView(R.id.iv_goods));
helper.loadImage(mContext,item.getVehicleModel().getIcon(), (ImageView) helper.getView(R.id.iv_goods));
// helper.setText(R.id.tv_name,item);
helper.setText(R.id.tv_price,String.format("¥%1$s%2$s",item.getVehicleModel().getPrice(),mContext.getString(R.string.rv_day)));
}
......
package com.rv.home.rv.module.ui.main.home.bean;
import com.alibaba.fastjson.JSON;
import com.base.utils.ui.datetime.selector.util.TextUtil;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import com.google.gson.reflect.TypeToken;
import com.ruiwenliu.wrapper.SPConstance;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.util.UtilsManager;
import com.rv.home.rv.module.basic.bean.BeanUserInfo;
import com.yuyife.okgo.OkGoUtil;
import org.w3c.dom.Text;
import java.io.Serializable;
import java.util.List;
......@@ -12,7 +22,7 @@ import java.util.List;
* Desc:租车类型列表
*/
public class CarTypeListBean extends BaseBean implements Serializable{
public class CarTypeListBean extends BaseBean implements Serializable {
/**
......@@ -39,7 +49,7 @@ public class CarTypeListBean extends BaseBean implements Serializable{
this.rel = rel;
}
public static class DataBeanX implements Serializable{
public static class DataBeanX implements Serializable {
/**
* totalCount : 32
* totalPage : 4
......@@ -94,7 +104,7 @@ public class CarTypeListBean extends BaseBean implements Serializable{
this.data = data;
}
public static class DataBean implements Serializable{
public static class DataBean implements Serializable {
/**
* distance : 4307.442767774642
* vehicleModel : {"id":25,"name":"大通自行式C型房车(旅居版)车型24","licensePlate":"C24","factory":1,"keyword":"烧烤,6乘29卧,麻将,微波炉","point":0,"picture":"https://xxfcim.upyuns.com/image/u/2/10000002/201905/o/adb766b69c0140018a3aaaa08b37d41d.jpg"}
......@@ -129,7 +139,7 @@ public class CarTypeListBean extends BaseBean implements Serializable{
this.company = company;
}
public static class VehicleModelBean implements Serializable{
public static class VehicleModelBean implements Serializable {
/**
* id : 25
* name : 大通自行式C型房车(旅居版)车型24
......@@ -148,6 +158,48 @@ public class CarTypeListBean extends BaseBean implements Serializable{
private double point;
private String picture;
private double price;
private String rentDiscountPrice;//租车优惠价格
private int rentDiscountStatus;//租车优惠状态 0–没有优惠;1–会员折扣;2–固定值
public double getSum() {
BeanUserInfo.UserInfo info = null;
String spStringCode = UtilsManager.getInstance(OkGoUtil.application).getSPStringCode(SPConstance.USER_JSON, SPConstance.USER_JSON_USERINFO);
if (!TextUtil.isEmpty(spStringCode)) {
info = JSON.parseObject(spStringCode, BeanUserInfo.UserInfo.class);
}
double amount = price;
if (info == null) {
return price;
}
if (0 == info.getIsMember()) { //不是会员
amount = price;
} else if (1 == info.getIsMember()) { //会员
if (0 == rentDiscountStatus) {
amount = price;
} else if (1 == rentDiscountStatus) {
int discount = info.getDiscount();
amount = price * (discount / 100);
} else if (2 == rentDiscountStatus) {
if (!TextUtil.isEmpty(rentDiscountPrice)){
String[] list = rentDiscountPrice.split(",");
int memberLevel = info.getMemberLevel();//1 普通会员 2 黄金会员 3 钻石会员
if (list !=null && list.length >1){
if (1==memberLevel){
amount = Integer.valueOf(list[0]);
}else if (2==memberLevel){
amount = Integer.valueOf(list[1]);
}else if (3==memberLevel){
amount = Integer.valueOf(list[2]);
}
}
}
}
}
return amount;
}
public double getPrice() {
return price;
......@@ -212,9 +264,39 @@ public class CarTypeListBean extends BaseBean implements Serializable{
public void setPicture(String picture) {
this.picture = picture;
}
public String getIcon() {
String icon = "";
if (!TextUtil.isEmpty(picture)) {
String[] icons = picture.split(",");
if (icons != null && icons.length > 0) {
icon = icons[0];
} else {
icon = picture;
}
}
return icon;
}
public String getRentDiscountPrice() {
return rentDiscountPrice;
}
public void setRentDiscountPrice(String rentDiscountPrice) {
this.rentDiscountPrice = rentDiscountPrice;
}
public int getRentDiscountStatus() {
return rentDiscountStatus;
}
public void setRentDiscountStatus(int rentDiscountStatus) {
this.rentDiscountStatus = rentDiscountStatus;
}
}
public static class CompanyBean implements Serializable{
public static class CompanyBean implements Serializable {
/**
* id : 2
* name : 深圳宝安分公司
......
......@@ -48,6 +48,9 @@ public class OrderDataBean implements Serializable{
private int startCompanyId;
private long startTime;
// private int vehicleId;
private int damageSafe;//是否购买免赔 1--是 0--否
private int rentFreeDay;//是否使用出租免费天数 1--是 0--否
private String couponIds;//优惠券ids,逗号分割
public int getDayNum() {
return dayNum;
......@@ -163,6 +166,29 @@ public class OrderDataBean implements Serializable{
this.startTime = startTime;
}
public int getDamageSafe() {
return damageSafe;
}
public void setDamageSafe(int damageSafe) {
this.damageSafe = damageSafe;
}
public int getRentFreeDay() {
return rentFreeDay;
}
public void setRentFreeDay(int rentFreeDay) {
this.rentFreeDay = rentFreeDay;
}
public String getCouponIds() {
return couponIds;
}
public void setCouponIds(String couponIds) {
this.couponIds = couponIds;
}
@Override
public String toString() {
......@@ -181,6 +207,9 @@ public class OrderDataBean implements Serializable{
", startCityName='" + startCityName + '\'' +
", startCompanyId=" + startCompanyId +
", startTime=" + startTime +
", damageSafe=" + damageSafe +
", rentFreeDay=" + rentFreeDay +
", couponIds='" + couponIds + '\'' +
'}';
}
}
......@@ -46,9 +46,12 @@ public class OrderPriceBean extends BaseBean{
private double orderAmount;
private double goodsAmount;
private double vehicleAmount;
private int driverAmount;
private int deposit;
private int driverAmount; //司机价格
private double driverPrice; //司机单价
private int deposit; // 押金价格
private String costDetail;
private double damageSafePrice;//免赔付单价
private double damageSafeAmount;//免赔付价格
public String getCostDetail() {
return costDetail;
......@@ -97,5 +100,29 @@ public class OrderPriceBean extends BaseBean{
public void setDeposit(int deposit) {
this.deposit = deposit;
}
public double getDriverPrice() {
return driverPrice;
}
public void setDriverPrice(double driverPrice) {
this.driverPrice = driverPrice;
}
public double getDamageSafePrice() {
return damageSafePrice;
}
public void setDamageSafePrice(double damageSafePrice) {
this.damageSafePrice = damageSafePrice;
}
public double getDamageSafeAmount() {
return damageSafeAmount;
}
public void setDamageSafeAmount(double damageSafeAmount) {
this.damageSafeAmount = damageSafeAmount;
}
}
}
......@@ -343,6 +343,7 @@
android:textSize="@dimen/text_16" />
<TextView
android:id="@+id/tv_car_rental_guide"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_20"
......
<?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"
......@@ -23,7 +24,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:background="@color/colorWrite"
android:padding="@dimen/size_15">
<ImageView
......@@ -87,102 +87,42 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:background="@color/colorWrite"
android:orientation="horizontal"
android:paddingBottom="@dimen/size_15"
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_20"
android:background="@drawable/shape_rv_bg_yellow"
android:paddingBottom="@dimen/size_3"
android:paddingLeft="@dimen/size_5"
android:paddingRight="@dimen/size_5"
android:paddingTop="@dimen/size_3"
android:text="@string/rv_get"
android:textColor="@color/colorWrite"
android:textSize="@dimen/text_10" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:orientation="vertical">
<TextView
android:id="@+id/tv_get_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_5"
android:layout_marginTop="@dimen/size_20"
android:text="2019-22"
android:textColor="@color/textGray"
android:textSize="@dimen/text_12" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_get_week"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv_get_time"
android:layout_marginLeft="@dimen/size_5"
android:text=""
android:text="活动日期:"
android:textColor="@color/textGray"
android:textSize="@dimen/text_16"
android:visibility="gone" />
</RelativeLayout>
<TextView
android:id="@+id/tv_day"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_10"
android:layout_weight="1"
android:drawableBottom="@color/colorLine"
android:gravity="center"
android:text="3天"
android:textSize="@dimen/text_14" />
<TextView
android:layout_width="wrap_content"
android:id="@+id/tv_event_date"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_20"
android:background="@drawable/shape_rv_main"
android:paddingBottom="@dimen/size_3"
android:paddingLeft="@dimen/size_5"
android:paddingRight="@dimen/size_5"
android:paddingTop="@dimen/size_3"
android:text="@string/rv_out"
android:textColor="@color/colorWrite"
android:textSize="@dimen/text_10" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_out_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_5"
android:layout_marginTop="@dimen/size_20"
android:text="2019-22"
android:textColor="@color/textGray"
android:layout_weight="1"
android:text="2019-06-12 10:00~2019-06-15 18:00"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_12" />
<TextView
android:id="@+id/tv_out_week"
android:id="@+id/tv_activity_day"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv_out_time"
android:layout_marginLeft="@dimen/size_5"
android:text=""
android:textColor="@color/textGray"
android:textSize="@dimen/text_16"
android:visibility="gone" />
</RelativeLayout>
android:background="@drawable/shape_rv_bg_shallow_yellow_small_circle"
android:padding="@dimen/size_5"
android:text="3天"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_12" />
</LinearLayout>
......@@ -246,7 +186,7 @@
android:textSize="@dimen/text_16" />
</LinearLayout>
</LinearLayout>
<!--<LinearLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
......@@ -324,36 +264,50 @@
android:layout_marginTop="@dimen/size_15"
android:background="@color/colorWrite"
android:orientation="vertical"
android:paddingBottom="@dimen/size_15"
android:paddingTop="@dimen/size_15"
>
android:paddingBottom="@dimen/size_15">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_weight="1"
android:paddingBottom="@dimen/size_15"
android:paddingLeft="@dimen/size_15"
android:paddingBottom="@dimen/size_15"
android:text="@string/rv_driving_set"
android:textColor="@color/textMain"
android:textSize="@dimen/text_16" />
<include layout="@layout/common_line" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<CheckBox
android:id="@+id/rb_xin_driving"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/size_15"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:layout_marginTop="@dimen/size_15"
android:paddingLeft="@dimen/size_10"
android:layout_marginBottom="@dimen/size_15"
android:button="@drawable/selector_rv_check"
android:paddingLeft="@dimen/size_10"
android:text="@string/rv_select_driving_num_hint"
android:textSize="@dimen/text_14" />
<TextView
android:id="@+id/tv_xin_driving_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/text_14"
android:textColor="@color/colorBg"
android:text="(¥600/天)"/>
</LinearLayout>
<include layout="@layout/common_line" />
<LinearLayout
......@@ -369,8 +323,8 @@
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_8"
android:paddingLeft="@dimen/size_10"
android:button="@drawable/selector_rv_check"
android:paddingLeft="@dimen/size_10"
android:text="@string/rv_user_driving"
android:textSize="@dimen/text_14" />
......@@ -389,106 +343,11 @@
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/size_15"
android:padding="@dimen/size_3"
android:src="@drawable/rv_common_icon_thestaff" />
</LinearLayout>
</LinearLayout>
<!--<LinearLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginTop="@dimen/size_15"-->
<!--android:background="@color/colorWrite"-->
<!--android:gravity="center_vertical"-->
<!--android:orientation="horizontal"-->
<!--android:padding="@dimen/size_15">-->
<!--<TextView-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_weight="1"-->
<!--android:text="@string/rv_select_driving_num_hint"-->
<!--android:textColor="@color/textMain"-->
<!--android:textSize="@dimen/text_16" />-->
<!--&lt;!&ndash;<LinearLayout&ndash;&gt;-->
<!--&lt;!&ndash;android:layout_width="wrap_content"&ndash;&gt;-->
<!--&lt;!&ndash;android:layout_height="@dimen/size_40"&ndash;&gt;-->
<!--&lt;!&ndash;android:background="@drawable/shape_rv_border_gray"&ndash;&gt;-->
<!--&lt;!&ndash;android:orientation="horizontal">&ndash;&gt;-->
<!--&lt;!&ndash;<TextView&ndash;&gt;-->
<!--&lt;!&ndash;android:id="@+id/tv_cut_driving"&ndash;&gt;-->
<!--&lt;!&ndash;android:layout_width="@dimen/size_40"&ndash;&gt;-->
<!--&lt;!&ndash;android:layout_height="match_parent"&ndash;&gt;-->
<!--&lt;!&ndash;android:gravity="center"&ndash;&gt;-->
<!--&lt;!&ndash;android:text="-"&ndash;&gt;-->
<!--&lt;!&ndash;android:textColor="@color/textGray"&ndash;&gt;-->
<!--&lt;!&ndash;android:textSize="@dimen/text_30" />&ndash;&gt;-->
<!--&lt;!&ndash;<View&ndash;&gt;-->
<!--&lt;!&ndash;android:layout_width="@dimen/size_half"&ndash;&gt;-->
<!--&lt;!&ndash;android:layout_height="match_parent"&ndash;&gt;-->
<!--&lt;!&ndash;android:background="@color/colorLine" />&ndash;&gt;-->
<!--&lt;!&ndash;<TextView&ndash;&gt;-->
<!--&lt;!&ndash;android:id="@+id/tv_driving_num"&ndash;&gt;-->
<!--&lt;!&ndash;android:layout_width="@dimen/size_60"&ndash;&gt;-->
<!--&lt;!&ndash;android:layout_height="match_parent"&ndash;&gt;-->
<!--&lt;!&ndash;android:gravity="center"&ndash;&gt;-->
<!--&lt;!&ndash;android:text="123"&ndash;&gt;-->
<!--&lt;!&ndash;android:textColor="@color/textGray"&ndash;&gt;-->
<!--&lt;!&ndash;android:textSize="@dimen/text_16" />&ndash;&gt;-->
<!--&lt;!&ndash;<View&ndash;&gt;-->
<!--&lt;!&ndash;android:layout_width="@dimen/size_half"&ndash;&gt;-->
<!--&lt;!&ndash;android:layout_height="match_parent"&ndash;&gt;-->
<!--&lt;!&ndash;android:background="@color/colorLine" />&ndash;&gt;-->
<!--&lt;!&ndash;<TextView&ndash;&gt;-->
<!--&lt;!&ndash;android:id="@+id/tv_add_driving"&ndash;&gt;-->
<!--&lt;!&ndash;android:layout_width="@dimen/size_40"&ndash;&gt;-->
<!--&lt;!&ndash;android:layout_height="match_parent"&ndash;&gt;-->
<!--&lt;!&ndash;android:gravity="center"&ndash;&gt;-->
<!--&lt;!&ndash;android:text="+"&ndash;&gt;-->
<!--&lt;!&ndash;android:textColor="@color/textGray"&ndash;&gt;-->
<!--&lt;!&ndash;android:textSize="@dimen/text_20" />&ndash;&gt;-->
<!--&lt;!&ndash;</LinearLayout>&ndash;&gt;-->
<!--<TextView-->
<!--android:id="@+id/tv_driving_num"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="match_parent"-->
<!--android:gravity="center"-->
<!--android:text="1"-->
<!--android:textColor="@color/textGray"-->
<!--android:textSize="@dimen/text_16" />-->
<!--</LinearLayout>-->
<!--<RelativeLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginTop="@dimen/size_15"-->
<!--android:background="@color/colorWrite"-->
<!--android:padding="@dimen/size_15">-->
<!--<TextView-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_centerVertical="true"-->
<!--android:layout_weight="1"-->
<!--android:text="@string/rv_give_driving"-->
<!--android:textColor="@color/textMain"-->
<!--android:textSize="@dimen/text_16" />-->
<!--<ImageView-->
<!--android:layout_width="@dimen/size_30"-->
<!--android:layout_height="@dimen/size_30"-->
<!--android:id="@+id/iv_add_driving"-->
<!--android:layout_alignParentRight="true"-->
<!--android:layout_centerVertical="true"-->
<!--android:src="@drawable/shape_rv_main" />-->
<!--</RelativeLayout>-->
<include layout="@layout/common_line" />
<LinearLayout
......@@ -497,8 +356,8 @@
android:layout_height="wrap_content"
android:background="@color/colorWrite"
android:orientation="horizontal"
android:visibility="gone"
android:padding="@dimen/size_15">
android:padding="@dimen/size_15"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
......@@ -545,6 +404,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:layout_marginBottom="@dimen/size_15"
android:background="@color/colorWrite"
android:orientation="horizontal"
android:padding="@dimen/size_15">
......@@ -552,10 +412,10 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/rv_deposit"
android:drawableRight="@drawable/rv_common_icon_notice"
android:drawablePadding="@dimen/size_5"
android:text="@string/rv_deposit"
android:textColor="@color/textMain"
android:drawableRight="@drawable/rv_common_icon_notice"
android:textSize="@dimen/text_16" />
......@@ -565,16 +425,22 @@
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_10"
android:gravity="right"
android:text=""
android:text="¥20000元"
android:textColor="@color/colorAuxiliaryRed"
android:textSize="@dimen/text_16" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorWrite"
android:layout_marginBottom="@dimen/size_15"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:background="@color/colorWrite"
android:padding="@dimen/size_15">
......@@ -587,122 +453,137 @@
android:textColor="@color/textMain"
android:textSize="@dimen/text_16" />
<ImageView
android:layout_width="@dimen/size_16"
android:layout_height="@dimen/size_16"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@drawable/rv_common_icon_notice" />
android:drawableRight="@drawable/common_icon_rig_gray"
android:drawablePadding="@dimen/size_5"
android:text="详细说明"
android:textColor="@color/text_Gray"
android:textSize="@dimen/text_10" />
</RelativeLayout>
<include layout="@layout/common_line" />
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorWrite"
android:orientation="horizontal"
android:padding="@dimen/size_15">
<TextView
android:id="@+id/tv_lab1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/rv_include_rent_car"
android:text="已含租车服务费"
android:textColor="@color/textMain"
android:textSize="@dimen/text_14" />
<TextView
android:id="@+id/tv_give_car_info"
android:layout_width="match_parent"
android:id="@+id/tv_service_fee_show"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_2"
android:layout_toRightOf="@id/tv_lab1"
android:drawableRight="@drawable/common_icon_more_details_up"
android:drawablePadding="@dimen/size_5"
android:paddingLeft="@dimen/size_20"
android:paddingRight="@dimen/size_20"
android:text="@string/rv_detailed_info"
android:textColor="@color/textGray"
android:textSize="@dimen/text_12" />
</LinearLayout>
<TextView
android:id="@+id/tv_give_car_content"
android:layout_width="match_parent"
android:id="@+id/tv_layout_service_fee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv_give_car_info"
android:layout_marginTop="@dimen/size_8"
android:textColor="@color/textLightGrey"
android:textSize="@dimen/text_12"
android:visibility="gone" />
android:layout_marginLeft="@dimen/size_15"
android:textColor="@color/textGray"
android:textSize="@dimen/text_10"
android:visibility="gone"
android:layout_marginBottom="@dimen/size_10"
android:text="租车期间服务费" />
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/size_half"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:background="@color/colorLine"/>
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorWrite"
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15">
android:orientation="horizontal"
android:padding="@dimen/size_15">
<include layout="@layout/common_line" />
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="已含车辆清洁费"
android:textColor="@color/textMain"
android:textSize="@dimen/text_14" />
<!--<RelativeLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:background="@color/colorWrite"-->
<!--android:padding="@dimen/size_15">-->
<TextView
android:id="@+id/tv_vehicle_cleaning_fee_show"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_2"
android:drawableRight="@drawable/common_icon_more_details_up"
android:drawablePadding="@dimen/size_5"
android:paddingLeft="@dimen/size_20"
android:paddingRight="@dimen/size_20"
android:text="@string/rv_detailed_info"
android:textColor="@color/textGray"
android:textSize="@dimen/text_12" />
</LinearLayout>
<!--<TextView-->
<!--android:id="@+id/tv_lab2"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_weight="1"-->
<!--android:text="@string/rv_include_rent_car"-->
<!--android:textColor="@color/textMain"-->
<!--android:textSize="@dimen/text_14" />-->
<LinearLayout
android:visibility="gone"
android:id="@+id/ll_layout_clean_fee"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:orientation="vertical">
<!--<TextView-->
<!--android:id="@+id/tv_include_car_clear"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginTop="@dimen/size_2"-->
<!--android:layout_toRightOf="@id/tv_lab2"-->
<!--android:paddingLeft="@dimen/size_20"-->
<!--android:paddingRight="@dimen/size_20"-->
<!--android:text="@string/rv_include_car_clear"-->
<!--android:textColor="@color/textGray"-->
<!--android:textSize="@dimen/text_12" />-->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/text_10"
android:textColor="@color/colorMain"
android:text="车辆清洁费"/>
<!--<TextView-->
<!--android:id="@+id/tv_car_clear_money"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_alignParentRight="true"-->
<!--android:layout_weight="1"-->
<!--android:text="¥100"-->
<!--android:textColor="@color/textMain"-->
<!--android:textSize="@dimen/text_14" />-->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_5"
android:textColor="@color/textGray"
android:textSize="@dimen/text_10"
android:text="1. 已含100元车辆清洁费(含车辆外观、内饰等的清洁费用), 保证取车时车辆 干净整洁;" />
<!--<TextView-->
<!--android:id="@+id/tv_include_car_content"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_below="@id/tv_car_clear_money"-->
<!--android:layout_marginTop="@dimen/size_8"-->
<!--android:textColor="@color/textLightGrey"-->
<!--android:textSize="@dimen/text_12"-->
<!--android:visibility="gone" />-->
<!--</RelativeLayout>-->
<!--<RelativeLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:background="@color/colorWrite"-->
<!--android:paddingLeft="@dimen/size_15"-->
<!--android:paddingRight="@dimen/size_15">-->
<!--<include layout="@layout/common_line" />-->
<!--</RelativeLayout>-->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_5"
android:textColor="@color/textGray"
android:textSize="@dimen/text_10"
android:layout_marginBottom="@dimen/size_10"
android:text="2. 还车时,因客户原因,出现以下情形的:\n a.黑水箱未清理或移动马桶有污渍;\n b.冰箱未清理或有污渍;\n c.床垫有明显新增污渍,每项加收100元清洁服务费。" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/size_half"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:background="@color/colorLine"/>
<RelativeLayout
android:layout_width="match_parent"
......@@ -715,9 +596,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/rv_car_not_hurt"
android:paddingLeft="@dimen/size_10"
android:button="@drawable/selector_rv_check"
android:paddingLeft="@dimen/size_10"
android:text="@string/rv_car_not_hurt"
android:textColor="@color/textMain"
android:textSize="@dimen/text_14" />
......@@ -740,31 +621,113 @@
android:layout_alignParentRight="true"
android:layout_weight="1"
android:text="¥100/日"
android:textColor="@color/textMain"
android:textColor="@color/colorBg"
android:textSize="@dimen/text_14" />
</RelativeLayout>
<TextView
android:id="@+id/tv_car_not_hurt_content"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tv_car_not_hurt_money"
android:layout_marginTop="@dimen/size_8"
android:textColor="@color/textLightGrey"
android:textSize="@dimen/text_12"
android:visibility="gone" />
</RelativeLayout>
android:layout_marginLeft="@dimen/size_15"
android:layout_marginBottom="@dimen/size_10"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_10"
android:text="不计免赔服务 "/>
<RelativeLayout
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/text_10"
android:layout_marginTop="@dimen/size_5"
android:textColor="@color/textGray"
android:text="如在租赁期间内购买购买不计免赔服务,则1500元本车车辆损伤无需赔偿。"/>
</LinearLayout>
</LinearLayout>
<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">
<TextView
android:id="@+id/tv_layout_member_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:text="会员特权"
android:visibility="gone"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16" />
<LinearLayout
android:id="@+id/ll_layout_member_hint"
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:visibility="gone"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="免费用车"
android:textColor="@color/textGray"
android:textSize="@dimen/text_12" />
<TextView
android:id="@+id/tv_free_car_days"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="(剩余1天)"
android:textColor="@color/textGray"
android:textSize="@dimen/text_12" />
<com.rv.component.control.SwitchButton
android:id="@+id/swbtn_member"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:sb_button_color="@color/colorWrite"
app:sb_checked_color="@color/gray_FFB74B"
app:sb_show_indicator="false"
app:sb_uncheckcircle_color="@color/textLightGrey" />
</LinearLayout>
<include layout="@layout/common_line" />
<RelativeLayout
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:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:text="暂无优惠券"
android:textColor="@color/gray_FFB74B"
android:textSize="@dimen/text_14" />
</RelativeLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
......@@ -782,12 +745,16 @@
android:textColor="@color/textMain"
android:textSize="@dimen/text_16" />
<ImageView
android:layout_width="@dimen/size_16"
android:layout_height="@dimen/size_16"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@drawable/rv_common_icon_notice" />
android:drawableRight="@drawable/common_icon_rig_gray"
android:drawablePadding="@dimen/size_5"
android:text="详细说明"
android:textColor="@color/text_Gray"
android:textSize="@dimen/text_10" />
</RelativeLayout>
<LinearLayout
......@@ -800,9 +767,9 @@
android:id="@+id/tv_passenger_know"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@drawable/selector_rv_check"
android:checked="true"
android:paddingLeft="@dimen/size_10"
android:button="@drawable/selector_rv_check"
android:text="@string/rv_passenger_security"
android:textColor="@color/textLightGrey"
android:textSize="@dimen/text_14" />
......@@ -821,8 +788,8 @@
<include layout="@layout/common_line" />
<LinearLayout
android:layout_width="match_parent"
android:id="@+id/ll_bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorWrite"
android:orientation="horizontal">
......@@ -830,9 +797,9 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/size_15"
android:paddingLeft="@dimen/size_15"
android:paddingTop="@dimen/size_15"
android:paddingBottom="@dimen/size_15"
android:text="@string/rv_pay_money_content"
android:textColor="@color/textMain"
android:textSize="@dimen/text_16" />
......@@ -858,8 +825,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/size_10"
android:drawablePadding="@dimen/size_2"
android:drawableRight="@drawable/rv_common_icon_down_arrow"
android:drawablePadding="@dimen/size_2"
android:text="@string/rv_detail"
android:textColor="@color/textMain" />
......
......@@ -77,7 +77,7 @@
<string name="rv_cancel">取消</string>
<string name="rv_shop_map">门店地图</string>
<string name="rv_select_car_num_hint">选择车辆数量</string>
<string name="rv_select_driving_num_hint">欣新专职司机(¥600/天)</string>
<string name="rv_select_driving_num_hint">欣新专职司机</string>
<string name="rv_user_driving">自驾</string>
<string name="rv_user_driving_hint">(需提供驾驶人信息)</string>
<string name="rv_driving_set">驾驶人设置</string>
......
......@@ -19,6 +19,12 @@ import com.alibaba.android.arouter.launcher.ARouter;
import com.baidu.location.BDAbstractLocationListener;
import com.baidu.location.BDLocation;
import com.baidu.mapapi.model.LatLng;
import com.baidu.mapapi.search.core.SearchResult;
import com.baidu.mapapi.search.geocode.GeoCodeOption;
import com.baidu.mapapi.search.geocode.GeoCodeResult;
import com.baidu.mapapi.search.geocode.GeoCoder;
import com.baidu.mapapi.search.geocode.OnGetGeoCoderResultListener;
import com.baidu.mapapi.search.geocode.ReverseGeoCodeResult;
import com.base.utils.tools.android.IntentUtil;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.frame.base.browse.ActivityImageBrowseUrl;
......@@ -89,6 +95,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements B
private double lonLongitude;
private LatLng mLatLng;//当前城市经纬度
private LocationManager locationManager;
private GeoCoder geoCoder;
public static TourismFragment getInstance(int type) {
......@@ -184,8 +191,8 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements B
//搜索
ARouter.getInstance()
.build(Constance.ACTIVITY_URL_TRAVELSEARCH)
.withDouble("latLatitude",latLatitude)
.withDouble("lonLongitude",lonLongitude)
.withDouble("latLatitude", latLatitude)
.withDouble("lonLongitude", lonLongitude)
.navigation();
} else if (id == R.id.travel_server_image) {
showToast("亲,该功能还在开发中。。。");
......@@ -212,7 +219,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements B
map.put("query", "");
map.put("page", page);
map.put("limit", "10");
map.put("latitudel", latLatitude);
map.put("latitude", latLatitude);
map.put("longitude", lonLongitude);
mPresenter.getData(2, TourismApi.QUERY_RIM_LIST, BeanTourAround.class, map, false);
}
......@@ -339,9 +346,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements B
@Override
public void onDestroy() {
super.onDestroy();
// if (ModuleEventUtil.getOnModuleEventListener() != null) {
// ModuleEventUtil.getOnModuleEventListener().onClear();
// }
geoCoder.destroy();
}
......@@ -377,9 +382,10 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements B
private void setRequestData(int type, String data, double lat, double lon) {
switch (type) {
case 1:
latLatitude = lat;
lonLongitude = lon;
travelCityText.setText(data);
geoCoder.geocode(new GeoCodeOption()
.city(data)
.address(data));
break;
}
}
......@@ -421,6 +427,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements B
public void accept(Boolean aBoolean) throws Exception {
if (aBoolean == true) {
initGps();
initCity();
} else {
getActivity().finish();
}
......@@ -428,9 +435,41 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements B
});
} else {
initGps();
initCity();
}
}
private void initCity() {
geoCoder = GeoCoder.newInstance();
geoCoder.setOnGetGeoCodeResultListener(new OnGetGeoCoderResultListener() {
@Override
public void onGetGeoCodeResult(GeoCodeResult result) {
if (result == null || result.error != SearchResult.ERRORNO.NO_ERROR) {
//没有检索到结果
} else {
latLatitude = result.getLocation().latitude;
lonLongitude = result.getLocation().longitude;
mTourAroundAdapter.getData().clear();
mTourAroundAdapter.notifyDataSetChanged();
loadTourAroundData();
}
//获取地理编码结果
}
@Override
public void onGetReverseGeoCodeResult(ReverseGeoCodeResult result) {
if (result == null || result.error != SearchResult.ERRORNO.NO_ERROR) {
//没有找到检索结果
} else {
latLatitude = result.getLocation().latitude;
lonLongitude = result.getLocation().longitude;
}
}
});
}
/**
* 初始化定位
*/
......
......@@ -119,9 +119,12 @@ public class TravelDetailsActivity extends BaseStatusActivity<TourismPresenter>
//收藏
if ("1".equals(isCollection)) {
cancelCollect();
ivCollect.setImageResource(R.drawable.travel_rv_collect);
} else {
addCollect();
ivCollect.setImageResource(R.drawable.common_icon_collected);
}
ivCollect.setEnabled(false);
} else if (id == R.id.iv_share) {
//分享
......@@ -188,12 +191,12 @@ public class TravelDetailsActivity extends BaseStatusActivity<TourismPresenter>
case 1:
showToast("收藏成功");
isCollection = "1";
ivCollect.setImageResource(R.drawable.common_icon_collected);
ivCollect.setEnabled(true);
break;
case 2:
showToast("取消收藏成功");
isCollection = "0";
ivCollect.setImageResource(R.drawable.travel_rv_collect);
ivCollect.setEnabled(true);
break;
}
......@@ -354,7 +357,7 @@ public class TravelDetailsActivity extends BaseStatusActivity<TourismPresenter>
@Override
public void run() {
TvAppointment.setEnabled(false);
TvAppointment.setText("库存不足");
TvAppointment.setText("已售完");
TvAppointment.setBackground(mActivity.getResources().getDrawable(R.color.gray_707070));
}
});
......
......@@ -39,5 +39,6 @@ dependencies {
annotationProcessor 'com.alibaba:arouter-compiler:1.1.4'
api project(':RvWrapper')
api project(':component_resource')
api project(':component_utils')
}
......@@ -15,6 +15,7 @@ import com.frame.base.url.Constance;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseStatusActivity;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.utils.KeyboardUtil;
import com.rv.plugin.search.R;
import com.rv.plugin.search.R2;
import com.rv.search.adapter.TravelSearchAdapter;
......@@ -79,8 +80,6 @@ public class TravelSearchActivity extends BaseStatusActivity<SearchPresenter> {
}
}
});
}
@OnClick({R2.id.iv_back, R2.id.tv_search})
......@@ -104,6 +103,7 @@ public class TravelSearchActivity extends BaseStatusActivity<SearchPresenter> {
}
private void setData(BeanTravelSearch data) {
KeyboardUtil.hideKeyboard(mActivity);
if (mPage == 1) {
mTravelSearchAdapter.getData().clear();
mTravelSearchAdapter.notifyDataSetChanged();
......
......@@ -26,11 +26,14 @@
android:layout_width="0dp"
android:layout_height="@dimen/size_40"
android:layout_weight="1"
android:maxLines="1"
android:singleLine="true"
android:background="@drawable/shape_rv_travel_search_line"
android:drawableLeft="@drawable/search"
android:drawablePadding="@dimen/size_15"
android:hint="搜索目的地/旅游线"
android:paddingLeft="@dimen/size_15"
android:textColor="@color/textMain"
android:textSize="@dimen/text_14" />
......
//include ':WXPay'
include ':RvFrame', ':plugin_search', ':component_utils', ':memer', ':plugin_member', ':plugin_version'
include ':RvFrame', ':plugin_search', ':component_utils', ':plugin_member', ':plugin_version', ':component_control'
include ':RvTravel'
include ':RvClient'
include ':RvWrapper'
......
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