Commit 1a6a04c0 authored by linfeng's avatar linfeng

租车和日历

parent 941a638e
......@@ -24,6 +24,7 @@ public final class Constance {
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_CALENDAR ="/plugin/calendar/CalendarActivity";
}
......@@ -7,8 +7,8 @@ android {
applicationId "com.test.rv"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 101
versionName "1.0.1"
versionCode 103
versionName "1.0.3"
multiDexEnabled true
//新版Gradle 是 implementation 为了兼容compile,写上这句话
......
......@@ -36,6 +36,7 @@
<color name="gray_50000000">#50000000</color>
<color name="gray_EEEEEE">#EEEEEE</color>
<color name="gray_ba242525">#ba242525</color>
<color name="gray_f8f3c9">#F8F3C9</color>
<!--end-->
......
......@@ -624,6 +624,24 @@ public class DateUtils {
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
*
......
......@@ -626,7 +626,7 @@ public class CarRentalActivity extends BaseStatusActivity<CommonPresenter> {
dataBean.setEndCityName(endCity);
dataBean.setEndAddr(endAddress);
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));
}
......
......@@ -33,6 +33,7 @@ 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.DateUtil;
import com.base.utils.ui.datetime.selector.util.TextUtil;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.frame.base.url.Constance;
......@@ -256,9 +257,11 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
tvGetWeek.setText("周" + MyUtils.getWeek(DateUtils.getCurDate()));
tvOutTime.setText(MyUtils.getFetureDate2(1));
tvOutWeek.setText("周" + MyUtils.getWeek(MyUtils.getFetureDate(1)));
begDate = DateUtils.getCurDate();
endDate = MyUtils.getFetureDate(1);
copyDay = DateUtils.compareDateDay(endDate, begDate) + 1;
begDate = DateUtils.formatDate8(DateUtils.getCurDateTime());
endDate = MyUtils.getFetureDate2(1);
copyDay = DateUtils.compareDateDay(MyUtils.getFetureDate(1), DateUtils.getCurDate()) + 1;
llItemHotRvtour.setSelected(true);
tvItemRvTour.setSelected(true);
......@@ -277,8 +280,6 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
}
});
mAdapter = new HotCarTypeAdapter();
recyclerViewContent.setLayoutManager(new GridLayoutManager(getContext(), 2));
recyclerViewContent.addItemDecoration(new AbSpacesItemDecoration(10));// 分割线。
......@@ -580,7 +581,13 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
// } else {
startActivityForResult(SelectLocationActivity.getIntent(getContext(), 2, outCity, outLatitude, outLongitude, nowCity), TYPE_REQUEST_ADDRESS);
} 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) {
if (copyDay < 1) {
showToast(getContext().getString(R.string.rv_day_toast));
......@@ -776,11 +783,9 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
} else if (resultCode == 200 && requestCode == 108) {
begDate = data.getStringExtra("begDate");
endDate = data.getStringExtra("endDate");
String begTime = data.getStringExtra("begTime");
String endTime = data.getStringExtra("endTime");
copyDay = DateUtils.compareDateDay(endDate, begDate) + 1;
tvGetTime.setText(begDate + " " + begTime);
tvOutTime.setText(endDate + " " + endTime);
tvGetTime.setText(begDate);
tvOutTime.setText(endDate);
tvGetWeek.setText("周" + MyUtils.getWeek(begDate));
tvOutWeek.setText("周" + MyUtils.getWeek(endDate));
tvDay.setText(String.format("%1$s%2$s", copyDay, getContext().getString(R.string.rv_days)));
......@@ -962,7 +967,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
dataBean.setEndCityName(endCity);
dataBean.setEndAddr(endAddress);
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));
}
......
......@@ -587,6 +587,6 @@ public class HomePageFragment extends BaseFragment<CommonPresenter> {
dataBean.setEndCityName(endCity);
dataBean.setEndAddr(endAddress);
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));
}
}
......@@ -46,4 +46,5 @@ dependencies {
api project(':plugin_version')
//动态权限申请库
implementation 'pub.devrel:easypermissions:1.3.0'
implementation 'com.alibaba:fastjson:1.2.21'
}
......@@ -13,6 +13,8 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.base.utils.tools.android.IntentUtil;
import com.base.utils.ui.image.round.RoundImageView;
import com.frame.base.browse.ActivityImageBrowseInt;
......@@ -372,7 +374,7 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simp
GlideManager.getInstance(_mActivity).loadImage(info.getHeadimgurl(), ivAvatar);
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-已认证
tvVerified.setText("未实名认证");
tvVerified.setEnabled(true);
......
......@@ -40,5 +40,6 @@ dependencies {
api project(':RvWrapper')
api project(':component_resource')
api project(':component_utils')
api project(':component_control')
}
......@@ -7,9 +7,9 @@ final class InertiaTimerTask extends TimerTask
float a;
final float velocityY;
final WheelView loopView;
final WheelView3 loopView;
InertiaTimerTask(WheelView loopview, float velocityY)
InertiaTimerTask(WheelView3 loopview, float velocityY)
{
super();
loopView = loopview;
......
......@@ -8,9 +8,9 @@ final class MessageHandler extends Handler {
public static final int WHAT_SMOOTH_SCROLL = 2000;
public static final int WHAT_ITEM_SELECTED = 3000;
final WheelView loopview;
final WheelView3 loopview;
MessageHandler(WheelView loopview) {
MessageHandler(WheelView3 loopview) {
this.loopview = loopview;
}
......@@ -22,7 +22,7 @@ final class MessageHandler extends Handler {
break;
case WHAT_SMOOTH_SCROLL:
loopview.smoothScroll(WheelView.ACTION.FLING);
loopview.smoothScroll(WheelView3.ACTION.FLING);
break;
case WHAT_ITEM_SELECTED:
......
package com.rv.plugin.calendar;
final class OnItemSelectedRunnable implements Runnable {
final WheelView loopView;
final WheelView3 loopView;
OnItemSelectedRunnable(WheelView loopview) {
OnItemSelectedRunnable(WheelView3 loopview) {
loopView = loopview;
}
......
......@@ -7,9 +7,9 @@ final class SmoothScrollTimerTask extends TimerTask {
int realTotalOffset;
int realOffset;
int offset;
final WheelView loopView;
final WheelView3 loopView;
SmoothScrollTimerTask(WheelView loopview, int offset) {
SmoothScrollTimerTask(WheelView3 loopview, int offset) {
this.loopView = loopview;
this.offset = offset;
realTotalOffset = Integer.MAX_VALUE;
......
......@@ -10,7 +10,7 @@ import java.util.ArrayList;
public class WheelTime2
{
private View view;
private WheelView wv_hours;
private WheelView3 wv_hours;
private ArrayList<String> timeList;
private String time;
......@@ -29,7 +29,7 @@ public class WheelTime2
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.setCurrentItem(h);
time = timeList.get(h);*/
......
......@@ -27,7 +27,7 @@ import java.util.concurrent.TimeUnit;
/**
* 3d滚轮控件
*/
public class WheelView extends View
public class WheelView3 extends View
{
public enum ACTION
......@@ -109,12 +109,12 @@ public class WheelView extends View
private static final float CENTERCONTENTOFFSET = 6;// 中间文字文字居中需要此偏移值
private static final String GETPICKERVIEWTEXT = "getPickerViewText";// 反射的方法名
public WheelView(Context context)
public WheelView3(Context context)
{
this(context, null);
}
public WheelView(Context context, AttributeSet attrs)
public WheelView3(Context context, AttributeSet attrs)
{
super(context, attrs);
textColorOut = getResources().getColor(R.color.pickerview_wheelview_textcolor_out);
......
......@@ -2,13 +2,13 @@ package com.rv.plugin.calendar.listener;
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 {
final WheelView loopView;
final WheelView3 loopView;
public LoopViewGestureListener(WheelView loopview) {
public LoopViewGestureListener(WheelView3 loopview) {
loopView = loopview;
}
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="300dp"/>
<solid android:color="@color/colorYellow"/>
<solid android:color="@color/gray_FFB74B"/>
</shape>
\ No newline at end of file
This diff is collapsed.
......@@ -21,77 +21,4 @@
</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>
\ No newline at end of file
......@@ -16,7 +16,7 @@
android:background="@android:color/white"
android:orientation="horizontal">
<com.rv.plugin.calendar.WheelView
<com.rv.plugin.calendar.WheelView3
android:id="@+id/hour"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
......
......@@ -20,4 +20,6 @@
<color name="ri_lhui">#FFCCCCCC</color>
<color name="greenC7FFED">#c7ffed</color>
<color name="gren_171413">#171413</color>
</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