Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RvApp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lify
RvApp
Commits
c809a4b8
Commit
c809a4b8
authored
Jul 08, 2019
by
jianglx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://113.105.137.151:22280/lify/rvapp
into dev-member-john
parents
e366a60b
5ae70cbe
Changes
58
Hide whitespace changes
Inline
Side-by-side
Showing
58 changed files
with
1542 additions
and
665 deletions
+1542
-665
Constance.java
MyFrame/src/main/java/com/frame/base/url/Constance.java
+2
-1
StarBar.java
MyFrame/src/main/java/com/frame/base/view/StarBar.java
+5
-0
attrs.xml
MyFrame/src/main/res/values/attrs.xml
+2
-0
build.gradle
RvClient/build.gradle
+2
-2
TravelFragmentCommitOrder.java
...ava/com/rv/travel/fragment/TravelFragmentCommitOrder.java
+22
-22
BaseWrapperActivity.java
.../java/com/ruiwenliu/wrapper/base/BaseWrapperActivity.java
+10
-0
BaseWrapperFragment.java
.../java/com/ruiwenliu/wrapper/base/BaseWrapperFragment.java
+10
-0
colors.xml
RvWrapper/src/main/res/values/colors.xml
+2
-0
WheelView.java
...rol/src/main/java/com/rv/component/control/WheelView.java
+361
-0
DateUtils.java
...utils/src/main/java/com/rv/component/utils/DateUtils.java
+18
-0
LoginRvActivity.java
.../java/com/rv/home/rv/module/ui/login/LoginRvActivity.java
+2
-2
CarRentalActivity.java
...com/rv/home/rv/module/ui/main/home/CarRentalActivity.java
+3
-3
CarRentalListActivity.java
...rv/home/rv/module/ui/main/home/CarRentalListActivity.java
+122
-97
ConfirmOrderActivity.java
.../rv/home/rv/module/ui/main/home/ConfirmOrderActivity.java
+10
-8
HomeFragment.java
...java/com/rv/home/rv/module/ui/main/home/HomeFragment.java
+21
-16
HomePageFragment.java
.../com/rv/home/rv/module/ui/main/home/HomePageFragment.java
+3
-3
SelectLocationActivity.java
...v/home/rv/module/ui/main/home/SelectLocationActivity.java
+123
-31
CarRentalListAdapter.java
.../rv/module/ui/main/home/adapter/CarRentalListAdapter.java
+15
-2
CarTypeListBean.java
.../rv/home/rv/module/ui/main/home/bean/CarTypeListBean.java
+18
-0
ForPaymentFragment.java
...home/rv/module/ui/main/home/order/ForPaymentFragment.java
+5
-2
OrderDetailActivity.java
...ome/rv/module/ui/main/home/order/OrderDetailActivity.java
+4
-2
ToTravelFragment.java
...v/home/rv/module/ui/main/home/order/ToTravelFragment.java
+3
-2
TravelOrderDetailsActivity.java
...module/ui/main/home/order/TravelOrderDetailsActivity.java
+3
-2
CompletedAdapter.java
...v/module/ui/main/home/order/adapter/CompletedAdapter.java
+1
-1
ForPaymentAdapter.java
.../module/ui/main/home/order/adapter/ForPaymentAdapter.java
+2
-0
HaveToTravelAdapter.java
...odule/ui/main/home/order/adapter/HaveToTravelAdapter.java
+1
-1
OrderListAdapter.java
...v/module/ui/main/home/order/adapter/OrderListAdapter.java
+1
-1
ToTravelAdapter.java
...rv/module/ui/main/home/order/adapter/ToTravelAdapter.java
+1
-1
OrderListBean.java
...home/rv/module/ui/main/home/order/bean/OrderListBean.java
+15
-0
icon_home_item_car_rental_sold_out.png
...res/drawable-xhdpi/icon_home_item_car_rental_sold_out.png
+0
-0
fragment_home.xml
module_home/src/main/res/layout/fragment_home.xml
+1
-1
rv_act_car_rental_list.xml
module_home/src/main/res/layout/rv_act_car_rental_list.xml
+149
-91
rv_act_confim_order.xml
module_home/src/main/res/layout/rv_act_confim_order.xml
+8
-7
rv_act_select_location.xml
module_home/src/main/res/layout/rv_act_select_location.xml
+60
-27
rv_item_car_rental_list.xml
module_home/src/main/res/layout/rv_item_car_rental_list.xml
+94
-71
strings.xml
module_home/src/main/res/values/strings.xml
+1
-0
build.gradle
module_mine/build.gradle
+1
-0
MineFragment.java
module_mine/src/main/java/com/rv/rvmine/MineFragment.java
+11
-7
CollectionActivity.java
.../main/java/com/rv/rvmine/traveler/CollectionActivity.java
+1
-1
PersonalInformationActivity.java
...a/com/rv/rvmine/traveler/PersonalInformationActivity.java
+2
-0
DeletePopupWindow.java
...e/src/main/java/com/rv/rvmine/view/DeletePopupWindow.java
+1
-2
TravelerConfirmOrderActivity.java
...va/com/rv/tourism/other/TravelerConfirmOrderActivity.java
+7
-4
build.gradle
plugin_calendar/build.gradle
+1
-0
CalendarActivity.java
...rc/main/java/com/rv/plugin/calendar/CalendarActivity.java
+108
-163
InertiaTimerTask.java
...rc/main/java/com/rv/plugin/calendar/InertiaTimerTask.java
+2
-2
MessageHandler.java
.../src/main/java/com/rv/plugin/calendar/MessageHandler.java
+3
-3
OnItemSelectedRunnable.java
...n/java/com/rv/plugin/calendar/OnItemSelectedRunnable.java
+2
-2
SmoothScrollTimerTask.java
...in/java/com/rv/plugin/calendar/SmoothScrollTimerTask.java
+2
-2
WheelTime2.java
...ndar/src/main/java/com/rv/plugin/calendar/WheelTime2.java
+2
-2
WheelView3.java
...ndar/src/main/java/com/rv/plugin/calendar/WheelView3.java
+3
-3
LoopViewGestureListener.java
.../rv/plugin/calendar/listener/LoopViewGestureListener.java
+3
-3
common_icon_calendar_left.png
...src/main/res/drawable-xhdpi/common_icon_calendar_left.png
+0
-0
common_icon_calendar_righe.png
...rc/main/res/drawable-xhdpi/common_icon_calendar_righe.png
+0
-0
shape_calender_selectbg.xml
...alendar/src/main/res/drawable/shape_calender_selectbg.xml
+1
-1
activity_calendar2.xml
plugin_calendar/src/main/res/layout/activity_calendar2.xml
+289
-0
item_calendar_header.xml
plugin_calendar/src/main/res/layout/item_calendar_header.xml
+0
-73
popview_time2.xml
plugin_calendar/src/main/res/layout/popview_time2.xml
+1
-1
colors.xml
plugin_calendar/src/main/res/values/colors.xml
+2
-0
No files found.
MyFrame/src/main/java/com/frame/base/url/Constance.java
View file @
c809a4b8
...
...
@@ -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"
;
}
MyFrame/src/main/java/com/frame/base/view/StarBar.java
View file @
c809a4b8
...
...
@@ -23,6 +23,7 @@ public class StarBar extends View {
private
OnStarChangeListener
onStarChangeListener
;
//监听星星变化接口
private
Paint
paint
;
//绘制星星画笔
private
boolean
integerMark
=
false
;
private
boolean
isOnclick
=
false
;
public
StarBar
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
init
(
context
,
attrs
);
...
...
@@ -47,6 +48,7 @@ public class StarBar extends View {
this
.
starCount
=
mTypedArray
.
getInteger
(
R
.
styleable
.
RatingBar_starCount
,
5
);
this
.
starEmptyDrawable
=
mTypedArray
.
getDrawable
(
R
.
styleable
.
RatingBar_starEmpty
);
this
.
starFillBitmap
=
drawableToBitmap
(
mTypedArray
.
getDrawable
(
R
.
styleable
.
RatingBar_starFill
));
this
.
isOnclick
=
mTypedArray
.
getBoolean
(
R
.
styleable
.
RatingBar_isClick
,
false
);
mTypedArray
.
recycle
();
paint
=
new
Paint
();
...
...
@@ -146,6 +148,9 @@ public class StarBar extends View {
int
x
=
(
int
)
event
.
getX
();
if
(
x
<
0
)
x
=
0
;
if
(
x
>
getMeasuredWidth
())
x
=
getMeasuredWidth
();
if
(
isOnclick
){
return
false
;
}
switch
(
event
.
getAction
()){
case
MotionEvent
.
ACTION_DOWN
:
{
setStarMark
(
x
*
1.0f
/
(
getMeasuredWidth
()*
1.0f
/
starCount
));
...
...
MyFrame/src/main/res/values/attrs.xml
View file @
c809a4b8
...
...
@@ -11,6 +11,8 @@
<attr
format=
"reference"
name=
"starEmpty"
/>
<!--星星满图-->
<attr
format=
"reference"
name=
"starFill"
/>
<!--星星是否点击-->
<attr
format=
"boolean"
name=
"isClick"
/>
</declare-styleable>
</resources>
\ No newline at end of file
RvClient/build.gradle
View file @
c809a4b8
...
...
@@ -7,8 +7,8 @@ android {
applicationId
"com.xxfc.rv"
minSdkVersion
rootProject
.
ext
.
minSdkVersion
targetSdkVersion
rootProject
.
ext
.
targetSdkVersion
versionCode
10
1
versionName
"1.0.
1
"
versionCode
10
4
versionName
"1.0.
4
"
multiDexEnabled
true
//新版Gradle 是 implementation 为了兼容compile,写上这句话
...
...
RvTravel/src/main/java/com/rv/travel/fragment/TravelFragmentCommitOrder.java
View file @
c809a4b8
...
...
@@ -255,29 +255,29 @@ public class TravelFragmentCommitOrder extends BaseFragment {
@SuppressLint
(
"CheckResult"
)
private
void
initRxBus
()
{
RxBus
.
tObservable
(
PaymentSuccessfulEvent
.
class
)
.
observeOn
(
Schedulers
.
newThread
())
.
subscribe
(
new
Consumer
<
PaymentSuccessfulEvent
>()
{
@Override
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
();
// RxBus.tObservable(PaymentSuccessfulEvent.class)
// .observeOn(Schedulers.newThread())
// .subscribe(new Consumer<PaymentSuccessfulEvent>() {
// @Override
// 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();
//// }
// }
// });
}
...
...
RvWrapper/src/main/java/com/ruiwenliu/wrapper/base/BaseWrapperActivity.java
View file @
c809a4b8
...
...
@@ -19,6 +19,7 @@ import com.ruiwenliu.wrapper.weight.TitleView;
import
com.ruiwenliu.wrapper.weight.ToastView
;
import
butterknife.ButterKnife
;
import
io.reactivex.disposables.CompositeDisposable
;
import
me.yokeyword.fragmentation.SupportActivity
;
/**
...
...
@@ -36,11 +37,15 @@ public abstract class BaseWrapperActivity extends SupportActivity {
protected
FrameLayout
frameLayout
;
private
LinearLayout
rootView
;
protected
AppCompatActivity
mActivity
;
protected
CompositeDisposable
disposable
;
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
ARouter
.
getInstance
().
inject
(
this
);
if
(
disposable
==
null
||
disposable
.
isDisposed
())
{
disposable
=
new
CompositeDisposable
();
}
//获取类名
// RuiwenAppliction.getInstance().activityName=this.getClass().getSimpleName();
handleBeforeSetLayout
();
//设置布局之前的操作
...
...
@@ -49,6 +54,7 @@ public abstract class BaseWrapperActivity extends SupportActivity {
intiBaseData
();
ButterKnife
.
bind
(
this
);
initView
(
savedInstanceState
,
titleView
,
getIntent
());
}
...
...
@@ -76,6 +82,10 @@ public abstract class BaseWrapperActivity extends SupportActivity {
frameLayout
.
removeAllViews
();
frameLayout
=
null
;
}
if
(
disposable
!=
null
)
{
disposable
.
clear
();
}
}
...
...
RvWrapper/src/main/java/com/ruiwenliu/wrapper/base/BaseWrapperFragment.java
View file @
c809a4b8
...
...
@@ -21,6 +21,7 @@ import java.lang.reflect.ParameterizedType;
import
butterknife.ButterKnife
;
import
butterknife.Unbinder
;
import
io.reactivex.disposables.CompositeDisposable
;
import
me.yokeyword.fragmentation.SupportFragment
;
/**
...
...
@@ -35,6 +36,7 @@ public abstract class BaseWrapperFragment<P extends MvpPresenter> extends Suppor
private
LoadingDialog
mLoadingDialog
;
private
View
contentView
;
private
Unbinder
unbinder
;
protected
CompositeDisposable
disposable
;
@Override
public
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
...
...
@@ -48,9 +50,14 @@ public abstract class BaseWrapperFragment<P extends MvpPresenter> extends Suppor
}
catch
(
java
.
lang
.
InstantiationException
e
)
{
e
.
printStackTrace
();
}
if
(
disposable
==
null
||
disposable
.
isDisposed
())
{
disposable
=
new
CompositeDisposable
();
}
mPresenter
.
attachView
(
this
);
mLoadingDialog
=
createLoadingDialog
();
ARouter
.
getInstance
().
inject
(
this
);
}
...
...
@@ -89,6 +96,9 @@ public abstract class BaseWrapperFragment<P extends MvpPresenter> extends Suppor
mLoadingDialog
=
null
;
mPresenter
.
detachView
();
mPresenter
=
null
;
if
(
disposable
!=
null
)
{
disposable
.
clear
();
}
}
...
...
RvWrapper/src/main/res/values/colors.xml
View file @
c809a4b8
...
...
@@ -36,6 +36,8 @@
<color
name=
"gray_50000000"
>
#50000000
</color>
<color
name=
"gray_EEEEEE"
>
#EEEEEE
</color>
<color
name=
"gray_ba242525"
>
#ba242525
</color>
<color
name=
"gray_f8f3c9"
>
#F8F3C9
</color>
<color
name=
"gray_30000000"
>
#30000000
</color>
<!--end-->
...
...
component_control/src/main/java/com/rv/component/control/WheelView.java
0 → 100644
View file @
c809a4b8
package
com
.
rv
.
component
.
control
;
import
android.content.Context
;
import
android.graphics.Canvas
;
import
android.graphics.Color
;
import
android.graphics.ColorFilter
;
import
android.graphics.Paint
;
import
android.graphics.PixelFormat
;
import
android.graphics.drawable.Drawable
;
import
android.util.AttributeSet
;
import
android.util.TypedValue
;
import
android.view.Gravity
;
import
android.view.MotionEvent
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.LinearLayout
;
import
android.widget.ScrollView
;
import
android.widget.TextView
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
WheelView
extends
ScrollView
{
public
static
final
String
TAG
=
WheelView
.
class
.
getSimpleName
();
public
static
class
OnWheelViewListener
{
public
void
onSelected
(
int
selectedIndex
,
String
item
)
{
}
}
private
Context
context
;
private
LinearLayout
views
;
public
WheelView
(
Context
context
)
{
super
(
context
);
init
(
context
);
}
public
WheelView
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
init
(
context
);
}
public
WheelView
(
Context
context
,
AttributeSet
attrs
,
int
defStyle
)
{
super
(
context
,
attrs
,
defStyle
);
init
(
context
);
}
List
<
String
>
items
;
private
List
<
String
>
getItems
()
{
return
items
;
}
public
void
setItems
(
List
<
String
>
list
)
{
if
(
null
==
items
)
{
items
=
new
ArrayList
<
String
>();
}
items
.
clear
();
items
.
addAll
(
list
);
// 前面和后面补全
for
(
int
i
=
0
;
i
<
offset
;
i
++)
{
items
.
add
(
0
,
""
);
items
.
add
(
""
);
}
initData
();
}
public
static
final
int
OFF_SET_DEFAULT
=
1
;
int
offset
=
OFF_SET_DEFAULT
;
// 偏移量(需要在最前面和最后面补全)
public
int
getOffset
()
{
return
offset
;
}
public
void
setOffset
(
int
offset
)
{
this
.
offset
=
offset
;
}
int
displayItemCount
;
// 每页显示的数量
int
selectedIndex
=
1
;
private
void
init
(
Context
context
)
{
this
.
context
=
context
;
this
.
setVerticalScrollBarEnabled
(
false
);
views
=
new
LinearLayout
(
context
);
views
.
setOrientation
(
LinearLayout
.
VERTICAL
);
this
.
addView
(
views
);
scrollerTask
=
new
Runnable
()
{
public
void
run
()
{
int
newY
=
getScrollY
();
if
(
initialY
-
newY
==
0
)
{
// stopped
final
int
remainder
=
initialY
%
itemHeight
;
final
int
divided
=
initialY
/
itemHeight
;
if
(
remainder
==
0
)
{
selectedIndex
=
divided
+
offset
;
onSeletedCallBack
();
}
else
{
if
(
remainder
>
itemHeight
/
2
)
{
WheelView
.
this
.
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
WheelView
.
this
.
smoothScrollTo
(
0
,
initialY
-
remainder
+
itemHeight
);
selectedIndex
=
divided
+
offset
+
1
;
onSeletedCallBack
();
}
});
}
else
{
WheelView
.
this
.
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
WheelView
.
this
.
smoothScrollTo
(
0
,
initialY
-
remainder
);
selectedIndex
=
divided
+
offset
;
onSeletedCallBack
();
}
});
}
}
}
else
{
initialY
=
getScrollY
();
WheelView
.
this
.
postDelayed
(
scrollerTask
,
newCheck
);
}
}
};
// 默认初始不滑动时执行一次回调
if
(
null
!=
onWheelViewListener
)
{
onWheelViewListener
.
onSelected
(
selectedIndex
,
items
.
get
(
selectedIndex
));
}
}
int
initialY
;
Runnable
scrollerTask
;
int
newCheck
=
50
;
public
void
startScrollerTask
()
{
initialY
=
getScrollY
();
this
.
postDelayed
(
scrollerTask
,
newCheck
);
}
private
void
initData
()
{
displayItemCount
=
offset
*
2
+
1
;
views
.
removeAllViews
();
for
(
String
item
:
items
)
{
views
.
addView
(
createView
(
item
));
}
refreshItemView
(
0
);
}
int
itemHeight
=
0
;
private
TextView
createView
(
String
item
)
{
TextView
tv
=
new
TextView
(
context
);
tv
.
setLayoutParams
(
new
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
));
tv
.
setSingleLine
(
true
);
tv
.
setTextSize
(
TypedValue
.
COMPLEX_UNIT_SP
,
16
);
tv
.
setText
(
item
);
tv
.
setGravity
(
Gravity
.
CENTER
);
int
padding
=
dip2px
(
12
);
tv
.
setPadding
(
padding
,
padding
,
padding
,
padding
);
if
(
0
==
itemHeight
)
{
itemHeight
=
getViewMeasuredHeight
(
tv
);
views
.
setLayoutParams
(
new
LayoutParams
(
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
,
itemHeight
*
displayItemCount
,
Gravity
.
CENTER_HORIZONTAL
));
views
.
setGravity
(
Gravity
.
CENTER
);
LinearLayout
.
LayoutParams
lp
=
(
LinearLayout
.
LayoutParams
)
this
.
getLayoutParams
();
this
.
setLayoutParams
(
new
LinearLayout
.
LayoutParams
(
lp
.
width
,
itemHeight
*
displayItemCount
));
}
return
tv
;
}
@Override
protected
void
onScrollChanged
(
int
l
,
int
t
,
int
oldl
,
int
oldt
)
{
super
.
onScrollChanged
(
l
,
t
,
oldl
,
oldt
);
refreshItemView
(
t
);
if
(
t
>
oldt
)
{
// Log.d(TAG, "向下滚动");
scrollDirection
=
SCROLL_DIRECTION_DOWN
;
}
else
{
// Log.d(TAG, "向上滚动");
scrollDirection
=
SCROLL_DIRECTION_UP
;
}
}
private
void
refreshItemView
(
int
y
)
{
int
position
=
y
/
itemHeight
+
offset
;
int
remainder
=
y
%
itemHeight
;
int
divided
=
y
/
itemHeight
;
if
(
remainder
==
0
)
{
position
=
divided
+
offset
;
}
else
{
if
(
remainder
>
itemHeight
/
2
)
{
position
=
divided
+
offset
+
1
;
}
}
int
childSize
=
views
.
getChildCount
();
for
(
int
i
=
0
;
i
<
childSize
;
i
++)
{
TextView
itemView
=
(
TextView
)
views
.
getChildAt
(
i
);
if
(
null
==
itemView
)
{
return
;
}
if
(
position
==
i
)
{
itemView
.
setTextColor
(
Color
.
parseColor
(
"#171413"
));
}
else
{
itemView
.
setTextColor
(
Color
.
parseColor
(
"#999999"
));
}
}
}
/**
* 获取选中区域的边界
*/
int
[]
selectedAreaBorder
;
private
int
[]
obtainSelectedAreaBorder
()
{
if
(
null
==
selectedAreaBorder
)
{
selectedAreaBorder
=
new
int
[
2
];
selectedAreaBorder
[
0
]
=
itemHeight
*
offset
;
selectedAreaBorder
[
1
]
=
itemHeight
*
(
offset
+
1
);
}
return
selectedAreaBorder
;
}
private
int
scrollDirection
=
-
1
;
private
static
final
int
SCROLL_DIRECTION_UP
=
0
;
private
static
final
int
SCROLL_DIRECTION_DOWN
=
1
;
Paint
paint
;
int
viewWidth
;
@Override
public
void
setBackgroundDrawable
(
Drawable
background
)
{
if
(
viewWidth
==
0
)
{
// viewWidth = ((Activity) context).getWindowManager().getDefaultDisplay().getWidth();
viewWidth
=
views
.
getWidth
();
}
if
(
null
==
paint
)
{
paint
=
new
Paint
();
paint
.
setColor
(
Color
.
parseColor
(
"#CCCCCC"
));
paint
.
setStrokeWidth
(
dip2px
(
1
f
));
}
background
=
new
Drawable
()
{
@Override
public
void
draw
(
Canvas
canvas
)
{
canvas
.
drawLine
(
viewWidth
*
1
/
6
,
obtainSelectedAreaBorder
()[
0
],
viewWidth
*
5
/
6
,
obtainSelectedAreaBorder
()[
0
],
paint
);
canvas
.
drawLine
(
viewWidth
*
1
/
6
,
obtainSelectedAreaBorder
()[
1
],
viewWidth
*
5
/
6
,
obtainSelectedAreaBorder
()[
1
],
paint
);
}
@Override
public
void
setAlpha
(
int
alpha
)
{
}
@Override
public
void
setColorFilter
(
ColorFilter
cf
)
{
}
@Override
public
int
getOpacity
()
{
return
PixelFormat
.
UNKNOWN
;
}
};
super
.
setBackgroundDrawable
(
background
);
}
@Override
protected
void
onSizeChanged
(
int
w
,
int
h
,
int
oldw
,
int
oldh
)
{
super
.
onSizeChanged
(
w
,
h
,
oldw
,
oldh
);
viewWidth
=
w
;
setBackgroundDrawable
(
null
);
}
/**
* 选中回调
*/
private
void
onSeletedCallBack
()
{
if
(
null
!=
onWheelViewListener
)
{
onWheelViewListener
.
onSelected
(
selectedIndex
,
items
.
get
(
selectedIndex
));
}
}
public
void
setSeletion
(
int
position
)
{
final
int
p
=
position
;
selectedIndex
=
p
+
offset
;
this
.
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
WheelView
.
this
.
smoothScrollTo
(
0
,
p
*
itemHeight
);
}
});
}
public
String
getSeletedItem
()
{
return
items
.
get
(
selectedIndex
);
}
public
int
getSeletedIndex
()
{
return
selectedIndex
-
offset
;
}
@Override
public
void
fling
(
int
velocityY
)
{
super
.
fling
(
velocityY
/
3
);
}
@Override
public
boolean
onTouchEvent
(
MotionEvent
ev
)
{
if
(
ev
.
getAction
()
==
MotionEvent
.
ACTION_UP
)
{
startScrollerTask
();
}
return
super
.
onTouchEvent
(
ev
);
}
private
OnWheelViewListener
onWheelViewListener
;
public
OnWheelViewListener
getOnWheelViewListener
()
{
return
onWheelViewListener
;
}
public
void
setOnWheelViewListener
(
OnWheelViewListener
onWheelViewListener
)
{
this
.
onWheelViewListener
=
onWheelViewListener
;
// 默认初始不滑动时执行一次回调
onWheelViewListener
.
onSelected
(
selectedIndex
,
items
.
get
(
selectedIndex
));
}
private
int
dip2px
(
float
dpValue
)
{
final
float
scale
=
context
.
getResources
().
getDisplayMetrics
().
density
;
return
(
int
)
(
dpValue
*
scale
+
0.5f
);
}
private
int
getViewMeasuredHeight
(
View
view
)
{
int
width
=
View
.
MeasureSpec
.
makeMeasureSpec
(
0
,
View
.
MeasureSpec
.
UNSPECIFIED
);
int
expandSpec
=
View
.
MeasureSpec
.
makeMeasureSpec
(
Integer
.
MAX_VALUE
>>
2
,
View
.
MeasureSpec
.
AT_MOST
);
view
.
measure
(
width
,
expandSpec
);
return
view
.
getMeasuredHeight
();
}
}
component_utils/src/main/java/com/rv/component/utils/DateUtils.java
View file @
c809a4b8
...
...
@@ -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
*
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/login/LoginRvActivity.java
View file @
c809a4b8
...
...
@@ -91,9 +91,9 @@ public class LoginRvActivity extends BaseLoginActivity<CommonPresenter> {
private
void
initRxbus
()
{
RxBus
.
tObservable
(
LoginSuccessfulEvent
.
class
)
.
observeOn
(
Schedulers
.
newThread
())
.
subscribe
(
new
Consumer
<
LoginSuccessfulEvent
>(
)
{
.
subscribe
(
new
com
.
frame
.
base
.
bus
.
Observer
<
LoginSuccessfulEvent
>(
disposable
)
{
@Override
public
void
accept
(
LoginSuccessfulEvent
event
)
throws
Exception
{
public
void
onNext
(
LoginSuccessfulEvent
event
)
{
finish
();
}
});
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/CarRentalActivity.java
View file @
c809a4b8
...
...
@@ -306,7 +306,7 @@ public class CarRentalActivity extends BaseStatusActivity<CommonPresenter> {
// 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);
// } 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
){
...
...
@@ -314,7 +314,7 @@ public class CarRentalActivity extends BaseStatusActivity<CommonPresenter> {
// 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);
// } 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
){
if
(
mapGetTime
==
null
)
{
...
...
@@ -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));
}
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/CarRentalListActivity.java
View file @
c809a4b8
...
...
@@ -3,6 +3,7 @@ package com.rv.home.rv.module.ui.main.home;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.support.annotation.Nullable
;
import
android.support.v4.content.ContextCompat
;
import
android.support.v7.widget.GridLayoutManager
;
import
android.support.v7.widget.LinearLayoutManager
;
...
...
@@ -12,15 +13,19 @@ import android.widget.ImageView;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
com.alibaba.android.arouter.launcher.ARouter
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.frame.base.url.Constance
;
import
com.frame.rv.config.RvFrameConfig
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.rv.home.R
;
import
com.rv.home.R2
;
import
com.rv.home.rv.module.basic.BaseStatusActivity
;
import
com.ruiwenliu.wrapper.util.TimeManager
;
import
com.ruiwenliu.wrapper.util.ViewHolder
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
import
com.rv.component.utils.DateUtils
;
import
com.rv.home.R
;
import
com.rv.home.R2
;
import
com.rv.home.rv.module.ApiConfig
;
import
com.rv.home.rv.module.basic.BaseStatusActivity
;
import
com.rv.home.rv.module.basic.bean.MultiItemBean
;
import
com.rv.home.rv.module.basic.presenter.CommonPresenter
;
import
com.rv.home.rv.module.ui.main.home.adapter.AttributeListAdapter
;
...
...
@@ -31,12 +36,14 @@ import com.rv.home.rv.module.ui.main.home.bean.OrderDataBean;
import
com.rv.home.rv.module.ui.main.home.dialog.CarAttributePw
;
import
com.rv.home.rv.module.ui.main.home.dialog.SelectAttributeDialog
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.OnClick
;
/**
...
...
@@ -45,48 +52,41 @@ import butterknife.OnClick;
* Desc:租车列表
*/
public
class
CarRentalListActivity
extends
BaseStatusActivity
<
CommonPresenter
>
implements
BaseQuickAdapter
.
RequestLoadMoreListener
{
@BindView
(
R2
.
id
.
tv_brand
)
TextView
tvBrand
;
@BindView
(
R2
.
id
.
iv_brand
)
ImageView
ivBrand
;
@BindView
(
R2
.
id
.
tv_price
)
TextView
tvPrice
;
@BindView
(
R2
.
id
.
iv_price
)
ImageView
ivPrice
;
@BindView
(
R2
.
id
.
tv_seat
)
TextView
tvSeat
;
@BindView
(
R2
.
id
.
iv_seat
)
ImageView
ivSeat
;
@BindView
(
R2
.
id
.
tv_selected
)
TextView
tvSelected
;
@BindView
(
R2
.
id
.
iv_selected
)
ImageView
ivSelected
;
@BindView
(
R2
.
id
.
recyclerView
)
RecyclerView
recyclerView
;
@BindView
(
R2
.
id
.
ll_head_menu
)
LinearLayout
llHeadMenu
;
@BindView
(
R2
.
id
.
tv_get_date
)
TextView
tvGetDate
;
@BindView
(
R2
.
id
.
tv_out_date
)
TextView
tvOutDate
;
@BindView
(
R2
.
id
.
tv_get_address
)
TextView
tvGetAddress
;
@BindView
(
R2
.
id
.
tv_out_address
)
TextView
tvOutAddress
;
public
CarRentalListAdapter
mAdapter
;
private
int
countPage
;
private
int
mPage
;
private
double
mLat
;
private
double
mLon
;
private
double
outLongitude
;
private
double
outLatitude
;
private
boolean
mBool
;
private
int
selectType
;
private
CarAttributePw
mCarPw
;
private
CarAttributeListBean
attributeListBean
;
List
<
Integer
>
listScreeningId
;
//获取筛选的ID
private
OrderDataBean
dataBean
;
private
String
begDate
;
private
String
endDate
;
private
List
<
CarAttributeListBean
.
DataBean
.
CataBean
.
ChildrenBean
>
childrenBeanList1
;
private
List
<
CarAttributeListBean
.
DataBean
.
CataBean
.
ChildrenBean
>
childrenBeanList2
;
private
List
<
CarAttributeListBean
.
DataBean
.
CataBean
.
ChildrenBean
>
childrenBeanList3
;
public
static
Intent
getIntent
(
Context
context
,
double
lat
,
double
lon
,
boolean
bool
,
OrderDataBean
bean
,
String
startTime
,
String
endTime
)
{
public
static
Intent
getIntent
(
Context
context
,
double
lat
,
double
lon
,
double
outLatitude
,
double
outLongitude
,
boolean
bool
,
OrderDataBean
bean
,
String
startTime
,
String
endTime
)
{
return
new
Intent
(
context
,
CarRentalListActivity
.
class
)
.
putExtra
(
"lat"
,
lat
)
.
putExtra
(
"lon"
,
lon
)
.
putExtra
(
"outLatitude"
,
outLatitude
)
.
putExtra
(
"outLongitude"
,
outLongitude
)
.
putExtra
(
"bean"
,
bean
)
.
putExtra
(
"bool"
,
bool
)
.
putExtra
(
"startTime"
,
startTime
)
...
...
@@ -94,8 +94,6 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
}
;
@Override
protected
int
setLayout
()
{
return
R
.
layout
.
rv_act_car_rental_list
;
...
...
@@ -104,10 +102,14 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
@Override
protected
void
initView
(
Bundle
savedInstanceState
,
TitleView
titleView
,
Intent
intent
)
{
titleView
.
setTitle
(
mActivity
.
getString
(
R
.
string
.
rv_select_car
));
begDate
=
intent
.
getStringExtra
(
"startTime"
);
endDate
=
intent
.
getStringExtra
(
"endTime"
);
dataBean
=
(
OrderDataBean
)
intent
.
getSerializableExtra
(
"bean"
);
listScreeningId
=
new
ArrayList
<>();
mLat
=
intent
.
getDoubleExtra
(
"lat"
,
0
);
mLon
=
intent
.
getDoubleExtra
(
"lon"
,
0
);
outLatitude
=
intent
.
getDoubleExtra
(
"outLatitude"
,
0
);
outLongitude
=
intent
.
getDoubleExtra
(
"outLongitude"
,
0
);
mBool
=
intent
.
getBooleanExtra
(
"bool"
,
false
);
titleView
.
setImageResource
(
R
.
id
.
iv_title_right
,
R
.
drawable
.
rv_rentingcar_icon_plat
);
titleView
.
setChildClickListener
(
R
.
id
.
iv_title_right
,
new
View
.
OnClickListener
()
{
...
...
@@ -116,6 +118,12 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
startActivity
(
ShopShowActivity
.
getIntent
(
mActivity
,
0
,
0
));
}
});
tvGetDate
.
setText
(
"取"
+
DateUtils
.
formatDate66
(
begDate
));
tvOutDate
.
setText
(
"还"
+
DateUtils
.
formatDate66
(
endDate
));
tvGetAddress
.
setText
(
dataBean
.
getStartAddr
());
tvOutAddress
.
setText
(
dataBean
.
getEndAddr
());
mAdapter
=
new
CarRentalListAdapter
();
mAdapter
.
setOnLoadMoreListener
(
this
,
recyclerView
);
recyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
this
));
...
...
@@ -124,15 +132,15 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
@Override
public
void
onItemClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
CarTypeListBean
.
DataBeanX
.
DataBean
bean
=
mAdapter
.
getItem
(
position
);
if
(
dataBean
!=
null
)
{
dataBean
.
setModelId
(
bean
.
getVehicleModel
().
getId
());
dataBean
.
setStartCompanyId
(
bean
.
getCompany
().
getId
());
if
(
"1"
.
equals
(
bean
.
getHasVehicle
()))
{
if
(
dataBean
!=
null
)
{
dataBean
.
setModelId
(
bean
.
getVehicleModel
().
getId
());
dataBean
.
setStartCompanyId
(
bean
.
getCompany
().
getId
());
}
startActivity
(
CarDetailActivity
.
getIntent
(
mActivity
,
dataBean
,
bean
,
getIntent
().
getStringExtra
(
"startTime"
),
getIntent
().
getStringExtra
(
"endTime"
)));
}
startActivity
(
CarDetailActivity
.
getIntent
(
mActivity
,
dataBean
,
bean
,
getIntent
().
getStringExtra
(
"startTime"
),
getIntent
().
getStringExtra
(
"endTime"
)));
}
});
}
@Override
...
...
@@ -155,33 +163,7 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
}
private
void
initData
(
CarAttributeListBean
data
)
{
childrenBeanList1
=
new
ArrayList
<>();
childrenBeanList2
=
new
ArrayList
<>();
childrenBeanList3
=
new
ArrayList
<>();
if
(
data
!=
null
)
{
List
<
CarAttributeListBean
.
DataBean
.
CataBean
>
cata
=
data
.
getData
().
getCata
();
if
(
cata
!=
null
&&
cata
.
size
()
>
1
)
{
CarAttributeListBean
.
DataBean
.
CataBean
.
ChildrenBean
childrenBean1
=
new
CarAttributeListBean
.
DataBean
.
CataBean
.
ChildrenBean
();
childrenBean1
.
setName
(
"全部"
);
childrenBean1
.
setShow
(
true
);
childrenBeanList1
.
add
(
childrenBean1
);
childrenBeanList1
.
addAll
(
cata
.
get
(
0
).
getChildren
());
CarAttributeListBean
.
DataBean
.
CataBean
.
ChildrenBean
childrenBean2
=
new
CarAttributeListBean
.
DataBean
.
CataBean
.
ChildrenBean
();
childrenBean2
.
setName
(
"全部"
);
childrenBean2
.
setShow
(
true
);
childrenBeanList2
.
add
(
childrenBean2
);
childrenBeanList2
.
addAll
(
cata
.
get
(
1
).
getChildren
());
CarAttributeListBean
.
DataBean
.
CataBean
.
ChildrenBean
childrenBean3
=
new
CarAttributeListBean
.
DataBean
.
CataBean
.
ChildrenBean
();
childrenBean3
.
setName
(
"全部"
);
childrenBean3
.
setShow
(
true
);
childrenBeanList3
.
add
(
childrenBean3
);
childrenBeanList3
.
addAll
(
cata
.
get
(
2
).
getChildren
());
}
}
attributeListBean
=
data
;
initAttr
();
// .get(0).getChildren();
}
...
...
@@ -203,19 +185,28 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
super
.
onDestroy
();
}
@OnClick
({
R2
.
id
.
rl_brand
,
R2
.
id
.
rl_price
,
R2
.
id
.
rl_seat
,
R2
.
id
.
rl_selected
})
@OnClick
({
R2
.
id
.
ll_item_select_date
,
R2
.
id
.
ll_item_get_address
,
R2
.
id
.
ll_item_out_address
,
R2
.
id
.
ll_item_filter
})
public
void
onViewClicked
(
View
view
)
{
if
(
attributeListBean
==
null
)
{
return
;
}
if
(
view
.
getId
()
==
R
.
id
.
rl_brand
)
{
setMenuSelect
(
0
,
view
,
childrenBeanList1
,
tvBrand
.
getText
().
toString
().
trim
());
}
else
if
(
view
.
getId
()
==
R
.
id
.
rl_price
)
{
setMenuSelect
(
1
,
view
,
childrenBeanList2
,
tvPrice
.
getText
().
toString
().
trim
());
}
else
if
(
view
.
getId
()
==
R
.
id
.
rl_seat
)
{
setMenuSelect
(
2
,
view
,
childrenBeanList3
,
tvSeat
.
getText
().
toString
().
trim
());
}
else
if
(
view
.
getId
()
==
R
.
id
.
rl_selected
)
{
int
id
=
view
.
getId
();
if
(
id
==
R
.
id
.
ll_item_select_date
)
{
//选择时间
ARouter
.
getInstance
()
.
build
(
Constance
.
ACTIVITY_URL_CALENDAR
)
.
withString
(
"begDate"
,
begDate
)
.
withString
(
"endDate"
,
endDate
)
.
navigation
(
mActivity
,
109
);
}
else
if
(
id
==
R
.
id
.
ll_item_get_address
)
{
//取车地址
startActivityForResult
(
SelectLocationActivity
.
getIntent
(
mActivity
,
1
,
dataBean
.
getStartCityName
(),
mLat
,
mLon
,
""
,
1
),
110
);
}
else
if
(
id
==
R
.
id
.
ll_item_out_address
)
{
//还车地址
startActivityForResult
(
SelectLocationActivity
.
getIntent
(
mActivity
,
2
,
dataBean
.
getStartCityName
(),
outLatitude
,
outLongitude
,
""
,
1
),
110
);
}
else
if
(
id
==
R
.
id
.
ll_item_filter
)
{
if
(
attributeListBean
==
null
)
{
return
;
}
setMenuSelect
(
3
,
view
,
null
,
null
);
List
<
MultiItemBean
>
multiList
=
new
ArrayList
<>();
for
(
CarAttributeListBean
.
DataBean
.
CataBean
bean
:
attributeListBean
.
getData
().
getCata
())
{
...
...
@@ -252,8 +243,13 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
map
.
put
(
"limit"
,
10
);
map
.
put
(
"lat"
,
mLat
);
map
.
put
(
"lon"
,
mLon
);
map
.
put
(
"startDateTamp"
,
dataBean
.
getStartTime
());
map
.
put
(
"endDateTamp"
,
dataBean
.
getEndTime
());
try
{
map
.
put
(
"startDateTamp"
,
TimeManager
.
dateToStamp
(
begDate
));
map
.
put
(
"endDateTamp"
,
TimeManager
.
dateToStamp
(
endDate
));
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
mPresenter
.
getData
(
RvFrameConfig
.
VEHICLE_POST
,
1
,
ApiConfig
.
HTTP_URL_CAR_TYPE_LIST
,
CarTypeListBean
.
class
,
map
,
true
);
}
...
...
@@ -272,6 +268,7 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
return
stringBuilder
.
toString
().
substring
(
0
,
stringBuilder
.
toString
().
length
()
-
1
);
}
/**
* 刷新
*/
...
...
@@ -295,17 +292,6 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
}
}
/**
* 初始化筛选数据
*/
private
void
initAttr
()
{
if
(
attributeListBean
!=
null
&&
attributeListBean
.
getData
().
getCata
().
size
()
>
0
)
{
tvBrand
.
setText
(
attributeListBean
.
getData
().
getCata
().
get
(
0
).
getName
());
tvPrice
.
setText
(
attributeListBean
.
getData
().
getCata
().
get
(
1
).
getName
());
tvSeat
.
setText
(
attributeListBean
.
getData
().
getCata
().
get
(
2
).
getName
());
}
}
private
void
setMenuSelect
(
int
index
,
View
view
,
List
<
CarAttributeListBean
.
DataBean
.
CataBean
.
ChildrenBean
>
list
,
String
attrName
)
{
// if(mCarPw!=null && mCarPw.isShowing()){
...
...
@@ -345,17 +331,6 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
public
void
onItemClick
(
BaseQuickAdapter
adapter
,
View
views
,
int
position
)
{
// mCarPw.attributeAdapter.setSelectItem(position);
CarAttributeListBean
.
DataBean
.
CataBean
.
ChildrenBean
childrenBean
=
mCarPw
.
attributeAdapter
.
getItem
(
position
);
switch
(
type
)
{
case
0
:
tvBrand
.
setText
(
childrenBean
.
getName
());
break
;
case
1
:
tvPrice
.
setText
(
childrenBean
.
getName
());
break
;
case
2
:
tvSeat
.
setText
(
childrenBean
.
getName
());
break
;
}
if
(
listScreeningId
!=
null
&&
listScreeningId
.
indexOf
(
childrenBean
.
getId
())
==
-
1
)
{
listScreeningId
.
add
(
childrenBean
.
getId
());
}
...
...
@@ -386,7 +361,6 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
public
void
onClick
(
View
v
)
{
if
(
listScreeningId
!=
null
)
{
listScreeningId
.
clear
();
initAttr
();
adapter
.
resetData
();
}
...
...
@@ -398,7 +372,6 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
if
(
listScreeningId
!=
null
)
{
listScreeningId
.
clear
();
listScreeningId
=
adapter
.
getSelectId
(
listScreeningId
);
initAttr
();
onFresh
();
dismiss
();
}
...
...
@@ -426,4 +399,56 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
}
@Override
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
@Nullable
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
if
(
resultCode
==
200
&&
requestCode
==
109
)
{
begDate
=
data
.
getStringExtra
(
"begDate"
);
endDate
=
data
.
getStringExtra
(
"endDate"
);
tvGetDate
.
setText
(
"取"
+
DateUtils
.
formatDate66
(
begDate
));
tvOutDate
.
setText
(
"还"
+
DateUtils
.
formatDate66
(
endDate
));
onFresh
();
try
{
dataBean
.
setStartTime
(
TimeManager
.
dateToStamp
(
begDate
));
dataBean
.
setEndTime
(
TimeManager
.
dateToStamp
(
endDate
));
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
else
if
(
requestCode
==
110
&&
resultCode
==
RESULT_OK
)
{
double
lat
=
data
.
getDoubleExtra
(
"latitude"
,
0
);
double
lon
=
data
.
getDoubleExtra
(
"longitude"
,
0
);
int
type
=
data
.
getIntExtra
(
"type"
,
1
);
String
requestData
=
data
.
getStringExtra
(
"location"
);
String
city
=
data
.
getStringExtra
(
"city"
);
int
cityId
=
data
.
getIntExtra
(
"cityId"
,
0
);
setRequestData
(
type
,
requestData
,
lat
,
lon
,
city
,
cityId
);
}
}
private
void
setRequestData
(
int
type
,
String
requestData
,
double
lat
,
double
lon
,
String
city
,
int
cityId
)
{
if
(
type
==
1
)
{
tvGetAddress
.
setText
(
requestData
);
dataBean
.
setStartAddr
(
requestData
);
dataBean
.
setStartCity
(
cityId
);
dataBean
.
setStartCityName
(
city
);
mLat
=
lat
;
mLon
=
lon
;
}
else
if
(
type
==
2
)
{
tvOutAddress
.
setText
(
requestData
);
dataBean
.
setEndAddr
(
requestData
);
dataBean
.
setEndCity
(
cityId
);
dataBean
.
setEndCityName
(
city
);
outLatitude
=
lat
;
outLongitude
=
lon
;
}
onFresh
();
}
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
// TODO: add setContentView(...) invocation
ButterKnife
.
bind
(
this
);
}
}
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/ConfirmOrderActivity.java
View file @
c809a4b8
...
...
@@ -22,10 +22,13 @@ import android.widget.Toast;
import
com.alibaba.android.arouter.launcher.ARouter
;
import
com.alibaba.fastjson.JSON
;
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.PaymentSuccessfulEvent
;
import
com.frame.base.bus.RxBus
;
import
com.frame.base.url.Constance
;
import
com.frame.base.view.StarBar
;
import
com.frame.rv.config.RvFrameConfig
;
import
com.ruiwenliu.wrapper.SPConstance
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
...
...
@@ -79,7 +82,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
@BindView
(
R2
.
id
.
tv_content
)
TextView
tvContent
;
@BindView
(
R2
.
id
.
rating_bar
)
Rating
Bar
ratingBar
;
Star
Bar
ratingBar
;
@BindView
(
R2
.
id
.
tv_price
)
TextView
tvPrice
;
@BindView
(
R2
.
id
.
tv_get_car_address
)
...
...
@@ -178,21 +181,21 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
@SuppressLint
(
"CheckResult"
)
private
void
initRxBus
()
{
RxBus
.
tObservable
(
PaymentSuccessfulEvent
.
class
)
.
observeOn
(
Schedulers
.
newThread
())
.
subscribe
(
new
Consumer
<
PaymentSuccessfulEvent
>(
)
{
.
subscribe
(
new
Observer
<
PaymentSuccessfulEvent
>(
disposable
)
{
@Override
public
void
accept
(
PaymentSuccessfulEvent
payEvent
)
throws
Exception
{
public
void
onNext
(
PaymentSuccessfulEvent
event
)
{
finish
();
}
});
RxBus
.
tObservable
(
PaymentFailedEvent
.
class
)
.
observeOn
(
Schedulers
.
newThread
())
.
subscribe
(
new
Consumer
<
PaymentFailedEvent
>(
)
{
.
subscribe
(
new
Observer
<
PaymentFailedEvent
>(
disposable
)
{
@Override
public
void
accept
(
PaymentFailedEvent
payEvent
)
throws
Exception
{
showToast
(
"333333"
);
public
void
onNext
(
PaymentFailedEvent
event
)
{
if
(
mActivity
.
getClass
().
equals
(
ConfirmOrderActivity
.
class
))
{
startActivity
(
OrderListActivity
.
getIntent
(
mActivity
,
0
));
finish
();
...
...
@@ -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
);
}
/**
* 初始化View
*/
...
...
@@ -436,7 +438,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
GlideManager
.
getInstance
(
mActivity
).
loadImage
(
mCarBean
.
getVehicleModel
().
getIcon
(),
ivGoods
);
tvName
.
setText
(
mCarBean
.
getVehicleModel
().
getName
());
tvContent
.
setText
(
mCarBean
.
getVehicleModel
().
getKeyword
());
ratingBar
.
set
Rating
((
float
)
mCarBean
.
getVehicleModel
().
getPoint
()
);
ratingBar
.
set
StarMark
((
float
)
mCarBean
.
getVehicleModel
().
getScore
()
/
10
);
tvPrice
.
setText
(
String
.
format
(
"%1$s%2$s"
,
mCarBean
.
getVehicleModel
().
getSum
(),
mActivity
.
getString
(
R
.
string
.
rv_day
)));
tvEventDate
.
setText
(
getIntent
().
getStringExtra
(
"startTime"
)
+
"~"
+
getIntent
().
getStringExtra
(
"endTime"
));
tvActivityDay
.
setText
(
String
.
format
(
"%1$s%2$s"
,
dataBean
.
getDayNum
(),
mActivity
.
getString
(
R
.
string
.
rv_days
)));
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/HomeFragment.java
View file @
c809a4b8
...
...
@@ -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,12 +257,15 @@ 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
);
hotType
=
"2"
;
tvHotRvtourHint
.
setTextColor
(
getResources
().
getColor
(
R
.
color
.
colorWrite
));
tvHotRvtour
.
setTextColor
(
getResources
().
getColor
(
R
.
color
.
colorWrite
));
tvHotRvtour
.
getPaint
().
setFakeBoldText
(
true
);
...
...
@@ -277,8 +281,6 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
}
});
mAdapter
=
new
HotCarTypeAdapter
();
recyclerViewContent
.
setLayoutManager
(
new
GridLayoutManager
(
getContext
(),
2
));
recyclerViewContent
.
addItemDecoration
(
new
AbSpacesItemDecoration
(
10
));
// 分割线。
...
...
@@ -508,7 +510,6 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
mRvTourAdapter
.
setNewData
(
hotData
);
mRvTourLabelAdapter
.
setNewData
(
hotData
);
}
...
...
@@ -572,15 +573,21 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
// 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);
// } 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
)
{
String
outCity
=
headTvOutCity
.
getText
().
toString
().
trim
();
// 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);
// } 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
)
{
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
));
...
...
@@ -695,7 +702,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
recommendGood
(
"3"
);
hotType
=
"3"
;
}
else
if
(
id
==
R
.
id
.
ll_item_hot_car_rental
)
{
//
优质车型
//
购房车
llItemHotRvtour
.
setSelected
(
false
);
llItemHotEntertainmentCamp
.
setSelected
(
false
);
llItemHotCarRental
.
setSelected
(
true
);
...
...
@@ -711,6 +718,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
tvHotCarRental
.
getPaint
().
setFakeBoldText
(
true
);
tvSeeMorePopular
.
setText
(
"更多优质车型"
);
recommendGood
(
"4"
);
hotType
=
"1"
;
}
else
if
(
id
==
R
.
id
.
tv_see_more_popular
)
{
//查看更多热门
...
...
@@ -776,11 +784,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 +968,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
));
}
...
...
@@ -983,7 +989,6 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
}
else
{
llItemTitle
.
setBackgroundColor
(
Color
.
argb
((
int
)
alpha
,
255
,
255
,
255
));
}
}
else
{
llItemTop
.
setVisibility
(
View
.
VISIBLE
);
llItemSearch
.
setBackground
(
getResources
().
getDrawable
(
R
.
drawable
.
shape_rv_textview_home_search
));
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/HomePageFragment.java
View file @
c809a4b8
...
...
@@ -321,7 +321,7 @@ public class HomePageFragment extends BaseFragment<CommonPresenter> {
// 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);
// } 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> {
// 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);
// } 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
)
{
...
...
@@ -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));
}
}
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/SelectLocationActivity.java
View file @
c809a4b8
...
...
@@ -3,6 +3,7 @@ package com.rv.home.rv.module.ui.main.home;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.support.annotation.Nullable
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.support.v7.widget.RecyclerView
;
import
android.text.Editable
;
...
...
@@ -14,8 +15,10 @@ import android.view.animation.TranslateAnimation;
import
android.widget.EditText
;
import
android.widget.FrameLayout
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
com.alibaba.android.arouter.launcher.ARouter
;
import
com.baidu.location.BDAbstractLocationListener
;
import
com.baidu.location.BDLocation
;
import
com.baidu.mapapi.map.BaiduMap
;
...
...
@@ -25,6 +28,7 @@ import com.baidu.mapapi.map.MapView;
import
com.baidu.mapapi.map.MyLocationData
;
import
com.baidu.mapapi.model.LatLng
;
import
com.baidu.mapapi.search.core.SearchResult
;
import
com.baidu.mapapi.search.geocode.GeoCodeOption
;
import
com.baidu.mapapi.search.geocode.GeoCodeResult
;
import
com.baidu.mapapi.search.geocode.GeoCoder
;
import
com.baidu.mapapi.search.geocode.OnGetGeoCoderResultListener
;
...
...
@@ -35,13 +39,13 @@ import com.baidu.mapapi.search.sug.SuggestionResult;
import
com.baidu.mapapi.search.sug.SuggestionSearch
;
import
com.baidu.mapapi.search.sug.SuggestionSearchOption
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.frame.base.url.Constance
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.util.LocationManager
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
import
com.rv.home.R
;
import
com.rv.home.R2
;
import
com.rv.home.rv.module.basic.BaseStatusActivity
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
import
com.rv.home.rv.module.basic.presenter.CommonPresenter
;
import
com.rv.home.rv.module.ui.main.home.adapter.SearchAdapter
;
import
com.rv.home.rv.module.ui.main.home.bean.SearchBean
;
...
...
@@ -50,6 +54,8 @@ import java.util.ArrayList;
import
java.util.List
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.OnClick
;
public
class
SelectLocationActivity
extends
BaseStatusActivity
<
CommonPresenter
>
implements
OnGetSuggestionResultListener
{
...
...
@@ -65,6 +71,10 @@ public class SelectLocationActivity extends BaseStatusActivity<CommonPresenter>
RecyclerView
mRecyclerView
;
@BindView
(
R2
.
id
.
fl_rv
)
FrameLayout
mFl
;
@BindView
(
R2
.
id
.
tv_city
)
TextView
tvCity
;
@BindView
(
R2
.
id
.
ll_item_car_city
)
LinearLayout
llItemCarCity
;
private
LocationManager
locationManager
;
BaiduMap
mBaiduMap
;
...
...
@@ -75,15 +85,20 @@ public class SelectLocationActivity extends BaseStatusActivity<CommonPresenter>
private
int
locationType
;
private
double
latLatitude
;
private
double
lonLongitude
;
private
String
nowCity
;
private
String
nowCity
;
private
String
mAddress
;
public
static
Intent
getIntent
(
Context
context
,
int
type
,
String
city
,
double
latitude
,
double
longitude
,
String
now_city
)
{
private
int
mCityId
;
// 头城市ID
private
int
isShowCity
;
private
GeoCoder
geoCoder
;
public
static
Intent
getIntent
(
Context
context
,
int
type
,
String
city
,
double
latitude
,
double
longitude
,
String
now_city
,
int
isShowCity
)
{
return
new
Intent
(
context
,
SelectLocationActivity
.
class
)
.
putExtra
(
"type"
,
type
)
.
putExtra
(
"city"
,
city
)
.
putExtra
(
"latitude"
,
latitude
)
.
putExtra
(
"longitude"
,
longitude
)
.
putExtra
(
"now_city"
,
now_city
);
.
putExtra
(
"now_city"
,
now_city
)
.
putExtra
(
"isShowCity"
,
isShowCity
);
}
@Override
...
...
@@ -95,12 +110,20 @@ public class SelectLocationActivity extends BaseStatusActivity<CommonPresenter>
protected
void
initView
(
Bundle
savedInstanceState
,
TitleView
titleView
,
Intent
intent
)
{
selectCity
=
intent
.
getStringExtra
(
"city"
);
locationType
=
intent
.
getIntExtra
(
"type"
,
1
);
latLatitude
=
intent
.
getDoubleExtra
(
"latitude"
,
0
);
lonLongitude
=
intent
.
getDoubleExtra
(
"longitude"
,
0
);
latLatitude
=
intent
.
getDoubleExtra
(
"latitude"
,
0
);
lonLongitude
=
intent
.
getDoubleExtra
(
"longitude"
,
0
);
nowCity
=
intent
.
getStringExtra
(
"now_city"
);
isShowCity
=
intent
.
getIntExtra
(
"isShowCity"
,
0
);
tvCity
.
setText
(
selectCity
);
if
(
0
==
isShowCity
)
{
llItemCarCity
.
setVisibility
(
View
.
GONE
);
}
else
{
llItemCarCity
.
setVisibility
(
View
.
VISIBLE
);
}
initTitle
(
titleView
);
initMap
();
intiView
();
initCity
();
}
@Override
...
...
@@ -130,7 +153,7 @@ public class SelectLocationActivity extends BaseStatusActivity<CommonPresenter>
@Override
public
void
onDestroy
()
{
// 退出时销毁定位
if
(
locationManager
!=
null
)
{
if
(
locationManager
!=
null
)
{
locationManager
.
onDestroy
();
}
// 退出时销毁定位
...
...
@@ -150,8 +173,9 @@ public class SelectLocationActivity extends BaseStatusActivity<CommonPresenter>
titleView
.
setChildClickListener
(
R
.
id
.
tv_title_right
,
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
if
(
TextUtils
.
isEmpty
(
mAddress
)&&
latLatitude
>
0
)
{
if
(
TextUtils
.
isEmpty
(
mAddress
)
&&
latLatitude
>
0
)
{
finish
();
return
;
}
if
(
TextUtils
.
isEmpty
(
mAddress
))
{
showToast
(
mActivity
.
getString
(
R
.
string
.
rv_select_address_toast
));
...
...
@@ -160,7 +184,9 @@ public class SelectLocationActivity extends BaseStatusActivity<CommonPresenter>
getIntent
().
putExtra
(
"location"
,
mAddress
);
getIntent
().
putExtra
(
"type"
,
locationType
);
getIntent
().
putExtra
(
"latitude"
,
latLatitude
);
getIntent
().
putExtra
(
"longitude"
,
lonLongitude
);
getIntent
().
putExtra
(
"longitude"
,
lonLongitude
);
getIntent
().
putExtra
(
"city"
,
selectCity
);
getIntent
().
putExtra
(
"cityId"
,
mCityId
);
setResult
(
RESULT_OK
,
getIntent
());
finish
();
...
...
@@ -181,9 +207,9 @@ public class SelectLocationActivity extends BaseStatusActivity<CommonPresenter>
mSuggestionSearch
.
setOnGetSuggestionResultListener
(
this
);
// 开启定位图层
mBaiduMap
.
setMyLocationEnabled
(
true
);
if
(
latLatitude
>
0
)
{
mBaiduMap
.
animateMapStatus
(
MapStatusUpdateFactory
.
newMapStatus
(
createMapStatusBuilder
(
new
LatLng
(
latLatitude
,
lonLongitude
)).
build
()));
}
else
{
if
(
latLatitude
>
0
)
{
mBaiduMap
.
animateMapStatus
(
MapStatusUpdateFactory
.
newMapStatus
(
createMapStatusBuilder
(
new
LatLng
(
latLatitude
,
lonLongitude
)).
build
()));
}
else
{
locationManager
=
new
LocationManager
(
this
,
new
BDAbstractLocationListener
()
{
@Override
public
void
onReceiveLocation
(
BDLocation
bdLocation
)
{
...
...
@@ -192,9 +218,9 @@ public class SelectLocationActivity extends BaseStatusActivity<CommonPresenter>
nowCity
=
bdLocation
.
getCity
();
}
tvContent
.
setVisibility
(
TextUtils
.
isEmpty
(
bdLocation
.
getAddrStr
())
?
View
.
GONE
:
View
.
VISIBLE
);
tvContent
.
setVisibility
(
TextUtils
.
isEmpty
(
bdLocation
.
getAddrStr
())
?
View
.
GONE
:
View
.
VISIBLE
);
tvContent
.
setText
(
bdLocation
.
getAddrStr
());
mAddress
=
bdLocation
.
getAddrStr
();
mAddress
=
bdLocation
.
getAddrStr
();
locationManager
.
stopLocation
();
// locationManager.onDestroy();
}
...
...
@@ -214,7 +240,7 @@ public class SelectLocationActivity extends BaseStatusActivity<CommonPresenter>
searchAdapter
=
new
SearchAdapter
();
mRecyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
this
));
mRecyclerView
.
setAdapter
(
searchAdapter
);
/* 当输入关键字变化时,动态更新建议列表 */
/* 当输入关键字变化时,动态更新建议列表 */
etContent
.
addTextChangedListener
(
new
TextWatcher
()
{
@Override
public
void
afterTextChanged
(
Editable
arg0
)
{
...
...
@@ -292,8 +318,8 @@ public class SelectLocationActivity extends BaseStatusActivity<CommonPresenter>
MapStatus
.
Builder
builder
=
new
MapStatus
.
Builder
();
builder
.
target
(
ll
).
zoom
(
18.0f
);
mBaiduMap
.
animateMapStatus
(
MapStatusUpdateFactory
.
newMapStatus
(
builder
.
build
()));
if
(!
selectCity
.
equals
(
nowCity
))
{
setSearchContent
(
selectCity
,
selectCity
.
equals
(
"北京"
)?
"故宫"
:
selectCity
);
if
(!
selectCity
.
equals
(
nowCity
))
{
setSearchContent
(
selectCity
,
selectCity
.
equals
(
"北京"
)
?
"故宫"
:
selectCity
);
return
;
}
}
...
...
@@ -306,11 +332,10 @@ public class SelectLocationActivity extends BaseStatusActivity<CommonPresenter>
// 反地理编码查询结果回调函数
@Override
public
void
onGetReverseGeoCodeResult
(
ReverseGeoCodeResult
result
)
{
if
(
result
==
null
||
result
.
error
!=
SearchResult
.
ERRORNO
.
NO_ERROR
)
{
if
(
result
==
null
||
result
.
error
!=
SearchResult
.
ERRORNO
.
NO_ERROR
)
{
// 没有检测到结果
}
mAddress
=
result
.
getSematicDescription
();
mAddress
=
result
.
getSematicDescription
();
tvContent
.
setText
(
result
.
getSematicDescription
());
//这里的addressText就是我们要的地址
// Log.i("info===",""+result.getAddress()+"=="+result.getBusinessCircle()+"=="+result.getSematicDescription()+"=="+result.toString());
}
...
...
@@ -347,8 +372,8 @@ public class SelectLocationActivity extends BaseStatusActivity<CommonPresenter>
@Override
public
void
onMapStatusChangeFinish
(
MapStatus
mapStatus
)
{
tvContent
.
setVisibility
(
View
.
VISIBLE
);
latLatitude
=
mapStatus
.
bound
.
getCenter
().
latitude
;
lonLongitude
=
mapStatus
.
bound
.
getCenter
().
longitude
;
latLatitude
=
mapStatus
.
bound
.
getCenter
().
latitude
;
lonLongitude
=
mapStatus
.
bound
.
getCenter
().
longitude
;
geoCoder
.
reverseGeoCode
(
new
ReverseGeoCodeOption
().
location
(
mapStatus
.
bound
.
getCenter
()));
}
});
...
...
@@ -359,11 +384,11 @@ public class SelectLocationActivity extends BaseStatusActivity<CommonPresenter>
* 动画平移
*/
public
void
Translate
()
{
/*
* TranslateAnimation translateAni = new TranslateAnimation(fromXType,
* fromXValue, toXType, toXValue, fromYType, fromYValue, toYType,
* toYValue);
*/
/*
* TranslateAnimation translateAni = new TranslateAnimation(fromXType,
* fromXValue, toXType, toXValue, fromYType, fromYValue, toYType,
* toYValue);
*/
//参数1~2:x轴的开始位置
//参数3~4:y轴的开始位置
//参数5~6:x轴的结束位置
...
...
@@ -402,7 +427,7 @@ public class SelectLocationActivity extends BaseStatusActivity<CommonPresenter>
* 设置搜索内容
*/
private
void
setSearchContent
(
String
city
,
String
content
)
{
/* 使用建议搜索服务获取建议列表,结果在onSuggestionResult()中更新 */
/* 使用建议搜索服务获取建议列表,结果在onSuggestionResult()中更新 */
mSuggestionSearch
.
requestSuggestion
((
new
SuggestionSearchOption
())
.
keyword
(
content
)
.
city
(
city
));
...
...
@@ -414,8 +439,8 @@ public class SelectLocationActivity extends BaseStatusActivity<CommonPresenter>
return
;
}
if
(
isFirstLoc
==
false
&&
!
nowCity
.
equals
(
selectCity
))
{
isFirstLoc
=
true
;
if
(
isFirstLoc
==
false
&&
!
nowCity
.
equals
(
selectCity
))
{
isFirstLoc
=
true
;
mBaiduMap
.
animateMapStatus
(
MapStatusUpdateFactory
.
newMapStatus
(
createMapStatusBuilder
(
suggestionResult
.
getAllSuggestions
().
get
(
0
).
pt
).
build
()));
return
;
}
...
...
@@ -433,4 +458,71 @@ public class SelectLocationActivity extends BaseStatusActivity<CommonPresenter>
mFl
.
setVisibility
(
View
.
VISIBLE
);
searchAdapter
.
setNewData
(
suggest
);
}
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
// TODO: add setContentView(...) invocation
ButterKnife
.
bind
(
this
);
}
@OnClick
({
R2
.
id
.
ll_item_car_city
})
public
void
onViewClicked
(
View
view
)
{
int
id
=
view
.
getId
();
if
(
id
==
R
.
id
.
ll_item_car_city
)
{
ARouter
.
getInstance
()
.
build
(
Constance
.
ACTIVITY_URL_CITYLIST
)
.
withInt
(
"mCityType"
,
1
)
.
withString
(
"mNowCity"
,
tvCity
.
getText
().
toString
())
.
withInt
(
"mCityId"
,
mCityId
)
.
navigation
(
mActivity
,
113
);
}
}
@Override
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
@Nullable
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
if
(
requestCode
==
113
&&
resultCode
==
RESULT_OK
)
{
int
type
=
data
.
getIntExtra
(
"type"
,
1
);
selectCity
=
data
.
getStringExtra
(
"location"
);
if
(
type
==
1
)
{
tvCity
.
setText
(
data
.
getStringExtra
(
"location"
));
mCityId
=
data
.
getIntExtra
(
"id"
,
0
);
latLatitude
=
0.0
;
lonLongitude
=
0.0
;
geoCoder
.
geocode
(
new
GeoCodeOption
()
.
city
(
selectCity
)
.
address
(
selectCity
));
}
}
}
private
void
initCity
()
{
geoCoder
=
GeoCoder
.
newInstance
();
geoCoder
.
setOnGetGeoCodeResultListener
(
new
OnGetGeoCoderResultListener
()
{
@Override
public
void
onGetGeoCodeResult
(
GeoCodeResult
result
)
{
if
(
result
==
null
||
result
.
error
!=
SearchResult
.
ERRORNO
.
NO_ERROR
)
{
//没有检索到结果
}
else
{
latLatitude
=
result
.
getLocation
().
latitude
;
lonLongitude
=
result
.
getLocation
().
longitude
;
mBaiduMap
.
animateMapStatus
(
MapStatusUpdateFactory
.
newMapStatus
(
createMapStatusBuilder
(
new
LatLng
(
latLatitude
,
lonLongitude
)).
build
()));
}
//获取地理编码结果
}
@Override
public
void
onGetReverseGeoCodeResult
(
ReverseGeoCodeResult
result
)
{
if
(
result
==
null
||
result
.
error
!=
SearchResult
.
ERRORNO
.
NO_ERROR
)
{
//没有找到检索结果
}
else
{
latLatitude
=
result
.
getLocation
().
latitude
;
lonLongitude
=
result
.
getLocation
().
longitude
;
}
}
});
}
}
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/adapter/CarRentalListAdapter.java
View file @
c809a4b8
package
com
.
rv
.
home
.
rv
.
module
.
ui
.
main
.
home
.
adapter
;
import
android.view.View
;
import
android.widget.ImageView
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.frame.base.view.StarBar
;
import
com.ruiwenliu.wrapper.util.BaseGlideHolder
;
import
com.rv.home.R
;
import
com.rv.home.R2
;
...
...
@@ -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.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
)));
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
());
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
)));
}
}
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/bean/CarTypeListBean.java
View file @
c809a4b8
...
...
@@ -114,6 +114,7 @@ public class CarTypeListBean extends BaseBean implements Serializable {
private
double
distance
;
private
VehicleModelBean
vehicleModel
;
private
CompanyBean
company
;
private
String
hasVehicle
;
//1--有车,0--没车
public
double
getDistance
()
{
return
distance
;
...
...
@@ -139,6 +140,14 @@ public class CarTypeListBean extends BaseBean implements Serializable {
this
.
company
=
company
;
}
public
String
getHasVehicle
()
{
return
hasVehicle
;
}
public
void
setHasVehicle
(
String
hasVehicle
)
{
this
.
hasVehicle
=
hasVehicle
;
}
public
static
class
VehicleModelBean
implements
Serializable
{
/**
* id : 25
...
...
@@ -160,6 +169,7 @@ public class CarTypeListBean extends BaseBean implements Serializable {
private
double
price
;
private
String
rentDiscountPrice
;
//租车优惠价格
private
int
rentDiscountStatus
;
//租车优惠状态 0–没有优惠;1–会员折扣;2–固定值
private
int
score
;
public
double
getSum
()
{
BeanUserInfo
.
UserInfo
info
=
null
;
...
...
@@ -293,6 +303,14 @@ public class CarTypeListBean extends BaseBean implements Serializable {
public
void
setRentDiscountStatus
(
int
rentDiscountStatus
)
{
this
.
rentDiscountStatus
=
rentDiscountStatus
;
}
public
int
getScore
()
{
return
score
;
}
public
void
setScore
(
int
score
)
{
this
.
score
=
score
;
}
}
public
static
class
CompanyBean
implements
Serializable
{
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/order/ForPaymentFragment.java
View file @
c809a4b8
...
...
@@ -12,6 +12,7 @@ import com.alibaba.android.arouter.launcher.ARouter;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.entity.MultiItemEntity
;
import
com.frame.base.bus.CancelOrderEvent
;
import
com.frame.base.bus.Observer
;
import
com.frame.base.bus.PaymentFailedEvent
;
import
com.frame.base.bus.PaymentSuccessfulEvent
;
import
com.frame.base.bus.RxBus
;
...
...
@@ -27,6 +28,7 @@ import com.rv.home.R;
import
com.rv.home.R2
;
import
com.rv.home.rv.module.ApiConfig
;
import
com.rv.home.rv.module.basic.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.OrderPayBean
;
import
com.rv.home.rv.module.ui.main.home.order.adapter.ForPaymentAdapter
;
...
...
@@ -125,11 +127,12 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements
@SuppressLint
(
"CheckResult"
)
private
void
initRxBus
()
{
RxBus
.
tObservable
(
CancelOrderEvent
.
class
)
.
observeOn
(
Schedulers
.
newThread
())
.
subscribe
(
new
Consumer
<
CancelOrderEvent
>(
)
{
.
subscribe
(
new
Observer
<
CancelOrderEvent
>(
disposable
)
{
@Override
public
void
accept
(
CancelOrderEvent
event
)
throws
Exception
{
public
void
onNext
(
CancelOrderEvent
event
)
{
onRefresh
();
}
});
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/order/OrderDetailActivity.java
View file @
c809a4b8
...
...
@@ -18,6 +18,7 @@ import android.widget.TextView;
import
com.alibaba.android.arouter.launcher.ARouter
;
import
com.frame.base.bus.CancelOrderEvent
;
import
com.frame.base.bus.Observer
;
import
com.frame.base.bus.RxBus
;
import
com.frame.rv.config.RvFrameConfig
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
...
...
@@ -184,11 +185,12 @@ public class OrderDetailActivity extends BaseStatusActivity<PickerPresenter> {
@SuppressLint
(
"CheckResult"
)
private
void
initRxBus
()
{
RxBus
.
tObservable
(
CancelOrderEvent
.
class
)
.
observeOn
(
Schedulers
.
newThread
())
.
subscribe
(
new
Consumer
<
CancelOrderEvent
>(
)
{
.
subscribe
(
new
Observer
<
CancelOrderEvent
>(
disposable
)
{
@Override
public
void
accept
(
CancelOrderEvent
event
)
throws
Exception
{
public
void
onNext
(
CancelOrderEvent
event
)
{
finish
();
}
});
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/order/ToTravelFragment.java
View file @
c809a4b8
...
...
@@ -10,6 +10,7 @@ import android.view.View;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.entity.MultiItemEntity
;
import
com.frame.base.bus.CancelOrderEvent
;
import
com.frame.base.bus.Observer
;
import
com.frame.base.bus.RxBus
;
import
com.frame.rv.config.RvFrameConfig
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
...
...
@@ -105,9 +106,9 @@ public class ToTravelFragment extends BaseFragment<CommonPresenter> implements B
private
void
initRxBus
()
{
RxBus
.
tObservable
(
CancelOrderEvent
.
class
)
.
observeOn
(
Schedulers
.
newThread
())
.
subscribe
(
new
Consumer
<
CancelOrderEvent
>(
)
{
.
subscribe
(
new
Observer
<
CancelOrderEvent
>(
disposable
)
{
@Override
public
void
accept
(
CancelOrderEvent
event
)
throws
Exception
{
public
void
onNext
(
CancelOrderEvent
event
)
{
onRefresh
();
}
});
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/order/TravelOrderDetailsActivity.java
View file @
c809a4b8
...
...
@@ -17,6 +17,7 @@ import android.widget.LinearLayout;
import
android.widget.TextView
;
import
com.frame.base.bus.CancelOrderEvent
;
import
com.frame.base.bus.Observer
;
import
com.frame.base.bus.RxBus
;
import
com.frame.rv.config.RvFrameConfig
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
...
...
@@ -184,9 +185,9 @@ public class TravelOrderDetailsActivity extends BaseStatusActivity<PickerPresent
private
void
initRxBus
()
{
RxBus
.
tObservable
(
CancelOrderEvent
.
class
)
.
observeOn
(
Schedulers
.
newThread
())
.
subscribe
(
new
Consumer
<
CancelOrderEvent
>(
)
{
.
subscribe
(
new
Observer
<
CancelOrderEvent
>(
disposable
)
{
@Override
public
void
accept
(
CancelOrderEvent
event
)
throws
Exception
{
public
void
onNext
(
CancelOrderEvent
event
)
{
finish
();
}
});
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/order/adapter/CompletedAdapter.java
View file @
c809a4b8
...
...
@@ -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_order_state
,
mContext
.
getString
(
R
.
string
.
rv_order_completed
));
helper
.
loadRoundImage
(
mContext
,
dataBean
.
get
Picture
(),
(
ImageView
)
helper
.
getView
(
R
.
id
.
iv_goods
),
10
);
helper
.
loadRoundImage
(
mContext
,
dataBean
.
get
Icon
(),
(
ImageView
)
helper
.
getView
(
R
.
id
.
iv_goods
),
10
);
helper
.
setText
(
R
.
id
.
tv_car_type
,
dataBean
.
getName
());
if
(
dataBean
.
getOrderRentVehicleDetail
()
!=
null
)
{
helper
.
setText
(
R
.
id
.
tv_get_time
,
TimeManager
.
stampToDate
(
String
.
valueOf
(
dataBean
.
getOrderRentVehicleDetail
().
getStart_time
())));
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/order/adapter/ForPaymentAdapter.java
View file @
c809a4b8
...
...
@@ -54,6 +54,8 @@ public class ForPaymentAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity
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
.
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
());
if
(
dataBean
.
getOrderRentVehicleDetail
()
!=
null
)
{
helper
.
setText
(
R
.
id
.
tv_get_time
,
TimeManager
.
stampToDate
(
String
.
valueOf
(
dataBean
.
getOrderRentVehicleDetail
().
getStart_time
())));
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/order/adapter/HaveToTravelAdapter.java
View file @
c809a4b8
...
...
@@ -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_order_state
,
mContext
.
getString
(
R
.
string
.
rv_order_have_travel
));
helper
.
loadRoundImage
(
mContext
,
dataBean
.
get
Picture
(),
(
ImageView
)
helper
.
getView
(
R
.
id
.
iv_goods
),
10
);
helper
.
loadRoundImage
(
mContext
,
dataBean
.
get
Icon
(),
(
ImageView
)
helper
.
getView
(
R
.
id
.
iv_goods
),
10
);
helper
.
setText
(
R
.
id
.
tv_car_type
,
dataBean
.
getName
());
if
(
dataBean
.
getOrderRentVehicleDetail
()
!=
null
)
{
helper
.
setText
(
R
.
id
.
tv_get_time
,
TimeManager
.
stampToDate
(
String
.
valueOf
(
dataBean
.
getOrderRentVehicleDetail
().
getStart_time
())));
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/order/adapter/OrderListAdapter.java
View file @
c809a4b8
...
...
@@ -45,7 +45,7 @@ public class OrderListAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity,
if
(
dataBean
.
getOrderRentVehicleDetail
()
!=
null
&&
dataBean
.
getOrderRentVehicleDetail
().
getStart_city_name
()
!=
null
)
{
helper
.
setText
(
R
.
id
.
tv_city
,
dataBean
.
getOrderRentVehicleDetail
().
getStart_city_name
());
}
helper
.
loadRoundImage
(
mContext
,
dataBean
.
get
Picture
(),
(
ImageView
)
helper
.
getView
(
R
.
id
.
iv_goods
),
10
);
helper
.
loadRoundImage
(
mContext
,
dataBean
.
get
Icon
(),
(
ImageView
)
helper
.
getView
(
R
.
id
.
iv_goods
),
10
);
helper
.
setText
(
R
.
id
.
tv_car_type
,
dataBean
.
getName
());
if
(
dataBean
.
getOrderRentVehicleDetail
()
!=
null
)
{
helper
.
setText
(
R
.
id
.
tv_get_time
,
TimeManager
.
stampToDate
(
String
.
valueOf
(
dataBean
.
getOrderRentVehicleDetail
().
getStart_time
())));
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/order/adapter/ToTravelAdapter.java
View file @
c809a4b8
...
...
@@ -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_order_state
,
mContext
.
getString
(
R
.
string
.
rv_order_to_travel
));
helper
.
loadRoundImage
(
mContext
,
dataBean
.
get
Picture
(),
(
ImageView
)
helper
.
getView
(
R
.
id
.
iv_goods
),
10
);
helper
.
loadRoundImage
(
mContext
,
dataBean
.
get
Icon
(),
(
ImageView
)
helper
.
getView
(
R
.
id
.
iv_goods
),
10
);
helper
.
setText
(
R
.
id
.
tv_car_type
,
dataBean
.
getName
());
if
(
dataBean
.
getOrderRentVehicleDetail
()
!=
null
)
{
helper
.
setText
(
R
.
id
.
tv_get_time
,
TimeManager
.
stampToDate
(
String
.
valueOf
(
dataBean
.
getOrderRentVehicleDetail
().
getStart_time
())));
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/order/bean/OrderListBean.java
View file @
c809a4b8
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.google.gson.annotations.SerializedName
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
...
...
@@ -210,6 +211,20 @@ public class OrderListBean extends BaseBean {
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
)
{
this
.
picture
=
picture
;
}
...
...
module_home/src/main/res/drawable-xhdpi/icon_home_item_car_rental_sold_out.png
0 → 100644
View file @
c809a4b8
43.6 KB
module_home/src/main/res/layout/fragment_home.xml
View file @
c809a4b8
...
...
@@ -605,7 +605,7 @@
android:id=
"@+id/tv_hot_car_rental"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"
优质车型
"
android:text=
"
购房车
"
android:textColor=
"@color/textGray"
android:textSize=
"@dimen/text_14"
/>
...
...
module_home/src/main/res/layout/rv_act_car_rental_list.xml
View file @
c809a4b8
...
...
@@ -5,117 +5,175 @@
android:layout_height=
"match_parent"
android:orientation=
"vertical"
tools:context=
".rv.module.ui.main.home.CarRentalListActivity"
>
<LinearLayout
android:orientation=
"horizontal"
android:layout_width=
"match_parent"
android:id=
"@+id/ll_head_menu"
android:layout_height=
"wrap_content"
>
<RelativeLayout
android:id=
"@+id/rl_brand"
android:layout_weight=
"1"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/size_50"
>
<TextView
android:layout_centerInParent=
"true"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"@dimen/text_14"
android:maxLength=
"4"
android:id=
"@+id/tv_brand"
android:textColor=
"@color/textMain"
android:text=
"@string/rv_car_type_brand"
/>
<ImageView
android:padding=
"@dimen/size_5"
android:layout_toRightOf=
"@id/tv_brand"
android:layout_centerInParent=
"true"
android:id=
"@+id/iv_brand"
android:src=
"@drawable/selector_rv_selected"
android:layout_width=
"@dimen/size_25"
android:layout_height=
"@dimen/size_25"
/>
</RelativeLayout>
<RelativeLayout
android:id=
"@+id/rl_price"
android:layout_weight=
"1"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/size_50"
>
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<LinearLayout
android:id=
"@+id/ll_item_select_date"
android:layout_width=
"0dp"
android:layout_height=
"@dimen/size_50"
android:layout_weight=
"2"
android:paddingLeft=
"@dimen/size_2"
android:paddingRight=
"@dimen/size_2"
android:gravity=
"center"
android:orientation=
"vertical"
>
<TextView
android:
layout_centerInParent=
"tru
e"
android:
id=
"@+id/tv_get_dat
e"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"@dimen/text_14"
android:id=
"@+id/tv_price"
android:textColor=
"@color/textMain"
android:text=
"@string/rv_car_type_price"
android:maxLength=
"4"
/>
<ImageView
android:padding=
"@dimen/size_5"
android:layout_toRightOf=
"@id/tv_price"
android:layout_centerInParent=
"true"
android:id=
"@+id/iv_price"
android:src=
"@drawable/selector_rv_selected"
android:layout_width=
"@dimen/size_25"
android:layout_height=
"@dimen/size_25"
/>
</RelativeLayout>
<RelativeLayout
android:id=
"@+id/rl_seat"
android:layout_weight=
"1"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/size_50"
>
android:text=
"取07/06 11:30"
android:textColor=
"@color/colorMain"
android:textSize=
"@dimen/text_10"
/>
<TextView
android:
layout_centerInParent=
"tru
e"
android:
id=
"@+id/tv_out_dat
e"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"@dimen/text_14"
android:id=
"@+id/tv_seat"
android:textColor=
"@color/textMain"
android:text=
"@string/rv_car_type_seat"
/>
android:text=
"还07/06 11:30"
android:textColor=
"@color/colorMain"
android:textSize=
"@dimen/text_10"
/>
</LinearLayout>
<View
android:layout_width=
"@dimen/size_1"
android:layout_height=
"match_parent"
android:layout_marginTop=
"@dimen/size_10"
android:layout_marginBottom=
"@dimen/size_10"
android:background=
"@color/colorLine"
/>
<LinearLayout
android:id=
"@+id/ll_item_get_address"
android:layout_width=
"0dp"
android:layout_height=
"@dimen/size_50"
android:layout_weight=
"2.5"
android:gravity=
"center"
android:paddingLeft=
"@dimen/size_2"
android:paddingRight=
"@dimen/size_2"
android:orientation=
"horizontal"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"取车地址"
android:textColor=
"@color/text_Gray"
android:textSize=
"@dimen/text_10"
/>
<TextView
android:id=
"@+id/tv_get_address"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:maxEms=
"8"
android:singleLine=
"true"
android:ellipsize=
"end"
android:textColor=
"@color/colorMain"
android:textSize=
"@dimen/text_10"
/>
</LinearLayout>
<ImageView
android:padding=
"@dimen/size_5"
android:layout_toRightOf=
"@id/tv_seat"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/common_icon_rig_black"
/>
</LinearLayout>
<View
android:layout_width=
"@dimen/size_1"
android:layout_height=
"match_parent"
android:layout_marginTop=
"@dimen/size_10"
android:layout_marginBottom=
"@dimen/size_10"
android:background=
"@color/colorLine"
/>
<LinearLayout
android:id=
"@+id/ll_item_out_address"
android:layout_width=
"0dp"
android:layout_height=
"@dimen/size_50"
android:layout_weight=
"2.5"
android:paddingLeft=
"@dimen/size_2"
android:paddingRight=
"@dimen/size_2"
android:gravity=
"center"
android:orientation=
"horizontal"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"还车地址"
android:textColor=
"@color/text_Gray"
android:textSize=
"@dimen/text_10"
/>
<TextView
android:id=
"@+id/tv_out_address"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:maxEms=
"8"
android:singleLine=
"true"
android:ellipsize=
"end"
android:textColor=
"@color/colorMain"
android:textSize=
"@dimen/text_10"
/>
</LinearLayout>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/common_icon_rig_black"
/>
</LinearLayout>
<View
android:layout_width=
"@dimen/size_1"
android:layout_height=
"match_parent"
android:layout_marginTop=
"@dimen/size_10"
android:layout_marginBottom=
"@dimen/size_10"
android:background=
"@color/colorLine"
/>
<LinearLayout
android:id=
"@+id/ll_item_filter"
android:layout_width=
"0dp"
android:layout_height=
"@dimen/size_50"
android:layout_weight=
"1"
android:paddingLeft=
"@dimen/size_2"
android:paddingRight=
"@dimen/size_2"
android:gravity=
"center"
android:orientation=
"vertical"
>
<ImageView
android:layout_width=
"@dimen/size_22"
android:layout_height=
"@dimen/size_22"
android:layout_centerInParent=
"true"
android:adjustViewBounds=
"true"
android:maxLength=
"4"
android:id=
"@+id/iv_seat"
android:src=
"@drawable/selector_rv_selected"
android:layout_width=
"@dimen/size_25"
android:layout_height=
"@dimen/size_25"
/>
</RelativeLayout>
<RelativeLayout
android:id=
"@+id/rl_selected"
android:layout_weight=
"1"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/size_50"
>
android:padding=
"@dimen/size_5"
android:src=
"@drawable/rv_rentingcar_icon_screen"
/>
<TextView
android:layout_centerInParent=
"true"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"@dimen/text_14"
android:id=
"@+id/tv_selected"
android:textColor=
"@color/textMain"
android:text=
"@string/rv_car_type_selected"
/>
<ImageView
android:padding=
"@dimen/size_5"
android:layout_toRightOf=
"@id/tv_selected"
android:layout_centerInParent=
"true"
android:id=
"@+id/iv_selected"
android:maxLength=
"4"
android:adjustViewBounds=
"true"
android:src=
"@drawable/rv_rentingcar_icon_screen"
android:layout_width=
"@dimen/size_22"
android:layout_height=
"@dimen/size_22"
/>
</RelativeLayout>
android:text=
"@string/rv_car_type_selected"
android:textColor=
"@color/colorMain"
android:textSize=
"@dimen/text_10"
/>
</LinearLayout>
</LinearLayout>
<View
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/size_half"
android:background=
"@color/colorLine"
/>
android:background=
"@color/colorLine"
/>
<android.support.v7.widget.RecyclerView
android:layout_width=
"match_parent"
android:id=
"@+id/recyclerView"
android:layout_height=
"match_parent"
/>
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
</LinearLayout>
module_home/src/main/res/layout/rv_act_confim_order.xml
View file @
c809a4b8
...
...
@@ -61,15 +61,16 @@
android:textColor=
"@color/textGray"
android:textSize=
"@dimen/text_12"
/>
<
Rating
Bar
<
com.frame.base.view.Star
Bar
android:id=
"@+id/rating_bar"
style=
"@style/fiveRatingBar"
android:layout_width=
"wrap_content"
android:layout_height=
"@dimen/size_16"
android:layout_below=
"@id/tv_context"
android:layout_marginTop=
"@dimen/size_5"
android:numStars=
"5"
android:rating=
"4.5"
/>
android:layout_height=
"wrap_content"
app:starEmpty=
"@drawable/rv_vehicle_icon_star_gray"
app:starFill=
"@drawable/rv_vehicle_icon_star_light"
app:starDistance=
"3dp"
app:starCount=
"5"
app:isClick =
"true"
app:starSize=
"@dimen/size_12"
/>
<TextView
android:id=
"@+id/tv_price"
...
...
module_home/src/main/res/layout/rv_act_select_location.xml
View file @
c809a4b8
...
...
@@ -16,51 +16,84 @@
android:id=
"@+id/iv_logo"
android:layout_width=
"40dp"
android:layout_height=
"45dp"
android:layout_marginBottom=
"@dimen/size_15"
android:layout_centerInParent=
"true"
android:layout_marginBottom=
"@dimen/size_15"
android:src=
"@drawable/rv_rentingcar_icon_stop_lever"
/>
<TextView
android:id=
"@+id/tv_content"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/size_60"
android:paddingLeft=
"@dimen/size_15"
android:paddingRight=
"@dimen/size_15"
android:visibility=
"gone"
android:layout_alignParentBottom=
"true"
android:
textSize=
"@dimen/text_18
"
android:
background=
"@color/colorWrite
"
android:gravity=
"center"
android:textColor=
"@color/textMain"
android:background=
"@color/colorWrite"
/>
<FrameLayout
android:paddingLeft=
"@dimen/size_15"
android:paddingRight=
"@dimen/size_15"
android:paddingTop=
"@dimen/size_8"
android:paddingBottom=
"@dimen/size_8"
android:textColor=
"@color/textMain"
android:textSize=
"@dimen/text_18"
android:visibility=
"gone"
/>
<FrameLayout
android:id=
"@+id/fl_search"
android:background=
"@color/colorWrite"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<EditText
android:background=
"@drawable/shape_rv_circly_line"
android:layout_height=
"wrap_content"
android:background=
"@color/colorWrite"
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:paddingLeft=
"@dimen/size_15"
android:textSize=
"@dimen/text_14"
android:drawablePadding=
"@dimen/size_15"
android:id=
"@+id/et_search"
android:drawableLeft=
"@drawable/search"
android:textColor=
"@color/textMain"
android:layout_height=
"@dimen/size_40"
android:hint=
"@string/rv_select_address_hint"
/>
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
>
<LinearLayout
android:id=
"@+id/ll_item_car_city"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
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
android:visibility=
"gone"
android:id=
"@+id/fl_rv"
android:layout_below=
"@id/fl_search"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<include
layout=
"@layout/common_rv"
/>
android:layout_height=
"match_parent"
android:layout_below=
"@id/fl_search"
android:visibility=
"gone"
>
<include
layout=
"@layout/common_rv"
/>
</FrameLayout>
...
...
module_home/src/main/res/layout/rv_item_car_rental_list.xml
View file @
c809a4b8
<?xml version="1.0" encoding="utf-8"?>
<
Fram
eLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
Relativ
eLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
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
android:padding=
"@dimen/size_15"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/size_5"
android:layout_marginBottom=
"@dimen/size_5"
android:orientation=
"horizontal"
android:layout_width=
"match_parent"
android:background=
"@color/colorWrite"
android:layout_height=
"wrap_content"
>
android:orientation=
"horizontal"
android:padding=
"@dimen/size_15"
>
<ImageView
android:id=
"@+id/iv_goods"
android:layout_width=
"@dimen/size_120"
android:layout_height=
"@dimen/size_100"
android:id=
"@+id/iv_goods"
android:scaleType=
"centerCrop"
/>
android:scaleType=
"centerCrop"
/>
<RelativeLayout
android:layout_marginLeft=
"@dimen/size_5"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/size_5"
>
<TextView
android:id=
"@+id/tv_name"
android:layout_width=
"wrap_content"
android:
maxLines=
"1
"
android:
layout_height=
"wrap_content
"
android:ellipsize=
"end"
android:maxLines=
"1"
android:text=
""
android:id=
"@+id/tv_name"
android:textColor=
"@color/textMain"
android:layout_height=
"wrap_content"
android:textSize=
"@dimen/text_16"
/>
android:textSize=
"@dimen/text_16"
/>
<TextView
android:id=
"@+id/tv_address"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/tv_name"
android:layout_marginTop=
"@dimen/size_8"
android:layout_width=
"wrap_content"
android:maxLines=
"1"
android:ellipsize=
"end"
android:maxLines=
"1"
android:text=
""
android:id=
"@+id/tv_address"
android:textColor=
"@color/textGray"
android:layout_height=
"wrap_content"
android:textSize=
"@dimen/text_12"
/>
android:textSize=
"@dimen/text_12"
/>
<LinearLayout
android:layout_marginTop=
"@dimen/size_5"
android:orientation=
"horizontal"
android:id=
"@+id/ll_content"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/tv_address"
android:layout_marginTop=
"@dimen/size_5"
android:gravity=
"center_vertical"
android:
layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:
orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_context"
android:layout_width=
"match_parent"
android:
maxLines=
"1
"
android:
layout_height=
"wrap_content
"
android:layout_weight=
"1"
android:ellipsize=
"end"
android:maxLines=
"1"
android:text=
""
android:id=
"@+id/tv_context"
android:textColor=
"@color/textGray"
android:layout_height=
"wrap_content"
android:textSize=
"@dimen/text_12"
/>
android:textSize=
"@dimen/text_12"
/>
<TextView
android:
layout_marginLeft=
"@dimen/size_10
"
android:
id=
"@+id/tv_point
"
android:layout_width=
"wrap_content"
android:maxLines=
"1"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/size_10"
android:ellipsize=
"end"
android:maxLines=
"1"
android:text=
""
android:id=
"@+id/tv_point"
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:textSize=
"@dimen/text_12"
/>
<ImageView
android:layout_marginLeft=
"@dimen/size_5"
android:layout_width=
"@dimen/size_15"
android:layout_height=
"@dimen/size_15"
android:src=
"@drawable/rv_vehicle_icon_star_light"
/>
android:layout_marginLeft=
"@dimen/size_10"
ratingbar:starEmpty=
"@drawable/rv_vehicle_icon_star_gray"
ratingbar:starFill=
"@drawable/rv_vehicle_icon_star_light"
ratingbar:starDistance=
"3dp"
ratingbar:starCount=
"5"
ratingbar:isClick =
"true"
ratingbar:starSize=
"@dimen/size_12"
/>
<!--<RatingBar-->
<!--android:layout_marginTop="@dimen/size_5"-->
<!--android:layout_below="@id/tv_context"-->
<!--android:layout_width="wrap_content"-->
<!--style="@style/fiveRatingBar"-->
<!--android:numStars="5"-->
<!--android:id="@+id/rating_bar"-->
<!--android:rating="4.5"-->
<!--android:layout_height="@dimen/size_16"-->
<!--/>-->
<!--android:layout_marginTop="@dimen/size_5"-->
<!--android:layout_below="@id/tv_context"-->
<!--android:layout_width="wrap_content"-->
<!--style="@style/fiveRatingBar"-->
<!--android:numStars="5"-->
<!--android:id="@+id/rating_bar"-->
<!--android:rating="4.5"-->
<!--android:layout_height="@dimen/size_16"-->
<!--/>-->
</LinearLayout>
<LinearLayout
android:orientation=
"horizontal"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/ll_content"
android:layout_marginTop=
"@dimen/size_5"
android:gravity=
"center_vertical"
android:layout_width=
"match_parent"
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"
/>
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_price"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
""
android:textColor=
"@color/colorAuxiliaryRed"
android:textSize=
"@dimen/text_16"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/tv_km"
android:textColor=
"@color/textGray"
android:textSize=
"@dimen/text_10"
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>
<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>
</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>
module_home/src/main/res/values/strings.xml
View file @
c809a4b8
...
...
@@ -170,5 +170,6 @@
<string
name=
"rv_charge_details"
>
费用明细
</string>
<string
name=
"tv_boarding"
>
立即上车
</string>
<string
name=
"tv_cancelled"
>
已取消
</string>
<string
name=
"rv_collection_data_null"
>
您还没有收藏的信息哦
</string>
<!--=================================================房车结束========================================-->
</resources>
module_mine/build.gradle
View file @
c809a4b8
...
...
@@ -46,4 +46,5 @@ dependencies {
api
project
(
':plugin_version'
)
//动态权限申请库
implementation
'pub.devrel:easypermissions:1.3.0'
implementation
'com.alibaba:fastjson:1.2.21'
}
module_mine/src/main/java/com/rv/rvmine/MineFragment.java
View file @
c809a4b8
...
...
@@ -13,10 +13,13 @@ 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
;
import
com.frame.base.bus.LoginSuccessfulEvent
;
import
com.frame.base.bus.Observer
;
import
com.frame.base.bus.RxBus
;
import
com.frame.rv.config.RvFrameConfig
;
import
com.ruiwenliu.wrapper.SPConstance
;
...
...
@@ -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
)
RoundImageView
ivAvatar
;
...
...
@@ -158,20 +161,21 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simp
@SuppressLint
(
"CheckResult"
)
private
void
initRxBus
()
{
RxBus
.
tObservable
(
UserInfoEvent
.
class
)
.
observeOn
(
Schedulers
.
newThread
())
.
subscribe
(
new
Consumer
<
UserInfoEvent
>(
)
{
.
subscribe
(
new
Observer
<
UserInfoEvent
>(
disposable
)
{
@Override
public
void
accept
(
UserInfoEvent
info
)
throws
Exception
{
public
void
onNext
(
UserInfoEvent
info
)
{
getUserData
();
}
});
RxBus
.
tObservable
(
LoginSuccessfulEvent
.
class
)
.
observeOn
(
Schedulers
.
newThread
())
.
subscribe
(
new
Consumer
<
LoginSuccessfulEvent
>(
)
{
.
subscribe
(
new
Observer
<
LoginSuccessfulEvent
>(
disposable
)
{
@Override
public
void
accept
(
LoginSuccessfulEvent
event
)
throws
Exception
{
public
void
onNext
(
LoginSuccessfulEvent
event
)
{
getUserData
();
}
});
...
...
@@ -372,7 +376,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
);
...
...
@@ -396,7 +400,7 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simp
tvMembershipLevel
.
setText
(
"钻石会员特权"
);
ivMember
.
setImageResource
(
R
.
drawable
.
mycenter_icon_type_diamond_membership
);
}
tvMemberHint
.
setText
(
"免费用车"
+
info
.
getRentFreeDays
()
+
"天"
);
tvMemberHint
.
setText
(
"免费用车"
+
info
.
getRentFreeDays
()
+
"天"
);
}
}
...
...
module_mine/src/main/java/com/rv/rvmine/traveler/CollectionActivity.java
View file @
c809a4b8
...
...
@@ -130,7 +130,7 @@ public class CollectionActivity extends BaseStatusActivity<CommonPresenter> impl
private
void
processData
(
CollectionListBean
bean
)
{
if
(
mPage
==
1
)
{
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
;
}
...
...
module_mine/src/main/java/com/rv/rvmine/traveler/PersonalInformationActivity.java
View file @
c809a4b8
...
...
@@ -141,6 +141,8 @@ public class PersonalInformationActivity extends BaseStatusActivity<PickerPresen
RxBus
.
post
(
new
UserInfoEvent
());
finish
();
break
;
}
}
...
...
module_mine/src/main/java/com/rv/rvmine/view/DeletePopupWindow.java
View file @
c809a4b8
...
...
@@ -19,8 +19,7 @@ public class DeletePopupWindow extends PopupWindow {
public
DeletePopupWindow
(
final
Activity
context
,
OnClickListener
onClickListener
)
{
super
(
context
);
LayoutInflater
inflater
=
(
LayoutInflater
)
context
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
LayoutInflater
inflater
=
(
LayoutInflater
)
context
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
ViewGroup
menuView
=
(
ViewGroup
)
inflater
.
inflate
(
R
.
layout
.
popu_delete
,
null
);
menuView
.
findViewById
(
R
.
id
.
tv_delete
).
setOnClickListener
(
onClickListener
);
...
...
module_tourism/src/main/java/com/rv/tourism/other/TravelerConfirmOrderActivity.java
View file @
c809a4b8
...
...
@@ -22,6 +22,8 @@ import com.alibaba.android.arouter.launcher.ARouter;
import
com.base.utils.tools.java.DateUtil
;
import
com.base.utils.ui.datetime.selector.util.TextUtil
;
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.PaymentSuccessfulEvent
;
import
com.frame.base.bus.RxBus
;
...
...
@@ -194,20 +196,21 @@ public class TravelerConfirmOrderActivity extends BaseStatusActivity<TourismPres
@SuppressLint
(
"CheckResult"
)
private
void
initRxBus
()
{
RxBus
.
tObservable
(
PaymentSuccessfulEvent
.
class
)
.
observeOn
(
Schedulers
.
newThread
())
.
subscribe
(
new
Consumer
<
PaymentSuccessfulEvent
>(
)
{
.
subscribe
(
new
Observer
<
PaymentSuccessfulEvent
>(
disposable
)
{
@Override
public
void
accept
(
PaymentSuccessfulEvent
payEvent
)
throws
Exception
{
public
void
onNext
(
PaymentSuccessfulEvent
event
)
{
finish
();
}
});
RxBus
.
tObservable
(
PaymentFailedEvent
.
class
)
.
observeOn
(
Schedulers
.
newThread
())
.
subscribe
(
new
Consumer
<
PaymentFailedEvent
>(
)
{
.
subscribe
(
new
Observer
<
PaymentFailedEvent
>(
disposable
)
{
@Override
public
void
accept
(
PaymentFailedEvent
payEvent
)
throws
Exception
{
public
void
onNext
(
PaymentFailedEvent
event
)
{
if
(
mActivity
.
getClass
().
equals
(
TravelerConfirmOrderActivity
.
class
))
{
ARouter
.
getInstance
().
build
(
Constance
.
ACTIVITY_URL_ORDERLIST
).
navigation
();
finish
();
...
...
plugin_calendar/build.gradle
View file @
c809a4b8
...
...
@@ -40,5 +40,6 @@ dependencies {
api
project
(
':RvWrapper'
)
api
project
(
':component_resource'
)
api
project
(
':component_utils'
)
api
project
(
':component_control'
)
}
plugin_calendar/src/main/java/com/rv/plugin/calendar/CalendarActivity.java
View file @
c809a4b8
...
...
@@ -6,55 +6,53 @@ import android.graphics.Color;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
android.view.View
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
com.alibaba.android.arouter.facade.annotation.Autowired
;
import
com.alibaba.android.arouter.facade.annotation.Route
;
import
com.frame.base.url.Constance
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.base.BaseStatusActivity
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
import
com.rv.component.control.WheelView
;
import
com.rv.component.utils.DateUtils
;
import
com.rv.component.utils.MyUtils
;
import
com.rv.plugin.calendar.bean.DateInfo
;
import
com.rv.plugin.calendar.presenter.CalendarPresenter
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.OnClick
;
/**
* 日历
*/
@Route
(
path
=
Constance
.
ACTIVITY_URL_CALENDAR
)
public
class
CalendarActivity
extends
BaseStatusActivity
<
CalendarPresenter
>
{
@BindView
(
R2
.
id
.
v_calendarView
)
CalendarView2
vCalendarView
;
@BindView
(
R2
.
id
.
tv_calendar_inday
)
TextView
tvCalendarInday
;
@BindView
(
R2
.
id
.
tv_calendar_inweek
)
TextView
tvCalendarInweek
;
@BindView
(
R2
.
id
.
tv_calendar_intime
)
TextView
tvCalendarIntime
;
@BindView
(
R2
.
id
.
tv_calendar_night
)
TextView
tvCalendarNight
;
@BindView
(
R2
.
id
.
tv_calendar_outday
)
TextView
tvCalendarOutday
;
@BindView
(
R2
.
id
.
tv_calendar_outweek
)
TextView
tvCalendarOutweek
;
@BindView
(
R2
.
id
.
tv_calendar_outtime
)
TextView
tvCalendarOuttime
;
@BindView
(
R2
.
id
.
tv_calendar_sl_intime
)
TextView
tvCalendarSlIntime
;
@BindView
(
R2
.
id
.
ll_selecter_intime
)
LinearLayout
llSelecterIntime
;
@BindView
(
R2
.
id
.
ll_selecter_outday
)
LinearLayout
llSelecterOutday
;
@BindView
(
R2
.
id
.
tv_selecter_outday
)
TextView
tvSelecterOutday
;
@BindView
(
R2
.
id
.
tv_get_date
)
TextView
tvGetDate
;
@BindView
(
R2
.
id
.
tv_get_time
)
TextView
tvGetTime
;
@BindView
(
R2
.
id
.
tv_out_date
)
TextView
tvOutDate
;
@BindView
(
R2
.
id
.
tv_out_time
)
TextView
tvOutTime
;
@BindView
(
R2
.
id
.
wheelView_left
)
WheelView
wheelViewLeft
;
@BindView
(
R2
.
id
.
wheelView_right
)
WheelView
wheelViewRight
;
private
List
<
DateInfo
>
listCalendarDay
;
private
String
begDate
,
endDate
,
s_begDate
,
s_endDate
,
s_begTime
,
s_endTime
,
begDay
,
begTime
,
endDay
,
endTime
;
private
String
s_begDate
,
s_endDate
,
s_begTime
,
s_endTime
,
begDay
,
begTime
,
endDay
,
endTime
;
private
Context
context
;
/**
* 最大的日历期限
...
...
@@ -63,11 +61,17 @@ public class CalendarActivity extends BaseStatusActivity<CalendarPresenter> {
private
int
spanIndex
=
1
;
private
TimePopView
inTime
;
private
TimePopView2
outTime
;
private
ArrayList
<
String
>
timeList
=
new
ArrayList
<>();
@Autowired
()
String
begDate
;
@Autowired
()
String
endDate
;
@Autowired
()
int
begSelected
;
@Autowired
()
int
endSelected
;
public
static
Intent
getIntent
(
Context
context
)
{
return
new
Intent
(
context
,
CalendarActivity
.
class
);
...
...
@@ -77,12 +81,7 @@ public class CalendarActivity extends BaseStatusActivity<CalendarPresenter> {
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
ButterKnife
.
bind
(
this
);
// setMyTitle("选择日期");
// ibActivityTitleRight.setText("确定");
context
=
this
;
Intent
intent
=
this
.
getIntent
();
begDate
=
intent
.
getStringExtra
(
"begDate"
);
endDate
=
intent
.
getStringExtra
(
"endDate"
);
begDay
=
DateUtils
.
formatDate16
(
begDate
);
begTime
=
DateUtils
.
formatDate17
(
begDate
);
...
...
@@ -94,17 +93,10 @@ public class CalendarActivity extends BaseStatusActivity<CalendarPresenter> {
s_endTime
=
endTime
;
initTime
();
initView
();
tvCalendarInday
.
setText
(
begDay
);
tvCalendarInweek
.
setText
(
"周"
+
MyUtils
.
getWeek
(
begDay
));
tvCalendarIntime
.
setText
(
begTime
);
tvCalendarSlIntime
.
setText
(
begTime
);
tvCalendarNight
.
setText
(
String
.
valueOf
(
DateUtils
.
compareDateDay
(
endDay
,
begDay
)
+
1
));
tvCalendarOutday
.
setText
(
DateUtils
.
formatDate15
(
endDay
));
tvCalendarOutweek
.
setText
(
"周"
+
MyUtils
.
getWeek
(
endDay
));
tvCalendarOuttime
.
setText
(
endTime
);
tvSelecterOutday
.
setText
(
endTime
);
tvGetTime
.
setText
(
begTime
);
tvGetDate
.
setText
(
DateUtils
.
formatDate
(
s_begDate
)
+
"\t星期"
+
MyUtils
.
getWeek
(
s_begDate
));
tvOutTime
.
setText
(
endTime
);
tvOutDate
.
setText
(
DateUtils
.
formatDate
(
s_endDate
)
+
"\t星期"
+
MyUtils
.
getWeek
(
s_endDate
));
listCalendarDay
=
initDate
();
...
...
@@ -112,36 +104,19 @@ public class CalendarActivity extends BaseStatusActivity<CalendarPresenter> {
@Override
public
void
inClick
(
DateInfo
date
)
{
s_begDate
=
date
.
getDay
();
tvCalendarInday
.
setText
(
DateUtils
.
formatDate15
(
s_begDate
));
tvCalendarInweek
.
setText
(
"周"
+
MyUtils
.
getWeek
(
s_begDate
));
tvCalendarNight
.
setText
(
"0"
);
String
content
=
DateUtils
.
formatDate
(
s_begDate
)
+
"\t星期"
+
MyUtils
.
getWeek
(
s_begDate
);
tvGetDate
.
setText
(
content
);
s_endDate
=
date
.
getDay
();
tvCalendarOutday
.
setText
(
DateUtils
.
formatDate15
(
s_endDate
));
tvCalendarOutweek
.
setText
(
"周"
+
MyUtils
.
getWeek
(
s_endDate
));
s_endTime
=
DateUtils
.
formatDate19
(
s_begTime
);
tvCalendarOuttime
.
setText
(
s_endTime
);
tvSelecterOutday
.
setText
(
s_endTime
);
String
content2
=
DateUtils
.
formatDate
(
s_endDate
)
+
"\t星期"
+
MyUtils
.
getWeek
(
s_endDate
);
tvOutDate
.
setText
(
content2
);
}
@Override
public
void
outClick
(
DateInfo
date
)
{
s_endDate
=
date
.
getDay
();
tvCalendarOutday
.
setText
(
DateUtils
.
formatDate15
(
s_endDate
));
tvCalendarOutweek
.
setText
(
"周"
+
MyUtils
.
getWeek
(
s_endDate
));
tvCalendarNight
.
setText
(
String
.
valueOf
(
DateUtils
.
compareDateDay
(
s_endDate
,
s_begDate
)
+
1
));
//如果不是同一天 租和还时间是酒店默认的
if
(!
s_begDate
.
equals
(
s_endDate
))
{
// s_begTime = getSaveData(MyConstant.checkinTime);
tvCalendarIntime
.
setText
(
s_begTime
);
tvCalendarSlIntime
.
setText
(
s_begTime
);
// s_endTime = getSaveData(MyConstant.checkoutTime);
tvCalendarOuttime
.
setText
(
s_endTime
);
tvSelecterOutday
.
setText
(
s_endTime
);
}
String
content
=
DateUtils
.
formatDate
(
s_endDate
)
+
"\t星期"
+
MyUtils
.
getWeek
(
s_endDate
);
tvOutDate
.
setText
(
content
);
}
});
...
...
@@ -150,123 +125,82 @@ public class CalendarActivity extends BaseStatusActivity<CalendarPresenter> {
@Override
protected
int
setLayout
()
{
return
R
.
layout
.
activity_calendar
;
return
R
.
layout
.
activity_calendar
2
;
}
@Override
protected
void
initView
(
Bundle
savedInstanceState
,
TitleView
titleView
,
Intent
intent
)
{
titleView
.
setTitle
(
"选择日期"
);
titleView
.
setText
(
R
.
id
.
tv_title_right
,
"确定"
);
titleView
.
setChildClickListener
(
R
.
id
.
tv_title_right
,
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
if
(
TextUtils
.
isEmpty
(
s_begDate
)){
showToast
(
"请选择租车日期!"
);
return
;
}
if
(
TextUtils
.
isEmpty
(
s_endDate
)){
showToast
(
"请选择还车日期!"
);
return
;
}
if
(
TextUtils
.
isEmpty
(
s_begTime
)){
showToast
(
"请选择租车时间!"
);
return
;
}
if
(
TextUtils
.
isEmpty
(
s_endTime
)){
showToast
(
"请选择还车时间!"
);
return
;
}
Intent
intent
=
new
Intent
();
intent
.
putExtra
(
"begDate"
,
s_begDate
);
intent
.
putExtra
(
"endDate"
,
s_endDate
);
intent
.
putExtra
(
"begTime"
,
s_begTime
);
intent
.
putExtra
(
"endTime"
,
s_endTime
);
setResult
(
200
,
intent
);
finish
();
}
});
showTitle
(
false
);
}
private
void
initView
()
{
//租车时间
inTime
=
new
TimePopView
(
CalendarActivity
.
this
,
timeList
,
new
TimePopView
.
OnTimeSelectListener
()
{
@Override
public
void
onTimeSelect
(
String
date
)
{
s_begTime
=
date
;
tvCalendarIntime
.
setText
(
date
);
tvCalendarSlIntime
.
setText
(
date
);
//如果是同一天,离店时间小于入住时间
if
(
s_begDate
.
equals
(
s_endDate
)
&&
DateUtils
.
formatDate20
(
s_endTime
)
<=
DateUtils
.
formatDate20
(
date
))
{
s_endTime
=
DateUtils
.
formatDate19
(
s_begTime
);
tvCalendarOuttime
.
setText
(
s_endTime
);
tvSelecterOutday
.
setText
(
s_endTime
);
}
}
});
inTime
.
setCyclic
(
true
);
inTime
.
setCancelable
(
true
);
inTime
.
setTitle
(
"租车时间"
);
//还车时间
outTime
=
new
TimePopView2
(
CalendarActivity
.
this
,
timeList
,
new
TimePopView2
.
OnTimeSelectListener
()
{
wheelViewLeft
.
setOffset
(
1
);
// 对话框中当前项上面和下面的项数
wheelViewLeft
.
setItems
(
timeList
);
// 设置数据源
wheelViewLeft
.
setOnWheelViewListener
(
new
WheelView
.
OnWheelViewListener
()
{
@Override
public
void
onTimeSelect
(
String
date
)
{
//如果是同一天,离店时间小于入住时间
if
(
s_begDate
.
equals
(
s_endDate
)
&&
DateUtils
.
formatDate20
(
s_begTime
)
>=
DateUtils
.
formatDate20
(
date
))
{
return
;
}
s_endTime
=
date
;
tvCalendarOuttime
.
setText
(
date
);
tvSelecterOutday
.
setText
(
date
);
public
void
onSelected
(
int
selectedIndex
,
String
item
)
{
begSelected
=
selectedIndex
;
s_begTime
=
item
;
tvGetTime
.
setText
(
item
);
}
});
outTime
.
setCyclic
(
true
);
outTime
.
setCancelable
(
true
);
outTime
.
setTitle
(
"还车时间"
);
//租车时间选择
llSelecterIntime
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
wheelViewRight
.
setOffset
(
1
);
// 对话框中当前项上面和下面的项数
wheelViewRight
.
setItems
(
timeList
);
// 设置数据源
wheelViewRight
.
setOnWheelViewListener
(
new
WheelView
.
OnWheelViewListener
()
{
@Override
public
void
onClick
(
View
v
)
{
if
(
inTime
!=
null
)
{
for
(
int
i
=
0
;
i
<
timeList
.
size
();
i
++)
{
if
(
s_begTime
.
equals
(
timeList
.
get
(
i
)))
{
inTime
.
setCurrentItem
(
i
);
break
;
}
}
inTime
.
show
();
public
void
onSelected
(
int
selectedIndex
,
String
item
)
{
if
(
s_begDate
.
equals
(
s_endDate
)
&&
DateUtils
.
formatDate20
(
s_endTime
)
<=
DateUtils
.
formatDate20
(
s_begTime
))
{
s_endTime
=
DateUtils
.
formatDate19
(
s_begTime
);
wheelViewRight
.
setSeletion
(
begSelected
);
endSelected
=
begSelected
;
tvOutTime
.
setText
(
s_endTime
);
}
else
{
s_endTime
=
item
;
tvOutTime
.
setText
(
item
);
endSelected
=
selectedIndex
;
}
}
});
//还车时间选择
llSelecterOutday
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
if
(
outTime
!=
null
)
{
for
(
int
i
=
0
;
i
<
timeList
.
size
();
i
++)
{
if
(
s_endTime
.
equals
(
timeList
.
get
(
i
)))
{
outTime
.
setCurrentItem
(
i
);
break
;
}
}
outTime
.
show
();
if
(
timeList
!=
null
)
{
for
(
int
i
=
0
;
i
<
timeList
.
size
();
i
++)
{
if
(
timeList
.
get
(
i
).
equals
(
begTime
)){
wheelViewLeft
.
setSeletion
(
i
);
s_begTime
=
begTime
;
}
if
(
timeList
.
get
(
i
).
equals
(
endTime
)){
wheelViewRight
.
setSeletion
(
i
);
s_endTime
=
endTime
;
}
}
});
}
}
/**
* 初始化时间数据
*/
private
void
initTime
()
{
for
(
int
i
=
0
;
i
<
24
;
i
++)
{
;
timeList
.
add
(
String
.
format
(
"%02d"
,
i
)
+
":00"
);
timeList
.
add
(
String
.
format
(
"%02d"
,
i
)
+
":30"
);
@OnClick
({
R2
.
id
.
iv_close
,
R2
.
id
.
tv_ok
})
public
void
onViewClicked
(
View
view
)
{
int
id
=
view
.
getId
();
if
(
id
==
R
.
id
.
iv_close
){
finish
();
}
else
if
(
id
==
R
.
id
.
tv_ok
)
{
if
(
TextUtils
.
isEmpty
(
s_begDate
))
{
showToast
(
"请选择租车日期!"
);
return
;
}
if
(
TextUtils
.
isEmpty
(
s_endDate
))
{
showToast
(
"请选择还车日期!"
);
return
;
}
Intent
intent
=
new
Intent
();
intent
.
putExtra
(
"begDate"
,
s_begDate
+
" "
+
s_begTime
);
intent
.
putExtra
(
"endDate"
,
s_endDate
+
" "
+
s_endTime
);
setResult
(
200
,
intent
);
finish
();
}
}
...
...
@@ -347,7 +281,7 @@ public class CalendarActivity extends BaseStatusActivity<CalendarPresenter> {
}
// 公历
day
.
setDefTextColor
(
context
.
getResources
().
getColor
(
R
.
color
.
ri_mlv
));
day
.
setDefTextColor
(
context
.
getResources
().
getColor
(
R
.
color
.
gren_171413
));
// 周末字体颜色
if
((
j
+
firstWeek
)
%
7
==
0
||
(
j
+
firstWeek
-
1
)
%
7
==
0
)
{
day
.
setDefTextColor
(
context
.
getResources
().
getColor
(
R
.
color
.
ri_dhong
));
...
...
@@ -408,4 +342,15 @@ public class CalendarActivity extends BaseStatusActivity<CalendarPresenter> {
public
void
onShowResult
(
int
requestType
,
BaseBean
result
)
{
}
/**
* 初始化时间数据
*/
private
void
initTime
()
{
for
(
int
i
=
0
;
i
<
24
;
i
++)
{
timeList
.
add
(
String
.
format
(
"%02d"
,
i
)
+
":00"
);
timeList
.
add
(
String
.
format
(
"%02d"
,
i
)
+
":30"
);
}
}
}
plugin_calendar/src/main/java/com/rv/plugin/calendar/InertiaTimerTask.java
View file @
c809a4b8
...
...
@@ -7,9 +7,9 @@ final class InertiaTimerTask extends TimerTask
float
a
;
final
float
velocityY
;
final
WheelView
loopView
;
final
WheelView
3
loopView
;
InertiaTimerTask
(
WheelView
loopview
,
float
velocityY
)
InertiaTimerTask
(
WheelView
3
loopview
,
float
velocityY
)
{
super
();
loopView
=
loopview
;
...
...
plugin_calendar/src/main/java/com/rv/plugin/calendar/MessageHandler.java
View file @
c809a4b8
...
...
@@ -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
WheelView
3
loopview
;
MessageHandler
(
WheelView
loopview
)
{
MessageHandler
(
WheelView
3
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
(
WheelView
3
.
ACTION
.
FLING
);
break
;
case
WHAT_ITEM_SELECTED:
...
...
plugin_calendar/src/main/java/com/rv/plugin/calendar/OnItemSelectedRunnable.java
View file @
c809a4b8
package
com
.
rv
.
plugin
.
calendar
;
final
class
OnItemSelectedRunnable
implements
Runnable
{
final
WheelView
loopView
;
final
WheelView
3
loopView
;
OnItemSelectedRunnable
(
WheelView
loopview
)
{
OnItemSelectedRunnable
(
WheelView
3
loopview
)
{
loopView
=
loopview
;
}
...
...
plugin_calendar/src/main/java/com/rv/plugin/calendar/SmoothScrollTimerTask.java
View file @
c809a4b8
...
...
@@ -7,9 +7,9 @@ final class SmoothScrollTimerTask extends TimerTask {
int
realTotalOffset
;
int
realOffset
;
int
offset
;
final
WheelView
loopView
;
final
WheelView
3
loopView
;
SmoothScrollTimerTask
(
WheelView
loopview
,
int
offset
)
{
SmoothScrollTimerTask
(
WheelView
3
loopview
,
int
offset
)
{
this
.
loopView
=
loopview
;
this
.
offset
=
offset
;
realTotalOffset
=
Integer
.
MAX_VALUE
;
...
...
plugin_calendar/src/main/java/com/rv/plugin/calendar/WheelTime2.java
View file @
c809a4b8
...
...
@@ -10,7 +10,7 @@ import java.util.ArrayList;
public
class
WheelTime2
{
private
View
view
;
private
WheelView
wv_hours
;
private
WheelView
3
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
=
(
WheelView
3
)
view
.
findViewById
(
R
.
id
.
hour
);
wv_hours
.
setAdapter
(
new
ArrayWheelAdapter
(
timeList
,
timeList
.
size
()));
/*wv_hours.setCurrentItem(h);
time = timeList.get(h);*/
...
...
plugin_calendar/src/main/java/com/rv/plugin/calendar/WheelView.java
→
plugin_calendar/src/main/java/com/rv/plugin/calendar/WheelView
3
.java
View file @
c809a4b8
...
...
@@ -27,7 +27,7 @@ import java.util.concurrent.TimeUnit;
/**
* 3d滚轮控件
*/
public
class
WheelView
extends
View
public
class
WheelView
3
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
WheelView
3
(
Context
context
)
{
this
(
context
,
null
);
}
public
WheelView
(
Context
context
,
AttributeSet
attrs
)
public
WheelView
3
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
textColorOut
=
getResources
().
getColor
(
R
.
color
.
pickerview_wheelview_textcolor_out
);
...
...
plugin_calendar/src/main/java/com/rv/plugin/calendar/listener/LoopViewGestureListener.java
View file @
c809a4b8
...
...
@@ -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.WheelView
3
;
public
final
class
LoopViewGestureListener
extends
android
.
view
.
GestureDetector
.
SimpleOnGestureListener
{
final
WheelView
loopView
;
final
WheelView
3
loopView
;
public
LoopViewGestureListener
(
WheelView
loopview
)
{
public
LoopViewGestureListener
(
WheelView
3
loopview
)
{
loopView
=
loopview
;
}
...
...
plugin_calendar/src/main/res/drawable-xhdpi/common_icon_calendar_left.png
0 → 100644
View file @
c809a4b8
232 Bytes
plugin_calendar/src/main/res/drawable-xhdpi/common_icon_calendar_righe.png
0 → 100644
View file @
c809a4b8
233 Bytes
plugin_calendar/src/main/res/drawable/shape_calender_selectbg.xml
View file @
c809a4b8
<?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
plugin_calendar/src/main/res/layout/activity_calendar2.xml
0 → 100644
View file @
c809a4b8
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/size_150"
android:background=
"@color/gray_FFB74B"
android:orientation=
"vertical"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<ImageView
android:id=
"@+id/iv_close"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:paddingLeft=
"@dimen/size_15"
android:paddingTop=
"@dimen/size_20"
android:paddingRight=
"@dimen/size_15"
android:paddingBottom=
"@dimen/size_10"
android:src=
"@drawable/common_icon_close_white"
/>
</RelativeLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_marginLeft=
"@dimen/size_15"
android:layout_marginRight=
"@dimen/size_15"
android:layout_weight=
"1"
android:orientation=
"horizontal"
>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"取车时间"
android:textColor=
"@color/gray_f8f3c9"
android:textSize=
"@dimen/text_12"
/>
<TextView
android:id=
"@+id/tv_get_date"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/size_5"
android:text=
"07-10 星期三"
android:textColor=
"@color/colorWrite"
android:textSize=
"@dimen/text_16"
/>
<TextView
android:id=
"@+id/tv_get_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/size_5"
android:text=
"上午10:00"
android:textColor=
"@color/colorWrite"
android:textSize=
"@dimen/text_14"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"还车时间"
android:textColor=
"@color/gray_f8f3c9"
android:textSize=
"@dimen/text_12"
/>
<TextView
android:id=
"@+id/tv_out_date"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/size_5"
android:text=
"07-10 星期三"
android:textColor=
"@color/colorWrite"
android:textSize=
"@dimen/text_16"
/>
<TextView
android:id=
"@+id/tv_out_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/size_5"
android:text=
"上午10:00"
android:textColor=
"@color/colorWrite"
android:textSize=
"@dimen/text_14"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:paddingBottom=
"@dimen/size_5"
android:paddingTop=
"@dimen/size_5"
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/gray_f8f3c9"
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/gray_f8f3c9"
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/gray_f8f3c9"
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/gray_f8f3c9"
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/gray_f8f3c9"
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/gray_f8f3c9"
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/gray_f8f3c9"
android:textSize=
"@dimen/text_12"
/>
</LinearLayout>
</LinearLayout>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/size_15"
android:background=
"@color/colorWrite"
android:paddingTop=
"@dimen/size_5"
android:paddingBottom=
"@dimen/size_5"
android:text=
"日期选择"
android:textColor=
"@color/colorMain"
android:textSize=
"@dimen/text_16"
/>
<com.rv.plugin.calendar.CalendarView2
android:id=
"@+id/v_calendarView"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/size_15"
android:background=
"@color/gray_f5f5f5"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/size_220"
android:background=
"@color/colorWrite"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/size_15"
android:layout_marginTop=
"@dimen/size_15"
android:text=
"时刻选择"
android:textColor=
"@color/colorMain"
android:textSize=
"@dimen/text_16"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
android:gravity=
"center"
android:orientation=
"horizontal"
>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:gravity=
"center"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:ems=
"1"
android:text=
"取车时刻"
android:textSize=
"@dimen/text_12"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/size_10"
android:src=
"@drawable/common_icon_calendar_righe"
/>
<com.rv.component.control.WheelView
android:id=
"@+id/wheelView_left"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
></com.rv.component.control.WheelView>
</LinearLayout>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:gravity=
"center"
android:orientation=
"horizontal"
>
<com.rv.component.control.WheelView
android:id=
"@+id/wheelView_right"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
></com.rv.component.control.WheelView>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/common_icon_calendar_left"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/size_10"
android:ems=
"1"
android:text=
"还车时刻"
android:textSize=
"@dimen/text_12"
/>
</LinearLayout>
</LinearLayout>
<TextView
android:id=
"@+id/tv_ok"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/size_50"
android:background=
"@color/gray_FFB74B"
android:gravity=
"center"
android:text=
"确定"
android:textColor=
"@color/colorWrite"
android:textSize=
"@dimen/text_16"
/>
</LinearLayout>
</LinearLayout>
plugin_calendar/src/main/res/layout/item_calendar_header.xml
View file @
c809a4b8
...
...
@@ -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
plugin_calendar/src/main/res/layout/popview_time2.xml
View file @
c809a4b8
...
...
@@ -16,7 +16,7 @@
android:background=
"@android:color/white"
android:orientation=
"horizontal"
>
<com.rv.plugin.calendar.WheelView
<com.rv.plugin.calendar.WheelView
3
android:id=
"@+id/hour"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
...
...
plugin_calendar/src/main/res/values/colors.xml
View file @
c809a4b8
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment