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
f5c734e3
Commit
f5c734e3
authored
Jul 02, 2019
by
linfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
租车确认订单和bug修复
parent
77b9eeef
Changes
27
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
1730 additions
and
47 deletions
+1730
-47
OkGoUtil.java
OkGo/src/main/java/com/yuyife/okgo/OkGoUtil.java
+3
-1
RvFrameConfig.java
RvFrame/src/main/java/com/frame/rv/config/RvFrameConfig.java
+1
-0
RvFrameConstant.java
...me/src/main/java/com/frame/rv/config/RvFrameConstant.java
+1
-0
TravelFragmentMain.java
.../main/java/com/rv/travel/fragment/TravelFragmentMain.java
+0
-2
SPConstance.java
...pper/src/main/java/com/ruiwenliu/wrapper/SPConstance.java
+1
-0
RxRequestResult.java
...main/java/com/ruiwenliu/wrapper/http/RxRequestResult.java
+2
-0
.gitignore
component_control/.gitignore
+1
-0
build.gradle
component_control/build.gradle
+33
-0
proguard-rules.pro
component_control/proguard-rules.pro
+21
-0
AndroidManifest.xml
component_control/src/main/AndroidManifest.xml
+2
-0
SwitchButton.java
.../src/main/java/com/rv/component/control/SwitchButton.java
+1175
-0
strings.xml
component_control/src/main/res/values/strings.xml
+3
-0
switch_button_attrs.xml
...onent_control/src/main/res/values/switch_button_attrs.xml
+23
-0
common_icon_more_details_up.png
...c/main/res/drawable-xhdpi/common_icon_more_details_up.png
+0
-0
common_icon_rig_gray.png
...urce/src/main/res/drawable-xhdpi/common_icon_rig_gray.png
+0
-0
shape_rv_bg_shallow_yellow_small_circle.xml
.../res/drawable/shape_rv_bg_shallow_yellow_small_circle.xml
+5
-0
KeyboardUtil.java
...ls/src/main/java/com/rv/component/utils/KeyboardUtil.java
+1
-1
CampFragment.java
module_camp/src/main/java/com/rv/camp/CampFragment.java
+74
-2
BaseLoginActivity.java
...n/java/com/rv/home/rv/module/basic/BaseLoginActivity.java
+38
-24
WebActivity.java
...rc/main/java/com/rv/home/rv/module/basic/WebActivity.java
+14
-3
BeanUserInfo.java
...n/java/com/rv/home/rv/module/basic/bean/BeanUserInfo.java
+272
-0
TourismFragment.java
...tourism/src/main/java/com/rv/tourism/TourismFragment.java
+47
-8
TravelDetailsActivity.java
...main/java/com/rv/tourism/other/TravelDetailsActivity.java
+6
-3
build.gradle
plugin_search/build.gradle
+1
-0
TravelSearchActivity.java
...rch/src/main/java/com/rv/search/TravelSearchActivity.java
+2
-2
activity_travel_search.xml
plugin_search/src/main/res/layout/activity_travel_search.xml
+3
-0
settings.gradle
settings.gradle
+1
-1
No files found.
OkGo/src/main/java/com/yuyife/okgo/OkGoUtil.java
View file @
f5c734e3
...
...
@@ -42,6 +42,8 @@ public class OkGoUtil {
//把Token保存到SP文件中的Key
final
private
static
String
SP_KEY_TOKEN
=
"sp_key_token"
;
final
private
static
String
SP_KEY_USERINFO
=
"userinfo"
;
//保存Token
public
static
void
setToken
(
String
token
)
{
if
(
application
==
null
)
return
;
...
...
@@ -72,7 +74,7 @@ public class OkGoUtil {
}
@SuppressLint
(
"StaticFieldLeak"
)
p
rivate
static
Context
application
=
null
;
p
ublic
static
Context
application
=
null
;
private
static
boolean
addToken
=
false
;
public
static
void
initOkGo
(
Application
app
,
boolean
addToken
)
{
...
...
RvFrame/src/main/java/com/frame/rv/config/RvFrameConfig.java
View file @
f5c734e3
...
...
@@ -9,6 +9,7 @@ package com.frame.rv.config;
public
interface
RvFrameConfig
extends
RvFrameConstant
{
String
HOST
=
"https://xxtest.upyuns.com"
;
// String HOST = "http://10.1.37.192:8765";
// String HOST = "http://10.1.37.248:8765";
// String HOST = "http://10.1.37.244:9527";
String
ADMIN_POST
=
HOST
+
"/api/admin/"
;
...
...
RvFrame/src/main/java/com/frame/rv/config/RvFrameConstant.java
View file @
f5c734e3
...
...
@@ -12,6 +12,7 @@ public interface RvFrameConstant {
int
HTTP_STATE_NOT_REGISTERED
=
1003
;
//用户未注册
int
HTTP_STATE_USER_SP
=
1002
;
//用户已存在
int
HTTP_STATE_SUCCESS
=
200
;
//请求成功
int
HTTP_STATE_DATA_ALREADY_EXISTS
=
1001
;
/**
* 请求错误类型
*/
...
...
RvTravel/src/main/java/com/rv/travel/fragment/TravelFragmentMain.java
View file @
f5c734e3
...
...
@@ -17,7 +17,6 @@ import android.widget.LinearLayout;
import
com.base.animset.util.NiftyEffects
;
import
com.base.utils.base.BaseFragment
;
import
com.base.utils.tools.android.IntentUtil
;
import
com.base.utils.tools.android.KeyboardUtil
;
import
com.base.utils.ui.datetime.selector.util.TextUtil
;
import
com.frame.base.browse.ActivityImageBrowseUrl
;
import
com.frame.rv.widget.BaseTipsLayout
;
...
...
@@ -185,7 +184,6 @@ public class TravelFragmentMain extends BaseFragment {
private
boolean
isQueryMode
=
false
;
public
void
getRimData
(
String
queryInput
)
{
KeyboardUtil
.
hideKeyboard
(
getActivity
());
query
=
queryInput
;
isQueryMode
=
!
TextUtil
.
isEmpty
(
query
);
setRim
();
...
...
RvWrapper/src/main/java/com/ruiwenliu/wrapper/SPConstance.java
View file @
f5c734e3
...
...
@@ -9,4 +9,5 @@ public final class SPConstance {
public
static
final
String
USER_JSON_IMTOKEN
=
"imToken"
;
public
static
final
String
USER_JSON_IMUSERID
=
"imUserId"
;
public
static
final
String
USER_JSON_ISCERTIFICATIONSTATUS
=
"CertificationStatus"
;
public
static
final
String
USER_JSON_USERINFO
=
"userinfo"
;
}
RvWrapper/src/main/java/com/ruiwenliu/wrapper/http/RxRequestResult.java
View file @
f5c734e3
...
...
@@ -53,6 +53,8 @@ public class RxRequestResult<T extends BaseBean, V extends BaseView<T>> extends
case
RvFrameConstant
.
HTTP_STATE_NOT_REGISTERED
:
baseView
.
onShowError
(
""
,
RvFrameConstant
.
HTTP_STATE_NOT_REGISTERED
);
break
;
case
RvFrameConstant
.
HTTP_STATE_DATA_ALREADY_EXISTS
:
break
;
default
:
baseView
.
onShowError
(
bean
.
message
,
bean
.
status
);
break
;
...
...
component_control/.gitignore
0 → 100644
View file @
f5c734e3
/build
component_control/build.gradle
0 → 100644
View file @
f5c734e3
apply
plugin:
'com.android.library'
android
{
compileSdkVersion
28
defaultConfig
{
minSdkVersion
19
targetSdkVersion
28
versionCode
1
versionName
"1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes
{
release
{
minifyEnabled
false
proguardFiles
getDefaultProguardFile
(
'proguard-android-optimize.txt'
),
'proguard-rules.pro'
}
}
}
dependencies
{
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
implementation
'com.android.support:appcompat-v7:28.0.0'
testImplementation
'junit:junit:4.12'
androidTestImplementation
'com.android.support.test:runner:1.0.2'
androidTestImplementation
'com.android.support.test.espresso:espresso-core:3.0.2'
}
component_control/proguard-rules.pro
0 → 100644
View file @
f5c734e3
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
component_control/src/main/AndroidManifest.xml
0 → 100644
View file @
f5c734e3
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.rv.component.control"
/>
component_control/src/main/java/com/rv/component/control/SwitchButton.java
0 → 100644
View file @
f5c734e3
package
com
.
rv
.
component
.
control
;
import
android.animation.Animator
;
import
android.animation.ValueAnimator
;
import
android.annotation.TargetApi
;
import
android.content.Context
;
import
android.content.res.Resources
;
import
android.content.res.TypedArray
;
import
android.graphics.Canvas
;
import
android.graphics.Color
;
import
android.graphics.Paint
;
import
android.graphics.RectF
;
import
android.os.Build
;
import
android.util.AttributeSet
;
import
android.util.TypedValue
;
import
android.view.MotionEvent
;
import
android.view.View
;
import
android.widget.Checkable
;
/**
* SwitchButton.
*/
public
class
SwitchButton
extends
View
implements
Checkable
{
private
static
final
int
DEFAULT_WIDTH
=
dp2pxInt
(
58
);
private
static
final
int
DEFAULT_HEIGHT
=
dp2pxInt
(
36
);
/**
* 动画状态:
* 1.静止
* 2.进入拖动
* 3.处于拖动
* 4.拖动-复位
* 5.拖动-切换
* 6.点击切换
**/
private
final
int
ANIMATE_STATE_NONE
=
0
;
private
final
int
ANIMATE_STATE_PENDING_DRAG
=
1
;
private
final
int
ANIMATE_STATE_DRAGING
=
2
;
private
final
int
ANIMATE_STATE_PENDING_RESET
=
3
;
private
final
int
ANIMATE_STATE_PENDING_SETTLE
=
4
;
private
final
int
ANIMATE_STATE_SWITCH
=
5
;
public
SwitchButton
(
Context
context
)
{
super
(
context
);
init
(
context
,
null
);
}
public
SwitchButton
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
init
(
context
,
attrs
);
}
public
SwitchButton
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
init
(
context
,
attrs
);
}
@TargetApi
(
Build
.
VERSION_CODES
.
LOLLIPOP
)
public
SwitchButton
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
,
int
defStyleRes
)
{
super
(
context
,
attrs
,
defStyleAttr
,
defStyleRes
);
init
(
context
,
attrs
);
}
@Override
public
final
void
setPadding
(
int
left
,
int
top
,
int
right
,
int
bottom
)
{
super
.
setPadding
(
0
,
0
,
0
,
0
);
}
/**
* 初始化参数
*/
private
void
init
(
Context
context
,
AttributeSet
attrs
)
{
TypedArray
typedArray
=
null
;
if
(
attrs
!=
null
)
{
typedArray
=
context
.
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
SwitchButton
);
}
shadowEffect
=
optBoolean
(
typedArray
,
R
.
styleable
.
SwitchButton_sb_shadow_effect
,
true
);
uncheckCircleColor
=
optColor
(
typedArray
,
R
.
styleable
.
SwitchButton_sb_uncheckcircle_color
,
0XffAAAAAA
);
//0XffAAAAAA;
uncheckCircleWidth
=
optPixelSize
(
typedArray
,
R
.
styleable
.
SwitchButton_sb_uncheckcircle_width
,
dp2pxInt
(
1.5f
));
//dp2pxInt(1.5f);
uncheckCircleOffsetX
=
dp2px
(
10
);
uncheckCircleRadius
=
optPixelSize
(
typedArray
,
R
.
styleable
.
SwitchButton_sb_uncheckcircle_radius
,
dp2px
(
4
));
//dp2px(4);
checkedLineOffsetX
=
dp2px
(
4
);
checkedLineOffsetY
=
dp2px
(
4
);
shadowRadius
=
optPixelSize
(
typedArray
,
R
.
styleable
.
SwitchButton_sb_shadow_radius
,
dp2pxInt
(
2.5f
));
//dp2pxInt(2.5f);
shadowOffset
=
optPixelSize
(
typedArray
,
R
.
styleable
.
SwitchButton_sb_shadow_offset
,
dp2pxInt
(
1.5f
));
//dp2pxInt(1.5f);
shadowColor
=
optColor
(
typedArray
,
R
.
styleable
.
SwitchButton_sb_shadow_color
,
0X33000000
);
//0X33000000;
uncheckColor
=
optColor
(
typedArray
,
R
.
styleable
.
SwitchButton_sb_uncheck_color
,
0XffDDDDDD
);
//0XffDDDDDD;
checkedColor
=
optColor
(
typedArray
,
R
.
styleable
.
SwitchButton_sb_checked_color
,
0Xff51d367
);
//0Xff51d367;
borderWidth
=
optPixelSize
(
typedArray
,
R
.
styleable
.
SwitchButton_sb_border_width
,
dp2pxInt
(
1
));
//dp2pxInt(1);
checkLineColor
=
optColor
(
typedArray
,
R
.
styleable
.
SwitchButton_sb_checkline_color
,
Color
.
WHITE
);
//Color.WHITE;
checkLineWidth
=
optPixelSize
(
typedArray
,
R
.
styleable
.
SwitchButton_sb_checkline_width
,
dp2pxInt
(
1
f
));
//dp2pxInt(1.0f);
checkLineLength
=
dp2px
(
6
);
int
buttonColor
=
optColor
(
typedArray
,
R
.
styleable
.
SwitchButton_sb_button_color
,
Color
.
WHITE
);
//Color.WHITE;
int
effectDuration
=
optInt
(
typedArray
,
R
.
styleable
.
SwitchButton_sb_effect_duration
,
300
);
//300;
isChecked
=
optBoolean
(
typedArray
,
R
.
styleable
.
SwitchButton_sb_checked
,
false
);
showIndicator
=
optBoolean
(
typedArray
,
R
.
styleable
.
SwitchButton_sb_show_indicator
,
true
);
background
=
optColor
(
typedArray
,
R
.
styleable
.
SwitchButton_sb_background
,
Color
.
WHITE
);
//Color.WHITE;
enableEffect
=
optBoolean
(
typedArray
,
R
.
styleable
.
SwitchButton_sb_enable_effect
,
true
);
if
(
typedArray
!=
null
)
{
typedArray
.
recycle
();
}
paint
=
new
Paint
(
Paint
.
ANTI_ALIAS_FLAG
);
buttonPaint
=
new
Paint
(
Paint
.
ANTI_ALIAS_FLAG
);
buttonPaint
.
setColor
(
buttonColor
);
if
(
shadowEffect
)
{
buttonPaint
.
setShadowLayer
(
shadowRadius
,
0
,
shadowOffset
,
shadowColor
);
}
viewState
=
new
ViewState
();
beforeState
=
new
ViewState
();
afterState
=
new
ViewState
();
valueAnimator
=
ValueAnimator
.
ofFloat
(
0
f
,
1
f
);
valueAnimator
.
setDuration
(
effectDuration
);
valueAnimator
.
setRepeatCount
(
0
);
valueAnimator
.
addUpdateListener
(
animatorUpdateListener
);
valueAnimator
.
addListener
(
animatorListener
);
super
.
setClickable
(
true
);
this
.
setPadding
(
0
,
0
,
0
,
0
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
HONEYCOMB
)
{
setLayerType
(
LAYER_TYPE_SOFTWARE
,
null
);
}
}
@Override
protected
void
onMeasure
(
int
widthMeasureSpec
,
int
heightMeasureSpec
)
{
final
int
widthMode
=
MeasureSpec
.
getMode
(
widthMeasureSpec
);
final
int
heightMode
=
MeasureSpec
.
getMode
(
heightMeasureSpec
);
if
(
widthMode
==
MeasureSpec
.
UNSPECIFIED
||
widthMode
==
MeasureSpec
.
AT_MOST
)
{
widthMeasureSpec
=
MeasureSpec
.
makeMeasureSpec
(
DEFAULT_WIDTH
,
MeasureSpec
.
EXACTLY
);
}
if
(
heightMode
==
MeasureSpec
.
UNSPECIFIED
||
heightMode
==
MeasureSpec
.
AT_MOST
)
{
heightMeasureSpec
=
MeasureSpec
.
makeMeasureSpec
(
DEFAULT_HEIGHT
,
MeasureSpec
.
EXACTLY
);
}
super
.
onMeasure
(
widthMeasureSpec
,
heightMeasureSpec
);
}
@Override
protected
void
onSizeChanged
(
int
w
,
int
h
,
int
oldw
,
int
oldh
)
{
super
.
onSizeChanged
(
w
,
h
,
oldw
,
oldh
);
float
viewPadding
=
Math
.
max
(
shadowRadius
+
shadowOffset
,
borderWidth
);
height
=
h
-
viewPadding
-
viewPadding
;
width
=
w
-
viewPadding
-
viewPadding
;
viewRadius
=
height
*
.
5
f
;
buttonRadius
=
viewRadius
-
borderWidth
;
left
=
viewPadding
;
top
=
viewPadding
;
right
=
w
-
viewPadding
;
bottom
=
h
-
viewPadding
;
centerX
=
(
left
+
right
)
*
.
5
f
;
centerY
=
(
top
+
bottom
)
*
.
5
f
;
buttonMinX
=
left
+
viewRadius
;
buttonMaxX
=
right
-
viewRadius
;
if
(
isChecked
())
{
setCheckedViewState
(
viewState
);
}
else
{
setUncheckViewState
(
viewState
);
}
isUiInited
=
true
;
postInvalidate
();
}
/**
* @param viewState
*/
private
void
setUncheckViewState
(
ViewState
viewState
)
{
viewState
.
radius
=
0
;
viewState
.
checkStateColor
=
uncheckColor
;
viewState
.
checkedLineColor
=
Color
.
TRANSPARENT
;
viewState
.
buttonX
=
buttonMinX
;
}
/**
* @param viewState
*/
private
void
setCheckedViewState
(
ViewState
viewState
)
{
viewState
.
radius
=
viewRadius
;
viewState
.
checkStateColor
=
checkedColor
;
viewState
.
checkedLineColor
=
checkLineColor
;
viewState
.
buttonX
=
buttonMaxX
;
}
@Override
protected
void
onDraw
(
Canvas
canvas
)
{
super
.
onDraw
(
canvas
);
paint
.
setStrokeWidth
(
borderWidth
);
paint
.
setStyle
(
Paint
.
Style
.
FILL
);
//绘制白色背景
paint
.
setColor
(
background
);
drawRoundRect
(
canvas
,
left
,
top
,
right
,
bottom
,
viewRadius
,
paint
);
//绘制关闭状态的边框
paint
.
setStyle
(
Paint
.
Style
.
STROKE
);
paint
.
setColor
(
uncheckColor
);
drawRoundRect
(
canvas
,
left
,
top
,
right
,
bottom
,
viewRadius
,
paint
);
//绘制小圆圈
if
(
showIndicator
)
{
drawUncheckIndicator
(
canvas
);
}
//绘制开启背景色
float
des
=
viewState
.
radius
*
.
5
f
;
//[0-backgroundRadius*0.5f]
paint
.
setStyle
(
Paint
.
Style
.
STROKE
);
paint
.
setColor
(
viewState
.
checkStateColor
);
paint
.
setStrokeWidth
(
borderWidth
+
des
*
2
f
);
drawRoundRect
(
canvas
,
left
+
des
,
top
+
des
,
right
-
des
,
bottom
-
des
,
viewRadius
,
paint
);
//绘制按钮左边绿色长条遮挡
paint
.
setStyle
(
Paint
.
Style
.
FILL
);
paint
.
setStrokeWidth
(
1
);
drawArc
(
canvas
,
left
,
top
,
left
+
2
*
viewRadius
,
top
+
2
*
viewRadius
,
90
,
180
,
paint
);
canvas
.
drawRect
(
left
+
viewRadius
,
top
,
viewState
.
buttonX
,
top
+
2
*
viewRadius
,
paint
);
//绘制小线条
if
(
showIndicator
)
{
drawCheckedIndicator
(
canvas
);
}
//绘制按钮
drawButton
(
canvas
,
viewState
.
buttonX
,
centerY
);
}
/**
* 绘制选中状态指示器
*
* @param canvas
*/
protected
void
drawCheckedIndicator
(
Canvas
canvas
)
{
drawCheckedIndicator
(
canvas
,
viewState
.
checkedLineColor
,
checkLineWidth
,
left
+
viewRadius
-
checkedLineOffsetX
,
centerY
-
checkLineLength
,
left
+
viewRadius
-
checkedLineOffsetY
,
centerY
+
checkLineLength
,
paint
);
}
/**
* 绘制选中状态指示器
*
* @param canvas
* @param color
* @param lineWidth
* @param sx
* @param sy
* @param ex
* @param ey
* @param paint
*/
protected
void
drawCheckedIndicator
(
Canvas
canvas
,
int
color
,
float
lineWidth
,
float
sx
,
float
sy
,
float
ex
,
float
ey
,
Paint
paint
)
{
paint
.
setStyle
(
Paint
.
Style
.
STROKE
);
paint
.
setColor
(
color
);
paint
.
setStrokeWidth
(
lineWidth
);
canvas
.
drawLine
(
sx
,
sy
,
ex
,
ey
,
paint
);
}
/**
* 绘制关闭状态指示器
*
* @param canvas
*/
private
void
drawUncheckIndicator
(
Canvas
canvas
)
{
drawUncheckIndicator
(
canvas
,
uncheckCircleColor
,
uncheckCircleWidth
,
right
-
uncheckCircleOffsetX
,
centerY
,
uncheckCircleRadius
,
paint
);
}
/**
* 绘制关闭状态指示器
*
* @param canvas
* @param color
* @param lineWidth
* @param centerX
* @param centerY
* @param radius
* @param paint
*/
protected
void
drawUncheckIndicator
(
Canvas
canvas
,
int
color
,
float
lineWidth
,
float
centerX
,
float
centerY
,
float
radius
,
Paint
paint
)
{
paint
.
setStyle
(
Paint
.
Style
.
STROKE
);
paint
.
setColor
(
color
);
paint
.
setStrokeWidth
(
lineWidth
);
canvas
.
drawCircle
(
centerX
,
centerY
,
radius
,
paint
);
}
/**
* @param canvas
* @param left
* @param top
* @param right
* @param bottom
* @param startAngle
* @param sweepAngle
* @param paint
*/
private
void
drawArc
(
Canvas
canvas
,
float
left
,
float
top
,
float
right
,
float
bottom
,
float
startAngle
,
float
sweepAngle
,
Paint
paint
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
canvas
.
drawArc
(
left
,
top
,
right
,
bottom
,
startAngle
,
sweepAngle
,
true
,
paint
);
}
else
{
rect
.
set
(
left
,
top
,
right
,
bottom
);
canvas
.
drawArc
(
rect
,
startAngle
,
sweepAngle
,
true
,
paint
);
}
}
/**
* @param canvas
* @param left
* @param top
* @param right
* @param bottom
* @param backgroundRadius
* @param paint
*/
private
void
drawRoundRect
(
Canvas
canvas
,
float
left
,
float
top
,
float
right
,
float
bottom
,
float
backgroundRadius
,
Paint
paint
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
canvas
.
drawRoundRect
(
left
,
top
,
right
,
bottom
,
backgroundRadius
,
backgroundRadius
,
paint
);
}
else
{
rect
.
set
(
left
,
top
,
right
,
bottom
);
canvas
.
drawRoundRect
(
rect
,
backgroundRadius
,
backgroundRadius
,
paint
);
}
}
/**
* @param canvas
* @param x px
* @param y px
*/
private
void
drawButton
(
Canvas
canvas
,
float
x
,
float
y
)
{
canvas
.
drawCircle
(
x
,
y
,
buttonRadius
,
buttonPaint
);
paint
.
setStyle
(
Paint
.
Style
.
STROKE
);
paint
.
setStrokeWidth
(
1
);
paint
.
setColor
(
0XffDDDDDD
);
canvas
.
drawCircle
(
x
,
y
,
buttonRadius
,
paint
);
}
@Override
public
void
setChecked
(
boolean
checked
)
{
if
(
checked
==
isChecked
())
{
postInvalidate
();
return
;
}
toggle
(
enableEffect
,
false
);
}
@Override
public
boolean
isChecked
()
{
return
isChecked
;
}
@Override
public
void
toggle
()
{
toggle
(
true
);
}
/**
* 切换状态
*
* @param animate
*/
public
void
toggle
(
boolean
animate
)
{
toggle
(
animate
,
true
);
}
private
void
toggle
(
boolean
animate
,
boolean
broadcast
)
{
if
(!
isEnabled
())
{
return
;
}
if
(
isEventBroadcast
)
{
throw
new
RuntimeException
(
"should NOT switch the state in method: [onCheckedChanged]!"
);
}
if
(!
isUiInited
)
{
isChecked
=
!
isChecked
;
if
(
broadcast
)
{
broadcastEvent
();
}
return
;
}
if
(
valueAnimator
.
isRunning
())
{
valueAnimator
.
cancel
();
}
if
(!
enableEffect
||
!
animate
)
{
isChecked
=
!
isChecked
;
if
(
isChecked
())
{
setCheckedViewState
(
viewState
);
}
else
{
setUncheckViewState
(
viewState
);
}
postInvalidate
();
if
(
broadcast
)
{
broadcastEvent
();
}
return
;
}
animateState
=
ANIMATE_STATE_SWITCH
;
beforeState
.
copy
(
viewState
);
if
(
isChecked
())
{
//切换到unchecked
setUncheckViewState
(
afterState
);
}
else
{
setCheckedViewState
(
afterState
);
}
valueAnimator
.
start
();
}
/**
*
*/
private
void
broadcastEvent
()
{
if
(
onCheckedChangeListener
!=
null
)
{
isEventBroadcast
=
true
;
onCheckedChangeListener
.
onCheckedChanged
(
this
,
isChecked
());
}
isEventBroadcast
=
false
;
}
@Override
public
boolean
onTouchEvent
(
MotionEvent
event
)
{
if
(!
isEnabled
())
{
return
false
;
}
int
actionMasked
=
event
.
getActionMasked
();
switch
(
actionMasked
)
{
case
MotionEvent
.
ACTION_DOWN
:
{
isTouchingDown
=
true
;
touchDownTime
=
System
.
currentTimeMillis
();
//取消准备进入拖动状态
removeCallbacks
(
postPendingDrag
);
//预设100ms进入拖动状态
postDelayed
(
postPendingDrag
,
100
);
break
;
}
case
MotionEvent
.
ACTION_MOVE
:
{
float
eventX
=
event
.
getX
();
if
(
isPendingDragState
())
{
//在准备进入拖动状态过程中,可以拖动按钮位置
float
fraction
=
eventX
/
getWidth
();
fraction
=
Math
.
max
(
0
f
,
Math
.
min
(
1
f
,
fraction
));
viewState
.
buttonX
=
buttonMinX
+
(
buttonMaxX
-
buttonMinX
)
*
fraction
;
}
else
if
(
isDragState
())
{
//拖动按钮位置,同时改变对应的背景颜色
float
fraction
=
eventX
/
getWidth
();
fraction
=
Math
.
max
(
0
f
,
Math
.
min
(
1
f
,
fraction
));
viewState
.
buttonX
=
buttonMinX
+
(
buttonMaxX
-
buttonMinX
)
*
fraction
;
viewState
.
checkStateColor
=
(
int
)
argbEvaluator
.
evaluate
(
fraction
,
uncheckColor
,
checkedColor
);
postInvalidate
();
}
break
;
}
case
MotionEvent
.
ACTION_UP
:
{
isTouchingDown
=
false
;
//取消准备进入拖动状态
removeCallbacks
(
postPendingDrag
);
if
(
System
.
currentTimeMillis
()
-
touchDownTime
<=
300
)
{
//点击时间小于300ms,认为是点击操作
toggle
();
}
else
if
(
isDragState
())
{
//在拖动状态,计算按钮位置,设置是否切换状态
float
eventX
=
event
.
getX
();
float
fraction
=
eventX
/
getWidth
();
fraction
=
Math
.
max
(
0
f
,
Math
.
min
(
1
f
,
fraction
));
boolean
newCheck
=
fraction
>
.
5
f
;
if
(
newCheck
==
isChecked
())
{
pendingCancelDragState
();
}
else
{
isChecked
=
newCheck
;
pendingSettleState
();
}
}
else
if
(
isPendingDragState
())
{
//在准备进入拖动状态过程中,取消之,复位
pendingCancelDragState
();
}
break
;
}
case
MotionEvent
.
ACTION_CANCEL
:
{
isTouchingDown
=
false
;
removeCallbacks
(
postPendingDrag
);
if
(
isPendingDragState
()
||
isDragState
())
{
//复位
pendingCancelDragState
();
}
break
;
}
}
return
true
;
}
/**
* 是否在动画状态
*
* @return
*/
private
boolean
isInAnimating
()
{
return
animateState
!=
ANIMATE_STATE_NONE
;
}
/**
* 是否在进入拖动或离开拖动状态
*
* @return
*/
private
boolean
isPendingDragState
()
{
return
animateState
==
ANIMATE_STATE_PENDING_DRAG
||
animateState
==
ANIMATE_STATE_PENDING_RESET
;
}
/**
* 是否在手指拖动状态
*
* @return
*/
private
boolean
isDragState
()
{
return
animateState
==
ANIMATE_STATE_DRAGING
;
}
/**
* 设置是否启用阴影效果
*
* @param shadowEffect true.启用
*/
public
void
setShadowEffect
(
boolean
shadowEffect
)
{
if
(
this
.
shadowEffect
==
shadowEffect
)
{
return
;
}
this
.
shadowEffect
=
shadowEffect
;
if
(
this
.
shadowEffect
)
{
buttonPaint
.
setShadowLayer
(
shadowRadius
,
0
,
shadowOffset
,
shadowColor
);
}
else
{
buttonPaint
.
setShadowLayer
(
0
,
0
,
0
,
0
);
}
}
public
void
setEnableEffect
(
boolean
enable
)
{
this
.
enableEffect
=
enable
;
}
/**
* 开始进入拖动状态
*/
private
void
pendingDragState
()
{
if
(
isInAnimating
())
{
return
;
}
if
(!
isTouchingDown
)
{
return
;
}
if
(
valueAnimator
.
isRunning
())
{
valueAnimator
.
cancel
();
}
animateState
=
ANIMATE_STATE_PENDING_DRAG
;
beforeState
.
copy
(
viewState
);
afterState
.
copy
(
viewState
);
if
(
isChecked
())
{
afterState
.
checkStateColor
=
checkedColor
;
afterState
.
buttonX
=
buttonMaxX
;
afterState
.
checkedLineColor
=
checkedColor
;
}
else
{
afterState
.
checkStateColor
=
uncheckColor
;
afterState
.
buttonX
=
buttonMinX
;
afterState
.
radius
=
viewRadius
;
}
valueAnimator
.
start
();
}
/**
* 取消拖动状态
*/
private
void
pendingCancelDragState
()
{
if
(
isDragState
()
||
isPendingDragState
())
{
if
(
valueAnimator
.
isRunning
())
{
valueAnimator
.
cancel
();
}
animateState
=
ANIMATE_STATE_PENDING_RESET
;
beforeState
.
copy
(
viewState
);
if
(
isChecked
())
{
setCheckedViewState
(
afterState
);
}
else
{
setUncheckViewState
(
afterState
);
}
valueAnimator
.
start
();
}
}
/**
* 动画-设置新的状态
*/
private
void
pendingSettleState
()
{
if
(
valueAnimator
.
isRunning
())
{
valueAnimator
.
cancel
();
}
animateState
=
ANIMATE_STATE_PENDING_SETTLE
;
beforeState
.
copy
(
viewState
);
if
(
isChecked
())
{
setCheckedViewState
(
afterState
);
}
else
{
setUncheckViewState
(
afterState
);
}
valueAnimator
.
start
();
}
@Override
public
final
void
setOnClickListener
(
OnClickListener
l
)
{
}
@Override
public
final
void
setOnLongClickListener
(
OnLongClickListener
l
)
{
}
public
void
setOnCheckedChangeListener
(
OnCheckedChangeListener
l
)
{
onCheckedChangeListener
=
l
;
}
public
interface
OnCheckedChangeListener
{
void
onCheckedChanged
(
SwitchButton
view
,
boolean
isChecked
);
}
/*******************************************************/
private
static
float
dp2px
(
float
dp
)
{
Resources
r
=
Resources
.
getSystem
();
return
TypedValue
.
applyDimension
(
TypedValue
.
COMPLEX_UNIT_DIP
,
dp
,
r
.
getDisplayMetrics
());
}
private
static
int
dp2pxInt
(
float
dp
)
{
return
(
int
)
dp2px
(
dp
);
}
private
static
int
optInt
(
TypedArray
typedArray
,
int
index
,
int
def
)
{
if
(
typedArray
==
null
)
{
return
def
;
}
return
typedArray
.
getInt
(
index
,
def
);
}
private
static
float
optPixelSize
(
TypedArray
typedArray
,
int
index
,
float
def
)
{
if
(
typedArray
==
null
)
{
return
def
;
}
return
typedArray
.
getDimension
(
index
,
def
);
}
private
static
int
optPixelSize
(
TypedArray
typedArray
,
int
index
,
int
def
)
{
if
(
typedArray
==
null
)
{
return
def
;
}
return
typedArray
.
getDimensionPixelOffset
(
index
,
def
);
}
private
static
int
optColor
(
TypedArray
typedArray
,
int
index
,
int
def
)
{
if
(
typedArray
==
null
)
{
return
def
;
}
return
typedArray
.
getColor
(
index
,
def
);
}
private
static
boolean
optBoolean
(
TypedArray
typedArray
,
int
index
,
boolean
def
)
{
if
(
typedArray
==
null
)
{
return
def
;
}
return
typedArray
.
getBoolean
(
index
,
def
);
}
/*******************************************************/
/**
* 阴影半径
*/
private
int
shadowRadius
;
/**
* 阴影Y偏移px
*/
private
int
shadowOffset
;
/**
* 阴影颜色
*/
private
int
shadowColor
;
/**
* 背景半径
*/
private
float
viewRadius
;
/**
* 按钮半径
*/
private
float
buttonRadius
;
/**
* 背景高
*/
private
float
height
;
/**
* 背景宽
*/
private
float
width
;
/**
* 背景位置
*/
private
float
left
;
private
float
top
;
private
float
right
;
private
float
bottom
;
private
float
centerX
;
private
float
centerY
;
/**
* 背景底色
*/
private
int
background
;
/**
* 背景关闭颜色
*/
private
int
uncheckColor
;
/**
* 背景打开颜色
*/
private
int
checkedColor
;
/**
* 边框宽度px
*/
private
int
borderWidth
;
/**
* 打开指示线颜色
*/
private
int
checkLineColor
;
/**
* 打开指示线宽
*/
private
int
checkLineWidth
;
/**
* 打开指示线长
*/
private
float
checkLineLength
;
/**
* 关闭圆圈颜色
*/
private
int
uncheckCircleColor
;
/**
* 关闭圆圈线宽
*/
private
int
uncheckCircleWidth
;
/**
* 关闭圆圈位移X
*/
private
float
uncheckCircleOffsetX
;
/**
* 关闭圆圈半径
*/
private
float
uncheckCircleRadius
;
/**
* 打开指示线位移X
*/
private
float
checkedLineOffsetX
;
/**
* 打开指示线位移Y
*/
private
float
checkedLineOffsetY
;
/**
* 按钮最左边
*/
private
float
buttonMinX
;
/**
* 按钮最右边
*/
private
float
buttonMaxX
;
/**
* 按钮画笔
*/
private
Paint
buttonPaint
;
/**
* 背景画笔
*/
private
Paint
paint
;
/**
* 当前状态
*/
private
ViewState
viewState
;
private
ViewState
beforeState
;
private
ViewState
afterState
;
private
RectF
rect
=
new
RectF
();
/**
* 动画状态
*/
private
int
animateState
=
ANIMATE_STATE_NONE
;
/**
*
*/
private
ValueAnimator
valueAnimator
;
private
final
android
.
animation
.
ArgbEvaluator
argbEvaluator
=
new
android
.
animation
.
ArgbEvaluator
();
/**
* 是否选中
*/
private
boolean
isChecked
;
/**
* 是否启用动画
*/
private
boolean
enableEffect
;
/**
* 是否启用阴影效果
*/
private
boolean
shadowEffect
;
/**
* 是否显示指示器
*/
private
boolean
showIndicator
;
/**
* 收拾是否按下
*/
private
boolean
isTouchingDown
=
false
;
/**
*
*/
private
boolean
isUiInited
=
false
;
/**
*
*/
private
boolean
isEventBroadcast
=
false
;
private
OnCheckedChangeListener
onCheckedChangeListener
;
/**
* 手势按下的时刻
*/
private
long
touchDownTime
;
private
Runnable
postPendingDrag
=
new
Runnable
()
{
@Override
public
void
run
()
{
if
(!
isInAnimating
())
{
pendingDragState
();
}
}
};
private
ValueAnimator
.
AnimatorUpdateListener
animatorUpdateListener
=
new
ValueAnimator
.
AnimatorUpdateListener
()
{
@Override
public
void
onAnimationUpdate
(
ValueAnimator
animation
)
{
float
value
=
(
Float
)
animation
.
getAnimatedValue
();
switch
(
animateState
)
{
case
ANIMATE_STATE_PENDING_SETTLE:
{
}
case
ANIMATE_STATE_PENDING_RESET:
{
}
case
ANIMATE_STATE_PENDING_DRAG:
{
viewState
.
checkedLineColor
=
(
int
)
argbEvaluator
.
evaluate
(
value
,
beforeState
.
checkedLineColor
,
afterState
.
checkedLineColor
);
viewState
.
radius
=
beforeState
.
radius
+
(
afterState
.
radius
-
beforeState
.
radius
)
*
value
;
if
(
animateState
!=
ANIMATE_STATE_PENDING_DRAG
)
{
viewState
.
buttonX
=
beforeState
.
buttonX
+
(
afterState
.
buttonX
-
beforeState
.
buttonX
)
*
value
;
}
viewState
.
checkStateColor
=
(
int
)
argbEvaluator
.
evaluate
(
value
,
beforeState
.
checkStateColor
,
afterState
.
checkStateColor
);
break
;
}
case
ANIMATE_STATE_SWITCH:
{
viewState
.
buttonX
=
beforeState
.
buttonX
+
(
afterState
.
buttonX
-
beforeState
.
buttonX
)
*
value
;
float
fraction
=
(
viewState
.
buttonX
-
buttonMinX
)
/
(
buttonMaxX
-
buttonMinX
);
viewState
.
checkStateColor
=
(
int
)
argbEvaluator
.
evaluate
(
fraction
,
uncheckColor
,
checkedColor
);
viewState
.
radius
=
fraction
*
viewRadius
;
viewState
.
checkedLineColor
=
(
int
)
argbEvaluator
.
evaluate
(
fraction
,
Color
.
TRANSPARENT
,
checkLineColor
);
break
;
}
default
:
case
ANIMATE_STATE_DRAGING:
{
}
case
ANIMATE_STATE_NONE:
{
break
;
}
}
postInvalidate
();
}
};
private
Animator
.
AnimatorListener
animatorListener
=
new
Animator
.
AnimatorListener
()
{
@Override
public
void
onAnimationStart
(
Animator
animation
)
{
}
@Override
public
void
onAnimationEnd
(
Animator
animation
)
{
switch
(
animateState
)
{
case
ANIMATE_STATE_DRAGING:
{
break
;
}
case
ANIMATE_STATE_PENDING_DRAG:
{
animateState
=
ANIMATE_STATE_DRAGING
;
viewState
.
checkedLineColor
=
Color
.
TRANSPARENT
;
viewState
.
radius
=
viewRadius
;
postInvalidate
();
break
;
}
case
ANIMATE_STATE_PENDING_RESET:
{
animateState
=
ANIMATE_STATE_NONE
;
postInvalidate
();
break
;
}
case
ANIMATE_STATE_PENDING_SETTLE:
{
animateState
=
ANIMATE_STATE_NONE
;
postInvalidate
();
broadcastEvent
();
break
;
}
case
ANIMATE_STATE_SWITCH:
{
isChecked
=
!
isChecked
;
animateState
=
ANIMATE_STATE_NONE
;
postInvalidate
();
broadcastEvent
();
break
;
}
default
:
case
ANIMATE_STATE_NONE:
{
break
;
}
}
}
@Override
public
void
onAnimationCancel
(
Animator
animation
)
{
}
@Override
public
void
onAnimationRepeat
(
Animator
animation
)
{
}
};
/*******************************************************/
/**
* 保存动画状态
*/
private
static
class
ViewState
{
/**
* 按钮x位置[buttonMinX-buttonMaxX]
*/
float
buttonX
;
/**
* 状态背景颜色
*/
int
checkStateColor
;
/**
* 选中线的颜色
*/
int
checkedLineColor
;
/**
* 状态背景的半径
*/
float
radius
;
ViewState
()
{
}
private
void
copy
(
ViewState
source
)
{
this
.
buttonX
=
source
.
buttonX
;
this
.
checkStateColor
=
source
.
checkStateColor
;
this
.
checkedLineColor
=
source
.
checkedLineColor
;
this
.
radius
=
source
.
radius
;
}
}
}
component_control/src/main/res/values/strings.xml
0 → 100644
View file @
f5c734e3
<resources>
<string
name=
"app_name"
>
component_control
</string>
</resources>
component_control/src/main/res/values/switch_button_attrs.xml
0 → 100644
View file @
f5c734e3
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable
name=
"SwitchButton"
>
<attr
name=
"sb_shadow_radius"
format=
"reference|dimension"
/>
阴影半径
<attr
name=
"sb_shadow_offset"
format=
"reference|dimension"
/>
阴影偏移
<attr
name=
"sb_shadow_color"
format=
"reference|color"
/>
阴影颜色
<attr
name=
"sb_uncheck_color"
format=
"reference|color"
/>
关闭颜色
<attr
name=
"sb_checked_color"
format=
"reference|color"
/>
开启颜色
<attr
name=
"sb_border_width"
format=
"reference|dimension"
/>
边框宽度
<attr
name=
"sb_checkline_color"
format=
"reference|color"
/>
开启指示器颜色
<attr
name=
"sb_checkline_width"
format=
"reference|dimension"
/>
开启指示器线宽
<attr
name=
"sb_uncheckcircle_color"
format=
"reference|color"
/>
关闭指示器颜色
<attr
name=
"sb_uncheckcircle_width"
format=
"reference|dimension"
/>
关闭指示器线宽
<attr
name=
"sb_uncheckcircle_radius"
format=
"reference|dimension"
/>
关闭指示器半径
<attr
name=
"sb_checked"
format=
"reference|boolean"
/>
是否选中
<attr
name=
"sb_shadow_effect"
format=
"reference|boolean"
/>
是否启用阴影
<attr
name=
"sb_effect_duration"
format=
"reference|integer"
/>
动画时间,默认300ms
<attr
name=
"sb_button_color"
format=
"reference|color"
/>
按钮颜色
<attr
name=
"sb_show_indicator"
format=
"reference|boolean"
/>
是否显示指示器,默认true:显示
<attr
name=
"sb_background"
format=
"reference|color"
/>
背景色,默认白色
<attr
name=
"sb_enable_effect"
format=
"reference|boolean"
/>
是否启用特效,默认true
</declare-styleable>
</resources>
\ No newline at end of file
component_resource/src/main/res/drawable-xhdpi/common_icon_more_details_up.png
0 → 100644
View file @
f5c734e3
825 Bytes
component_resource/src/main/res/drawable-xhdpi/common_icon_rig_gray.png
0 → 100644
View file @
f5c734e3
487 Bytes
component_resource/src/main/res/drawable/shape_rv_bg_shallow_yellow_small_circle.xml
0 → 100644
View file @
f5c734e3
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"30dp"
/>
<solid
android:color=
"@color/colorBgYellow"
/>
</shape>
\ No newline at end of file
Utils/src/main/java/com/base/utils/tools/android
/KeyboardUtil.java
→
component_utils/src/main/java/com/rv/component/utils
/KeyboardUtil.java
View file @
f5c734e3
package
com
.
base
.
utils
.
tools
.
android
;
package
com
.
rv
.
component
.
utils
;
import
android.app.Activity
;
import
android.content.Context
;
...
...
module_camp/src/main/java/com/rv/camp/CampFragment.java
View file @
f5c734e3
package
com
.
rv
.
camp
;
import
android.Manifest
;
import
android.graphics.Rect
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.support.v7.widget.GridLayoutManager
;
import
android.support.v7.widget.LinearLayoutManager
;
...
...
@@ -8,11 +10,16 @@ import android.support.v7.widget.RecyclerView;
import
android.view.View
;
import
com.alibaba.android.arouter.launcher.ARouter
;
import
com.baidu.location.BDAbstractLocationListener
;
import
com.baidu.location.BDLocation
;
import
com.baidu.mapapi.model.LatLng
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.frame.base.url.Constance
;
import
com.frame.rv.config.RvFrameConfig
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.base.BaseFragment
;
import
com.ruiwenliu.wrapper.util.LocationManager
;
import
com.ruiwenliu.wrapper.util.permission.RxPermission
;
import
com.rv.camp.adapter.CampListAdapter
;
import
com.rv.camp.adapter.CampTypeListAdapter
;
import
com.rv.camp.api.CampApi
;
...
...
@@ -27,6 +34,7 @@ import java.util.Map;
import
butterknife.BindView
;
import
butterknife.OnClick
;
import
io.reactivex.functions.Consumer
;
/**
* 营地
...
...
@@ -46,6 +54,10 @@ public class CampFragment extends BaseFragment<CampPresenter> implements BaseQui
private
int
mPage
;
private
int
countPage
;
private
String
type
=
null
;
private
double
latLatitude
=
0
;
private
double
lonLongitude
;
private
LatLng
mLatLng
;
//当前城市经纬度
private
LocationManager
locationManager
;
public
static
CampFragment
getInstance
(
int
type
)
{
...
...
@@ -64,6 +76,7 @@ public class CampFragment extends BaseFragment<CampPresenter> implements BaseQui
@Override
protected
void
initView
(
Bundle
savedInstanceState
)
{
permissionProcess
();
campAdapter
=
new
CampListAdapter
();
rvContent
.
setLayoutManager
(
new
GridLayoutManager
(
_mActivity
,
2
));
rvContent
.
addItemDecoration
(
new
AbSpacesItemDecoration
(
15
));
// 分割线。
...
...
@@ -94,8 +107,8 @@ public class CampFragment extends BaseFragment<CampPresenter> implements BaseQui
ARouter
.
getInstance
()
.
build
(
Constance
.
ACTIVITY_URL_CAMPDETAIL
)
.
withString
(
"id"
,
data
.
getId
())
.
withString
(
"longitude"
,
data
.
getLongitude
(
))
.
withString
(
"latitude"
,
data
.
getLatitude
(
))
.
withString
(
"longitude"
,
String
.
valueOf
(
lonLongitude
))
.
withString
(
"latitude"
,
String
.
valueOf
(
latLatitude
))
.
navigation
();
}
});
...
...
@@ -210,6 +223,65 @@ public class CampFragment extends BaseFragment<CampPresenter> implements BaseQui
}
}
/**
* 定位权限处理
*/
private
void
permissionProcess
()
{
/**
* 6.0以上手机做权限处理
*/
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
N
)
{
new
RxPermission
(
getActivity
()).
request
(
Manifest
.
permission
.
ACCESS_COARSE_LOCATION
,
Manifest
.
permission
.
ACCESS_FINE_LOCATION
).
subscribe
(
new
Consumer
<
Boolean
>()
{
@Override
public
void
accept
(
Boolean
aBoolean
)
throws
Exception
{
if
(
aBoolean
==
true
)
{
initGps
();
}
else
{
getActivity
().
finish
();
}
}
});
}
else
{
initGps
();
}
}
/**
* 初始化定位
*/
public
void
initGps
()
{
locationManager
=
new
LocationManager
(
getContext
());
locationManager
.
getLocationDetail
(
new
BDAbstractLocationListener
()
{
@Override
public
void
onReceiveLocation
(
BDLocation
location
)
{
//此处的BDLocation为定位结果信息类,通过它的各种get方法可获取定位相关的全部结果
//以下只列举部分获取经纬度相关(常用)的结果信息
//更多结果信息获取说明,请参照类参考中BDLocation类中的说明
//获取定位精度,默认值为0.0f
float
radius
=
location
.
getRadius
();
//获取经纬度坐标类型,以LocationClientOption中设置过的坐标类型为准
String
coorType
=
location
.
getCoorType
();
//获取定位类型、定位错误返回码,具体信息可参照类参考中BDLocation类中的说明
int
errorCode
=
location
.
getLocType
();
// setGpsContent("count=:",String.valueOf(count));
// setGpsContent("latitude:",String.valueOf(location.getLatitude()));
// setGpsContent("longitude:",String.valueOf(location.getLongitude()));
// setGpsContent("城市:",location.getCity());
// setGpsContent("街道:",location.getAddrStr());
// setGpsContent("当前位置:",location.getLocationDescribe());
latLatitude
=
location
.
getLatitude
();
lonLongitude
=
location
.
getLongitude
();
mLatLng
=
new
LatLng
(
location
.
getLatitude
(),
location
.
getLongitude
());
locationManager
.
stopLocation
();
}
});
}
public
class
AbSpacesItemDecoration
extends
RecyclerView
.
ItemDecoration
{
...
...
module_home/src/main/java/com/rv/home/rv/module/basic/BaseLoginActivity.java
View file @
f5c734e3
...
...
@@ -6,17 +6,20 @@ import android.os.Bundle;
import
android.support.annotation.Nullable
;
import
com.alibaba.android.arouter.launcher.ARouter
;
import
com.alibaba.fastjson.JSON
;
import
com.frame.base.bus.LoginSuccessfulEvent
;
import
com.frame.base.bus.RxBus
;
import
com.frame.base.url.Constance
;
import
com.frame.rv.OnModuleEventListener
;
import
com.frame.rv.config.RvFrameConfig
;
import
com.ruiwenliu.wrapper.SPConstance
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.presenter.MvpPresenter
;
import
com.ruiwenliu.wrapper.util.UtilsManager
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
import
com.rv.home.R
;
import
com.rv.home.rv.module.ApiConfig
;
import
com.rv.home.rv.module.basic.bean.BeanUserInfo
;
import
com.rv.home.rv.module.ui.login.bean.RegisteredBean
;
import
com.rv.home.rv.module.ui.main.home.CarDetailActivity
;
import
com.umeng.socialize.UMAuthListener
;
...
...
@@ -81,6 +84,11 @@ public abstract class BaseLoginActivity<P extends MvpPresenter> extends BaseStat
UMShareAPI
.
get
(
mActivity
).
getPlatformInfo
(
mActivity
,
share_media
,
this
);
}
public
void
setDataUser
(
BeanUserInfo
data
)
{
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_USERINFO
,
JSON
.
toJSONString
(
data
.
getData
())).
commit
();
}
/**
* 第三方登录
*
...
...
@@ -109,21 +117,27 @@ public abstract class BaseLoginActivity<P extends MvpPresenter> extends BaseStat
}
public
void
processLoginData
(
RegisteredBean
bean
)
{
RegisteredBean
registeredBean
=
bean
;
UtilsManager
.
getInstance
(
mActivity
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_NAME
,
registeredBean
.
getData
().
getUsername
()).
commit
();
UtilsManager
.
getInstance
(
mActivity
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_HEADERURL
,
registeredBean
.
getData
().
getHeaderurl
()).
commit
();
UtilsManager
.
getInstance
(
mActivity
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_USERID
,
registeredBean
.
getData
().
getUserId
()).
commit
();
UtilsManager
.
getInstance
(
mActivity
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_TOKEN
,
registeredBean
.
getToken
()).
commit
();
UtilsManager
.
getInstance
(
mActivity
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_IMUSERID
,
registeredBean
.
getData
().
getImUserId
()).
commit
();
UtilsManager
.
getInstance
(
mActivity
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_IMTOKEN
,
registeredBean
.
getData
().
getImToken
()).
commit
();
UtilsManager
.
getInstance
(
mActivity
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_ISCERTIFICATIONSTATUS
,
registeredBean
.
getData
().
getCertificationStatus
()).
commit
();
RegisteredBean
registeredBean
=
bean
;
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_NAME
,
registeredBean
.
getData
().
getUsername
()).
commit
();
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_HEADERURL
,
registeredBean
.
getData
().
getHeaderurl
()).
commit
();
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_USERID
,
registeredBean
.
getData
().
getUserId
()).
commit
();
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_TOKEN
,
registeredBean
.
getToken
()).
commit
();
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_IMUSERID
,
registeredBean
.
getData
().
getImUserId
()).
commit
();
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_IMTOKEN
,
registeredBean
.
getData
().
getImToken
()).
commit
();
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_ISCERTIFICATIONSTATUS
,
registeredBean
.
getData
().
getCertificationStatus
()).
commit
();
Map
<
String
,
Object
>
headMap
=
new
LinkedHashMap
<>();
if
(
registeredBean
.
getToken
()
!=
null
)
{
headMap
.
put
(
"Authorization"
,
registeredBean
.
getToken
());
mPresenter
.
getDataHead
(
RvFrameConfig
.
ADMIN_POST
,
10
,
ApiConfig
.
HTTP_URL_APP_USER_INFO
,
BeanUserInfo
.
class
,
headMap
,
false
);
}
OkGoUtil
.
setToken
(
registeredBean
.
getToken
());
switch
(
RvFrameConfig
.
RvFrameInfo
.
TYPE_LOGIN
)
{
case
1
:
if
(
"0"
.
equals
(
bean
.
getData
().
getCertificationStatus
()))
{
//实名认证状态:0-未认证,1-已认证
if
(
"0"
.
equals
(
bean
.
getData
().
getCertificationStatus
()))
{
//实名认证状态:0-未认证,1-已认证
ARouter
.
getInstance
().
build
(
Constance
.
ACTIVITY_URL_IDCARDCERTIFICATION
).
navigation
();
}
else
{
}
else
{
startActivity
(
CarDetailActivity
.
getIntent
(
mActivity
,
1
));
}
break
;
...
...
@@ -136,4 +150,4 @@ public abstract class BaseLoginActivity<P extends MvpPresenter> extends BaseStat
finish
();
}
}
}
module_home/src/main/java/com/rv/home/rv/module/basic/WebActivity.java
View file @
f5c734e3
...
...
@@ -12,6 +12,7 @@ import com.ruiwenliu.wrapper.weight.webview.SafeWebView;
import
com.rv.home.R
;
import
com.rv.home.rv.module.basic.presenter.PickerPresenter
;
import
com.rv.home.R2
;
import
butterknife.BindView
;
public
class
WebActivity
extends
BaseStatusActivity
<
PickerPresenter
>
{
...
...
@@ -21,8 +22,14 @@ public class WebActivity extends BaseStatusActivity<PickerPresenter> {
@BindView
(
R2
.
id
.
lay_web
)
LinearLayout
mRoot
;
String
title
;
String
url
;
int
type
;
public
static
Intent
getIntent
(
Context
context
,
String
title
,
String
url
)
{
return
new
Intent
(
context
,
WebActivity
.
class
).
putExtra
(
"title"
,
title
).
putExtra
(
"url"
,
url
);
return
new
Intent
(
context
,
WebActivity
.
class
)
.
putExtra
(
"title"
,
title
)
.
putExtra
(
"url"
,
url
);
}
...
...
@@ -40,7 +47,12 @@ public class WebActivity extends BaseStatusActivity<PickerPresenter> {
protected
void
initView
(
Bundle
savedInstanceState
,
TitleView
titleView
,
Intent
intent
)
{
titleView
.
setTitle
(
intent
.
getStringExtra
(
"title"
));
String
url
=
intent
.
getStringExtra
(
"url"
);
if
(
0
==
type
)
{
mWebView
.
loadUrl
(
url
);
}
else
{
String
baseUrl
=
url
+
"?type="
+
type
;
mWebView
.
loadUrl
(
baseUrl
);
}
}
@Override
...
...
@@ -49,7 +61,6 @@ public class WebActivity extends BaseStatusActivity<PickerPresenter> {
}
@Override
public
void
onResume
()
{
super
.
onResume
();
...
...
module_home/src/main/java/com/rv/home/rv/module/basic/bean/BeanUserInfo.java
0 → 100644
View file @
f5c734e3
package
com
.
rv
.
home
.
rv
.
module
.
basic
.
bean
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
java.io.Serializable
;
/**
* 获取用户信息
*/
public
class
BeanUserInfo
extends
BaseBean
{
private
UserInfo
data
;
private
boolean
rel
;
public
UserInfo
getData
()
{
return
data
;
}
public
void
setData
(
UserInfo
data
)
{
this
.
data
=
data
;
}
public
boolean
isRel
()
{
return
rel
;
}
public
void
setRel
(
boolean
rel
)
{
this
.
rel
=
rel
;
}
public
static
class
UserInfo
implements
Serializable
{
private
Integer
id
;
//用户id
private
Integer
userid
;
//imid
private
Integer
imUserid
;
///账号(手机号)
private
String
username
;
//微信openid
private
String
wxOpenid
;
//微信unionid
private
String
unionid
;
//qq
private
String
openid
;
//状态:0-启用,1-禁用
private
Integer
status
;
//身份证号
private
String
idNumber
;
//实名认证状态:0-未认证,1-已认证
private
Integer
certificationStatus
;
//会员
private
Integer
isMember
;
// 是否为会员 0-普通用户 1-会员
//昵称
private
String
nickname
;
//真实姓名
private
String
realname
;
//头像
private
String
headimgurl
;
//邮箱
private
String
email
;
//性别 0-女,1-男
private
Integer
sex
;
//生日
private
String
birthday
;
//个性签名
private
String
personSign
;
//备注
private
String
remark
;
// 剩余天数
private
int
rentFreeDays
;
// 会员消费次数
private
int
payCount
;
// 购买会员册数
private
int
buyCount
;
// 会员等级
private
int
memberLevel
;
private
int
discount
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
Integer
getUserid
()
{
return
userid
;
}
public
void
setUserid
(
Integer
userid
)
{
this
.
userid
=
userid
;
}
public
Integer
getImUserid
()
{
return
imUserid
;
}
public
void
setImUserid
(
Integer
imUserid
)
{
this
.
imUserid
=
imUserid
;
}
public
String
getUsername
()
{
return
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
String
getWxOpenid
()
{
return
wxOpenid
;
}
public
void
setWxOpenid
(
String
wxOpenid
)
{
this
.
wxOpenid
=
wxOpenid
;
}
public
String
getUnionid
()
{
return
unionid
;
}
public
void
setUnionid
(
String
unionid
)
{
this
.
unionid
=
unionid
;
}
public
String
getOpenid
()
{
return
openid
;
}
public
void
setOpenid
(
String
openid
)
{
this
.
openid
=
openid
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
String
getIdNumber
()
{
return
idNumber
;
}
public
void
setIdNumber
(
String
idNumber
)
{
this
.
idNumber
=
idNumber
;
}
public
Integer
getCertificationStatus
()
{
return
certificationStatus
;
}
public
void
setCertificationStatus
(
Integer
certificationStatus
)
{
this
.
certificationStatus
=
certificationStatus
;
}
public
Integer
getIsMember
()
{
return
isMember
;
}
public
void
setIsMember
(
Integer
isMember
)
{
this
.
isMember
=
isMember
;
}
public
String
getNickname
()
{
return
nickname
;
}
public
void
setNickname
(
String
nickname
)
{
this
.
nickname
=
nickname
;
}
public
String
getRealname
()
{
return
realname
;
}
public
void
setRealname
(
String
realname
)
{
this
.
realname
=
realname
;
}
public
String
getHeadimgurl
()
{
return
headimgurl
;
}
public
void
setHeadimgurl
(
String
headimgurl
)
{
this
.
headimgurl
=
headimgurl
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
public
Integer
getSex
()
{
return
sex
;
}
public
void
setSex
(
Integer
sex
)
{
this
.
sex
=
sex
;
}
public
String
getBirthday
()
{
return
birthday
;
}
public
void
setBirthday
(
String
birthday
)
{
this
.
birthday
=
birthday
;
}
public
String
getPersonSign
()
{
return
personSign
;
}
public
void
setPersonSign
(
String
personSign
)
{
this
.
personSign
=
personSign
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
int
getRentFreeDays
()
{
return
rentFreeDays
;
}
public
void
setRentFreeDays
(
int
rentFreeDays
)
{
this
.
rentFreeDays
=
rentFreeDays
;
}
public
int
getPayCount
()
{
return
payCount
;
}
public
void
setPayCount
(
int
payCount
)
{
this
.
payCount
=
payCount
;
}
public
int
getBuyCount
()
{
return
buyCount
;
}
public
void
setBuyCount
(
int
buyCount
)
{
this
.
buyCount
=
buyCount
;
}
public
int
getMemberLevel
()
{
return
memberLevel
;
}
public
void
setMemberLevel
(
int
memberLevel
)
{
this
.
memberLevel
=
memberLevel
;
}
public
int
getDiscount
()
{
return
discount
;
}
public
void
setDiscount
(
int
discount
)
{
this
.
discount
=
discount
;
}
}
}
module_tourism/src/main/java/com/rv/tourism/TourismFragment.java
View file @
f5c734e3
...
...
@@ -19,6 +19,12 @@ import com.alibaba.android.arouter.launcher.ARouter;
import
com.baidu.location.BDAbstractLocationListener
;
import
com.baidu.location.BDLocation
;
import
com.baidu.mapapi.model.LatLng
;
import
com.baidu.mapapi.search.core.SearchResult
;
import
com.baidu.mapapi.search.geocode.GeoCodeOption
;
import
com.baidu.mapapi.search.geocode.GeoCodeResult
;
import
com.baidu.mapapi.search.geocode.GeoCoder
;
import
com.baidu.mapapi.search.geocode.OnGetGeoCoderResultListener
;
import
com.baidu.mapapi.search.geocode.ReverseGeoCodeResult
;
import
com.base.utils.tools.android.IntentUtil
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.frame.base.browse.ActivityImageBrowseUrl
;
...
...
@@ -89,6 +95,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements B
private
double
lonLongitude
;
private
LatLng
mLatLng
;
//当前城市经纬度
private
LocationManager
locationManager
;
private
GeoCoder
geoCoder
;
public
static
TourismFragment
getInstance
(
int
type
)
{
...
...
@@ -184,8 +191,8 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements B
//搜索
ARouter
.
getInstance
()
.
build
(
Constance
.
ACTIVITY_URL_TRAVELSEARCH
)
.
withDouble
(
"latLatitude"
,
latLatitude
)
.
withDouble
(
"lonLongitude"
,
lonLongitude
)
.
withDouble
(
"latLatitude"
,
latLatitude
)
.
withDouble
(
"lonLongitude"
,
lonLongitude
)
.
navigation
();
}
else
if
(
id
==
R
.
id
.
travel_server_image
)
{
showToast
(
"亲,该功能还在开发中。。。"
);
...
...
@@ -212,7 +219,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements B
map
.
put
(
"query"
,
""
);
map
.
put
(
"page"
,
page
);
map
.
put
(
"limit"
,
"10"
);
map
.
put
(
"latitude
l
"
,
latLatitude
);
map
.
put
(
"latitude"
,
latLatitude
);
map
.
put
(
"longitude"
,
lonLongitude
);
mPresenter
.
getData
(
2
,
TourismApi
.
QUERY_RIM_LIST
,
BeanTourAround
.
class
,
map
,
false
);
}
...
...
@@ -339,9 +346,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements B
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
// if (ModuleEventUtil.getOnModuleEventListener() != null) {
// ModuleEventUtil.getOnModuleEventListener().onClear();
// }
geoCoder
.
destroy
();
}
...
...
@@ -377,9 +382,10 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements B
private
void
setRequestData
(
int
type
,
String
data
,
double
lat
,
double
lon
)
{
switch
(
type
)
{
case
1
:
latLatitude
=
lat
;
lonLongitude
=
lon
;
travelCityText
.
setText
(
data
);
geoCoder
.
geocode
(
new
GeoCodeOption
()
.
city
(
data
)
.
address
(
data
));
break
;
}
}
...
...
@@ -421,6 +427,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements B
public
void
accept
(
Boolean
aBoolean
)
throws
Exception
{
if
(
aBoolean
==
true
)
{
initGps
();
initCity
();
}
else
{
getActivity
().
finish
();
}
...
...
@@ -428,9 +435,41 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements B
});
}
else
{
initGps
();
initCity
();
}
}
private
void
initCity
()
{
geoCoder
=
GeoCoder
.
newInstance
();
geoCoder
.
setOnGetGeoCodeResultListener
(
new
OnGetGeoCoderResultListener
()
{
@Override
public
void
onGetGeoCodeResult
(
GeoCodeResult
result
)
{
if
(
result
==
null
||
result
.
error
!=
SearchResult
.
ERRORNO
.
NO_ERROR
)
{
//没有检索到结果
}
else
{
latLatitude
=
result
.
getLocation
().
latitude
;
lonLongitude
=
result
.
getLocation
().
longitude
;
mTourAroundAdapter
.
getData
().
clear
();
mTourAroundAdapter
.
notifyDataSetChanged
();
loadTourAroundData
();
}
//获取地理编码结果
}
@Override
public
void
onGetReverseGeoCodeResult
(
ReverseGeoCodeResult
result
)
{
if
(
result
==
null
||
result
.
error
!=
SearchResult
.
ERRORNO
.
NO_ERROR
)
{
//没有找到检索结果
}
else
{
latLatitude
=
result
.
getLocation
().
latitude
;
lonLongitude
=
result
.
getLocation
().
longitude
;
}
}
});
}
/**
* 初始化定位
*/
...
...
module_tourism/src/main/java/com/rv/tourism/other/TravelDetailsActivity.java
View file @
f5c734e3
...
...
@@ -119,9 +119,12 @@ public class TravelDetailsActivity extends BaseStatusActivity<TourismPresenter>
//收藏
if
(
"1"
.
equals
(
isCollection
))
{
cancelCollect
();
ivCollect
.
setImageResource
(
R
.
drawable
.
travel_rv_collect
);
}
else
{
addCollect
();
ivCollect
.
setImageResource
(
R
.
drawable
.
common_icon_collected
);
}
ivCollect
.
setEnabled
(
false
);
}
else
if
(
id
==
R
.
id
.
iv_share
)
{
//分享
...
...
@@ -188,12 +191,12 @@ public class TravelDetailsActivity extends BaseStatusActivity<TourismPresenter>
case
1
:
showToast
(
"收藏成功"
);
isCollection
=
"1"
;
ivCollect
.
set
ImageResource
(
R
.
drawable
.
common_icon_collected
);
ivCollect
.
set
Enabled
(
true
);
break
;
case
2
:
showToast
(
"取消收藏成功"
);
isCollection
=
"0"
;
ivCollect
.
set
ImageResource
(
R
.
drawable
.
travel_rv_collect
);
ivCollect
.
set
Enabled
(
true
);
break
;
}
...
...
@@ -354,7 +357,7 @@ public class TravelDetailsActivity extends BaseStatusActivity<TourismPresenter>
@Override
public
void
run
()
{
TvAppointment
.
setEnabled
(
false
);
TvAppointment
.
setText
(
"
库存不足
"
);
TvAppointment
.
setText
(
"
已售完
"
);
TvAppointment
.
setBackground
(
mActivity
.
getResources
().
getDrawable
(
R
.
color
.
gray_707070
));
}
});
...
...
plugin_search/build.gradle
View file @
f5c734e3
...
...
@@ -39,5 +39,6 @@ dependencies {
annotationProcessor
'com.alibaba:arouter-compiler:1.1.4'
api
project
(
':RvWrapper'
)
api
project
(
':component_resource'
)
api
project
(
':component_utils'
)
}
plugin_search/src/main/java/com/rv/search/TravelSearchActivity.java
View file @
f5c734e3
...
...
@@ -15,6 +15,7 @@ import com.frame.base.url.Constance;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.base.BaseStatusActivity
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
import
com.rv.component.utils.KeyboardUtil
;
import
com.rv.plugin.search.R
;
import
com.rv.plugin.search.R2
;
import
com.rv.search.adapter.TravelSearchAdapter
;
...
...
@@ -79,8 +80,6 @@ public class TravelSearchActivity extends BaseStatusActivity<SearchPresenter> {
}
}
});
}
@OnClick
({
R2
.
id
.
iv_back
,
R2
.
id
.
tv_search
})
...
...
@@ -104,6 +103,7 @@ public class TravelSearchActivity extends BaseStatusActivity<SearchPresenter> {
}
private
void
setData
(
BeanTravelSearch
data
)
{
KeyboardUtil
.
hideKeyboard
(
mActivity
);
if
(
mPage
==
1
)
{
mTravelSearchAdapter
.
getData
().
clear
();
mTravelSearchAdapter
.
notifyDataSetChanged
();
...
...
plugin_search/src/main/res/layout/activity_travel_search.xml
View file @
f5c734e3
...
...
@@ -26,11 +26,14 @@
android:layout_width=
"0dp"
android:layout_height=
"@dimen/size_40"
android:layout_weight=
"1"
android:maxLines=
"1"
android:singleLine=
"true"
android:background=
"@drawable/shape_rv_travel_search_line"
android:drawableLeft=
"@drawable/search"
android:drawablePadding=
"@dimen/size_15"
android:hint=
"搜索目的地/旅游线"
android:paddingLeft=
"@dimen/size_15"
android:textColor=
"@color/textMain"
android:textSize=
"@dimen/text_14"
/>
...
...
settings.gradle
View file @
f5c734e3
//include ':WXPay'
include
':RvFrame'
,
':plugin_search'
,
':component_utils'
include
':RvFrame'
,
':plugin_search'
,
':component_utils'
,
':component_control'
include
':RvTravel'
include
':RvClient'
include
':RvWrapper'
...
...
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