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
ae65a8f2
Commit
ae65a8f2
authored
Jul 26, 2019
by
linfeng
Browse files
Options
Browse Files
Download
Plain Diff
刷新动画
parents
b1650366
77a520cc
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
265 additions
and
112 deletions
+265
-112
AndroidManifest.xml
RvClient/src/main/AndroidManifest.xml
+18
-15
MainActivity.java
RvClient/src/main/java/com/xxfc/rv/MainActivity.java
+36
-9
RvClientApplication.java
RvClient/src/main/java/com/xxfc/rv/RvClientApplication.java
+3
-0
WakeUpActivity.java
RvClient/src/main/java/com/xxfc/rv/WakeUpActivity.java
+64
-0
WelcomeActivity.java
RvClient/src/main/java/com/xxfc/rv/WelcomeActivity.java
+11
-6
build.gradle
RvWrapper/build.gradle
+1
-5
OkHttpCreate.java
...rc/main/java/com/ruiwenliu/wrapper/http/OkHttpCreate.java
+4
-0
RvLogInterceptor.java
...ain/java/com/ruiwenliu/wrapper/http/RvLogInterceptor.java
+50
-0
view_refresh_header.xml
RvWrapper/src/main/res/layout/view_refresh_header.xml
+1
-0
city.json
module_home/src/main/assets/city.json
+4
-4
ApiConfig.java
...e_home/src/main/java/com/rv/home/rv/module/ApiConfig.java
+2
-0
BaseLoginActivity.java
...n/java/com/rv/home/rv/module/basic/BaseLoginActivity.java
+2
-0
CarRentalListActivity.java
...rv/home/rv/module/ui/main/home/CarRentalListActivity.java
+4
-3
HomeFragment.java
...java/com/rv/home/rv/module/ui/main/home/HomeFragment.java
+20
-11
SelectShopActivity.java
...om/rv/home/rv/module/ui/main/home/SelectShopActivity.java
+7
-6
SelectShopAdapter.java
...ome/rv/module/ui/main/home/adapter/SelectShopAdapter.java
+25
-2
fragment_home.xml
module_home/src/main/res/layout/fragment_home.xml
+1
-2
AndroidManifest.xml
plugin_share/src/main/AndroidManifest.xml
+6
-16
ShareActivity.java
plugin_share/src/main/java/com/rv/share/ShareActivity.java
+1
-1
WebViewActivity.java
plugin_share/src/main/java/com/rv/share/WebViewActivity.java
+0
-27
ReativeBillPresenter.java
...ain/java/com/rv/share/presenter/ReativeBillPresenter.java
+1
-1
RvWebView.java
plugin_share/src/main/java/com/rv/share/view/RvWebView.java
+3
-3
activity_share.xml
plugin_share/src/main/res/layout/activity_share.xml
+1
-1
No files found.
RvClient/src/main/AndroidManifest.xml
View file @
ae65a8f2
...
...
@@ -2,6 +2,7 @@
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
package=
"com.xxfc.rv"
>
<!-- ===================标准 =================== -->
<uses-permission
android:name=
"android.permission.VIBRATE"
/>
<!-- 震动 -->
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<!-- 联网 -->
...
...
@@ -30,8 +31,6 @@
<uses-permission
android:name=
"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"
/>
<!-- 用于申请获取蓝牙信息进行室内定位 -->
<uses-permission
android:name=
"android.permission.DOWNLOAD_WITHOUT_NOTIFICATION"
/>
<uses-permission
android:name=
"android.permission.FLASHLIGHT"
/>
<uses-feature
android:name=
"android.hardware.camera"
/>
...
...
@@ -100,7 +99,7 @@
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<application
android:name=
"
com.xxfc.rv
.RvClientApplication"
android:name=
".RvClientApplication"
android:allowBackup=
"true"
android:icon=
"@mipmap/logo"
android:label=
"@string/app_name"
...
...
@@ -109,7 +108,6 @@
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme.NoActionBar.SwipeBack"
tools:ignore=
"GoogleAppIndexingWarning"
>
<activity
android:name=
".WelcomeActivity"
android:launchMode=
"singleTask"
...
...
@@ -117,9 +115,9 @@
android:theme=
"@style/SplashTheme"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<!-- 百度地图相关 -->
<!-- 声明service组件 -->
<service
...
...
@@ -127,11 +125,9 @@
android:enabled=
"true"
android:process=
":remote"
/>
<meta-data
android:name=
"com.shareinstall.APP_KEY"
android:value=
"B7BK2A6722BAH6"
/>
<meta-data
android:name=
"com.baidu.lbsapi.API_KEY"
android:value=
"QaN98C5rV8hawNLVix0FAPLSsz7uh2q1"
/>
<!-- <meta-data -->
...
...
@@ -149,7 +145,7 @@
<meta-data
android:name=
"UMENG_APPKEY"
android:value=
"5d242bf24ca357797e000922"
></meta-data
>
android:value=
"5d242bf24ca357797e000922"
/
>
<activity
android:name=
".wxapi.WXEntryActivity"
...
...
@@ -160,7 +156,7 @@
<activity
android:name=
".wxapi.WXPayEntryActivity"
android:exported=
"true"
android:launchMode=
"singleTop"
></activity
>
<!-- QQ callback -->
android:launchMode=
"singleTop"
/
>
<!-- QQ callback -->
<activity
android:name=
"com.tencent.tauth.AuthActivity"
android:launchMode=
"singleTask"
...
...
@@ -181,15 +177,12 @@
android:theme=
"@android:style/Theme.Translucent.NoTitleBar"
/>
<!-- umShare 相关 end -->
<activity
android:name=
"
com.xxfc.rv
.MainActivity"
android:name=
".MainActivity"
android:launchMode=
"singleTask"
android:screenOrientation=
"portrait"
/>
android:screenOrientation=
"portrait"
></activity>
<activity
android:name=
"com.rv.home.rv.module.ui.login.LoginRvActivity"
android:screenOrientation=
"portrait"
>
</activity>
android:screenOrientation=
"portrait"
/>
<activity
android:name=
"com.rv.home.rv.module.ui.login.RegisteredActivity"
android:screenOrientation=
"portrait"
/>
...
...
@@ -385,6 +378,16 @@
android:launchMode=
"singleTask"
android:screenOrientation=
"portrait"
/>
<!-- ============================旅游========================================== -->
<activity
android:name=
".WakeUpActivity"
>
<intent-filter>
<action
android:name=
"android.intent.action.VIEW"
/>
<category
android:name=
"android.intent.category.DEFAULT"
/>
<category
android:name=
"android.intent.category.BROWSABLE"
/>
<data
android:scheme=
"pdfd6612"
/>
</intent-filter>
</activity>
</application>
</manifest>
\ No newline at end of file
RvClient/src/main/java/com/xxfc/rv/MainActivity.java
View file @
ae65a8f2
package
com
.
xxfc
.
rv
;
import
android.content.ComponentName
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.pm.PackageManager
;
import
android.os.Bundle
;
import
android.support.annotation.NonNull
;
import
android.support.annotation.Nullable
;
import
android.support.v4.content.ContextCompat
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
android.view.KeyEvent
;
import
android.view.View
;
...
...
@@ -17,6 +18,7 @@ import android.widget.Toast;
import
com.alibaba.android.arouter.launcher.ARouter
;
import
com.frame.base.url.Constance
;
import
com.frame.rv.config.RvFrameConfig
;
import
com.ruiwenliu.wrapper.adapter.TabAdapter
;
import
com.ruiwenliu.wrapper.base.BaseActivity
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.base.BaseWrapperFragment
;
...
...
@@ -28,7 +30,6 @@ import com.rv.camp.CampFragment;
import
com.rv.component.utils.Cooker
;
import
com.rv.home.rv.module.ApiConfig
;
import
com.rv.home.rv.module.basic.presenter.CommonPresenter
;
import
com.ruiwenliu.wrapper.adapter.TabAdapter
;
import
com.rv.home.rv.module.ui.main.home.HomeFragment
;
import
com.rv.home.rv.module.ui.main.home.bean.EffectiveTimeBean
;
import
com.rv.rvmine.MineFragment
;
...
...
@@ -98,7 +99,6 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
@Override
protected
void
initView
(
Bundle
savedInstanceState
,
TitleView
titleView
,
Intent
intent
)
{
ShareInstall
.
getInstance
().
reportRegister
();
updateAppUtils
=
UpdateAppUtils
.
from
(
MainActivity
.
this
);
viewPager
=
findViewById
(
R
.
id
.
pager_view_fragment
);
showTitle
(
false
);
...
...
@@ -117,6 +117,7 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
@Override
protected
void
loadData
(
Bundle
savedInstanceState
,
Intent
intent
)
{
wakeUp
(
intent
);
getEffectiveTime
();
getActivityPopup
();
checkVersion
();
...
...
@@ -274,18 +275,17 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
super
.
onNewIntent
(
intent
);
if
(
intent
!=
null
&&
"home"
.
equals
(
intent
.
getStringExtra
(
"to"
)))
{
setCurrent
(
TYPE_HOME_PAGE
);
}
if
(
intent
!=
null
&&
"travel"
.
equals
(
intent
.
getStringExtra
(
"to"
)))
{
}
else
if
(
intent
!=
null
&&
"travel"
.
equals
(
intent
.
getStringExtra
(
"to"
)))
{
setCurrent
(
TYPE_TRAVEL
);
}
if
(
intent
!=
null
&&
"discovery"
.
equals
(
intent
.
getStringExtra
(
"to"
)))
{
}
else
if
(
intent
!=
null
&&
"discovery"
.
equals
(
intent
.
getStringExtra
(
"to"
)))
{
setCurrent
(
TYPE_FOUND
);
}
if
(
intent
!=
null
&&
"mine_coupons"
.
equals
(
intent
.
getStringExtra
(
"to"
)))
{
}
else
if
(
intent
!=
null
&&
"mine_coupons"
.
equals
(
intent
.
getStringExtra
(
"to"
)))
{
setCurrent
(
TYPE_MINE
);
ARouter
.
getInstance
()
.
build
(
Constance
.
ACTIVITY_URL_COUPONALL
)
.
navigation
();
}
else
{
wakeUp
(
intent
);
}
}
...
...
@@ -297,6 +297,7 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
String
versionName
=
updateAppUtils
.
getAppVersionName
(
this
);
if
(!
TextUtils
.
isEmpty
(
versionName
))
{
mPresenter
.
getData
(
0
,
String
.
format
(
ApiConfig
.
HTTP_URL_VERSION_CHECK
,
versionName
),
VersionCheckBean
.
class
,
headMap
,
false
);
}
}
...
...
@@ -327,4 +328,30 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
}
return
true
;
}
/******
* 唤醒Apk,跳转到webView页面
* @param intent
*/
private
void
wakeUp
(
Intent
intent
)
{
if
(
"webView"
.
equals
(
intent
.
getStringExtra
(
"to"
)))
{
if
(!
TextUtils
.
isEmpty
(
OkGoUtil
.
getToken
()))
{
Map
<
String
,
Object
>
header
=
new
HashMap
<>();
header
.
put
(
"Authorization"
,
OkGoUtil
.
getToken
());
Map
<
String
,
Object
>
body
=
new
HashMap
<>();
body
.
put
(
"code"
,
Cooker
.
getStringValue
(
getApplicationContext
(),
"code"
));
mPresenter
.
postData
(
RvFrameConfig
.
HOST
,
10000
,
ApiConfig
.
HTTP_URL_RELATION_BIND
,
null
,
body
,
header
,
false
);
}
ComponentName
componentName
=
new
ComponentName
(
this
,
"com.rv.share.WebViewActivity"
);
Intent
in
=
new
Intent
();
in
.
setComponent
(
componentName
);
in
.
putExtra
(
"url"
,
intent
.
getStringExtra
(
"url"
));
in
.
putExtra
(
"title"
,
intent
.
getStringExtra
(
"title"
));
startActivity
(
in
);
}
}
}
RvClient/src/main/java/com/xxfc/rv/RvClientApplication.java
View file @
ae65a8f2
...
...
@@ -5,6 +5,7 @@ import android.app.Activity;
import
android.app.ActivityManager
;
import
android.content.Context
;
import
android.os.StrictMode
;
import
android.util.Log
;
import
com.alibaba.android.arouter.launcher.ARouter
;
import
com.baidu.mapapi.CoordType
;
...
...
@@ -47,11 +48,13 @@ public class RvClientApplication extends FrameApp {
@Override
public
void
onCreate
()
{
super
.
onCreate
();
Log
.
e
(
"xxxxxxxxxxxxxxxxxxxxx"
,
"RvClientApplication_onCreate"
);
StrictMode
.
VmPolicy
.
Builder
builder
=
new
StrictMode
.
VmPolicy
.
Builder
();
StrictMode
.
setVmPolicy
(
builder
.
build
());
builder
.
detectFileUriExposure
();
if
(
isMainProcess
())
{
ShareInstall
.
getInstance
().
init
(
this
);
ShareInstall
.
getInstance
().
reportRegister
();
}
LogUtil
.
setLogEnable
(
true
,
getApplicationContext
());
CrashHandler
.
getInstance
().
init
(
this
);
...
...
RvClient/src/main/java/com/xxfc/rv/WakeUpActivity.java
0 → 100644
View file @
ae65a8f2
package
com
.
xxfc
.
rv
;
import
android.content.Intent
;
import
android.support.v7.app.AppCompatActivity
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
com.rv.component.utils.Cooker
;
import
com.rv.component.utils.LogUtil
;
import
com.sh.sdk.shareinstall.ShareInstall
;
import
com.sh.sdk.shareinstall.listener.AppGetInfoListener
;
import
org.json.JSONException
;
import
org.json.JSONObject
;
/********
* shareInstall 唤醒界面
*/
public
class
WakeUpActivity
extends
AppCompatActivity
{
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
rv_act_weclome
);
ShareInstall
.
getInstance
().
getInfo
(
getIntent
(),
listener
);
}
@Override
protected
void
onNewIntent
(
Intent
intent
)
{
super
.
onNewIntent
(
intent
);
// 此处要调用,否则app在后台运行时,会无法截获
ShareInstall
.
getInstance
().
getInfo
(
intent
,
listener
);
}
private
AppGetInfoListener
listener
=
new
AppGetInfoListener
()
{
@Override
public
void
onGetInfoFinish
(
String
info
)
{
LogUtil
.
d
(
"ShareInstall"
,
"info = "
+
info
);
if
(
info
.
contains
(
"code"
))
try
{
JSONObject
object
=
new
JSONObject
(
info
);
String
inviteCode
=
object
.
optString
(
"code"
);
if
(!
TextUtils
.
isEmpty
(
inviteCode
))
{
Cooker
.
save
(
getApplicationContext
(),
"code"
,
inviteCode
);
}
String
url
=
object
.
optString
(
"url"
);
LogUtil
.
d
(
"唤醒传过来的url="
+
url
);
String
title
=
object
.
optString
(
"title"
);
LogUtil
.
d
(
"唤醒传过来的tile="
+
title
);
if
(!
TextUtils
.
isEmpty
(
url
)
&&
!
TextUtils
.
isEmpty
(
title
))
{
Intent
intent
=
new
Intent
(
getApplicationContext
(),
MainActivity
.
class
);
intent
.
putExtra
(
"to"
,
"webView"
);
intent
.
putExtra
(
"url"
,
url
);
intent
.
putExtra
(
"title"
,
title
);
startActivity
(
intent
);
finish
();
}
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
}
}
};
}
RvClient/src/main/java/com/xxfc/rv/WelcomeActivity.java
View file @
ae65a8f2
...
...
@@ -72,13 +72,18 @@ public class WelcomeActivity extends BaseActivity<CommonPresenter> {
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
new
Consumer
<
Long
>()
{
@Override
public
void
accept
(
@NonNull
Long
aLong
)
throws
Exception
{
public
void
accept
(
@NonNull
Long
aLong
)
{
try
{
if
(!
TextUtils
.
isEmpty
(
UtilsManager
.
getInstance
(
mActivity
).
getSPInstance
(
"city_json"
).
getString
(
"token"
,
""
)))
{
OkGoUtil
.
setToken
(
UtilsManager
.
getInstance
(
mActivity
)
.
getSPInstance
(
"city_json"
)
.
getString
(
"token"
,
""
));
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
startActivity
(
MainActivity
.
getIntent
(
mActivity
));
mDisposable
.
dispose
();
finish
();
...
...
RvWrapper/build.gradle
View file @
ae65a8f2
...
...
@@ -33,7 +33,6 @@ android {
dependencies
{
api
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
/*系统*/
api
'com.jakewharton:butterknife:9.0.0-rc1'
annotationProcessor
'com.jakewharton:butterknife-compiler:9.0.0-rc1'
/*fragment*/
...
...
@@ -51,16 +50,13 @@ dependencies {
api
"com.squareup.okhttp3:logging-interceptor:$rootProject.ext.okHttpVersion"
//转换器,请求结果转换成Model
api
'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
api
'com.davemorrissey.labs:subsampling-scale-image-view:3.9.0'
api
project
(
path:
':RvFrame'
)
// glide相关
api
'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor
'com.github.bumptech.glide:compiler:4.7.1'
api
'com.github.bumptech.glide:okhttp3-integration:4.3.1'
api
'com.davemorrissey.labs:subsampling-scale-image-view:3.9.0'
implementation
'com.alibaba:fastjson:1.2.21'
implementation
project
(
':component_utils'
)
}
RvWrapper/src/main/java/com/ruiwenliu/wrapper/http/OkHttpCreate.java
View file @
ae65a8f2
package
com
.
ruiwenliu
.
wrapper
.
http
;
import
android.os.Build
;
import
android.os.Environment
;
import
com.ruiwenliu.wrapper.BuildConfig
;
import
com.ruiwenliu.wrapper.util.LogUtils
;
import
java.io.File
;
...
...
@@ -119,6 +121,8 @@ public class OkHttpCreate {
});
loggingInterceptor
.
setLevel
(
HttpLoggingInterceptor
.
Level
.
BODY
);
this
.
mHttpBuilder
.
addInterceptor
(
loggingInterceptor
);
// if (BuildConfig.DEBUG)
// this.mHttpBuilder.addInterceptor(new RvLogInterceptor());
}
/**
...
...
RvWrapper/src/main/java/com/ruiwenliu/wrapper/http/RvLogInterceptor.java
0 → 100644
View file @
ae65a8f2
package
com
.
ruiwenliu
.
wrapper
.
http
;
import
android.text.TextUtils
;
import
com.ruiwenliu.wrapper.util.LogUtils
;
import
com.rv.component.utils.LogUtil
;
import
java.io.IOException
;
import
java.nio.charset.Charset
;
import
java.util.Set
;
import
okhttp3.Headers
;
import
okhttp3.Interceptor
;
import
okhttp3.Request
;
import
okhttp3.Response
;
import
okio.Buffer
;
import
okio.BufferedSink
;
import
okio.BufferedSource
;
public
class
RvLogInterceptor
implements
Interceptor
{
private
final
String
TAG
=
"http"
;
@Override
public
Response
intercept
(
Chain
chain
)
throws
IOException
{
Request
request
=
chain
.
request
();
LogUtil
.
d
(
"http:url="
,
request
.
url
().
toString
());
LogUtil
.
d
(
"http:请求方法="
,
request
.
method
());
LogUtil
.
d
(
"http:headers="
,
" "
);
Headers
headers
=
request
.
headers
();
if
(
headers
!=
null
)
{
Set
<
String
>
names
=
headers
.
names
();
if
(
names
!=
null
)
{
for
(
String
s
:
names
)
{
LogUtil
.
d
(
"http:headers="
,
s
+
"="
+
headers
.
get
(
s
));
}
}
}
Response
response
=
chain
.
proceed
(
chain
.
request
());
BufferedSource
source
=
response
.
body
().
source
();
Buffer
buffer
=
source
.
buffer
();
Charset
UTF8
=
Charset
.
forName
(
"UTF-8"
);
String
bodyStr
=
buffer
.
clone
().
readString
(
UTF8
);
LogUtil
.
d
(
"http:response="
,
bodyStr
);
return
response
;
}
}
RvWrapper/src/main/res/layout/view_refresh_header.xml
View file @
ae65a8f2
...
...
@@ -16,6 +16,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/progress_freshing_frame"
/>
</LinearLayout>
<TextView
...
...
module_home/src/main/assets/city.json
View file @
ae65a8f2
...
...
@@ -32,7 +32,7 @@
},
{
"lists"
:
[{
"name"
:
"北京"
,
"id"
:
110
0
00
"id"
:
110
1
00
},
{
"name"
:
"白银市"
,
"id"
:
620400
...
...
@@ -77,7 +77,7 @@
},
{
"lists"
:
[{
"name"
:
"重庆"
,
"id"
:
500
0
00
"id"
:
500
1
00
},
{
"name"
:
"成都市"
,
"id"
:
510100
...
...
@@ -641,7 +641,7 @@
},
{
"lists"
:
[{
"name"
:
"上海"
,
"id"
:
310
0
00
"id"
:
310
1
00
},
{
"name"
:
"深圳市"
,
"id"
:
440300
...
...
@@ -719,7 +719,7 @@
},
{
"lists"
:
[{
"name"
:
"天津"
,
"id"
:
120
0
00
"id"
:
120
1
00
},
{
"name"
:
"太原市"
,
"id"
:
140100
...
...
module_home/src/main/java/com/rv/home/rv/module/ApiConfig.java
View file @
ae65a8f2
...
...
@@ -109,4 +109,6 @@ public class ApiConfig {
* 通用文本请求
*/
public
static
String
HTTP_URL_UNAUTH_TYPES
=
RvFrameConfig
.
HOST
+
"/api/app/cofig/app/unauth/types/"
;
public
static
String
HTTP_URL_RELATION_BIND
=
RvFrameConfig
.
HOST
+
"/api/admin/relation/bind"
;
}
module_home/src/main/java/com/rv/home/rv/module/basic/BaseLoginActivity.java
View file @
ae65a8f2
...
...
@@ -16,6 +16,7 @@ import com.ruiwenliu.wrapper.SPConstance;
import
com.ruiwenliu.wrapper.presenter.MvpPresenter
;
import
com.ruiwenliu.wrapper.util.UtilsManager
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
import
com.rv.component.utils.LogUtil
;
import
com.rv.home.R
;
import
com.rv.home.rv.module.ApiConfig
;
import
com.ruiwenliu.wrapper.bean.BeanUserInfo
;
...
...
@@ -118,6 +119,7 @@ public abstract class BaseLoginActivity<P extends MvpPresenter> extends BaseStat
public
void
processLoginData
(
RegisteredBean
bean
)
{
LogUtil
.
d
(
"登录返回的code为"
+
bean
.
getData
().
getCode
());
RegisteredBean
registeredBean
=
bean
;
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_CODE
,
registeredBean
.
getData
().
getCode
()).
commit
();
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_NAME
,
registeredBean
.
getData
().
getUsername
()).
commit
();
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/CarRentalListActivity.java
View file @
ae65a8f2
...
...
@@ -54,7 +54,7 @@ import butterknife.OnClick;
* Date: 2019/5/16.
* Desc:租车列表
*/
public
class
CarRentalListActivity
extends
BaseStatusActivity
<
CommonPresenter
>
implements
BaseQuickAdapter
.
RequestLoadMoreListener
,
SimpleRefreshLayout
.
OnSimpleRefreshListener
{
public
class
CarRentalListActivity
extends
BaseStatusActivity
<
CommonPresenter
>
implements
BaseQuickAdapter
.
RequestLoadMoreListener
,
SimpleRefreshLayout
.
OnSimpleRefreshListener
{
@BindView
(
R2
.
id
.
recyclerView
)
RecyclerView
recyclerView
;
@BindView
(
R2
.
id
.
ll_head_menu
)
...
...
@@ -257,6 +257,7 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
map
.
put
(
"limit"
,
10
);
map
.
put
(
"lat"
,
mLat
);
map
.
put
(
"lon"
,
mLon
);
map
.
put
(
"parkBranchCompanyId"
,
dataBean
.
getStartCompanyId
());
try
{
map
.
put
(
"startDateTamp"
,
TimeManager
.
dateToStamp
(
begDate
));
map
.
put
(
"endDateTamp"
,
TimeManager
.
dateToStamp
(
endDate
));
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/HomeFragment.java
View file @
ae65a8f2
...
...
@@ -209,6 +209,9 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
private
double
lonLongitude
;
private
LatLng
mLatLng
;
//当前城市经纬度
private
int
getCompanyId
;
// 取车公司id
private
double
getLatitude
;
private
double
getLongitude
;
private
double
outLatitude
=
0
;
private
double
outLongitude
;
private
int
getCityId
;
//取车城市ID
...
...
@@ -559,7 +562,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
R2
.
id
.
tv_out_city
,
R2
.
id
.
tv_get_address
,
R2
.
id
.
tv_out_address
,
R2
.
id
.
ll_item_select_data
,
R2
.
id
.
tv_select_car
,
R2
.
id
.
ll_item_rv_city
,
R2
.
id
.
tv_book_now
,
R2
.
id
.
ll_item_rv_hot_label1
,
R2
.
id
.
ll_item_rv_hot_label2
,
R2
.
id
.
ll_item_rv_hot_label3
,
R2
.
id
.
ll_item_hot_rvtour
,
R2
.
id
.
ll_item_hot_entertainment_camp
,
R2
.
id
.
ll_item_hot_car_rental
,
R2
.
id
.
tv_see_more_popular
,
R2
.
id
.
ll_item_top
,
R2
.
id
.
travel_server_image
,
R2
.
id
.
tv_car_rental_guide
,
R2
.
id
.
ll_item_activity_all
,
R2
.
id
.
ll_rent
,
R2
.
id
.
ll_return
})
R2
.
id
.
ll_item_top
,
R2
.
id
.
travel_server_image
,
R2
.
id
.
tv_car_rental_guide
,
R2
.
id
.
ll_item_activity_all
,
R2
.
id
.
ll_rent
,
R2
.
id
.
ll_return
,
R2
.
id
.
cardview
})
public
void
onViewClicked
(
View
view
)
{
int
id
=
view
.
getId
();
if
(
id
==
R
.
id
.
travel_city_layout
)
{
...
...
@@ -769,6 +772,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
}
else
if
(
id
==
R
.
id
.
ll_item_activity_all
)
{
showToast
(
"亲,该功能还在开发中。。。"
);
}
else
if
(
id
==
R
.
id
.
cardview
)
{
return
;
}
}
...
...
@@ -783,20 +788,21 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
case
TYPE_REQUEST_CITY:
//城市列表
if
(
type
==
1
)
{
String
companyName
=
data
.
getStringExtra
(
"company"
);
getCompanyId
=
data
.
getIntExtra
(
"company_id"
,
1
);
getCityName
=
requestData
;
headTvGetShop
.
setText
(
companyName
);
getCityId
=
data
.
getIntExtra
(
"id"
,
0
);
double
lat
=
data
.
getDoubleExtra
(
"latitude"
,
0
);
double
lon
=
data
.
getDoubleExtra
(
"longitude"
,
0
);
setRequestData
(
type
,
requestData
,
headTvGetCity
,
headTvOutCity
,
lat
,
lon
);
getLatitude
=
data
.
getDoubleExtra
(
"latitude"
,
0
);
getLongitude
=
data
.
getDoubleExtra
(
"longitude"
,
0
);
setRequestData
(
type
,
requestData
,
headTvGetCity
,
headTvOutCity
,
getLatitude
,
getLongitude
);
}
else
if
(
type
==
2
)
{
outCityName
=
requestData
;
String
companyName
=
data
.
getStringExtra
(
"company"
);
headTvOutShop
.
setText
(
companyName
);
outCityId
=
data
.
getIntExtra
(
"id"
,
0
);
double
lat
=
data
.
getDoubleExtra
(
"latitude"
,
0
);
double
lon
=
data
.
getDoubleExtra
(
"longitude"
,
0
);
setRequestData
(
type
,
requestData
,
headTvGetCity
,
headTvOutCity
,
lat
,
lon
);
outLatitude
=
data
.
getDoubleExtra
(
"latitude"
,
0
);
outLongitude
=
data
.
getDoubleExtra
(
"longitude"
,
0
);
setRequestData
(
type
,
requestData
,
headTvGetCity
,
headTvOutCity
,
outLatitude
,
outLongitude
);
}
else
if
(
type
==
3
)
{
tvRvCity
.
setText
(
""
);
vVTourCityId
=
data
.
getIntExtra
(
"id"
,
0
);
...
...
@@ -858,13 +864,9 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
}
switch
(
type
)
{
case
1
:
latLatitude
=
lat
;
lonLongitude
=
lon
;
tvGet
.
setText
(
data
);
break
;
case
2
:
outLatitude
=
lat
;
outLongitude
=
lon
;
tvOut
.
setText
(
data
);
break
;
case
3
:
...
...
@@ -956,6 +958,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
headTvGetShop
.
setTextColor
(
_mActivity
.
getResources
().
getColor
(
R
.
color
.
colorMain
));
latLatitude
=
bean
.
getData
().
getData
().
get
(
0
).
getLatitude
();
lonLongitude
=
bean
.
getData
().
getData
().
get
(
0
).
getLongitude
();
getCompanyId
=
bean
.
getData
().
getData
().
get
(
0
).
getId
();
}
if
(
headTvOutShop
!=
null
)
{
...
...
@@ -1045,6 +1048,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
dataBean
.
setEndCityName
(
endCity
);
dataBean
.
setEndAddr
(
endAddress
);
dataBean
.
setDriverType
(
2
);
dataBean
.
setStartCompanyId
(
getCompanyId
);
startActivity
(
CarRentalListActivity
.
getIntent
(
getContext
(),
latLatitude
,
lonLongitude
,
outLatitude
,
outLongitude
,
false
,
dataBean
,
startTime
,
endTime
));
}
...
...
@@ -1120,6 +1124,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
}
else
{
latLatitude
=
result
.
getLocation
().
latitude
;
lonLongitude
=
result
.
getLocation
().
longitude
;
getLatitude
=
result
.
getLocation
().
latitude
;
getLongitude
=
result
.
getLocation
().
latitude
;
outLatitude
=
result
.
getLocation
().
latitude
;
outLongitude
=
result
.
getLocation
().
longitude
;
rvTourLatitude
=
result
.
getLocation
().
latitude
;
...
...
@@ -1136,10 +1142,13 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
}
else
{
latLatitude
=
result
.
getLocation
().
latitude
;
lonLongitude
=
result
.
getLocation
().
longitude
;
getLatitude
=
result
.
getLocation
().
latitude
;
getLongitude
=
result
.
getLocation
().
latitude
;
outLatitude
=
result
.
getLocation
().
latitude
;
outLongitude
=
result
.
getLocation
().
longitude
;
rvTourLatitude
=
result
.
getLocation
().
latitude
;
rvTourLongitude
=
result
.
getLocation
().
longitude
;
getShopList
(
latLatitude
,
lonLongitude
,
false
);
}
}
});
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/SelectShopActivity.java
View file @
ae65a8f2
...
...
@@ -112,8 +112,9 @@ public class SelectShopActivity extends BaseStatusActivity<CommonPresenter> impl
Intent
intent
=
new
Intent
();
intent
.
putExtra
(
"location"
,
cityName
);
intent
.
putExtra
(
"type"
,
shopType
);
intent
.
putExtra
(
"id"
,
mCityId
);
intent
.
putExtra
(
"company"
,
mAdapter
.
getData
().
get
(
position
).
getName
());
intent
.
putExtra
(
"id"
,
mAdapter
.
getItem
(
position
).
getAddrCity
());
intent
.
putExtra
(
"company"
,
mAdapter
.
getItem
(
position
).
getName
());
intent
.
putExtra
(
"company_id"
,
mAdapter
.
getItem
(
position
).
getId
());
intent
.
putExtra
(
"latitude"
,
latLatitude
);
intent
.
putExtra
(
"longitude"
,
lonLongitude
);
setResult
(
RESULT_OK
,
intent
);
...
...
@@ -238,10 +239,10 @@ public class SelectShopActivity extends BaseStatusActivity<CommonPresenter> impl
}
else
{
map
.
put
(
"addrCity"
,
mCityId
);
}
if
(
mLat
>
0
)
{
map
.
put
(
"lat"
,
mLat
);
map
.
put
(
"lon"
,
mLon
);
}
//
if (mLat > 0) {
//
map.put("lat", mLat);
//
map.put("lon", mLon);
//
}
mPresenter
.
getData
(
RvFrameConfig
.
VEHICLE_POST
,
0
,
ApiConfig
.
HTTP_URL_SHOP_LIST
,
ShopListBean
.
class
,
map
,
page
==
1
?
true
:
false
);
}
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/adapter/SelectShopAdapter.java
View file @
ae65a8f2
...
...
@@ -5,8 +5,10 @@ import android.net.Uri;
import
android.text.TextUtils
;
import
android.view.View
;
import
com.alibaba.android.arouter.launcher.ARouter
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.frame.base.url.Constance
;
import
com.rv.component.utils.LocationUtils
;
import
com.rv.home.R
;
import
com.rv.home.R2
;
...
...
@@ -38,6 +40,7 @@ public class SelectShopAdapter extends BaseQuickAdapter<ShopListBean.DataBeanX.D
helper
.
setText
(
R
.
id
.
tv_position
,
"地址:"
+
item
.
getAddrDetail
());
helper
.
setText
(
R
.
id
.
tv_contacts
,
"联系人: "
+
item
.
getLeader
()
+
" "
+
item
.
getLeaderContactInfo
());
helper
.
setOnClickListener
(
R
.
id
.
tv_call
,
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
...
...
@@ -52,7 +55,27 @@ public class SelectShopAdapter extends BaseQuickAdapter<ShopListBean.DataBeanX.D
});
double
distance
=
LocationUtils
.
getDistance
(
latitude
,
longitude
,
item
.
getLatitude
(),
item
.
getLongitude
());
int
distanceKm
=
(
int
)(
distance
/
1000
);
int
distanceKm
=
(
int
)
(
distance
/
1000
);
helper
.
setText
(
R
.
id
.
tv_distance
,
"距您"
+
distanceKm
+
"km"
);
helper
.
setOnClickListener
(
R
.
id
.
tv_distance
,
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
showMap
(
item
);
}
});
}
private
void
showMap
(
ShopListBean
.
DataBeanX
.
DataBean
bean
)
{
if
(
bean
!=
null
)
{
ARouter
.
getInstance
()
.
build
(
Constance
.
ACTIVITY_URL_CARDETAILMAP
)
.
withString
(
"addrDetail"
,
bean
.
getAddrDetail
())
.
withString
(
"phone"
,
bean
.
getLeaderContactInfo
())
.
withString
(
"name"
,
bean
.
getName
())
.
withDouble
(
"latitude"
,
bean
.
getLatitude
())
.
withDouble
(
"longitude"
,
bean
.
getLongitude
())
.
navigation
();
}
}
}
\ No newline at end of file
module_home/src/main/res/layout/fragment_home.xml
View file @
ae65a8f2
...
...
@@ -41,6 +41,7 @@
<android.support.v7.widget.CardView
android:id=
"@+id/cardview"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"@dimen/size_15"
...
...
@@ -124,7 +125,6 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/size_10"
android:drawableRight=
"@drawable/rv_common_icon_up_arrow"
android:drawablePadding=
"@dimen/size_3"
android:gravity=
"center"
android:hint=
"@string/rv_city_list"
...
...
@@ -174,7 +174,6 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/size_10"
android:drawableRight=
"@drawable/rv_common_icon_up_arrow"
android:drawablePadding=
"@dimen/size_3"
android:gravity=
"center"
android:hint=
"@string/rv_city_list"
...
...
plugin_share/src/main/AndroidManifest.xml
View file @
ae65a8f2
...
...
@@ -5,7 +5,7 @@
<application>
<activity
android:name=
".ShareActivity"
/>
<activity
android:name=
".BillActivity"
/>
<activity
android:name=
".WebViewActivity"
>
<activity
android:name=
".WebViewActivity"
>
<!--<intent-filter>-->
<!--<data android:scheme="rv" android:host="xxfc" android:path="/activity" />-->
<!--<!–下面这几行也必须得设置–>-->
...
...
@@ -13,16 +13,6 @@
<!--<action android:name="android.intent.action.VIEW"/>-->
<!--<category android:name="android.intent.category.BROWSABLE"/>-->
<!--</intent-filter>-->
<intent-filter>
<action
android:name=
"android.intent.action.VIEW"
/>
<category
android:name=
"android.intent.category.DEFAULT"
/>
<category
android:name=
"android.intent.category.BROWSABLE"
/>
<data
android:scheme=
"pdfd6612"
/>
</intent-filter>
</activity>
<activity
android:name=
".ReativeBillActivity"
/>
<activity
android:name=
".PopularizeActivity"
></activity>
...
...
plugin_share/src/main/java/com/rv/share/ShareActivity.java
View file @
ae65a8f2
...
...
@@ -115,7 +115,7 @@ public class ShareActivity extends BaseStatusActivity<SharePresenter> {
int
id
=
view
.
getId
();
if
(
TextUtils
.
isEmpty
(
shareUrl
))
{
String
code
=
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
getSPInstance
(
SPConstance
.
USER_JSON
).
getString
(
SPConstance
.
USER_JSON_CODE
,
""
);
shareUrl
=
RvFrameConfig
.
HOST
+
"/h5/appHtml/view/
download
.html?code="
+
code
+
"_P0101"
;
shareUrl
=
RvFrameConfig
.
HOST
+
"/h5/appHtml/view/
invitationCourtesyShare
.html?code="
+
code
+
"_P0101"
;
}
if
(
id
==
R
.
id
.
tv_weixin
)
{
mPresenter
.
shareWx
(
shareUrl
,
"【滴房车】"
,
"新人专享大礼包,快去领!"
);
...
...
plugin_share/src/main/java/com/rv/share/WebViewActivity.java
View file @
ae65a8f2
...
...
@@ -46,7 +46,6 @@ public class WebViewActivity extends BaseStatusActivity<WebViewPresenter> {
@Override
protected
void
initView
(
Bundle
savedInstanceState
,
TitleView
titleView
,
Intent
intent
)
{
// 获取唤醒参数
ShareInstall
.
getInstance
().
getInfo
(
intent
,
openListener
);
url
=
intent
.
getStringExtra
(
"url"
);
title
=
intent
.
getStringExtra
(
"title"
);
if
(!
TextUtils
.
isEmpty
(
title
))
{
...
...
@@ -76,13 +75,6 @@ public class WebViewActivity extends BaseStatusActivity<WebViewPresenter> {
}
@Override
protected
void
onNewIntent
(
Intent
intent
)
{
super
.
onNewIntent
(
intent
);
// 此处要调用,否则app在后台运行时,会无法截获
ShareInstall
.
getInstance
().
getInfo
(
intent
,
openListener
);
}
@Override
public
void
onDestroy
()
{
if
(
rvWebView
!=
null
)
{
...
...
@@ -113,23 +105,4 @@ public class WebViewActivity extends BaseStatusActivity<WebViewPresenter> {
}
};
private
AppGetInfoListener
openListener
=
new
AppGetInfoListener
()
{
@Override
public
void
onGetInfoFinish
(
String
info
)
{
// 客户端获取到的参数是json字符串格式
Log
.
d
(
"ShareInstall"
,
"info = "
+
info
);
if
(
info
.
contains
(
"code"
))
try
{
JSONObject
object
=
new
JSONObject
(
info
);
String
inviteCode
=
object
.
optString
(
"code"
);
if
(!
TextUtils
.
isEmpty
(
inviteCode
))
{
Cooker
.
save
(
getApplicationContext
(),
"code"
,
inviteCode
);
}
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
}
}
};
}
plugin_share/src/main/java/com/rv/share/presenter/ReativeBillPresenter.java
View file @
ae65a8f2
...
...
@@ -35,7 +35,7 @@ public class ReativeBillPresenter extends CommonPresenter {
file
=
saveBitmapFile
(
bitmap
);
}
if
(
file
!=
null
)
{
Toast
.
makeText
(
getPresenterContext
(),
"海报保存在"
+
file
.
getAbsolutePath
(),
Toast
.
LENGTH_
SHORT
).
show
();
Toast
.
makeText
(
getPresenterContext
(),
"海报保存在"
+
file
.
getAbsolutePath
(),
Toast
.
LENGTH_
LONG
).
show
();
}
}
}
...
...
plugin_share/src/main/java/com/rv/share/view/RvWebView.java
View file @
ae65a8f2
...
...
@@ -139,13 +139,13 @@ public class RvWebView extends WebView {
@JavascriptInterface
public
String
getUserName
()
{
String
name
=
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
getSPInstance
(
SPConstance
.
USER_JSON
).
getString
(
SPConstance
.
USER_JSON_NAME
,
""
);
String
name
=
UtilsManager
.
getInstance
(
getContext
()
).
getSPInstance
(
SPConstance
.
USER_JSON
).
getString
(
SPConstance
.
USER_JSON_NAME
,
""
);
return
name
;
}
@JavascriptInterface
public
String
getHeadUrl
()
{
String
url
=
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
getSPInstance
(
SPConstance
.
USER_JSON
).
getString
(
SPConstance
.
USER_JSON_HEADERURL
,
""
);
String
url
=
UtilsManager
.
getInstance
(
getContext
()
).
getSPInstance
(
SPConstance
.
USER_JSON
).
getString
(
SPConstance
.
USER_JSON_HEADERURL
,
""
);
return
url
;
}
...
...
@@ -163,7 +163,7 @@ public class RvWebView extends WebView {
@JavascriptInterface
public
String
getCode
()
{
String
code
=
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
getSPInstance
(
SPConstance
.
USER_JSON
).
getString
(
SPConstance
.
USER_JSON_CODE
,
""
);
String
code
=
UtilsManager
.
getInstance
(
getContext
()
).
getSPInstance
(
SPConstance
.
USER_JSON
).
getString
(
SPConstance
.
USER_JSON_CODE
,
""
);
return
code
;
}
...
...
plugin_share/src/main/res/layout/activity_share.xml
View file @
ae65a8f2
...
...
@@ -217,7 +217,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_10"
android:text=
"
已邀请
"
android:text=
"
待激活
"
android:textColor=
"@color/gray_707070"
/>
</LinearLayout>
...
...
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