Commit c809a4b8 authored by jianglx's avatar jianglx

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

parents e366a60b 5ae70cbe
...@@ -24,6 +24,7 @@ public final class Constance { ...@@ -24,6 +24,7 @@ public final class Constance {
public static final String ACTIVITY_URL_WEBVIEW ="/module/basic/WebActivity"; public static final String ACTIVITY_URL_WEBVIEW ="/module/basic/WebActivity";
public static final String ACTIVITY_URL_CARDETAILMAP ="/main/home/CarDetailMapActivity"; public static final String ACTIVITY_URL_CARDETAILMAP ="/main/home/CarDetailMapActivity";
public static final String ACTIVITY_URL_CALENDAR ="/plugin/calendar/CalendarActivity";
} }
...@@ -23,6 +23,7 @@ public class StarBar extends View { ...@@ -23,6 +23,7 @@ public class StarBar extends View {
private OnStarChangeListener onStarChangeListener;//监听星星变化接口 private OnStarChangeListener onStarChangeListener;//监听星星变化接口
private Paint paint; //绘制星星画笔 private Paint paint; //绘制星星画笔
private boolean integerMark = false; private boolean integerMark = false;
private boolean isOnclick = false;
public StarBar(Context context, AttributeSet attrs) { public StarBar(Context context, AttributeSet attrs) {
super(context, attrs); super(context, attrs);
init(context, attrs); init(context, attrs);
...@@ -47,6 +48,7 @@ public class StarBar extends View { ...@@ -47,6 +48,7 @@ public class StarBar extends View {
this.starCount = mTypedArray.getInteger(R.styleable.RatingBar_starCount, 5); this.starCount = mTypedArray.getInteger(R.styleable.RatingBar_starCount, 5);
this.starEmptyDrawable = mTypedArray.getDrawable(R.styleable.RatingBar_starEmpty); this.starEmptyDrawable = mTypedArray.getDrawable(R.styleable.RatingBar_starEmpty);
this.starFillBitmap = drawableToBitmap(mTypedArray.getDrawable(R.styleable.RatingBar_starFill)); this.starFillBitmap = drawableToBitmap(mTypedArray.getDrawable(R.styleable.RatingBar_starFill));
this.isOnclick = mTypedArray.getBoolean(R.styleable.RatingBar_isClick,false);
mTypedArray.recycle(); mTypedArray.recycle();
paint = new Paint(); paint = new Paint();
...@@ -146,6 +148,9 @@ public class StarBar extends View { ...@@ -146,6 +148,9 @@ public class StarBar extends View {
int x = (int) event.getX(); int x = (int) event.getX();
if (x < 0) x = 0; if (x < 0) x = 0;
if (x > getMeasuredWidth()) x = getMeasuredWidth(); if (x > getMeasuredWidth()) x = getMeasuredWidth();
if (isOnclick){
return false;
}
switch(event.getAction()){ switch(event.getAction()){
case MotionEvent.ACTION_DOWN: { case MotionEvent.ACTION_DOWN: {
setStarMark(x*1.0f / (getMeasuredWidth()*1.0f/starCount)); setStarMark(x*1.0f / (getMeasuredWidth()*1.0f/starCount));
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
<attr format="reference" name="starEmpty"/> <attr format="reference" name="starEmpty"/>
<!--星星满图--> <!--星星满图-->
<attr format="reference" name="starFill"/> <attr format="reference" name="starFill"/>
<!--星星是否点击-->
<attr format="boolean" name="isClick"/>
</declare-styleable> </declare-styleable>
</resources> </resources>
\ No newline at end of file
...@@ -7,8 +7,8 @@ android { ...@@ -7,8 +7,8 @@ android {
applicationId "com.xxfc.rv" applicationId "com.xxfc.rv"
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 101 versionCode 104
versionName "1.0.1" versionName "1.0.4"
multiDexEnabled true multiDexEnabled true
//新版Gradle 是 implementation 为了兼容compile,写上这句话 //新版Gradle 是 implementation 为了兼容compile,写上这句话
......
...@@ -255,29 +255,29 @@ public class TravelFragmentCommitOrder extends BaseFragment { ...@@ -255,29 +255,29 @@ public class TravelFragmentCommitOrder extends BaseFragment {
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
private void initRxBus() { private void initRxBus() {
RxBus.tObservable(PaymentSuccessfulEvent.class) // RxBus.tObservable(PaymentSuccessfulEvent.class)
.observeOn(Schedulers.newThread()) // .observeOn(Schedulers.newThread())
.subscribe(new Consumer<PaymentSuccessfulEvent>() { // .subscribe(new Consumer<PaymentSuccessfulEvent>() {
@Override // @Override
public void accept(PaymentSuccessfulEvent payEvent) throws Exception { // public void accept(PaymentSuccessfulEvent payEvent) throws Exception {
getActivity().finish();
}
});
RxBus.tObservable(PaymentFailedEvent.class)
.observeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<PaymentFailedEvent>() {
@Override
public void accept(PaymentFailedEvent payEvent) throws Exception {
// showToast("333333");
// if (baseContext.getClass().equals(TravelFragmentCommitOrder.class)) {
// startActivity(OrderListActivity.getIntent(getActivity(), 0));
ARouter.getInstance().build(Constance.ACTIVITY_URL_ORDERLIST).navigation();
// getActivity().finish(); // getActivity().finish();
// } // }
} // });
}); //
// RxBus.tObservable(PaymentFailedEvent.class)
// .observeOn(Schedulers.newThread())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(new Consumer<PaymentFailedEvent>() {
// @Override
// public void accept(PaymentFailedEvent payEvent) throws Exception {
//// showToast("333333");
//// if (baseContext.getClass().equals(TravelFragmentCommitOrder.class)) {
//// startActivity(OrderListActivity.getIntent(getActivity(), 0));
// ARouter.getInstance().build(Constance.ACTIVITY_URL_ORDERLIST).navigation();
//// getActivity().finish();
//// }
// }
// });
} }
......
...@@ -19,6 +19,7 @@ import com.ruiwenliu.wrapper.weight.TitleView; ...@@ -19,6 +19,7 @@ import com.ruiwenliu.wrapper.weight.TitleView;
import com.ruiwenliu.wrapper.weight.ToastView; import com.ruiwenliu.wrapper.weight.ToastView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import io.reactivex.disposables.CompositeDisposable;
import me.yokeyword.fragmentation.SupportActivity; import me.yokeyword.fragmentation.SupportActivity;
/** /**
...@@ -36,11 +37,15 @@ public abstract class BaseWrapperActivity extends SupportActivity { ...@@ -36,11 +37,15 @@ public abstract class BaseWrapperActivity extends SupportActivity {
protected FrameLayout frameLayout; protected FrameLayout frameLayout;
private LinearLayout rootView; private LinearLayout rootView;
protected AppCompatActivity mActivity; protected AppCompatActivity mActivity;
protected CompositeDisposable disposable;
@Override @Override
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
ARouter.getInstance().inject(this); ARouter.getInstance().inject(this);
if (disposable == null || disposable.isDisposed()) {
disposable = new CompositeDisposable();
}
//获取类名 //获取类名
// RuiwenAppliction.getInstance().activityName=this.getClass().getSimpleName(); // RuiwenAppliction.getInstance().activityName=this.getClass().getSimpleName();
handleBeforeSetLayout();//设置布局之前的操作 handleBeforeSetLayout();//设置布局之前的操作
...@@ -49,6 +54,7 @@ public abstract class BaseWrapperActivity extends SupportActivity { ...@@ -49,6 +54,7 @@ public abstract class BaseWrapperActivity extends SupportActivity {
intiBaseData(); intiBaseData();
ButterKnife.bind(this); ButterKnife.bind(this);
initView(savedInstanceState, titleView, getIntent()); initView(savedInstanceState, titleView, getIntent());
} }
...@@ -76,6 +82,10 @@ public abstract class BaseWrapperActivity extends SupportActivity { ...@@ -76,6 +82,10 @@ public abstract class BaseWrapperActivity extends SupportActivity {
frameLayout.removeAllViews(); frameLayout.removeAllViews();
frameLayout = null; frameLayout = null;
} }
if (disposable != null) {
disposable.clear();
}
} }
......
...@@ -21,6 +21,7 @@ import java.lang.reflect.ParameterizedType; ...@@ -21,6 +21,7 @@ import java.lang.reflect.ParameterizedType;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.Unbinder; import butterknife.Unbinder;
import io.reactivex.disposables.CompositeDisposable;
import me.yokeyword.fragmentation.SupportFragment; import me.yokeyword.fragmentation.SupportFragment;
/** /**
...@@ -35,6 +36,7 @@ public abstract class BaseWrapperFragment<P extends MvpPresenter> extends Suppor ...@@ -35,6 +36,7 @@ public abstract class BaseWrapperFragment<P extends MvpPresenter> extends Suppor
private LoadingDialog mLoadingDialog; private LoadingDialog mLoadingDialog;
private View contentView; private View contentView;
private Unbinder unbinder; private Unbinder unbinder;
protected CompositeDisposable disposable;
@Override @Override
public void onCreate(@Nullable Bundle savedInstanceState) { public void onCreate(@Nullable Bundle savedInstanceState) {
...@@ -48,9 +50,14 @@ public abstract class BaseWrapperFragment<P extends MvpPresenter> extends Suppor ...@@ -48,9 +50,14 @@ public abstract class BaseWrapperFragment<P extends MvpPresenter> extends Suppor
} catch (java.lang.InstantiationException e) { } catch (java.lang.InstantiationException e) {
e.printStackTrace(); e.printStackTrace();
} }
if (disposable == null || disposable.isDisposed()) {
disposable = new CompositeDisposable();
}
mPresenter.attachView(this); mPresenter.attachView(this);
mLoadingDialog = createLoadingDialog(); mLoadingDialog = createLoadingDialog();
ARouter.getInstance().inject(this); ARouter.getInstance().inject(this);
} }
...@@ -89,6 +96,9 @@ public abstract class BaseWrapperFragment<P extends MvpPresenter> extends Suppor ...@@ -89,6 +96,9 @@ public abstract class BaseWrapperFragment<P extends MvpPresenter> extends Suppor
mLoadingDialog = null; mLoadingDialog = null;
mPresenter.detachView(); mPresenter.detachView();
mPresenter = null; mPresenter = null;
if (disposable != null) {
disposable.clear();
}
} }
......
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
<color name="gray_50000000">#50000000</color> <color name="gray_50000000">#50000000</color>
<color name="gray_EEEEEE">#EEEEEE</color> <color name="gray_EEEEEE">#EEEEEE</color>
<color name="gray_ba242525">#ba242525</color> <color name="gray_ba242525">#ba242525</color>
<color name="gray_f8f3c9">#F8F3C9</color>
<color name="gray_30000000">#30000000</color>
<!--end--> <!--end-->
......
...@@ -624,6 +624,24 @@ public class DateUtils { ...@@ -624,6 +624,24 @@ public class DateUtils {
return day; return day;
} }
/**
* 将yyyy-MM-dd HH:mm格式成MM-dd
*
* @param dateStr yyyy-MM-dd HH:mm
* @return MM-dd hh:mm
*/
public static String formatDate66(String dateStr) {
String day = "";
try {
Date date = sdf7.parse(dateStr);
day = sdf6.format(date);
} catch (Exception e) {
e.printStackTrace();
}
return day;
}
/** /**
* 将yyMMddHHmmss格式成yyyy-MM-dd HH:mm:ss * 将yyMMddHHmmss格式成yyyy-MM-dd HH:mm:ss
* *
......
...@@ -91,9 +91,9 @@ public class LoginRvActivity extends BaseLoginActivity<CommonPresenter> { ...@@ -91,9 +91,9 @@ public class LoginRvActivity extends BaseLoginActivity<CommonPresenter> {
private void initRxbus() { private void initRxbus() {
RxBus.tObservable(LoginSuccessfulEvent.class) RxBus.tObservable(LoginSuccessfulEvent.class)
.observeOn(Schedulers.newThread()) .observeOn(Schedulers.newThread())
.subscribe(new Consumer<LoginSuccessfulEvent>() { .subscribe(new com.frame.base.bus.Observer<LoginSuccessfulEvent>(disposable) {
@Override @Override
public void accept(LoginSuccessfulEvent event) throws Exception { public void onNext(LoginSuccessfulEvent event) {
finish(); finish();
} }
}); });
......
...@@ -306,7 +306,7 @@ public class CarRentalActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -306,7 +306,7 @@ public class CarRentalActivity extends BaseStatusActivity<CommonPresenter> {
// if (getSwitchType == 0) { // if (getSwitchType == 0) {
// startActivityForResult(SelectShopActivity.getIntent(mActivity, 1,"",getCity.equals(nowCity) && mLatLng!=null?mLatLng.latitude:0,getCity.equals(nowCity)&& mLatLng!=null?mLatLng.longitude:0), TYPE_REQUEST_SHOP); // startActivityForResult(SelectShopActivity.getIntent(mActivity, 1,"",getCity.equals(nowCity) && mLatLng!=null?mLatLng.latitude:0,getCity.equals(nowCity)&& mLatLng!=null?mLatLng.longitude:0), TYPE_REQUEST_SHOP);
// } else { // } else {
startActivityForResult(SelectLocationActivity.getIntent(mActivity, 1, getCity, latLatitude, lonLongitude, nowCity), TYPE_REQUEST_ADDRESS); startActivityForResult(SelectLocationActivity.getIntent(mActivity, 1, getCity, latLatitude, lonLongitude, nowCity,0), TYPE_REQUEST_ADDRESS);
// } // }
}else if(v.getId()==R.id.tv_out_address){ }else if(v.getId()==R.id.tv_out_address){
...@@ -314,7 +314,7 @@ public class CarRentalActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -314,7 +314,7 @@ public class CarRentalActivity extends BaseStatusActivity<CommonPresenter> {
// if (outSwitchType == 0) { // if (outSwitchType == 0) {
// startActivityForResult(SelectShopActivity.getIntent(mActivity, 2,"",outCity.equals(nowCity)&& mLatLng!=null?mLatLng.latitude:0,outCity.equals(nowCity)&& mLatLng!=null?mLatLng.longitude:0), TYPE_REQUEST_SHOP); // startActivityForResult(SelectShopActivity.getIntent(mActivity, 2,"",outCity.equals(nowCity)&& mLatLng!=null?mLatLng.latitude:0,outCity.equals(nowCity)&& mLatLng!=null?mLatLng.longitude:0), TYPE_REQUEST_SHOP);
// } else { // } else {
startActivityForResult(SelectLocationActivity.getIntent(mActivity, 2, outCity, outLatitude, outLongitude, nowCity), TYPE_REQUEST_ADDRESS); startActivityForResult(SelectLocationActivity.getIntent(mActivity, 2, outCity, outLatitude, outLongitude, nowCity,0), TYPE_REQUEST_ADDRESS);
// } // }
}else if(v.getId()==R.id.tv_get_time){ }else if(v.getId()==R.id.tv_get_time){
if (mapGetTime == null) { if (mapGetTime == null) {
...@@ -626,7 +626,7 @@ public class CarRentalActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -626,7 +626,7 @@ public class CarRentalActivity extends BaseStatusActivity<CommonPresenter> {
dataBean.setEndCityName(endCity); dataBean.setEndCityName(endCity);
dataBean.setEndAddr(endAddress); dataBean.setEndAddr(endAddress);
dataBean.setDriverType(checkBox == true ? 1 : 2); dataBean.setDriverType(checkBox == true ? 1 : 2);
startActivity(CarRentalListActivity.getIntent(mActivity, latLatitude, lonLongitude, checkBox, dataBean, startTime, endTime)); // startActivity(CarRentalListActivity.getIntent(mActivity, latLatitude, lonLongitude, checkBox, dataBean, startTime, endTime));
} }
......
...@@ -22,10 +22,13 @@ import android.widget.Toast; ...@@ -22,10 +22,13 @@ import android.widget.Toast;
import com.alibaba.android.arouter.launcher.ARouter; import com.alibaba.android.arouter.launcher.ARouter;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.base.utils.ui.datetime.selector.util.TextUtil; import com.base.utils.ui.datetime.selector.util.TextUtil;
import com.frame.base.bus.LoginSuccessfulEvent;
import com.frame.base.bus.Observer;
import com.frame.base.bus.PaymentFailedEvent; import com.frame.base.bus.PaymentFailedEvent;
import com.frame.base.bus.PaymentSuccessfulEvent; import com.frame.base.bus.PaymentSuccessfulEvent;
import com.frame.base.bus.RxBus; import com.frame.base.bus.RxBus;
import com.frame.base.url.Constance; import com.frame.base.url.Constance;
import com.frame.base.view.StarBar;
import com.frame.rv.config.RvFrameConfig; import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.SPConstance; import com.ruiwenliu.wrapper.SPConstance;
import com.ruiwenliu.wrapper.base.BaseBean; import com.ruiwenliu.wrapper.base.BaseBean;
...@@ -79,7 +82,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -79,7 +82,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
@BindView(R2.id.tv_content) @BindView(R2.id.tv_content)
TextView tvContent; TextView tvContent;
@BindView(R2.id.rating_bar) @BindView(R2.id.rating_bar)
RatingBar ratingBar; StarBar ratingBar;
@BindView(R2.id.tv_price) @BindView(R2.id.tv_price)
TextView tvPrice; TextView tvPrice;
@BindView(R2.id.tv_get_car_address) @BindView(R2.id.tv_get_car_address)
...@@ -178,21 +181,21 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -178,21 +181,21 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
private void initRxBus() { private void initRxBus() {
RxBus.tObservable(PaymentSuccessfulEvent.class) RxBus.tObservable(PaymentSuccessfulEvent.class)
.observeOn(Schedulers.newThread()) .observeOn(Schedulers.newThread())
.subscribe(new Consumer<PaymentSuccessfulEvent>() { .subscribe(new Observer<PaymentSuccessfulEvent>(disposable) {
@Override @Override
public void accept(PaymentSuccessfulEvent payEvent) throws Exception { public void onNext(PaymentSuccessfulEvent event) {
finish(); finish();
} }
}); });
RxBus.tObservable(PaymentFailedEvent.class) RxBus.tObservable(PaymentFailedEvent.class)
.observeOn(Schedulers.newThread()) .observeOn(Schedulers.newThread())
.subscribe(new Consumer<PaymentFailedEvent>() { .subscribe(new Observer<PaymentFailedEvent>(disposable) {
@Override @Override
public void accept(PaymentFailedEvent payEvent) throws Exception { public void onNext(PaymentFailedEvent event) {
showToast("333333");
if (mActivity.getClass().equals(ConfirmOrderActivity.class)) { if (mActivity.getClass().equals(ConfirmOrderActivity.class)) {
startActivity(OrderListActivity.getIntent(mActivity, 0)); startActivity(OrderListActivity.getIntent(mActivity, 0));
finish(); finish();
...@@ -428,7 +431,6 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -428,7 +431,6 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
mPresenter.postBodyData(RvFrameConfig.VEHICLE_ORDER, 2, ApiConfig.HTTP_URL_PAY_THE_CALLBACK, OrderPayBean.class, new payBody(orderNo, payWay, type), headMap, true); mPresenter.postBodyData(RvFrameConfig.VEHICLE_ORDER, 2, ApiConfig.HTTP_URL_PAY_THE_CALLBACK, OrderPayBean.class, new payBody(orderNo, payWay, type), headMap, true);
} }
/** /**
* 初始化View * 初始化View
*/ */
...@@ -436,7 +438,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -436,7 +438,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
GlideManager.getInstance(mActivity).loadImage(mCarBean.getVehicleModel().getIcon(), ivGoods); GlideManager.getInstance(mActivity).loadImage(mCarBean.getVehicleModel().getIcon(), ivGoods);
tvName.setText(mCarBean.getVehicleModel().getName()); tvName.setText(mCarBean.getVehicleModel().getName());
tvContent.setText(mCarBean.getVehicleModel().getKeyword()); tvContent.setText(mCarBean.getVehicleModel().getKeyword());
ratingBar.setRating((float) mCarBean.getVehicleModel().getPoint()); ratingBar.setStarMark((float) mCarBean.getVehicleModel().getScore() /10);
tvPrice.setText(String.format("%1$s%2$s", mCarBean.getVehicleModel().getSum(), mActivity.getString(R.string.rv_day))); 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")); tvEventDate.setText(getIntent().getStringExtra("startTime") + "~" + getIntent().getStringExtra("endTime"));
tvActivityDay.setText(String.format("%1$s%2$s", dataBean.getDayNum(), mActivity.getString(R.string.rv_days))); tvActivityDay.setText(String.format("%1$s%2$s", dataBean.getDayNum(), mActivity.getString(R.string.rv_days)));
......
...@@ -33,6 +33,7 @@ import com.baidu.mapapi.search.geocode.GeoCodeResult; ...@@ -33,6 +33,7 @@ import com.baidu.mapapi.search.geocode.GeoCodeResult;
import com.baidu.mapapi.search.geocode.GeoCoder; import com.baidu.mapapi.search.geocode.GeoCoder;
import com.baidu.mapapi.search.geocode.OnGetGeoCoderResultListener; import com.baidu.mapapi.search.geocode.OnGetGeoCoderResultListener;
import com.baidu.mapapi.search.geocode.ReverseGeoCodeResult; import com.baidu.mapapi.search.geocode.ReverseGeoCodeResult;
import com.base.utils.ui.datetime.selector.util.DateUtil;
import com.base.utils.ui.datetime.selector.util.TextUtil; import com.base.utils.ui.datetime.selector.util.TextUtil;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.frame.base.url.Constance; import com.frame.base.url.Constance;
...@@ -256,12 +257,15 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -256,12 +257,15 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
tvGetWeek.setText("周" + MyUtils.getWeek(DateUtils.getCurDate())); tvGetWeek.setText("周" + MyUtils.getWeek(DateUtils.getCurDate()));
tvOutTime.setText(MyUtils.getFetureDate2(1)); tvOutTime.setText(MyUtils.getFetureDate2(1));
tvOutWeek.setText("周" + MyUtils.getWeek(MyUtils.getFetureDate(1))); tvOutWeek.setText("周" + MyUtils.getWeek(MyUtils.getFetureDate(1)));
begDate = DateUtils.getCurDate();
endDate = MyUtils.getFetureDate(1); begDate = DateUtils.formatDate8(DateUtils.getCurDateTime());
copyDay = DateUtils.compareDateDay(endDate, begDate) + 1; endDate = MyUtils.getFetureDate2(1);
copyDay = DateUtils.compareDateDay(MyUtils.getFetureDate(1), DateUtils.getCurDate()) + 1;
llItemHotRvtour.setSelected(true); llItemHotRvtour.setSelected(true);
tvItemRvTour.setSelected(true); tvItemRvTour.setSelected(true);
hotType = "2";
tvHotRvtourHint.setTextColor(getResources().getColor(R.color.colorWrite)); tvHotRvtourHint.setTextColor(getResources().getColor(R.color.colorWrite));
tvHotRvtour.setTextColor(getResources().getColor(R.color.colorWrite)); tvHotRvtour.setTextColor(getResources().getColor(R.color.colorWrite));
tvHotRvtour.getPaint().setFakeBoldText(true); tvHotRvtour.getPaint().setFakeBoldText(true);
...@@ -277,8 +281,6 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -277,8 +281,6 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
} }
}); });
mAdapter = new HotCarTypeAdapter(); mAdapter = new HotCarTypeAdapter();
recyclerViewContent.setLayoutManager(new GridLayoutManager(getContext(), 2)); recyclerViewContent.setLayoutManager(new GridLayoutManager(getContext(), 2));
recyclerViewContent.addItemDecoration(new AbSpacesItemDecoration(10));// 分割线。 recyclerViewContent.addItemDecoration(new AbSpacesItemDecoration(10));// 分割线。
...@@ -508,7 +510,6 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -508,7 +510,6 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
mRvTourAdapter.setNewData(hotData); mRvTourAdapter.setNewData(hotData);
mRvTourLabelAdapter.setNewData(hotData); mRvTourLabelAdapter.setNewData(hotData);
} }
...@@ -572,15 +573,21 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -572,15 +573,21 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
// if (getSwitchType == 0) { // if (getSwitchType == 0) {
// startActivityForResult(SelectShopActivity.getIntent(mActivity, 1,"",getCity.equals(nowCity) && mLatLng!=null?mLatLng.latitude:0,getCity.equals(nowCity)&& mLatLng!=null?mLatLng.longitude:0), TYPE_REQUEST_SHOP); // startActivityForResult(SelectShopActivity.getIntent(mActivity, 1,"",getCity.equals(nowCity) && mLatLng!=null?mLatLng.latitude:0,getCity.equals(nowCity)&& mLatLng!=null?mLatLng.longitude:0), TYPE_REQUEST_SHOP);
// } else { // } else {
startActivityForResult(SelectLocationActivity.getIntent(getContext(), 1, getCity, latLatitude, lonLongitude, nowCity), TYPE_REQUEST_ADDRESS); startActivityForResult(SelectLocationActivity.getIntent(getContext(), 1, getCity, latLatitude, lonLongitude, nowCity,0), TYPE_REQUEST_ADDRESS);
} else if (id == R.id.tv_out_address) { } else if (id == R.id.tv_out_address) {
String outCity = headTvOutCity.getText().toString().trim(); String outCity = headTvOutCity.getText().toString().trim();
// if (outSwitchType == 0) { // if (outSwitchType == 0) {
// startActivityForResult(SelectShopActivity.getIntent(mActivity, 2,"",outCity.equals(nowCity)&& mLatLng!=null?mLatLng.latitude:0,outCity.equals(nowCity)&& mLatLng!=null?mLatLng.longitude:0), TYPE_REQUEST_SHOP); // startActivityForResult(SelectShopActivity.getIntent(mActivity, 2,"",outCity.equals(nowCity)&& mLatLng!=null?mLatLng.latitude:0,outCity.equals(nowCity)&& mLatLng!=null?mLatLng.longitude:0), TYPE_REQUEST_SHOP);
// } else { // } else {
startActivityForResult(SelectLocationActivity.getIntent(getContext(), 2, outCity, outLatitude, outLongitude, nowCity), TYPE_REQUEST_ADDRESS); startActivityForResult(SelectLocationActivity.getIntent(getContext(), 2, outCity, outLatitude, outLongitude, nowCity,0), TYPE_REQUEST_ADDRESS);
} else if (id == R.id.ll_item_select_data) { } else if (id == R.id.ll_item_select_data) {
startActivityForResult(CalendarActivity.getIntent(_mActivity), 108); //选择日期
ARouter.getInstance()
.build(Constance.ACTIVITY_URL_CALENDAR)
.withString("begDate",begDate)
.withString("endDate",endDate)
.navigation(_mActivity,108);
} else if (id == R.id.tv_select_car) { } else if (id == R.id.tv_select_car) {
if (copyDay < 1) { if (copyDay < 1) {
showToast(getContext().getString(R.string.rv_day_toast)); showToast(getContext().getString(R.string.rv_day_toast));
...@@ -695,7 +702,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -695,7 +702,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
recommendGood("3"); recommendGood("3");
hotType = "3"; hotType = "3";
} else if (id == R.id.ll_item_hot_car_rental) { } else if (id == R.id.ll_item_hot_car_rental) {
//优质车型 //购房车
llItemHotRvtour.setSelected(false); llItemHotRvtour.setSelected(false);
llItemHotEntertainmentCamp.setSelected(false); llItemHotEntertainmentCamp.setSelected(false);
llItemHotCarRental.setSelected(true); llItemHotCarRental.setSelected(true);
...@@ -711,6 +718,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -711,6 +718,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
tvHotCarRental.getPaint().setFakeBoldText(true); tvHotCarRental.getPaint().setFakeBoldText(true);
tvSeeMorePopular.setText("更多优质车型"); tvSeeMorePopular.setText("更多优质车型");
recommendGood("4");
hotType = "1"; hotType = "1";
} else if (id == R.id.tv_see_more_popular) { } else if (id == R.id.tv_see_more_popular) {
//查看更多热门 //查看更多热门
...@@ -776,11 +784,9 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -776,11 +784,9 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
} else if (resultCode == 200 && requestCode == 108) { } else if (resultCode == 200 && requestCode == 108) {
begDate = data.getStringExtra("begDate"); begDate = data.getStringExtra("begDate");
endDate = data.getStringExtra("endDate"); endDate = data.getStringExtra("endDate");
String begTime = data.getStringExtra("begTime");
String endTime = data.getStringExtra("endTime");
copyDay = DateUtils.compareDateDay(endDate, begDate) + 1; copyDay = DateUtils.compareDateDay(endDate, begDate) + 1;
tvGetTime.setText(begDate + " " + begTime); tvGetTime.setText(begDate);
tvOutTime.setText(endDate + " " + endTime); tvOutTime.setText(endDate);
tvGetWeek.setText("周" + MyUtils.getWeek(begDate)); tvGetWeek.setText("周" + MyUtils.getWeek(begDate));
tvOutWeek.setText("周" + MyUtils.getWeek(endDate)); tvOutWeek.setText("周" + MyUtils.getWeek(endDate));
tvDay.setText(String.format("%1$s%2$s", copyDay, getContext().getString(R.string.rv_days))); tvDay.setText(String.format("%1$s%2$s", copyDay, getContext().getString(R.string.rv_days)));
...@@ -962,7 +968,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -962,7 +968,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
dataBean.setEndCityName(endCity); dataBean.setEndCityName(endCity);
dataBean.setEndAddr(endAddress); dataBean.setEndAddr(endAddress);
dataBean.setDriverType(2); dataBean.setDriverType(2);
startActivity(CarRentalListActivity.getIntent(getContext(), latLatitude, lonLongitude, false, dataBean, startTime, endTime)); startActivity(CarRentalListActivity.getIntent(getContext(), latLatitude, lonLongitude,outLatitude,outLongitude, false, dataBean, startTime, endTime));
} }
...@@ -983,7 +989,6 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser ...@@ -983,7 +989,6 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
} else { } else {
llItemTitle.setBackgroundColor(Color.argb((int) alpha, 255, 255, 255)); llItemTitle.setBackgroundColor(Color.argb((int) alpha, 255, 255, 255));
} }
} else { } else {
llItemTop.setVisibility(View.VISIBLE); llItemTop.setVisibility(View.VISIBLE);
llItemSearch.setBackground(getResources().getDrawable(R.drawable.shape_rv_textview_home_search)); llItemSearch.setBackground(getResources().getDrawable(R.drawable.shape_rv_textview_home_search));
......
...@@ -321,7 +321,7 @@ public class HomePageFragment extends BaseFragment<CommonPresenter> { ...@@ -321,7 +321,7 @@ public class HomePageFragment extends BaseFragment<CommonPresenter> {
// if (getSwitchType == 0) { // if (getSwitchType == 0) {
// startActivityForResult(SelectShopActivity.getIntent(mActivity, 1,"",getCity.equals(nowCity) && mLatLng!=null?mLatLng.latitude:0,getCity.equals(nowCity)&& mLatLng!=null?mLatLng.longitude:0), TYPE_REQUEST_SHOP); // startActivityForResult(SelectShopActivity.getIntent(mActivity, 1,"",getCity.equals(nowCity) && mLatLng!=null?mLatLng.latitude:0,getCity.equals(nowCity)&& mLatLng!=null?mLatLng.longitude:0), TYPE_REQUEST_SHOP);
// } else { // } else {
startActivityForResult(SelectLocationActivity.getIntent(getContext(), 1, getCity, latLatitude, lonLongitude, nowCity), TYPE_REQUEST_ADDRESS); startActivityForResult(SelectLocationActivity.getIntent(getContext(), 1, getCity, latLatitude, lonLongitude, nowCity,0), TYPE_REQUEST_ADDRESS);
// } // }
...@@ -330,7 +330,7 @@ public class HomePageFragment extends BaseFragment<CommonPresenter> { ...@@ -330,7 +330,7 @@ public class HomePageFragment extends BaseFragment<CommonPresenter> {
// if (outSwitchType == 0) { // if (outSwitchType == 0) {
// startActivityForResult(SelectShopActivity.getIntent(mActivity, 2,"",outCity.equals(nowCity)&& mLatLng!=null?mLatLng.latitude:0,outCity.equals(nowCity)&& mLatLng!=null?mLatLng.longitude:0), TYPE_REQUEST_SHOP); // startActivityForResult(SelectShopActivity.getIntent(mActivity, 2,"",outCity.equals(nowCity)&& mLatLng!=null?mLatLng.latitude:0,outCity.equals(nowCity)&& mLatLng!=null?mLatLng.longitude:0), TYPE_REQUEST_SHOP);
// } else { // } else {
startActivityForResult(SelectLocationActivity.getIntent(getContext(), 2, outCity, outLatitude, outLongitude, nowCity), TYPE_REQUEST_ADDRESS); startActivityForResult(SelectLocationActivity.getIntent(getContext(), 2, outCity, outLatitude, outLongitude, nowCity,0), TYPE_REQUEST_ADDRESS);
// } // }
} else if (i == R.id.tv_get_time) { } else if (i == R.id.tv_get_time) {
...@@ -587,6 +587,6 @@ public class HomePageFragment extends BaseFragment<CommonPresenter> { ...@@ -587,6 +587,6 @@ public class HomePageFragment extends BaseFragment<CommonPresenter> {
dataBean.setEndCityName(endCity); dataBean.setEndCityName(endCity);
dataBean.setEndAddr(endAddress); dataBean.setEndAddr(endAddress);
dataBean.setDriverType(checkBox == true ? 1 : 2); dataBean.setDriverType(checkBox == true ? 1 : 2);
startActivity(CarRentalListActivity.getIntent(getContext(), latLatitude, lonLongitude, checkBox, dataBean, startTime, endTime)); // startActivity(CarRentalListActivity.getIntent(getContext(), latLatitude, lonLongitude, checkBox, dataBean, startTime, endTime));
} }
} }
package com.rv.home.rv.module.ui.main.home.adapter; package com.rv.home.rv.module.ui.main.home.adapter;
import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.frame.base.view.StarBar;
import com.ruiwenliu.wrapper.util.BaseGlideHolder; import com.ruiwenliu.wrapper.util.BaseGlideHolder;
import com.rv.home.R; import com.rv.home.R;
import com.rv.home.R2; import com.rv.home.R2;
...@@ -30,13 +32,24 @@ public class CarRentalListAdapter extends BaseQuickAdapter<CarTypeListBean.DataB ...@@ -30,13 +32,24 @@ public class CarRentalListAdapter extends BaseQuickAdapter<CarTypeListBean.DataB
helper.loadImage(mContext,item.getVehicleModel().getIcon(), (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_name,item);
helper.setText(R.id.tv_price,String.format("¥%1$s%2$s",item.getVehicleModel().getPrice(),mContext.getString(R.string.rv_day))); helper.setText(R.id.tv_price,String.format("¥%1$s%2$s",item.getVehicleModel().getPrice(),mContext.getString(R.string.rv_day)));
float score = (float) item.getVehicleModel().getScore() / 10;
StarBar starBar = helper.getView(R.id.starbar1);
starBar.setStarMark(score);
helper.setText(R.id.tv_point,score +"分");
if ("0".equals(item.getHasVehicle())){
helper.setGone(R.id.iv_sold_out,true);
helper.setGone(R.id.tv_layout_gray,true);
}else if ("1".equals(item.getHasVehicle())){
helper.setGone(R.id.iv_sold_out,false);
helper.setGone(R.id.tv_layout_gray,false);
}
} }
helper.setText(R.id.tv_address,item.getCompany().getName()); helper.setText(R.id.tv_address,item.getCompany().getName());
double instance=item.getDistance()/1000; double instance=item.getDistance()/1000;
helper.setText(R.id.tv_km,String.format("%1$s%2$.3f%3$s",mContext.getString(R.string.rv_km_you),instance,mContext.getString(R.string.rv_km))); helper.setText(R.id.tv_km,String.format("%1$s%2$.3f%3$s",mContext.getString(R.string.rv_km_you),instance,mContext.getString(R.string.rv_km)));
} }
} }
...@@ -114,6 +114,7 @@ public class CarTypeListBean extends BaseBean implements Serializable { ...@@ -114,6 +114,7 @@ public class CarTypeListBean extends BaseBean implements Serializable {
private double distance; private double distance;
private VehicleModelBean vehicleModel; private VehicleModelBean vehicleModel;
private CompanyBean company; private CompanyBean company;
private String hasVehicle; //1--有车,0--没车
public double getDistance() { public double getDistance() {
return distance; return distance;
...@@ -139,6 +140,14 @@ public class CarTypeListBean extends BaseBean implements Serializable { ...@@ -139,6 +140,14 @@ public class CarTypeListBean extends BaseBean implements Serializable {
this.company = company; this.company = company;
} }
public String getHasVehicle() {
return hasVehicle;
}
public void setHasVehicle(String hasVehicle) {
this.hasVehicle = hasVehicle;
}
public static class VehicleModelBean implements Serializable { public static class VehicleModelBean implements Serializable {
/** /**
* id : 25 * id : 25
...@@ -160,6 +169,7 @@ public class CarTypeListBean extends BaseBean implements Serializable { ...@@ -160,6 +169,7 @@ public class CarTypeListBean extends BaseBean implements Serializable {
private double price; private double price;
private String rentDiscountPrice;//租车优惠价格 private String rentDiscountPrice;//租车优惠价格
private int rentDiscountStatus;//租车优惠状态 0–没有优惠;1–会员折扣;2–固定值 private int rentDiscountStatus;//租车优惠状态 0–没有优惠;1–会员折扣;2–固定值
private int score;
public double getSum() { public double getSum() {
BeanUserInfo.UserInfo info = null; BeanUserInfo.UserInfo info = null;
...@@ -293,6 +303,14 @@ public class CarTypeListBean extends BaseBean implements Serializable { ...@@ -293,6 +303,14 @@ public class CarTypeListBean extends BaseBean implements Serializable {
public void setRentDiscountStatus(int rentDiscountStatus) { public void setRentDiscountStatus(int rentDiscountStatus) {
this.rentDiscountStatus = rentDiscountStatus; this.rentDiscountStatus = rentDiscountStatus;
} }
public int getScore() {
return score;
}
public void setScore(int score) {
this.score = score;
}
} }
public static class CompanyBean implements Serializable { public static class CompanyBean implements Serializable {
......
...@@ -12,6 +12,7 @@ import com.alibaba.android.arouter.launcher.ARouter; ...@@ -12,6 +12,7 @@ import com.alibaba.android.arouter.launcher.ARouter;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.entity.MultiItemEntity; import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.frame.base.bus.CancelOrderEvent; import com.frame.base.bus.CancelOrderEvent;
import com.frame.base.bus.Observer;
import com.frame.base.bus.PaymentFailedEvent; import com.frame.base.bus.PaymentFailedEvent;
import com.frame.base.bus.PaymentSuccessfulEvent; import com.frame.base.bus.PaymentSuccessfulEvent;
import com.frame.base.bus.RxBus; import com.frame.base.bus.RxBus;
...@@ -27,6 +28,7 @@ import com.rv.home.R; ...@@ -27,6 +28,7 @@ import com.rv.home.R;
import com.rv.home.R2; import com.rv.home.R2;
import com.rv.home.rv.module.ApiConfig; import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.basic.presenter.CommonPresenter; import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.home.rv.module.ui.main.home.ConfirmOrderActivity;
import com.rv.home.rv.module.ui.main.home.bean.EffectiveTimeBean; import com.rv.home.rv.module.ui.main.home.bean.EffectiveTimeBean;
import com.rv.home.rv.module.ui.main.home.bean.OrderPayBean; import com.rv.home.rv.module.ui.main.home.bean.OrderPayBean;
import com.rv.home.rv.module.ui.main.home.order.adapter.ForPaymentAdapter; import com.rv.home.rv.module.ui.main.home.order.adapter.ForPaymentAdapter;
...@@ -125,11 +127,12 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements ...@@ -125,11 +127,12 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
private void initRxBus() { private void initRxBus() {
RxBus.tObservable(CancelOrderEvent.class) RxBus.tObservable(CancelOrderEvent.class)
.observeOn(Schedulers.newThread()) .observeOn(Schedulers.newThread())
.subscribe(new Consumer<CancelOrderEvent>() { .subscribe(new Observer<CancelOrderEvent>(disposable) {
@Override @Override
public void accept(CancelOrderEvent event) throws Exception { public void onNext(CancelOrderEvent event) {
onRefresh(); onRefresh();
} }
}); });
......
...@@ -18,6 +18,7 @@ import android.widget.TextView; ...@@ -18,6 +18,7 @@ import android.widget.TextView;
import com.alibaba.android.arouter.launcher.ARouter; import com.alibaba.android.arouter.launcher.ARouter;
import com.frame.base.bus.CancelOrderEvent; import com.frame.base.bus.CancelOrderEvent;
import com.frame.base.bus.Observer;
import com.frame.base.bus.RxBus; import com.frame.base.bus.RxBus;
import com.frame.rv.config.RvFrameConfig; import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.base.BaseBean; import com.ruiwenliu.wrapper.base.BaseBean;
...@@ -184,11 +185,12 @@ public class OrderDetailActivity extends BaseStatusActivity<PickerPresenter> { ...@@ -184,11 +185,12 @@ public class OrderDetailActivity extends BaseStatusActivity<PickerPresenter> {
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
private void initRxBus() { private void initRxBus() {
RxBus.tObservable(CancelOrderEvent.class) RxBus.tObservable(CancelOrderEvent.class)
.observeOn(Schedulers.newThread()) .observeOn(Schedulers.newThread())
.subscribe(new Consumer<CancelOrderEvent>() { .subscribe(new Observer<CancelOrderEvent>(disposable) {
@Override @Override
public void accept(CancelOrderEvent event) throws Exception { public void onNext(CancelOrderEvent event) {
finish(); finish();
} }
}); });
......
...@@ -10,6 +10,7 @@ import android.view.View; ...@@ -10,6 +10,7 @@ import android.view.View;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.entity.MultiItemEntity; import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.frame.base.bus.CancelOrderEvent; import com.frame.base.bus.CancelOrderEvent;
import com.frame.base.bus.Observer;
import com.frame.base.bus.RxBus; import com.frame.base.bus.RxBus;
import com.frame.rv.config.RvFrameConfig; import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.base.BaseBean; import com.ruiwenliu.wrapper.base.BaseBean;
...@@ -105,9 +106,9 @@ public class ToTravelFragment extends BaseFragment<CommonPresenter> implements B ...@@ -105,9 +106,9 @@ public class ToTravelFragment extends BaseFragment<CommonPresenter> implements B
private void initRxBus() { private void initRxBus() {
RxBus.tObservable(CancelOrderEvent.class) RxBus.tObservable(CancelOrderEvent.class)
.observeOn(Schedulers.newThread()) .observeOn(Schedulers.newThread())
.subscribe(new Consumer<CancelOrderEvent>() { .subscribe(new Observer<CancelOrderEvent>(disposable) {
@Override @Override
public void accept(CancelOrderEvent event) throws Exception { public void onNext(CancelOrderEvent event) {
onRefresh(); onRefresh();
} }
}); });
......
...@@ -17,6 +17,7 @@ import android.widget.LinearLayout; ...@@ -17,6 +17,7 @@ import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import com.frame.base.bus.CancelOrderEvent; import com.frame.base.bus.CancelOrderEvent;
import com.frame.base.bus.Observer;
import com.frame.base.bus.RxBus; import com.frame.base.bus.RxBus;
import com.frame.rv.config.RvFrameConfig; import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.base.BaseBean; import com.ruiwenliu.wrapper.base.BaseBean;
...@@ -184,9 +185,9 @@ public class TravelOrderDetailsActivity extends BaseStatusActivity<PickerPresent ...@@ -184,9 +185,9 @@ public class TravelOrderDetailsActivity extends BaseStatusActivity<PickerPresent
private void initRxBus() { private void initRxBus() {
RxBus.tObservable(CancelOrderEvent.class) RxBus.tObservable(CancelOrderEvent.class)
.observeOn(Schedulers.newThread()) .observeOn(Schedulers.newThread())
.subscribe(new Consumer<CancelOrderEvent>() { .subscribe(new Observer<CancelOrderEvent>(disposable) {
@Override @Override
public void accept(CancelOrderEvent event) throws Exception { public void onNext(CancelOrderEvent event) {
finish(); finish();
} }
}); });
......
...@@ -45,7 +45,7 @@ public class CompletedAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity, ...@@ -45,7 +45,7 @@ public class CompletedAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity,
helper.setText(R.id.tv_city, dataBean.getOrderRentVehicleDetail().getStart_city_name()); helper.setText(R.id.tv_city, dataBean.getOrderRentVehicleDetail().getStart_city_name());
} }
helper.setText(R.id.tv_order_state, mContext.getString(R.string.rv_order_completed)); helper.setText(R.id.tv_order_state, mContext.getString(R.string.rv_order_completed));
helper.loadRoundImage(mContext, dataBean.getPicture(), (ImageView) helper.getView(R.id.iv_goods), 10); helper.loadRoundImage(mContext, dataBean.getIcon(), (ImageView) helper.getView(R.id.iv_goods), 10);
helper.setText(R.id.tv_car_type, dataBean.getName()); helper.setText(R.id.tv_car_type, dataBean.getName());
if (dataBean.getOrderRentVehicleDetail() !=null) { if (dataBean.getOrderRentVehicleDetail() !=null) {
helper.setText(R.id.tv_get_time, TimeManager.stampToDate(String.valueOf(dataBean.getOrderRentVehicleDetail().getStart_time()))); helper.setText(R.id.tv_get_time, TimeManager.stampToDate(String.valueOf(dataBean.getOrderRentVehicleDetail().getStart_time())));
......
...@@ -54,6 +54,8 @@ public class ForPaymentAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity ...@@ -54,6 +54,8 @@ public class ForPaymentAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity
helper.setText(R.id.tv_city, dataBean.getOrderRentVehicleDetail().getStart_city_name()); helper.setText(R.id.tv_city, dataBean.getOrderRentVehicleDetail().getStart_city_name());
} }
helper.loadRoundImage(mContext, dataBean.getPicture(), (ImageView) helper.getView(R.id.iv_goods), 10); helper.loadRoundImage(mContext, dataBean.getPicture(), (ImageView) helper.getView(R.id.iv_goods), 10);
helper.setText(R.id.tv_order_state, mContext.getString(R.string.rv_order_for_payment));
helper.loadRoundImage(mContext, dataBean.getIcon(), (ImageView) helper.getView(R.id.iv_goods), 10);
helper.setText(R.id.tv_car_type, dataBean.getName()); helper.setText(R.id.tv_car_type, dataBean.getName());
if (dataBean.getOrderRentVehicleDetail() != null) { if (dataBean.getOrderRentVehicleDetail() != null) {
helper.setText(R.id.tv_get_time, TimeManager.stampToDate(String.valueOf(dataBean.getOrderRentVehicleDetail().getStart_time()))); helper.setText(R.id.tv_get_time, TimeManager.stampToDate(String.valueOf(dataBean.getOrderRentVehicleDetail().getStart_time())));
......
...@@ -45,7 +45,7 @@ public class HaveToTravelAdapter extends BaseMultiItemQuickAdapter<MultiItemEnti ...@@ -45,7 +45,7 @@ public class HaveToTravelAdapter extends BaseMultiItemQuickAdapter<MultiItemEnti
helper.setText(R.id.tv_city, dataBean.getOrderRentVehicleDetail().getStart_city_name()); helper.setText(R.id.tv_city, dataBean.getOrderRentVehicleDetail().getStart_city_name());
} }
helper.setText(R.id.tv_order_state,mContext.getString(R.string.rv_order_have_travel)); helper.setText(R.id.tv_order_state,mContext.getString(R.string.rv_order_have_travel));
helper.loadRoundImage(mContext,dataBean.getPicture(), (ImageView) helper.getView(R.id.iv_goods),10); helper.loadRoundImage(mContext,dataBean.getIcon(), (ImageView) helper.getView(R.id.iv_goods),10);
helper.setText(R.id.tv_car_type,dataBean.getName()); helper.setText(R.id.tv_car_type,dataBean.getName());
if (dataBean.getOrderRentVehicleDetail() !=null) { if (dataBean.getOrderRentVehicleDetail() !=null) {
helper.setText(R.id.tv_get_time, TimeManager.stampToDate(String.valueOf(dataBean.getOrderRentVehicleDetail().getStart_time()))); helper.setText(R.id.tv_get_time, TimeManager.stampToDate(String.valueOf(dataBean.getOrderRentVehicleDetail().getStart_time())));
......
...@@ -45,7 +45,7 @@ public class OrderListAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity, ...@@ -45,7 +45,7 @@ public class OrderListAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity,
if (dataBean.getOrderRentVehicleDetail() != null && dataBean.getOrderRentVehicleDetail().getStart_city_name() != null) { if (dataBean.getOrderRentVehicleDetail() != null && dataBean.getOrderRentVehicleDetail().getStart_city_name() != null) {
helper.setText(R.id.tv_city, dataBean.getOrderRentVehicleDetail().getStart_city_name()); helper.setText(R.id.tv_city, dataBean.getOrderRentVehicleDetail().getStart_city_name());
} }
helper.loadRoundImage(mContext, dataBean.getPicture(), (ImageView) helper.getView(R.id.iv_goods), 10); helper.loadRoundImage(mContext, dataBean.getIcon(), (ImageView) helper.getView(R.id.iv_goods), 10);
helper.setText(R.id.tv_car_type, dataBean.getName()); helper.setText(R.id.tv_car_type, dataBean.getName());
if (dataBean.getOrderRentVehicleDetail() != null) { if (dataBean.getOrderRentVehicleDetail() != null) {
helper.setText(R.id.tv_get_time, TimeManager.stampToDate(String.valueOf(dataBean.getOrderRentVehicleDetail().getStart_time()))); helper.setText(R.id.tv_get_time, TimeManager.stampToDate(String.valueOf(dataBean.getOrderRentVehicleDetail().getStart_time())));
......
...@@ -45,7 +45,7 @@ public class ToTravelAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity, ...@@ -45,7 +45,7 @@ public class ToTravelAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity,
helper.setText(R.id.tv_city, dataBean.getOrderRentVehicleDetail().getStart_city_name()); helper.setText(R.id.tv_city, dataBean.getOrderRentVehicleDetail().getStart_city_name());
} }
helper.setText(R.id.tv_order_state, mContext.getString(R.string.rv_order_to_travel)); helper.setText(R.id.tv_order_state, mContext.getString(R.string.rv_order_to_travel));
helper.loadRoundImage(mContext, dataBean.getPicture(), (ImageView) helper.getView(R.id.iv_goods), 10); helper.loadRoundImage(mContext, dataBean.getIcon(), (ImageView) helper.getView(R.id.iv_goods), 10);
helper.setText(R.id.tv_car_type, dataBean.getName()); helper.setText(R.id.tv_car_type, dataBean.getName());
if (dataBean.getOrderRentVehicleDetail() != null) { if (dataBean.getOrderRentVehicleDetail() != null) {
helper.setText(R.id.tv_get_time, TimeManager.stampToDate(String.valueOf(dataBean.getOrderRentVehicleDetail().getStart_time()))); helper.setText(R.id.tv_get_time, TimeManager.stampToDate(String.valueOf(dataBean.getOrderRentVehicleDetail().getStart_time())));
......
package com.rv.home.rv.module.ui.main.home.order.bean; package com.rv.home.rv.module.ui.main.home.order.bean;
import com.base.utils.ui.datetime.selector.util.TextUtil;
import com.chad.library.adapter.base.entity.MultiItemEntity; import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import com.ruiwenliu.wrapper.base.BaseBean; import com.ruiwenliu.wrapper.base.BaseBean;
...@@ -210,6 +211,20 @@ public class OrderListBean extends BaseBean { ...@@ -210,6 +211,20 @@ public class OrderListBean extends BaseBean {
return picture; return 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 void setPicture(String picture) { public void setPicture(String picture) {
this.picture = picture; this.picture = picture;
} }
......
...@@ -605,7 +605,7 @@ ...@@ -605,7 +605,7 @@
android:id="@+id/tv_hot_car_rental" android:id="@+id/tv_hot_car_rental"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="优质车型" android:text="购房车"
android:textColor="@color/textGray" android:textColor="@color/textGray"
android:textSize="@dimen/text_14" /> android:textSize="@dimen/text_14" />
......
...@@ -61,15 +61,16 @@ ...@@ -61,15 +61,16 @@
android:textColor="@color/textGray" android:textColor="@color/textGray"
android:textSize="@dimen/text_12" /> android:textSize="@dimen/text_12" />
<RatingBar <com.frame.base.view.StarBar
android:id="@+id/rating_bar" android:id="@+id/rating_bar"
style="@style/fiveRatingBar"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/size_16" android:layout_height="wrap_content"
android:layout_below="@id/tv_context" app:starEmpty="@drawable/rv_vehicle_icon_star_gray"
android:layout_marginTop="@dimen/size_5" app:starFill="@drawable/rv_vehicle_icon_star_light"
android:numStars="5" app:starDistance="3dp"
android:rating="4.5" /> app:starCount="5"
app:isClick ="true"
app:starSize="@dimen/size_12"/>
<TextView <TextView
android:id="@+id/tv_price" android:id="@+id/tv_price"
......
...@@ -16,51 +16,84 @@ ...@@ -16,51 +16,84 @@
android:id="@+id/iv_logo" android:id="@+id/iv_logo"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="45dp" android:layout_height="45dp"
android:layout_marginBottom="@dimen/size_15"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:layout_marginBottom="@dimen/size_15"
android:src="@drawable/rv_rentingcar_icon_stop_lever" /> android:src="@drawable/rv_rentingcar_icon_stop_lever" />
<TextView <TextView
android:id="@+id/tv_content" android:id="@+id/tv_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_60" android:layout_height="@dimen/size_60"
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15"
android:visibility="gone"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:textSize="@dimen/text_18" android:background="@color/colorWrite"
android:gravity="center" android:gravity="center"
android:textColor="@color/textMain"
android:background="@color/colorWrite" />
<FrameLayout
android:paddingLeft="@dimen/size_15" android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15" android:paddingRight="@dimen/size_15"
android:paddingTop="@dimen/size_8" android:textColor="@color/textMain"
android:paddingBottom="@dimen/size_8" android:textSize="@dimen/text_18"
android:visibility="gone" />
<FrameLayout
android:id="@+id/fl_search" android:id="@+id/fl_search"
android:background="@color/colorWrite"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
<EditText android:background="@color/colorWrite"
android:background="@drawable/shape_rv_circly_line" android:paddingLeft="@dimen/size_15"
android:paddingTop="@dimen/size_8"
android:paddingRight="@dimen/size_15"
android:paddingBottom="@dimen/size_8">
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:paddingLeft="@dimen/size_15" android:layout_height="match_parent"
android:textSize="@dimen/text_14" android:orientation="horizontal">
android:drawablePadding="@dimen/size_15"
android:id="@+id/et_search" <LinearLayout
android:drawableLeft="@drawable/search" android:id="@+id/ll_item_car_city"
android:textColor="@color/textMain" android:layout_width="wrap_content"
android:layout_height="@dimen/size_40" android:layout_height="match_parent"
android:hint="@string/rv_select_address_hint" android:layout_marginRight="@dimen/size_5"
/> android:clickable="true"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_city"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/ui_dimen_common_small"
android:text="东莞市"
android:textColor="@color/colorMain"
android:textSize="@dimen/_ui_text_size_h6" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/rv_common_icon_up_arrow" />
</LinearLayout>
<EditText
android:id="@+id/et_search"
android:layout_width="match_parent"
android:layout_height="@dimen/size_40"
android:background="@drawable/shape_rv_circly_line"
android:drawableLeft="@drawable/search"
android:drawablePadding="@dimen/size_15"
android:hint="@string/rv_select_address_hint"
android:paddingLeft="@dimen/size_15"
android:textColor="@color/textMain"
android:textSize="@dimen/text_14" />
</LinearLayout>
</FrameLayout> </FrameLayout>
<FrameLayout <FrameLayout
android:visibility="gone"
android:id="@+id/fl_rv" android:id="@+id/fl_rv"
android:layout_below="@id/fl_search"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
<include layout="@layout/common_rv"/> android:layout_below="@id/fl_search"
android:visibility="gone">
<include layout="@layout/common_rv" />
</FrameLayout> </FrameLayout>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:background="@color/colorLine" android:layout_height="wrap_content"
android:layout_height="wrap_content"> xmlns:ratingbar="http://schemas.android.com/apk/res-auto"
android:background="@color/colorLine">
<LinearLayout <LinearLayout
android:padding="@dimen/size_15" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_5" android:layout_marginTop="@dimen/size_5"
android:layout_marginBottom="@dimen/size_5" android:layout_marginBottom="@dimen/size_5"
android:orientation="horizontal"
android:layout_width="match_parent"
android:background="@color/colorWrite" android:background="@color/colorWrite"
android:layout_height="wrap_content"> android:orientation="horizontal"
android:padding="@dimen/size_15">
<ImageView <ImageView
android:id="@+id/iv_goods"
android:layout_width="@dimen/size_120" android:layout_width="@dimen/size_120"
android:layout_height="@dimen/size_100" android:layout_height="@dimen/size_100"
android:id="@+id/iv_goods" android:scaleType="centerCrop" />
android:scaleType="centerCrop"
/>
<RelativeLayout <RelativeLayout
android:layout_marginLeft="@dimen/size_5"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_5">
<TextView <TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:maxLines="1" android:layout_height="wrap_content"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1"
android:text="" android:text=""
android:id="@+id/tv_name"
android:textColor="@color/textMain" android:textColor="@color/textMain"
android:layout_height="wrap_content" android:textSize="@dimen/text_16" />
android:textSize="@dimen/text_16"
/>
<TextView <TextView
android:id="@+id/tv_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv_name" android:layout_below="@id/tv_name"
android:layout_marginTop="@dimen/size_8" android:layout_marginTop="@dimen/size_8"
android:layout_width="wrap_content"
android:maxLines="1"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1"
android:text="" android:text=""
android:id="@+id/tv_address"
android:textColor="@color/textGray" android:textColor="@color/textGray"
android:layout_height="wrap_content" android:textSize="@dimen/text_12" />
android:textSize="@dimen/text_12"
/>
<LinearLayout <LinearLayout
android:layout_marginTop="@dimen/size_5"
android:orientation="horizontal"
android:id="@+id/ll_content" android:id="@+id/ll_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tv_address" android:layout_below="@id/tv_address"
android:layout_marginTop="@dimen/size_5"
android:gravity="center_vertical" android:gravity="center_vertical"
android:layout_width="match_parent" android:orientation="horizontal">
android:layout_height="wrap_content">
<TextView <TextView
android:id="@+id/tv_context"
android:layout_width="match_parent" android:layout_width="match_parent"
android:maxLines="1" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1"
android:text="" android:text=""
android:id="@+id/tv_context"
android:textColor="@color/textGray" android:textColor="@color/textGray"
android:layout_height="wrap_content" android:textSize="@dimen/text_12" />
android:textSize="@dimen/text_12"
/>
<TextView <TextView
android:layout_marginLeft="@dimen/size_10" android:id="@+id/tv_point"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:maxLines="1" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_10"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1"
android:text="" android:text=""
android:id="@+id/tv_point"
android:textColor="@color/textGray" android:textColor="@color/textGray"
android:textSize="@dimen/text_12" />
<com.frame.base.view.StarBar
android:id="@+id/starbar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/text_12" android:layout_marginLeft="@dimen/size_10"
/> ratingbar:starEmpty="@drawable/rv_vehicle_icon_star_gray"
<ImageView ratingbar:starFill="@drawable/rv_vehicle_icon_star_light"
android:layout_marginLeft="@dimen/size_5" ratingbar:starDistance="3dp"
android:layout_width="@dimen/size_15" ratingbar:starCount="5"
android:layout_height="@dimen/size_15" ratingbar:isClick ="true"
android:src="@drawable/rv_vehicle_icon_star_light" ratingbar:starSize="@dimen/size_12"/>
/>
<!--<RatingBar--> <!--<RatingBar-->
<!--android:layout_marginTop="@dimen/size_5"--> <!--android:layout_marginTop="@dimen/size_5"-->
<!--android:layout_below="@id/tv_context"--> <!--android:layout_below="@id/tv_context"-->
<!--android:layout_width="wrap_content"--> <!--android:layout_width="wrap_content"-->
<!--style="@style/fiveRatingBar"--> <!--style="@style/fiveRatingBar"-->
<!--android:numStars="5"--> <!--android:numStars="5"-->
<!--android:id="@+id/rating_bar"--> <!--android:id="@+id/rating_bar"-->
<!--android:rating="4.5"--> <!--android:rating="4.5"-->
<!--android:layout_height="@dimen/size_16"--> <!--android:layout_height="@dimen/size_16"-->
<!--/>--> <!--/>-->
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/ll_content" android:layout_below="@id/ll_content"
android:layout_marginTop="@dimen/size_5" android:layout_marginTop="@dimen/size_5"
android:gravity="center_vertical" android:gravity="center_vertical"
android:layout_width="match_parent" android:orientation="horizontal">
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="@dimen/text_16"
android:text=""
android:textStyle="bold"
android:textColor="@color/colorAuxiliaryRed"
/>
<TextView <TextView
android:id="@+id/tv_price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="" android:text=""
android:textColor="@color/colorAuxiliaryRed"
android:textSize="@dimen/text_16"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_km" android:id="@+id/tv_km"
android:textColor="@color/textGray"
android:textSize="@dimen/text_10"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" /> android:layout_height="wrap_content"
android:text=""
android:textColor="@color/textGray"
android:textSize="@dimen/text_10" />
</LinearLayout> </LinearLayout>
<ImageView
android:id="@+id/iv_sold_out"
android:visibility="gone"
android:layout_width="@dimen/size_90"
android:layout_height="@dimen/size_90"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/size_10"
android:src="@drawable/icon_home_item_car_rental_sold_out" />
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>
</FrameLayout> <TextView
android:visibility="gone"
android:id="@+id/tv_layout_gray"
android:layout_width="match_parent"
android:layout_height="@dimen/size_130"
android:background="@color/gray_50ffffff"/>
</RelativeLayout>
...@@ -170,5 +170,6 @@ ...@@ -170,5 +170,6 @@
<string name="rv_charge_details">费用明细</string> <string name="rv_charge_details">费用明细</string>
<string name="tv_boarding">立即上车</string> <string name="tv_boarding">立即上车</string>
<string name="tv_cancelled">已取消</string> <string name="tv_cancelled">已取消</string>
<string name="rv_collection_data_null">您还没有收藏的信息哦</string>
<!--=================================================房车结束========================================--> <!--=================================================房车结束========================================-->
</resources> </resources>
...@@ -46,4 +46,5 @@ dependencies { ...@@ -46,4 +46,5 @@ dependencies {
api project(':plugin_version') api project(':plugin_version')
//动态权限申请库 //动态权限申请库
implementation 'pub.devrel:easypermissions:1.3.0' implementation 'pub.devrel:easypermissions:1.3.0'
implementation 'com.alibaba:fastjson:1.2.21'
} }
...@@ -13,10 +13,13 @@ import android.widget.ImageView; ...@@ -13,10 +13,13 @@ import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.base.utils.tools.android.IntentUtil; import com.base.utils.tools.android.IntentUtil;
import com.base.utils.ui.image.round.RoundImageView; import com.base.utils.ui.image.round.RoundImageView;
import com.frame.base.browse.ActivityImageBrowseInt; import com.frame.base.browse.ActivityImageBrowseInt;
import com.frame.base.bus.LoginSuccessfulEvent; import com.frame.base.bus.LoginSuccessfulEvent;
import com.frame.base.bus.Observer;
import com.frame.base.bus.RxBus; import com.frame.base.bus.RxBus;
import com.frame.rv.config.RvFrameConfig; import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.SPConstance; import com.ruiwenliu.wrapper.SPConstance;
...@@ -62,7 +65,7 @@ import io.reactivex.schedulers.Schedulers; ...@@ -62,7 +65,7 @@ import io.reactivex.schedulers.Schedulers;
/** /**
* 我的 * 我的
*/ */
public class MineFragment extends BaseFragment<CommonPresenter> implements SimpleRefreshLayout.OnSimpleRefreshListener{ public class MineFragment extends BaseFragment<CommonPresenter> implements SimpleRefreshLayout.OnSimpleRefreshListener {
@BindView(R2.id.iv_avatar) @BindView(R2.id.iv_avatar)
RoundImageView ivAvatar; RoundImageView ivAvatar;
...@@ -158,20 +161,21 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simp ...@@ -158,20 +161,21 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simp
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
private void initRxBus() { private void initRxBus() {
RxBus.tObservable(UserInfoEvent.class) RxBus.tObservable(UserInfoEvent.class)
.observeOn(Schedulers.newThread()) .observeOn(Schedulers.newThread())
.subscribe(new Consumer<UserInfoEvent>() { .subscribe(new Observer<UserInfoEvent>(disposable) {
@Override @Override
public void accept(UserInfoEvent info) throws Exception { public void onNext(UserInfoEvent info) {
getUserData(); getUserData();
} }
}); });
RxBus.tObservable(LoginSuccessfulEvent.class) RxBus.tObservable(LoginSuccessfulEvent.class)
.observeOn(Schedulers.newThread()) .observeOn(Schedulers.newThread())
.subscribe(new Consumer<LoginSuccessfulEvent>() { .subscribe(new Observer<LoginSuccessfulEvent>(disposable) {
@Override @Override
public void accept(LoginSuccessfulEvent event) throws Exception { public void onNext(LoginSuccessfulEvent event) {
getUserData(); getUserData();
} }
}); });
...@@ -372,7 +376,7 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simp ...@@ -372,7 +376,7 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simp
GlideManager.getInstance(_mActivity).loadImage(info.getHeadimgurl(), ivAvatar); GlideManager.getInstance(_mActivity).loadImage(info.getHeadimgurl(), ivAvatar);
tvNickname.setText(info.getUsername()); tvNickname.setText(info.getUsername());
//更新实名信息 //更新实名信息
UtilsManager.getInstance(_mActivity).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_ISCERTIFICATIONSTATUS, String.valueOf(info.getCertificationStatus())).commit(); UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_USERINFO, JSON.toJSONString(info)).commit();
if (info.getCertificationStatus() == 0) { //实名认证状态:0-未认证,1-已认证 if (info.getCertificationStatus() == 0) { //实名认证状态:0-未认证,1-已认证
tvVerified.setText("未实名认证"); tvVerified.setText("未实名认证");
tvVerified.setEnabled(true); tvVerified.setEnabled(true);
...@@ -396,7 +400,7 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simp ...@@ -396,7 +400,7 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simp
tvMembershipLevel.setText("钻石会员特权"); tvMembershipLevel.setText("钻石会员特权");
ivMember.setImageResource(R.drawable.mycenter_icon_type_diamond_membership); ivMember.setImageResource(R.drawable.mycenter_icon_type_diamond_membership);
} }
tvMemberHint.setText("免费用车" +info.getRentFreeDays() +"天"); tvMemberHint.setText("免费用车" + info.getRentFreeDays() + "天");
} }
} }
......
...@@ -130,7 +130,7 @@ public class CollectionActivity extends BaseStatusActivity<CommonPresenter> impl ...@@ -130,7 +130,7 @@ public class CollectionActivity extends BaseStatusActivity<CommonPresenter> impl
private void processData(CollectionListBean bean) { private void processData(CollectionListBean bean) {
if (mPage == 1) { if (mPage == 1) {
if (bean.getData().getTotalCount() == 0) { if (bean.getData().getTotalCount() == 0) {
collectionAdapter.setEmptyView(getEmptyView(recyclerView, -1, mActivity.getString(R.string.rv_driving_data_null))); collectionAdapter.setEmptyView(getEmptyView(recyclerView, -1, mActivity.getString(R.string.rv_collection_data_null)));
return; return;
} }
......
...@@ -141,6 +141,8 @@ public class PersonalInformationActivity extends BaseStatusActivity<PickerPresen ...@@ -141,6 +141,8 @@ public class PersonalInformationActivity extends BaseStatusActivity<PickerPresen
RxBus.post(new UserInfoEvent()); RxBus.post(new UserInfoEvent());
finish(); finish();
break; break;
} }
} }
......
...@@ -19,8 +19,7 @@ public class DeletePopupWindow extends PopupWindow { ...@@ -19,8 +19,7 @@ public class DeletePopupWindow extends PopupWindow {
public DeletePopupWindow(final Activity context, OnClickListener onClickListener) { public DeletePopupWindow(final Activity context, OnClickListener onClickListener) {
super(context); super(context);
LayoutInflater inflater = (LayoutInflater) context LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
ViewGroup menuView = (ViewGroup) inflater.inflate(R.layout.popu_delete, null); ViewGroup menuView = (ViewGroup) inflater.inflate(R.layout.popu_delete, null);
menuView.findViewById(R.id.tv_delete).setOnClickListener(onClickListener); menuView.findViewById(R.id.tv_delete).setOnClickListener(onClickListener);
......
...@@ -22,6 +22,8 @@ import com.alibaba.android.arouter.launcher.ARouter; ...@@ -22,6 +22,8 @@ import com.alibaba.android.arouter.launcher.ARouter;
import com.base.utils.tools.java.DateUtil; import com.base.utils.tools.java.DateUtil;
import com.base.utils.ui.datetime.selector.util.TextUtil; import com.base.utils.ui.datetime.selector.util.TextUtil;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.frame.base.bus.CancelOrderEvent;
import com.frame.base.bus.Observer;
import com.frame.base.bus.PaymentFailedEvent; import com.frame.base.bus.PaymentFailedEvent;
import com.frame.base.bus.PaymentSuccessfulEvent; import com.frame.base.bus.PaymentSuccessfulEvent;
import com.frame.base.bus.RxBus; import com.frame.base.bus.RxBus;
...@@ -194,20 +196,21 @@ public class TravelerConfirmOrderActivity extends BaseStatusActivity<TourismPres ...@@ -194,20 +196,21 @@ public class TravelerConfirmOrderActivity extends BaseStatusActivity<TourismPres
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
private void initRxBus() { private void initRxBus() {
RxBus.tObservable(PaymentSuccessfulEvent.class) RxBus.tObservable(PaymentSuccessfulEvent.class)
.observeOn(Schedulers.newThread()) .observeOn(Schedulers.newThread())
.subscribe(new Consumer<PaymentSuccessfulEvent>() { .subscribe(new Observer<PaymentSuccessfulEvent>(disposable) {
@Override @Override
public void accept(PaymentSuccessfulEvent payEvent) throws Exception { public void onNext(PaymentSuccessfulEvent event) {
finish(); finish();
} }
}); });
RxBus.tObservable(PaymentFailedEvent.class) RxBus.tObservable(PaymentFailedEvent.class)
.observeOn(Schedulers.newThread()) .observeOn(Schedulers.newThread())
.subscribe(new Consumer<PaymentFailedEvent>() { .subscribe(new Observer<PaymentFailedEvent>(disposable) {
@Override @Override
public void accept(PaymentFailedEvent payEvent) throws Exception { public void onNext(PaymentFailedEvent event) {
if (mActivity.getClass().equals(TravelerConfirmOrderActivity.class)) { if (mActivity.getClass().equals(TravelerConfirmOrderActivity.class)) {
ARouter.getInstance().build(Constance.ACTIVITY_URL_ORDERLIST).navigation(); ARouter.getInstance().build(Constance.ACTIVITY_URL_ORDERLIST).navigation();
finish(); finish();
......
...@@ -40,5 +40,6 @@ dependencies { ...@@ -40,5 +40,6 @@ dependencies {
api project(':RvWrapper') api project(':RvWrapper')
api project(':component_resource') api project(':component_resource')
api project(':component_utils') api project(':component_utils')
api project(':component_control')
} }
...@@ -7,9 +7,9 @@ final class InertiaTimerTask extends TimerTask ...@@ -7,9 +7,9 @@ final class InertiaTimerTask extends TimerTask
float a; float a;
final float velocityY; final float velocityY;
final WheelView loopView; final WheelView3 loopView;
InertiaTimerTask(WheelView loopview, float velocityY) InertiaTimerTask(WheelView3 loopview, float velocityY)
{ {
super(); super();
loopView = loopview; loopView = loopview;
......
...@@ -8,9 +8,9 @@ final class MessageHandler extends Handler { ...@@ -8,9 +8,9 @@ final class MessageHandler extends Handler {
public static final int WHAT_SMOOTH_SCROLL = 2000; public static final int WHAT_SMOOTH_SCROLL = 2000;
public static final int WHAT_ITEM_SELECTED = 3000; public static final int WHAT_ITEM_SELECTED = 3000;
final WheelView loopview; final WheelView3 loopview;
MessageHandler(WheelView loopview) { MessageHandler(WheelView3 loopview) {
this.loopview = loopview; this.loopview = loopview;
} }
...@@ -22,7 +22,7 @@ final class MessageHandler extends Handler { ...@@ -22,7 +22,7 @@ final class MessageHandler extends Handler {
break; break;
case WHAT_SMOOTH_SCROLL: case WHAT_SMOOTH_SCROLL:
loopview.smoothScroll(WheelView.ACTION.FLING); loopview.smoothScroll(WheelView3.ACTION.FLING);
break; break;
case WHAT_ITEM_SELECTED: case WHAT_ITEM_SELECTED:
......
package com.rv.plugin.calendar; package com.rv.plugin.calendar;
final class OnItemSelectedRunnable implements Runnable { final class OnItemSelectedRunnable implements Runnable {
final WheelView loopView; final WheelView3 loopView;
OnItemSelectedRunnable(WheelView loopview) { OnItemSelectedRunnable(WheelView3 loopview) {
loopView = loopview; loopView = loopview;
} }
......
...@@ -7,9 +7,9 @@ final class SmoothScrollTimerTask extends TimerTask { ...@@ -7,9 +7,9 @@ final class SmoothScrollTimerTask extends TimerTask {
int realTotalOffset; int realTotalOffset;
int realOffset; int realOffset;
int offset; int offset;
final WheelView loopView; final WheelView3 loopView;
SmoothScrollTimerTask(WheelView loopview, int offset) { SmoothScrollTimerTask(WheelView3 loopview, int offset) {
this.loopView = loopview; this.loopView = loopview;
this.offset = offset; this.offset = offset;
realTotalOffset = Integer.MAX_VALUE; realTotalOffset = Integer.MAX_VALUE;
......
...@@ -10,7 +10,7 @@ import java.util.ArrayList; ...@@ -10,7 +10,7 @@ import java.util.ArrayList;
public class WheelTime2 public class WheelTime2
{ {
private View view; private View view;
private WheelView wv_hours; private WheelView3 wv_hours;
private ArrayList<String> timeList; private ArrayList<String> timeList;
private String time; private String time;
...@@ -29,7 +29,7 @@ public class WheelTime2 ...@@ -29,7 +29,7 @@ public class WheelTime2
public void setPicker(int h) public void setPicker(int h)
{ {
wv_hours = (WheelView) view.findViewById(R.id.hour); wv_hours = (WheelView3) view.findViewById(R.id.hour);
wv_hours.setAdapter(new ArrayWheelAdapter(timeList,timeList.size())); wv_hours.setAdapter(new ArrayWheelAdapter(timeList,timeList.size()));
/*wv_hours.setCurrentItem(h); /*wv_hours.setCurrentItem(h);
time = timeList.get(h);*/ time = timeList.get(h);*/
......
...@@ -27,7 +27,7 @@ import java.util.concurrent.TimeUnit; ...@@ -27,7 +27,7 @@ import java.util.concurrent.TimeUnit;
/** /**
* 3d滚轮控件 * 3d滚轮控件
*/ */
public class WheelView extends View public class WheelView3 extends View
{ {
public enum ACTION public enum ACTION
...@@ -109,12 +109,12 @@ public class WheelView extends View ...@@ -109,12 +109,12 @@ public class WheelView extends View
private static final float CENTERCONTENTOFFSET = 6;// 中间文字文字居中需要此偏移值 private static final float CENTERCONTENTOFFSET = 6;// 中间文字文字居中需要此偏移值
private static final String GETPICKERVIEWTEXT = "getPickerViewText";// 反射的方法名 private static final String GETPICKERVIEWTEXT = "getPickerViewText";// 反射的方法名
public WheelView(Context context) public WheelView3(Context context)
{ {
this(context, null); this(context, null);
} }
public WheelView(Context context, AttributeSet attrs) public WheelView3(Context context, AttributeSet attrs)
{ {
super(context, attrs); super(context, attrs);
textColorOut = getResources().getColor(R.color.pickerview_wheelview_textcolor_out); textColorOut = getResources().getColor(R.color.pickerview_wheelview_textcolor_out);
......
...@@ -2,13 +2,13 @@ package com.rv.plugin.calendar.listener; ...@@ -2,13 +2,13 @@ package com.rv.plugin.calendar.listener;
import android.view.MotionEvent; import android.view.MotionEvent;
import com.rv.plugin.calendar.WheelView; import com.rv.plugin.calendar.WheelView3;
public final class LoopViewGestureListener extends android.view.GestureDetector.SimpleOnGestureListener { public final class LoopViewGestureListener extends android.view.GestureDetector.SimpleOnGestureListener {
final WheelView loopView; final WheelView3 loopView;
public LoopViewGestureListener(WheelView loopview) { public LoopViewGestureListener(WheelView3 loopview) {
loopView = loopview; loopView = loopview;
} }
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="300dp"/> <corners android:radius="300dp"/>
<solid android:color="@color/colorYellow"/> <solid android:color="@color/gray_FFB74B"/>
</shape> </shape>
\ No newline at end of file
This diff is collapsed.
...@@ -21,77 +21,4 @@ ...@@ -21,77 +21,4 @@
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="30dip"
android:orientation="horizontal" >
<TextView
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="日"
android:textColor="@color/ri_dhong"
android:textSize="@dimen/text_12" />
<TextView
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="一"
android:textColor="@color/ri_mlv"
android:textSize="@dimen/text_12" />
<TextView
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="二"
android:textColor="@color/ri_mlv"
android:textSize="@dimen/text_12" />
<TextView
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="三"
android:textColor="@color/ri_mlv"
android:textSize="@dimen/text_12" />
<TextView
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="四"
android:textColor="@color/ri_mlv"
android:textSize="@dimen/text_12" />
<TextView
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="五"
android:textColor="@color/ri_mlv"
android:textSize="@dimen/text_12" />
<TextView
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="六"
android:textColor="@color/ri_dhong"
android:textSize="@dimen/text_12" />
</LinearLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
android:background="@android:color/white" android:background="@android:color/white"
android:orientation="horizontal"> android:orientation="horizontal">
<com.rv.plugin.calendar.WheelView <com.rv.plugin.calendar.WheelView3
android:id="@+id/hour" android:id="@+id/hour"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
...@@ -20,4 +20,6 @@ ...@@ -20,4 +20,6 @@
<color name="ri_lhui">#FFCCCCCC</color> <color name="ri_lhui">#FFCCCCCC</color>
<color name="greenC7FFED">#c7ffed</color> <color name="greenC7FFED">#c7ffed</color>
<color name="gren_171413">#171413</color>
</resources> </resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment