Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_street
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
0
Merge Requests
0
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
android
android_street
Commits
04aba431
Commit
04aba431
authored
Jul 29, 2021
by
mengcuiguang2
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
072dc40d
d1e3e3d7
Changes
44
Show whitespace changes
Inline
Side-by-side
Showing
44 changed files
with
1176 additions
and
147 deletions
+1176
-147
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+1
-0
EnterDestinationAdapter.kt
.../java/com/mints/street/adapter/EnterDestinationAdapter.kt
+4
-0
GridBenfitAdapter.kt
...c/main/java/com/mints/street/adapter/GridBenfitAdapter.kt
+58
-0
GridMapAdapter.kt
app/src/main/java/com/mints/street/adapter/GridMapAdapter.kt
+2
-2
ItemEnterDestinationAdapter.kt
...a/com/mints/street/adapter/ItemEnterDestinationAdapter.kt
+6
-0
BaiduApi.kt
app/src/main/java/com/mints/street/api/BaiduApi.kt
+48
-0
BaseArrayResponse.java
...rc/main/java/com/mints/street/bean/BaseArrayResponse.java
+22
-0
BaseResponse.java
app/src/main/java/com/mints/street/bean/BaseResponse.java
+1
-1
PositionBean.kt
app/src/main/java/com/mints/street/bean/PositionBean.kt
+34
-0
LoginActivity.kt
app/src/main/java/com/mints/street/login/LoginActivity.kt
+1
-2
SearchAfterItem.kt
...c/main/java/com/mints/street/main/home/SearchAfterItem.kt
+24
-6
SearchMapActivity.kt
...main/java/com/mints/street/main/home/SearchMapActivity.kt
+68
-30
SearchMapViewModel.kt
...ain/java/com/mints/street/main/home/SearchMapViewModel.kt
+68
-5
onGetSuggestionPositionsLister.kt
.../mints/street/main/home/onGetSuggestionPositionsLister.kt
+8
-0
AboutusActivity.kt
...src/main/java/com/mints/street/main/my/AboutusActivity.kt
+1
-2
MoresettingsActivity.kt
...ain/java/com/mints/street/main/my/MoresettingsActivity.kt
+1
-2
MyFragment.kt
app/src/main/java/com/mints/street/main/my/MyFragment.kt
+3
-1
MyViewModel.kt
app/src/main/java/com/mints/street/main/my/MyViewModel.kt
+5
-0
OpenvipActivity.kt
...src/main/java/com/mints/street/main/my/OpenvipActivity.kt
+18
-12
FreeZoneFragment.kt
...rc/main/java/com/mints/street/main/vr/FreeZoneFragment.kt
+0
-3
BaiduModel.kt
app/src/main/java/com/mints/street/model/BaiduModel.kt
+31
-0
BaiduGsonConverterFactory.java
...mints/street/netwrok/baidu/BaiduGsonConverterFactory.java
+138
-0
BaiduHttpConfiguation.java
...com/mints/street/netwrok/baidu/BaiduHttpConfiguation.java
+86
-0
BaiduHttpManager.java
...java/com/mints/street/netwrok/baidu/BaiduHttpManager.java
+76
-0
BaiduRetrofitClient.java
...a/com/mints/street/netwrok/baidu/BaiduRetrofitClient.java
+90
-0
GuideActivity.kt
app/src/main/java/com/mints/street/splash/GuideActivity.kt
+6
-2
DialogUtils.kt
...c/main/java/com/mints/street/widget/dialog/DialogUtils.kt
+11
-1
ShowBenfitDialog.kt
...n/java/com/mints/street/widget/dialog/ShowBenfitDialog.kt
+53
-0
ShowLoginDialog.kt
...in/java/com/mints/street/widget/dialog/ShowLoginDialog.kt
+82
-0
shape_bg_guide_btn.xml
app/src/main/res/drawable/shape_bg_guide_btn.xml
+14
-0
shape_bg_guide_tv.xml
app/src/main/res/drawable/shape_bg_guide_tv.xml
+3
-3
activity_guide.xml
app/src/main/res/layout/activity_guide.xml
+97
-48
activity_main.xml
app/src/main/res/layout/activity_main.xml
+5
-2
dialog_showbenfit.xml
app/src/main/res/layout/dialog_showbenfit.xml
+60
-0
fragment_home.xml
app/src/main/res/layout/fragment_home.xml
+1
-3
item_grid_benfit_adpater.xml
app/src/main/res/layout/item_grid_benfit_adpater.xml
+50
-0
dialog_bg_benfit.png
app/src/main/res/mipmap-xhdpi/dialog_bg_benfit.png
+0
-0
dialog_close_benfit.png
app/src/main/res/mipmap-xhdpi/dialog_close_benfit.png
+0
-0
dialog_location_benfit.png
app/src/main/res/mipmap-xhdpi/dialog_location_benfit.png
+0
-0
ic_bg_guide.png
app/src/main/res/mipmap-xhdpi/ic_bg_guide.png
+0
-0
icon_guide1.png
app/src/main/res/mipmap-xhdpi/icon_guide1.png
+0
-0
icon_guide2.png
app/src/main/res/mipmap-xhdpi/icon_guide2.png
+0
-0
icon_guide3.png
app/src/main/res/mipmap-xhdpi/icon_guide3.png
+0
-0
BaseArrayResponse.java
...main/java/me/goldze/mvvmhabit/http/BaseArrayResponse.java
+0
-22
No files found.
app/src/main/AndroidManifest.xml
View file @
04aba431
...
...
@@ -82,6 +82,7 @@
<activity
android:name=
".main.home.HistoricalimageActivity"
/>
<activity
android:name=
".main.my.BindMobileActivity"
/>
<activity
android:name=
".splash.GuideActivity"
/>
<activity
android:name=
".main.home.SearchMapActivity"
/>
<!-- ShareSDK start -->
<activity
android:name=
"com.mob.tools.MobUIShell"
...
...
app/src/main/java/com/mints/street/adapter/EnterDestinationAdapter.kt
View file @
04aba431
package
com.mints.street.adapter
import
android.content.Context
import
android.content.Intent
import
android.view.View
import
androidx.core.content.ContextCompat.startActivity
import
androidx.databinding.ObservableArrayList
import
androidx.databinding.ObservableList
import
androidx.databinding.ViewDataBinding
...
...
@@ -15,7 +17,9 @@ import com.mints.street.BR
import
com.mints.street.R
import
com.mints.street.bean.VrmapBean
import
com.mints.street.databinding.EnterDestinationAdapterBinding
import
com.mints.street.main.vr.DetailedActivity
import
com.mints.street.main.vr.FreeZoneViewModel
import
com.mints.street.webview.MintsWebViewActivity
import
me.tatarka.bindingcollectionadapter2.BindingRecyclerViewAdapter
import
me.tatarka.bindingcollectionadapter2.ItemBinding
...
...
app/src/main/java/com/mints/street/adapter/GridBenfitAdapter.kt
0 → 100644
View file @
04aba431
package
com.mints.street.adapter
import
android.content.Context
import
android.graphics.Paint
import
com.alibaba.android.vlayout.LayoutHelper
import
com.alibaba.android.vlayout.layout.GridLayoutHelper
import
com.fry.base.adapter.AbstractVLayoutBaseAdapter
import
com.fry.base.adapter.BindingViewHolder
import
com.fry.base.binding.setMargin
import
com.mints.street.R
import
com.mints.street.databinding.ItemGridBenfitAdpaterBinding
import
com.mints.street.databinding.ItemGridPaymentAdpaterBinding
import
me.goldze.mvvmhabit.utils.AppUtils
class
GridBenfitAdapter
(
val
context
:
Context
,
val
list
:
List
<
String
>)
:
AbstractVLayoutBaseAdapter
<
ItemGridBenfitAdpaterBinding
,
List
<
String
>>(
context
,
list
,
3
)
{
private
var
datalist
:
List
<
String
>?
=
list
private
var
mposition
:
Int
=
0
//设置首次进来默认选中第一个
override
fun
onBindViewHolder
(
holder
:
BindingViewHolder
<
ItemGridBenfitAdpaterBinding
>,
position
:
Int
)
{
//设置 view边距
if
(
position
%
3
==
0
)
{
holder
.
binding
.
bg
.
setMargin
(
AppUtils
.
dp2Px
(
context
,
20F
),
AppUtils
.
dp2Px
(
context
,
10F
),
AppUtils
.
dp2Px
(
context
,
10F
),
0
,
null
,
null
,
null
)
}
else
if
(
position
%
3
==
1
)
{
holder
.
binding
.
bg
.
setMargin
(
AppUtils
.
dp2Px
(
context
,
10F
),
AppUtils
.
dp2Px
(
context
,
10F
),
AppUtils
.
dp2Px
(
context
,
10F
),
0
,
null
,
null
,
null
)
}
else
{
holder
.
binding
.
bg
.
setMargin
(
AppUtils
.
dp2Px
(
context
,
10F
),
AppUtils
.
dp2Px
(
context
,
10F
),
AppUtils
.
dp2Px
(
context
,
20F
),
0
,
null
,
null
,
null
)
}
// holder.binding.bg.setMargin(AppUtils.dp2Px(context, 20F), AppUtils.dp2Px(context, 10F),
// 0, 0, null, null, null)
}
override
fun
getItemCount
():
Int
{
return
if
(
datalist
==
null
)
{
0
}
else
{
datalist
!!
.
size
}
}
override
fun
getLayoutId
(
viewType
:
Int
)
=
R
.
layout
.
item_grid_benfit_adpater
fun
getPosition
()
=
mposition
override
fun
onCreateLayoutHelper
():
LayoutHelper
{
val
hp
:
GridLayoutHelper
=
GridLayoutHelper
(
3
)
hp
.
setAutoExpand
(
false
)
return
hp
}
}
app/src/main/java/com/mints/street/adapter/GridMapAdapter.kt
View file @
04aba431
...
...
@@ -29,8 +29,8 @@ class GridMapAdapter(val context: Context, var list: List<VrmapBean.Internal>?)
holder
.
binding
.
bg
.
setMargin
(
AppUtils
.
dp2Px
(
context
,
10F
),
AppUtils
.
dp2Px
(
context
,
10F
),
AppUtils
.
dp2Px
(
context
,
5F
),
0
,
null
,
null
,
null
)
}
else
{
holder
.
binding
.
bg
.
setMargin
(
AppUtils
.
dp2Px
(
context
,
5F
),
AppUtils
.
dp2Px
(
context
,
10F
),
AppUtils
.
dp2Px
(
context
,
10F
),
0
,
null
,
null
,
null
)
holder
.
binding
.
bg
.
setMargin
(
AppUtils
.
dp2Px
(
context
,
5F
),
AppUtils
.
dp2Px
(
context
,
10F
),
AppUtils
.
dp2Px
(
context
,
10F
),
0
,
null
,
null
,
null
)
}
datalist
?.
let
{
...
...
app/src/main/java/com/mints/street/adapter/ItemEnterDestinationAdapter.kt
View file @
04aba431
package
com.mints.street.adapter
import
android.content.Context
import
android.content.Intent
import
com.alibaba.android.vlayout.layout.LinearLayoutHelper
import
com.fry.base.adapter.AbstractVLayoutBaseAdapter
import
com.fry.base.adapter.BindingViewHolder
...
...
@@ -8,6 +9,7 @@ import com.fry.base.utils.ImageLoader
import
com.mints.street.R
import
com.mints.street.bean.VrmapBean
import
com.mints.street.databinding.ItemEnterDestinationAdapterBinding
import
com.mints.street.main.vr.DetailedActivity
/**
...
...
@@ -34,6 +36,10 @@ class ItemEnterDestinationAdapter(
}
else
{
bgLayoutParams
.
width
=
a
.
widthPixels
}
holder
.
itemView
.
setOnClickListener
{
var
intent
=
Intent
(
context
,
DetailedActivity
::
class
.
java
)
context
.
startActivity
(
intent
)
}
list
?.
let
{
it
->
holder
.
binding
.
tvName
.
text
=
it
[
position
].
name
holder
.
binding
.
tvNumberPeople
.
text
=
"人数"
...
...
app/src/main/java/com/mints/street/api/BaiduApi.kt
0 → 100644
View file @
04aba431
package
com.mints.street.api
import
com.google.gson.JsonObject
import
com.mints.street.bean.BaseArrayResponse
import
com.mints.street.bean.BaseResponse
import
com.mints.street.bean.PositionBean
import
com.mints.street.netwrok.baidu.BaiduHttpManager
import
io.reactivex.Observable
import
retrofit2.Response
import
retrofit2.http.*
interface
BaiduApi
{
companion
object
{
var
BAIDU_IP
=
"http://api.map.baidu.com/"
fun
newInstance
():
BaiduApi
{
return
BaiduHttpManager
.
getInstance
().
defaultClient
.
create
(
BaiduApi
::
class
.
java
)
}
}
/**
* 国内
*
* @return
*/
@GET
(
"place/v2/suggestion"
)
fun
suggestionPlace
(
@Body
vo
:
@JvmSuppressWildcards
Map
<
String
,
Any
>):
Observable
<
Response
<
BaseResponse
<
Any
>>>
/**
* 国外
* vo["region"] = "全球"
vo["output"] = "json"
vo["ak"] = "tnFhCM9cTeTDZqNjRPVHbfzOz6AUPoEq"@return
*/
@GET
(
"place_abroad/v1/suggestion"
)
// fun suggestionPlaceAbroad(@Query vo: @JvmSuppressWildcards Map<String, Any>): Observable<Response<BaseResponse<Any>>>
fun
suggestionPlaceAbroad
(
@Query
(
"query"
)
vo
:
String
,
@Query
(
"region"
)
vo2
:
String
,
@Query
(
"output"
)
vo3
:
String
,
@Query
(
"ak"
)
vo4
:
String
):
Observable
<
Response
<
BaseArrayResponse
<
PositionBean
>>>
@GET
(
"place/v2/suggestion"
)
fun
suggestionPlaceDomestic
(
@Query
(
"query"
)
vo
:
String
,
@Query
(
"region"
)
vo2
:
String
,
@Query
(
"output"
)
vo3
:
String
,
@Query
(
"ak"
)
vo4
:
String
):
Observable
<
Response
<
BaseArrayResponse
<
PositionBean
>>>
}
\ No newline at end of file
app/src/main/java/com/mints/street/bean/BaseArrayResponse.java
0 → 100644
View file @
04aba431
package
com
.
mints
.
street
.
bean
;
import
java.util.List
;
/**
* Created by goldze on 2017/5/10.
* 该类仅供参考,实际业务返回的固定字段, 根据需求来定义,
*/
public
class
BaseArrayResponse
<
T
>
extends
BaseResponse
<
List
<
T
>>{
@Override
public
List
<
T
>
getResult
()
{
return
result
;
}
@Override
public
void
setResult
(
List
<
T
>
result
)
{
this
.
result
=
result
;
}
}
app/src/main/java/com/mints/street/bean/BaseResponse.java
View file @
04aba431
...
...
@@ -15,7 +15,7 @@ public class BaseResponse<T> implements Serializable {
private
String
message
=
""
;
// @JsonAdapter(value = JsonAdapterGsonDeserializer.class)
// @JsonAdapter(value = JsonAdapterGsonDeserializer.class)
@SerializedName
(
"data"
)
protected
@Nullable
T
result
;
...
...
app/src/main/java/com/mints/street/bean/PositionBean.kt
0 → 100644
View file @
04aba431
package
com.mints.street.bean
import
java.io.Serializable
/**
* Created by 冯瑞雨 on 2021/7/15.
*/
data class
PositionBean
(
val
address
:
String
,
val
business
:
String
,
val
city
:
String
,
val
cityid
:
String
,
val
district
:
String
,
val
location
:
Location
,
val
name
:
String
,
val
tag
:
String
,
val
uid
:
String
/**
* public String key;
public String city;
public String district;
public LatLng pt;
public String uid;
public String tag;
public String address;
*/
)
data class
Location
(
val
lat
:
Double
,
val
lng
:
Double
)
\ No newline at end of file
app/src/main/java/com/mints/street/login/LoginActivity.kt
View file @
04aba431
...
...
@@ -28,7 +28,7 @@ class LoginActivity : BaseActivity<ActivityLoginBinding, LoginViewModel>(), View
private
val
userManager
by
lazy
{
UserManager
.
INSTANCE
}
override
fun
getStatusBarHeightView
():
View
?
{
return
null
return
binding
.
tvName
}
override
fun
initContentView
(
savedInstanceState
:
Bundle
?)
=
R
.
layout
.
activity_login
...
...
@@ -36,7 +36,6 @@ class LoginActivity : BaseActivity<ActivityLoginBinding, LoginViewModel>(), View
override
fun
initData
()
{
super
.
initData
()
StatusBarUtil
.
setHeightAndPadding
(
this
,
binding
.
tvName
)
initView
()
initListener
()
}
...
...
app/src/main/java/com/mints/street/main/home/SearchAfterItem.kt
View file @
04aba431
...
...
@@ -3,6 +3,7 @@ package com.mints.street.main.home
import
android.content.Intent
import
com.baidu.mapapi.model.LatLng
import
com.mints.street.bean.HistoryBean
import
com.mints.street.bean.Location
import
me.goldze.mvvmhabit.base.AppManager
import
me.goldze.mvvmhabit.base.ItemViewModel
import
me.goldze.mvvmhabit.binding.command.BindingAction
...
...
@@ -11,19 +12,36 @@ import me.goldze.mvvmhabit.utils.KLog
/**
* Created by 冯瑞雨 on 2021/7/15.
*
*/
class
SearchAfterItem
(
viewModel
:
SearchMapViewModel
,
val
name
:
String
?
,
val
address
:
String
?,
val
pt
:
LatLng
?=
null
)
:
,
val
address
:
String
?,
val
pt
:
Location
?=
null
)
:
ItemViewModel
<
SearchMapViewModel
>(
viewModel
)
{
/***
* 点击名称回调回调
*/
val
onClick
=
BindingCommand
<
Any
>(
BindingAction
{
viewModel
.
searchName
.
value
=
HistoryBean
(
name
=
this
.
name
,
latitude
=
pt
?.
latitude
,
longitude
=
pt
?.
longitude
)
latitude
=
pt
?.
lat
,
longitude
=
pt
?.
lat
)
val
intent
=
Intent
()
intent
.
putExtra
(
"latitude"
,
pt
?.
lat
itude
)
intent
.
putExtra
(
"longitude"
,
pt
?.
l
ongitude
)
intent
.
putExtra
(
"latitude"
,
pt
?.
lat
)
intent
.
putExtra
(
"longitude"
,
pt
?.
l
at
)
viewModel
.
finishData
(
SearchMapActivity
.
REQUEST_CODE
,
intent
)
})
}
/*class SearchAfterItem(viewModel: SearchMapViewModel,val name:String?
, val address:String?,val pt: LatLng?=null) :
ItemViewModel<SearchMapViewModel>(viewModel) {
*//***
* 点击名称回调回调
*//*
val onClick = BindingCommand<Any>(BindingAction {
viewModel.searchName.value = HistoryBean(name = this.name,
latitude = pt?.latitude,longitude = pt?.longitude)
//不带参数、不跳转
// val intent = Intent()
// intent.putExtra("latitude",pt?.latitude)
// intent.putExtra("longitude",pt?.longitude)
// viewModel.finishData(SearchMapActivity.REQUEST_CODE,intent)
})
}*/
\ No newline at end of file
app/src/main/java/com/mints/street/main/home/SearchMapActivity.kt
View file @
04aba431
...
...
@@ -8,10 +8,6 @@ import android.text.TextWatcher
import
androidx.lifecycle.Observer
import
com.alibaba.android.vlayout.DelegateAdapter
import
com.alibaba.android.vlayout.VirtualLayoutManager
import
com.baidu.mapapi.search.sug.OnGetSuggestionResultListener
import
com.baidu.mapapi.search.sug.SuggestionResult
import
com.baidu.mapapi.search.sug.SuggestionSearch
import
com.baidu.mapapi.search.sug.SuggestionSearchOption
import
com.fry.base.base.BaseActivity
import
com.fry.base.utils.ResourceUtils
import
com.mints.street.BR
...
...
@@ -20,14 +16,14 @@ import com.mints.street.adapter.HistoryRecordAdapter
import
com.mints.street.adapter.PopularSceneAdapter
import
com.mints.street.bean.HistoryBean
import
com.mints.street.bean.MapBean
import
com.mints.street.bean.PositionBean
import
com.mints.street.databinding.ActivitySearchMapBinding
import
me.goldze.mvvmhabit.utils.KLog
/**
* Created by 冯瑞雨 on 2021/7/13.
*/
class
SearchMapActivity
:
BaseActivity
<
ActivitySearchMapBinding
,
SearchMapViewModel
>()
,
OnGetSuggestionResultListener
{
class
SearchMapActivity
:
BaseActivity
<
ActivitySearchMapBinding
,
SearchMapViewModel
>()
{
//
OnGetSuggestionResultListener {
companion
object
{
const
val
HISTORY_NAME
=
"history_name"
const
val
REQUEST_CODE
=
201
...
...
@@ -44,9 +40,9 @@ class SearchMapActivity : BaseActivity<ActivitySearchMapBinding, SearchMapViewMo
private
var
historyRecordAdapter
:
HistoryRecordAdapter
?
=
null
private
var
popularSceneAdapter
:
PopularSceneAdapter
?
=
null
//检索模块
private
var
mSuggestionSearch
:
SuggestionSearch
?
=
null
//
//
//检索模块
//
private var mSuggestionSearch: SuggestionSearch? = null
override
fun
initContentView
(
savedInstanceState
:
Bundle
?)
=
R
.
layout
.
activity_search_map
...
...
@@ -62,10 +58,11 @@ class SearchMapActivity : BaseActivity<ActivitySearchMapBinding, SearchMapViewMo
binding
.
recyList
.
layoutManager
=
vLayout
binding
.
recyList
.
adapter
=
mAdapter
//
// // 初始化建议搜索模块,注册建议搜索事件监听
// mSuggestionSearch = SuggestionSearch.newInstance()
// mSuggestionSearch?.setOnGetSuggestionResultListener(this)
// 初始化建议搜索模块,注册建议搜索事件监听
mSuggestionSearch
=
SuggestionSearch
.
newInstance
()
mSuggestionSearch
?.
setOnGetSuggestionResultListener
(
this
)
binding
.
et
.
addTextChangedListener
(
object
:
TextWatcher
{
override
fun
beforeTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
count
:
Int
,
after
:
Int
)
{
}
...
...
@@ -78,18 +75,32 @@ class SearchMapActivity : BaseActivity<ActivitySearchMapBinding, SearchMapViewMo
viewModel
.
searchAfterOneItems
.
clear
()
return
}
// 使用建议搜索服务获取建议列表,结果在onSuggestionResult()中更新
mSuggestionSearch
?.
requestSuggestion
(
SuggestionSearchOption
()
.
keyword
(
s
.
toString
())
// 关键字
.
city
(
viewModel
.
positioningBean
?.
city
?:
"北京"
)
)
if
(
viewModel
.
index
==
0
){
//国外
viewModel
.
searchdomestic
(
s
.
toString
())
}
else
{
//传入参数【这里是可以获取到参数的】【国外】
viewModel
.
searchabroad
(
s
.
toString
())
}
// onGetSuggestionResult(postionConfig)
// // 使用建议搜索服务获取建议列表,结果在onSuggestionResult()中更新【这里也是百度三方的东西】
// mSuggestionSearch?.requestSuggestion(
// SuggestionSearchOption().keyword(s.toString()) // 关键字
// .city(viewModel.positioningBean?.city ?: "北京")
// )
}
})
historyRecordAdapter
=
HistoryRecordAdapter
(
this
,
viewModel
)
//历史记录
historyRecordAdapter
=
HistoryRecordAdapter
(
this
,
viewModel
)
//热门景点
popularSceneAdapter
=
PopularSceneAdapter
(
this
)
mAdapter
?.
addAdapter
(
historyRecordAdapter
)
...
...
@@ -130,11 +141,18 @@ class SearchMapActivity : BaseActivity<ActivitySearchMapBinding, SearchMapViewMo
}
})
viewModel
.
searchName
.
observe
(
this
,
Observer
<
HistoryBean
>
{
if
(
TextUtils
.
isEmpty
(
it
.
name
)){
if
(
TextUtils
.
isEmpty
(
it
.
name
))
{
return
@Observer
}
historyRecordAdapter
?.
addHistoryData
(
it
)
})
viewModel
.
positiondata
.
observe
(
this
@SearchMapActivity
,
Observer
{
//srl_my.finishRefresh(true)
it
?.
apply
{
onGetSuggestionResult
(
this
)
}
})
}
private
fun
territory
()
{
...
...
@@ -157,12 +175,32 @@ class SearchMapActivity : BaseActivity<ActivitySearchMapBinding, SearchMapViewMo
update
()
}
fun
onGetSuggestionResult
(
postionConfig
:
List
<
PositionBean
>?)
{
if
(
postionConfig
==
null
)
{
return
}
viewModel
.
searchAfterOneItems
.
clear
()
if
(
TextUtils
.
isEmpty
(
binding
.
et
.
text
))
{
return
}
for
(
info
in
postionConfig
!!
)
{
viewModel
.
searchAfterOneItems
.
add
(
SearchAfterItem
(
viewModel
,
info
.
name
,
info
.
address
,
info
.
location
)
)
}
}
/**
* 获取在线建议搜索结果,得到requestSuggestion返回的搜索结果
*
*
【这里是第三方百度的东西】
* @param suggestionResult Sug检索结果
*/
override
fun
onGetSuggestionResult
(
suggestionResult
:
SuggestionResult
?)
{
/*
override fun onGetSuggestionResult(suggestionResult: SuggestionResult?) {
if (suggestionResult == null || suggestionResult.allSuggestions == null) {
return
}
...
...
@@ -178,5 +216,5 @@ class SearchMapActivity : BaseActivity<ActivitySearchMapBinding, SearchMapViewMo
)
)
}
}
}
*/
}
\ No newline at end of file
app/src/main/java/com/mints/street/main/home/SearchMapViewModel.kt
View file @
04aba431
...
...
@@ -9,10 +9,9 @@ import androidx.lifecycle.MutableLiveData
import
com.google.gson.Gson
import
com.mints.street.BR
import
com.mints.street.R
import
com.mints.street.bean.HistoryBean
import
com.mints.street.bean.MapBean
import
com.mints.street.bean.Places
import
com.mints.street.bean.PositioningBean
import
com.mints.street.bean.*
import
com.mints.street.model.BaiduModel
import
com.mints.street.netwrok.base.HttpSubscribeImpl
import
me.goldze.mvvmhabit.base.AppManager
import
me.goldze.mvvmhabit.base.BaseViewModel
import
me.goldze.mvvmhabit.binding.command.BindingAction
...
...
@@ -28,14 +27,18 @@ import java.io.InputStreamReader
*/
class
SearchMapViewModel
(
application
:
Application
)
:
BaseViewModel
(
application
)
{
var
index
=
0
;
//0=境内 1=境外
val
positiondata
:
MutableLiveData
<
List
<
PositionBean
>>
=
MutableLiveData
()
//这里是走的一个点击回调,能够打开首页进行定位
val
searchAfterItemBinding
=
ItemBinding
.
of
<
SearchAfterItem
>(
BR
.
viewModel
,
R
.
layout
.
item_search_after
)
val
searchAfterOneItems
=
ObservableArrayList
<
SearchAfterItem
>()
//搜索的name
val
searchName
=
MutableLiveData
<
HistoryBean
>()
//定位位置
val
positioningBean
:
PositioningBean
?
=
getpositioningMap
()
private
fun
getpositioningMap
():
PositioningBean
?{
SPUtils
.
getInstance
(
SPUtils
.
POSITIONING_MAP
)
.
decodeString
(
SPUtils
.
POSITIONING_MAP
)
?.
apply
{
...
...
@@ -45,6 +48,8 @@ class SearchMapViewModel(application: Application) : BaseViewModel(application)
}
return
null
}
val
mapBean
=
MutableLiveData
<
MapBean
>()
fun
getMapBean
(){
...
...
@@ -67,6 +72,64 @@ class SearchMapViewModel(application: Application) : BaseViewModel(application)
}
/**
* 获取国外搜索信息【通过搜索内容进行查找】
*/
fun
searchabroad
(
position
:
String
)
{
val
vo
=
hashMapOf
<
String
,
Any
>()
vo
[
"query"
]
=
"澳大利亚 海岸"
vo
[
"region"
]
=
"全球"
vo
[
"output"
]
=
"json"
vo
[
"ak"
]
=
"tnFhCM9cTeTDZqNjRPVHbfzOz6AUPoEq"
// BaiduModel.suggestionPlaceAbroad(lifecycleProvider,vo).safeSubscribe(
BaiduModel
.
suggestionPlaceAbroad
(
lifecycleProvider
,
position
,
"全球"
,
"json"
,
"tnFhCM9cTeTDZqNjRPVHbfzOz6AUPoEq"
).
safeSubscribe
(
object
:
HttpSubscribeImpl
<
BaseArrayResponse
<
PositionBean
>>(
this
@SearchMapViewModel
,
true
)
{
override
fun
onBusinessSuccess
(
response
:
BaseArrayResponse
<
PositionBean
>)
{
positiondata
.
value
=
response
.
result
println
(
"mcg __ "
+
response
.
result
)
}
override
fun
onError
(
e
:
Throwable
)
{
}
}
)
}
/**
* 获取国内搜索信息
*/
fun
searchdomestic
(
position
:
String
)
{
val
vo
=
hashMapOf
<
String
,
Any
>()
vo
[
"query"
]
=
"北京"
vo
[
"region"
]
=
"中国"
vo
[
"output"
]
=
"json"
vo
[
"ak"
]
=
"C56Qdc560TQKtQaavS0NTPUYupsZHspI"
// BaiduModel.suggestionPlaceAbroad(lifecycleProvider,vo).safeSubscribe(
/*
http://api.map.baidu.com/place/v2/suggestion?
query=%E5%8C%97%E4%BA%AC
®ion=%E5%85%A8%E5%9B%BD
&output=json
&page_size=50&
ak=C56Qdc560TQKtQaavS0NTPUYupsZHspI
*/
BaiduModel
.
suggestionPlaceDomestic
(
lifecycleProvider
,
position
,
"中国"
,
"json"
,
"C56Qdc560TQKtQaavS0NTPUYupsZHspI"
).
safeSubscribe
(
object
:
HttpSubscribeImpl
<
BaseArrayResponse
<
PositionBean
>>(
this
@SearchMapViewModel
,
true
)
{
override
fun
onBusinessSuccess
(
response
:
BaseArrayResponse
<
PositionBean
>)
{
positiondata
.
value
=
response
.
result
println
(
"mcg __ "
+
response
.
result
)
}
override
fun
onError
(
e
:
Throwable
)
{
}
}
)
}
}
\ No newline at end of file
app/src/main/java/com/mints/street/main/home/onGetSuggestionPositionsLister.kt
0 → 100644
View file @
04aba431
package
com.mints.street.main.home
import
com.baidu.mapapi.search.sug.SuggestionResult
import
com.mints.street.bean.PositionBean
interface
onGetSuggestionPositionsLister
{
fun
onGetSuggestionResult
(
var1
:
PositionBean
?)
}
app/src/main/java/com/mints/street/main/my/AboutusActivity.kt
View file @
04aba431
...
...
@@ -22,11 +22,10 @@ class AboutusActivity : BaseActivity<ActivityAboutusBinding, AboutusViewModel>()
override
fun
initVariableId
()
=
BR
.
viewModel
override
fun
initContentView
(
savedInstanceState
:
Bundle
?)
=
R
.
layout
.
activity_aboutus
override
fun
getStatusBarHeightView
():
View
?
{
return
null
return
binding
.
tvText
}
override
fun
initData
()
{
super
.
initData
()
StatusBarUtil
.
setHeightAndPadding
(
this
,
binding
.
tvText
)
initView
()
initListener
()
}
...
...
app/src/main/java/com/mints/street/main/my/MoresettingsActivity.kt
View file @
04aba431
...
...
@@ -28,12 +28,11 @@ class MoresettingsActivity : BaseActivity<ActivityMoresettingsBinding, Moresetti
override
fun
initVariableId
()
=
BR
.
viewModel
override
fun
initContentView
(
savedInstanceState
:
Bundle
?)
=
R
.
layout
.
activity_moresettings
override
fun
getStatusBarHeightView
():
View
?
{
return
null
return
binding
.
elView
}
override
fun
initData
()
{
super
.
initData
()
StatusBarUtil
.
setHeightAndPadding
(
this
,
binding
.
elView
)
initView
()
initListener
()
...
...
app/src/main/java/com/mints/street/main/my/MyFragment.kt
View file @
04aba431
package
com.mints.street.main.my
import
android.Manifest
import
android.app.Dialog
import
android.content.Context
import
android.graphics.Color
import
android.os.Bundle
import
android.view.LayoutInflater
...
...
@@ -86,13 +88,13 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
loginDialog
.
show
()
}
}
//设置立即领取点击事件
binding
.
btTry
.
setOnClickListener
{
startActivity
(
OpenvipActivity
::
class
.
java
)
}
RxUtils
.
onMultiClick
(
aboutus
)
{
startActivity
(
AboutusActivity
::
class
.
java
)
// viewModel.test()
}
RxUtils
.
onMultiClick
(
moresettings
)
{
startActivity
(
MoresettingsActivity
::
class
.
java
)
...
...
app/src/main/java/com/mints/street/main/my/MyViewModel.kt
View file @
04aba431
...
...
@@ -3,11 +3,13 @@ package com.mints.street.main.my
import
android.app.Application
import
androidx.lifecycle.MutableLiveData
import
com.mints.street.bean.BaseResponse
import
com.mints.street.bean.PositionBean
import
com.mints.street.bean.UserBean
import
com.mints.street.common.DeviceInfo
import
com.mints.street.manager.UserManager
import
com.mints.street.manager.oaid.OaidManager
import
com.mints.street.model.ApiModel
import
com.mints.street.model.BaiduModel
import
com.mints.street.netwrok.base.HttpSubscribeImpl
import
com.mints.street.utils.DeviceUuidFactory
import
me.goldze.mvvmhabit.base.BaseViewModel
...
...
@@ -101,4 +103,7 @@ class MyViewModel(application: Application) : BaseViewModel(application) {
})
}
}
\ No newline at end of file
app/src/main/java/com/mints/street/main/my/OpenvipActivity.kt
View file @
04aba431
...
...
@@ -43,7 +43,7 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
private
var
mAdapter
:
DelegateAdapter
?
=
null
private
var
gridPaymentAdapter
:
GridPaymentAdapter
?
=
null
private
var
vipList
:
MutableList
<
VipBean
.
ListBean
>?
=
null
private
var
currentPayType
=
""
private
var
currentPayType
=
""
private
val
loginDialog
by
lazy
{
WxLoginDialog
(
this
).
init
()
}
...
...
@@ -51,7 +51,7 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
override
fun
initContentView
(
savedInstanceState
:
Bundle
?)
=
R
.
layout
.
activity_openvip
override
fun
getStatusBarHeightView
():
View
?
{
return
null
return
binding
.
viewBg
}
override
fun
initData
()
{
...
...
@@ -61,7 +61,6 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
//获取支付方式
viewModel
.
getpaymentwey
(
"android"
)
StatusBarUtil
.
setHeightAndPadding
(
this
,
binding
.
viewBg
)
initView
()
initListener
()
}
...
...
@@ -170,7 +169,7 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
viewModel
.
Vipdata
.
observe
(
this
,
Observer
<
VipBean
>
{
vipList
=
it
.
list
as
MutableList
<
VipBean
.
ListBean
>?
//展示 推荐套餐内容
gridPaymentAdapter
=
GridPaymentAdapter
(
this
,
it
.
list
!!
)
gridPaymentAdapter
=
GridPaymentAdapter
(
this
,
it
.
list
!!
)
mAdapter
?.
addAdapter
(
gridPaymentAdapter
)
})
viewModel
.
vippayParams
.
observe
(
this
,
Observer
<
WxPayParamBean
>
{
...
...
@@ -203,12 +202,12 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
for
(
str
in
it
.
list
!!
)
{
if
(
str
.
equals
(
"WEIXIN"
))
{
ly_weixin
.
visibility
=
View
.
VISIBLE
currentPayType
=
"WEIXIN"
currentPayType
=
"WEIXIN"
}
if
(
str
.
equals
(
"ALIPAY"
))
{
ly_alipay
.
visibility
=
View
.
VISIBLE
if
(
TextUtils
.
isEmpty
(
currentPayType
))
{
currentPayType
=
"ALIPAY"
if
(
TextUtils
.
isEmpty
(
currentPayType
))
{
currentPayType
=
"ALIPAY"
}
}
}
...
...
@@ -243,12 +242,12 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
R
.
id
.
ly_weixin
->
{
//微信支付
//设置选中样式
setOnChecked
(
1
)
currentPayType
=
"WEIXIN"
currentPayType
=
"WEIXIN"
}
R
.
id
.
ly_alipay
->
{
//支付宝支付
//设置选中样式
setOnChecked
(
2
)
currentPayType
=
"ALIPAY"
currentPayType
=
"ALIPAY"
}
R
.
id
.
bt_try
->
{
//点击开通全球会员按钮
if
(
UserManager
.
INSTANCE
.
userIsLogin
())
{
...
...
@@ -260,9 +259,9 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
}
}
private
fun
payVip
(){
if
(
vipList
!=
null
&&
vipList
!!
.
size
>
0
&&
gridPaymentAdapter
!=
null
)
{
if
(
TextUtils
.
equals
(
"WEIXIN"
,
currentPayType
))
{
private
fun
payVip
()
{
if
(
vipList
!=
null
&&
vipList
!!
.
size
>
0
&&
gridPaymentAdapter
!=
null
)
{
if
(
TextUtils
.
equals
(
"WEIXIN"
,
currentPayType
))
{
viewModel
.
getVipPayParams
(
"WEIXIN"
,
vipList
!!
[
gridPaymentAdapter
!!
.
getPosition
()].
pid
)
}
else
{
viewModel
.
getVipPayParams
(
"ALIPAY"
,
vipList
!!
[
gridPaymentAdapter
!!
.
getPosition
()].
pid
)
...
...
@@ -271,6 +270,13 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
}
private
fun
backvipDialog
()
{
/*DialogUtils.showbennfitsDialog(this, object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) {
if (dialog != null && dialog.isShowing) {
dialog.dismiss()
}
}
})*/
DialogUtils
.
showbackvipDialog
(
this
,
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
if
(
dialog
!=
null
&&
dialog
.
isShowing
)
{
...
...
app/src/main/java/com/mints/street/main/vr/FreeZoneFragment.kt
View file @
04aba431
...
...
@@ -40,7 +40,6 @@ class FreeZoneFragment : BaseFragment<FragmentFreeZoneBinding, FreeZoneViewModel
override
fun
initData
()
{
super
.
initData
()
//初始化布局管理器
if
(
context
==
null
)
return
vLayout
=
VirtualLayoutManager
(
context
!!
);
...
...
@@ -49,8 +48,6 @@ class FreeZoneFragment : BaseFragment<FragmentFreeZoneBinding, FreeZoneViewModel
binding
.
listView
.
layoutManager
=
vLayout
binding
.
listView
.
adapter
=
mAdapter
}
override
fun
initViewObservable
()
{
...
...
app/src/main/java/com/mints/street/model/BaiduModel.kt
0 → 100644
View file @
04aba431
package
com.mints.street.model
import
com.google.gson.JsonObject
import
com.mints.street.api.BaiduApi
import
com.mints.street.api.MainApi
import
com.mints.street.bean.*
import
com.mints.street.netwrok.baidu.BaiduHttpManager
import
com.mints.street.netwrok.common.HttpManager
import
com.trello.rxlifecycle2.LifecycleProvider
import
io.reactivex.Observable
import
retrofit2.Response
import
retrofit2.http.Body
object
BaiduModel
{
/**
* 国外
*/
// fun suggestionPlaceAbroad(lifecycleProvider: LifecycleProvider<Any>?, map: Map<String, Any>): Observable<Response<BaseResponse<Any>>> {
// return BaiduHttpManager.getInstance()
// .execute(lifecycleProvider, BaiduApi.newInstance().suggestionPlaceAbroad(map))
// }
fun
suggestionPlaceAbroad
(
lifecycleProvider
:
LifecycleProvider
<
Any
>?,
map
:
String
,
map2
:
String
,
map3
:
String
,
map4
:
String
):
Observable
<
Response
<
BaseArrayResponse
<
PositionBean
>>>
{
return
BaiduHttpManager
.
getInstance
()
.
execute
(
lifecycleProvider
,
BaiduApi
.
newInstance
().
suggestionPlaceAbroad
(
map
,
map2
,
map3
,
map4
))
}
fun
suggestionPlaceDomestic
(
lifecycleProvider
:
LifecycleProvider
<
Any
>?,
map
:
String
,
map2
:
String
,
map3
:
String
,
map4
:
String
):
Observable
<
Response
<
BaseArrayResponse
<
PositionBean
>>>
{
return
BaiduHttpManager
.
getInstance
()
.
execute
(
lifecycleProvider
,
BaiduApi
.
newInstance
().
suggestionPlaceDomestic
(
map
,
map2
,
map3
,
map4
))
}
}
\ No newline at end of file
app/src/main/java/com/mints/street/netwrok/baidu/BaiduGsonConverterFactory.java
0 → 100644
View file @
04aba431
package
com
.
mints
.
street
.
netwrok
.
baidu
;
import
com.google.gson.Gson
;
import
com.mints.street.bean.BaseResponse
;
import
com.mints.street.manager.UserManager
;
import
java.io.IOException
;
import
java.io.OutputStreamWriter
;
import
java.io.Reader
;
import
java.io.Writer
;
import
java.lang.annotation.Annotation
;
import
java.lang.reflect.Type
;
import
java.nio.charset.Charset
;
import
java.nio.charset.StandardCharsets
;
import
okhttp3.MediaType
;
import
okhttp3.RequestBody
;
import
okhttp3.ResponseBody
;
import
okio.Buffer
;
import
retrofit2.Converter
;
import
retrofit2.Retrofit
;
/**
* Description:gson全局解析
*/
public
class
BaiduGsonConverterFactory
extends
Converter
.
Factory
{
private
final
Gson
gson
;
public
static
BaiduGsonConverterFactory
create
()
{
return
create
(
new
Gson
());
}
public
static
BaiduGsonConverterFactory
create
(
Gson
gson
)
{
return
new
BaiduGsonConverterFactory
(
gson
);
}
private
BaiduGsonConverterFactory
(
Gson
gson
)
{
if
(
gson
==
null
)
throw
new
NullPointerException
(
"gson == null"
);
this
.
gson
=
gson
;
}
@Override
public
Converter
<
ResponseBody
,
?>
responseBodyConverter
(
Type
type
,
Annotation
[]
annotations
,
Retrofit
retrofit
)
{
return
new
GsonResponseBodyConverter
<>(
gson
,
type
);
}
@Override
public
Converter
<?,
RequestBody
>
requestBodyConverter
(
Type
type
,
Annotation
[]
parameterAnnotations
,
Annotation
[]
methodAnnotations
,
Retrofit
retrofit
)
{
return
new
GsonRequestBodyConverter
<>(
gson
,
type
);
}
// 这里创建从ResponseBody其它类型的Converter
// 主要用于对响应体的处理
final
class
GsonResponseBodyConverter
<
T
>
implements
Converter
<
ResponseBody
,
T
>
{
private
final
Gson
gson
;
private
final
Type
type
;
GsonResponseBodyConverter
(
Gson
gson
,
Type
type
)
{
this
.
gson
=
gson
;
this
.
type
=
type
;
}
@Override
public
T
convert
(
ResponseBody
value
)
throws
IOException
{
Reader
reader
=
value
.
charStream
();
try
{
T
t
=
gson
.
fromJson
(
reader
,
type
);
// loginInvalid(t);
return
t
;
}
finally
{
try
{
if
(
reader
!=
null
)
reader
.
close
();
}
catch
(
IOException
ignored
)
{
ignored
.
printStackTrace
();
}
}
}
/**
* 用户登陆失效
*
* @param t
*/
private
void
loginInvalid
(
T
t
)
{
if
(
t
instanceof
BaseResponse
)
{
BaseResponse
br
=
(
BaseResponse
)
t
;
int
code
=
br
.
getstatus
();
if
(
code
==
401
)
{
try
{
UserManager
.
Companion
.
getINSTANCE
().
userLogout
();
// Activity forwardActivity = ForegroundOrBackground.getApp_activity();
// if (forwardActivity != null) {
// if (!forwardActivity.isFinishing()) {
// forwardActivity.startActivity(new Intent(forwardActivity, WxLoginActivity.class));
// }
// }
}
catch
(
Exception
e
)
{
}
}
}
}
}
// 在这里创建 从自定类型到ResponseBody 的Converter
// 主要用于对Part、PartMap、Body注解的处理
final
class
GsonRequestBodyConverter
<
T
>
implements
Converter
<
T
,
RequestBody
>
{
private
final
MediaType
MEDIA_TYPE
=
MediaType
.
parse
(
"application/json; charset=UTF-8"
);
private
final
Charset
UTF_8
=
StandardCharsets
.
UTF_8
;
private
final
Gson
gson
;
private
final
Type
type
;
GsonRequestBodyConverter
(
Gson
gson
,
Type
type
)
{
this
.
gson
=
gson
;
this
.
type
=
type
;
}
@Override
public
RequestBody
convert
(
T
value
)
throws
IOException
{
Buffer
buffer
=
new
Buffer
();
Writer
writer
=
new
OutputStreamWriter
(
buffer
.
outputStream
(),
UTF_8
);
gson
.
toJson
(
value
,
type
,
writer
);
writer
.
flush
();
return
RequestBody
.
create
(
MEDIA_TYPE
,
buffer
.
readByteString
());
}
}
}
app/src/main/java/com/mints/street/netwrok/baidu/BaiduHttpConfiguation.java
0 → 100644
View file @
04aba431
package
com
.
mints
.
street
.
netwrok
.
baidu
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
okhttp3.Interceptor
;
/**
* Created by jeme on 2019/1/31
*/
public
class
BaiduHttpConfiguation
{
//超时时间
private
int
mDefaultTimeOut
=
30
;
//缓存时间
private
int
mDefaultCacheTimeOut
=
10
*
1024
*
1024
;
//服务端根路径
private
String
mBaseUrl
;
//缓存文件名
private
String
mCacheDirName
;
//http head
private
Map
<
String
,
String
>
mHeaders
;
//拦截器
private
List
<
Interceptor
>
mInterceptor
=
new
ArrayList
<>();
private
BaiduHttpConfiguation
()
{
}
public
static
BaiduHttpConfiguation
create
(
String
baseUrl
){
BaiduHttpConfiguation
thiz
=
new
BaiduHttpConfiguation
();
thiz
.
setBaseUrl
(
baseUrl
);
return
thiz
;
}
public
BaiduHttpConfiguation
setBaseUrl
(
String
baseUrl
){
mBaseUrl
=
baseUrl
;
return
this
;
}
public
String
getBaseUrl
(){
return
mBaseUrl
;
}
public
BaiduHttpConfiguation
setCacheDirName
(
String
cacheDirName
){
mCacheDirName
=
cacheDirName
;
return
this
;
}
public
String
getCacheDirName
(){
return
mCacheDirName
;
}
public
BaiduHttpConfiguation
setTimeOut
(
int
timeOut
){
mDefaultTimeOut
=
timeOut
;
return
this
;
}
public
BaiduHttpConfiguation
setCacheDirName
(
int
timeOut
){
mDefaultCacheTimeOut
=
timeOut
;
return
this
;
}
public
int
getTimeOut
(){
return
mDefaultTimeOut
;
}
public
int
getCacheTimeOut
(){
return
mDefaultCacheTimeOut
;
}
public
BaiduHttpConfiguation
setHeads
(
Map
<
String
,
String
>
heads
){
if
(
mHeaders
==
null
){
mHeaders
=
heads
;
}
else
{
mHeaders
.
putAll
(
heads
);
}
return
this
;
}
public
Map
<
String
,
String
>
getHeads
(){
return
mHeaders
;
}
public
BaiduHttpConfiguation
addInterceptor
(
Interceptor
interceptor
){
mInterceptor
.
add
(
interceptor
);
return
this
;
}
public
List
<
Interceptor
>
getInterceptors
(){
return
mInterceptor
;
}
}
app/src/main/java/com/mints/street/netwrok/baidu/BaiduHttpManager.java
0 → 100644
View file @
04aba431
package
com
.
mints
.
street
.
netwrok
.
baidu
;
import
com.fry.base.global.Constants
;
import
com.mints.street.api.BaiduApi
;
import
com.mints.street.bean.BaseResponse
;
import
com.mints.street.netwrok.base.HttpConfiguation
;
import
com.mints.street.netwrok.base.RetrofitClient
;
import
com.mints.street.netwrok.common.HttpErrorProcess
;
import
com.trello.rxlifecycle2.LifecycleProvider
;
import
io.reactivex.Observable
;
import
io.reactivex.ObservableSource
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.functions.Function
;
import
io.reactivex.schedulers.Schedulers
;
import
me.goldze.mvvmhabit.utils.RxUtils
;
import
retrofit2.Response
;
/**
* Created by jeme on 2019/1/31
*/
public
class
BaiduHttpManager
{
private
BaiduRetrofitClient
mDefaultClient
;
private
BaiduRetrofitClient
mTimeClient
;
private
static
class
SingletonHolder
{
private
static
BaiduHttpManager
INSTANCE
=
new
BaiduHttpManager
();
}
public
static
BaiduHttpManager
getInstance
()
{
return
SingletonHolder
.
INSTANCE
;
}
private
BaiduHttpManager
()
{
mDefaultClient
=
new
BaiduRetrofitClient
(
BaiduHttpConfiguation
.
create
(
BaiduApi
.
Companion
.
getBAIDU_IP
())
);
}
public
BaiduRetrofitClient
getDefaultClient
()
{
return
mDefaultClient
;
}
public
BaiduRetrofitClient
getTimeClient
()
{
if
(
mTimeClient
==
null
)
{
mTimeClient
=
new
BaiduRetrofitClient
(
BaiduHttpConfiguation
.
create
(
Constants
.
getBaseUrl
())
.
setTimeOut
(
5000
));
}
return
mTimeClient
;
}
public
<
T
>
T
getDefaultServices
(
Class
<
T
>
clz
)
{
return
getDefaultClient
().
create
(
clz
);
}
public
<
B
extends
BaseResponse
,
T
extends
Response
<
B
>>
Observable
<
T
>
execute
(
LifecycleProvider
life
,
final
Observable
<
T
>
observable
)
{
Observable
<
T
>
newObservable
=
Observable
.
just
(
observable
)
.
observeOn
(
Schedulers
.
io
())
.
flatMap
((
Function
<
Observable
<
T
>,
ObservableSource
<
T
>>)
tObservable
->
{
// ServerTimeHelper.requestServerTime();
return
observable
;
})
.
observeOn
(
AndroidSchedulers
.
mainThread
());
if
(
life
!=
null
)
{
newObservable
=
newObservable
.
compose
(
RxUtils
.
bindToLifecycle
(
life
));
}
return
newObservable
.
compose
(
RxUtils
.
schedulersTransformer
())
.
compose
(
RxUtils
.
exceptionTransformer
())
.
compose
(
HttpErrorProcess
.
businessExceptionTransformer
());
}
}
app/src/main/java/com/mints/street/netwrok/baidu/BaiduRetrofitClient.java
0 → 100644
View file @
04aba431
package
com
.
mints
.
street
.
netwrok
.
baidu
;
import
android.content.Context
;
import
android.text.TextUtils
;
import
androidx.annotation.NonNull
;
import
com.fry.base.BuildConfig
;
import
com.mints.street.netwrok.base.HttpConfiguation
;
import
com.mints.street.netwrok.common.GsonConverterFactory
;
import
com.mints.street.netwrok.common.OkHttpInterceptor
;
import
com.mints.street.utils.encry.AESUtils
;
import
com.orhanobut.logger.Logger
;
import
java.util.concurrent.TimeUnit
;
import
me.goldze.mvvmhabit.http.cookie.CookieJarImpl
;
import
me.goldze.mvvmhabit.http.cookie.store.PersistentCookieStore
;
import
me.goldze.mvvmhabit.utils.Utils
;
import
okhttp3.ConnectionPool
;
import
okhttp3.OkHttpClient
;
import
okhttp3.logging.HttpLoggingInterceptor
;
import
retrofit2.Retrofit
;
import
retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
;
/**
* Created by mcg
*/
public
class
BaiduRetrofitClient
{
public
BaiduHttpConfiguation
mHttpConfig
;
private
Context
mContext
=
Utils
.
getContext
();
private
OkHttpClient
mOkHttpClient
;
private
Retrofit
mRetrofit
;
public
BaiduRetrofitClient
(
@NonNull
BaiduHttpConfiguation
configuation
)
{
mHttpConfig
=
configuation
;
if
(
TextUtils
.
isEmpty
(
configuation
.
getBaseUrl
()))
{
throw
new
RuntimeException
(
"baseUrl 不能为空"
);
}
OkHttpClient
.
Builder
clientBuilder
=
new
OkHttpClient
.
Builder
()
.
cookieJar
(
new
CookieJarImpl
(
new
PersistentCookieStore
(
mContext
)))
.
connectTimeout
(
mHttpConfig
.
getTimeOut
(),
TimeUnit
.
SECONDS
)
.
writeTimeout
(
mHttpConfig
.
getTimeOut
(),
TimeUnit
.
SECONDS
)
.
readTimeout
(
mHttpConfig
.
getTimeOut
(),
TimeUnit
.
SECONDS
)
.
connectionPool
(
new
ConnectionPool
(
8
,
15
,
TimeUnit
.
SECONDS
));
if
(
BuildConfig
.
DEBUG
)
{
HttpLoggingInterceptor
logging
=
new
HttpLoggingInterceptor
(
message
->
{
if
(
TextUtils
.
isEmpty
(
message
))
return
;
String
s
=
message
.
substring
(
0
,
1
);
String
request
=
message
.
substring
(
0
,
4
);
if
(
"{"
.
equals
(
s
)
||
"["
.
equals
(
s
))
{
Logger
.
json
(
message
);
}
else
if
(
request
.
contains
(
"-->"
)
||
request
.
contains
(
"<--"
))
{
Logger
.
d
(
"Method"
+
message
);
}
else
{
Logger
.
d
(
"params:"
+
message
);
}
});
logging
.
setLevel
(
HttpLoggingInterceptor
.
Level
.
BODY
);
clientBuilder
.
interceptors
().
add
(
logging
);
}
OkHttpInterceptor
okHttpInterceptor
=
new
OkHttpInterceptor
(
AESUtils
.
getDefaultKey
());
clientBuilder
.
interceptors
().
add
(
okHttpInterceptor
);
mOkHttpClient
=
clientBuilder
.
build
();
mRetrofit
=
new
Retrofit
.
Builder
()
.
client
(
mOkHttpClient
)
.
addConverterFactory
(
BaiduGsonConverterFactory
.
create
())
.
addCallAdapterFactory
(
RxJava2CallAdapterFactory
.
create
())
.
baseUrl
(
mHttpConfig
.
getBaseUrl
())
.
build
();
}
/**
* create you ApiService
* Create an implementation of the API endpoints defined by the {@code service} interface.
*/
public
<
T
>
T
create
(
final
Class
<
T
>
service
)
{
if
(
service
==
null
)
{
throw
new
RuntimeException
(
"Api service is null!"
);
}
return
mRetrofit
.
create
(
service
);
}
}
app/src/main/java/com/mints/street/splash/GuideActivity.kt
View file @
04aba431
...
...
@@ -9,15 +9,19 @@ import com.mints.street.R
import
com.mints.street.databinding.ActivityGuideBinding
import
com.mints.street.main.MainActivity
import
kotlinx.android.synthetic.main.activity_guide.*
import
me.goldze.mvvmhabit.utils.systembar.StatusBarUtil
class
GuideActivity
:
BaseActivity
<
ActivityGuideBinding
,
GuideBindingViewModel
>(),
View
.
OnClickListener
{
override
fun
initContentView
(
savedInstanceState
:
Bundle
?)=
R
.
layout
.
activity_guide
override
fun
initVariableId
()=
BR
.
viewModel
override
fun
getStatusBarHeightView
():
View
?
{
return
null
}
override
fun
initData
()
{
super
.
initData
()
StatusBarUtil
.
setHeightAndPadding
(
this
,
binding
.
lyLinear
)
initView
()
initListener
()
}
...
...
@@ -27,7 +31,7 @@ class GuideActivity : BaseActivity<ActivityGuideBinding,GuideBindingViewModel>()
}
private
fun
initView
()
{
Glide
.
with
(
this
).
asGif
().
load
(
R
.
mipmap
.
earth
).
into
(
iv_earth
);
//
Glide.with(this).asGif().load(R.mipmap.earth).into(iv_earth);
}
override
fun
onClick
(
v
:
View
?)
{
...
...
app/src/main/java/com/mints/street/widget/dialog/DialogUtils.kt
View file @
04aba431
...
...
@@ -10,7 +10,7 @@ import java.lang.ref.WeakReference
object
DialogUtils
{
/**
*
公众号请求
弹框
*
取消开通Vip
弹框
*/
fun
showbackvipDialog
(
ctx
:
Context
,
dialogListener
:
DialogListener
)
{
val
weakReference
=
WeakReference
<
Context
>(
ctx
)
...
...
@@ -43,4 +43,14 @@ object DialogUtils {
builder
.
setCancelable
(
false
)
builder
.
show
()
}
/**
* 打开展示的限时福利弹框
*/
fun
showbennfitsDialog
(
ctx
:
Context
,
dialogListener
:
DialogListener
)
{
val
weakReference
=
WeakReference
<
Context
>(
ctx
)
val
bonusDialog
=
ShowBenfitDialog
(
weakReference
.
get
()
!!
,
dialogListener
)
bonusDialog
.
show
()
dialogListener
.
setDialog
(
bonusDialog
)
}
}
\ No newline at end of file
app/src/main/java/com/mints/street/widget/dialog/ShowBenfitDialog.kt
0 → 100644
View file @
04aba431
package
com.mints.street.widget.dialog
import
android.app.Dialog
import
android.content.Context
import
android.view.Gravity
import
android.view.KeyEvent
import
android.view.WindowManager
import
androidx.recyclerview.widget.RecyclerView
import
com.alibaba.android.vlayout.DelegateAdapter
import
com.alibaba.android.vlayout.VirtualLayoutManager
import
com.mints.street.R
import
com.mints.street.adapter.GridBenfitAdapter
as
GridBenfitAdapter
class
ShowBenfitDialog
(
context
:
Context
,
private
val
listener
:
DialogListener
)
:
Dialog
(
context
,
R
.
style
.
dialog
)
{
private
val
lp
:
WindowManager
.
LayoutParams
private
var
recycleView
:
RecyclerView
?
=
null
private
var
vLayout
:
VirtualLayoutManager
?
=
null
private
var
mAdapter
:
DelegateAdapter
?
=
null
private
var
gridbenfitAdapter
:
GridBenfitAdapter
?
=
null
init
{
setContentView
(
R
.
layout
.
layout_popupwindow
)
// 设置window属性
lp
=
window
!!
.
attributes
lp
.
gravity
=
Gravity
.
CENTER
lp
.
width
=
WindowManager
.
LayoutParams
.
WRAP_CONTENT
lp
.
windowAnimations
=
R
.
style
.
DialogAnimBottom
window
!!
.
attributes
=
lp
// 设置外部不可关闭
setCancelable
(
false
)
setCanceledOnTouchOutside
(
false
)
setOnKeyListener
{
_
,
i
,
_
->
i
==
KeyEvent
.
KEYCODE_BACK
}
initView
();
}
private
fun
initView
()
{
recycleView
=
findViewById
(
R
.
id
.
recyclerview
)
//recycleView管理(展示套餐推荐)
vLayout
=
VirtualLayoutManager
(
context
)
mAdapter
=
DelegateAdapter
(
vLayout
,
false
)
recycleView
?.
adapter
=
mAdapter
recycleView
?.
layoutManager
=
vLayout
//展示 推荐套餐内容
gridbenfitAdapter
=
GridBenfitAdapter
(
context
,
listOf
(
"1"
,
"2"
,
"3"
,
"1"
,
"2"
,
"3"
))
mAdapter
?.
addAdapter
(
gridbenfitAdapter
)
}
}
\ No newline at end of file
app/src/main/java/com/mints/street/widget/dialog/ShowLoginDialog.kt
0 → 100644
View file @
04aba431
package
com.mints.street.widget.dialog
import
android.app.Dialog
import
android.content.Context
import
android.view.Gravity
import
android.view.KeyEvent
import
android.view.WindowManager
import
android.widget.CheckBox
import
android.widget.ImageView
import
android.widget.TextView
import
androidx.appcompat.widget.LinearLayoutCompat
import
androidx.recyclerview.widget.RecyclerView
import
com.alibaba.android.vlayout.DelegateAdapter
import
com.alibaba.android.vlayout.VirtualLayoutManager
import
com.google.android.material.bottomsheet.BottomSheetDialog
import
com.mints.street.R
import
com.mints.street.adapter.GridBenfitAdapter
import
com.mints.street.login.LoginActivity
import
me.goldze.mvvmhabit.utils.RxUtils
import
me.goldze.mvvmhabit.utils.ToastUtils
class
ShowLoginDialog
(
context
:
Context
,
private
val
listener
:
DialogListener
)
:
BottomSheetDialog
(
context
,
R
.
style
.
dialog
)
{
private
val
lp
:
WindowManager
.
LayoutParams
//弹窗
private
var
iv_weixin
:
ImageView
?
=
null
private
var
ly_phone
:
LinearLayoutCompat
?
=
null
private
var
cb_checked
:
CheckBox
?
=
null
private
var
tv_regist
:
TextView
?
=
null
private
var
tv_private
:
TextView
?
=
null
init
{
setContentView
(
R
.
layout
.
layout_popupwindow
)
// 设置window属性
lp
=
window
!!
.
attributes
lp
.
gravity
=
Gravity
.
CENTER
lp
.
width
=
WindowManager
.
LayoutParams
.
WRAP_CONTENT
lp
.
windowAnimations
=
R
.
style
.
DialogAnimBottom
window
!!
.
attributes
=
lp
// 设置外部不可关闭
setCancelable
(
true
)
setCanceledOnTouchOutside
(
false
)
setOnKeyListener
{
_
,
i
,
_
->
i
==
KeyEvent
.
KEYCODE_BACK
}
initView
();
tv_regist
?.
setOnClickListener
{
listener
.
onClick
(
it
)
}
tv_private
?.
setOnClickListener
{
listener
.
onClick
(
it
)
}
iv_weixin
?.
setOnClickListener
{
listener
.
onClick
(
it
)
}
ly_phone
?.
setOnClickListener
{
listener
.
onClick
(
it
)
}
}
private
fun
initView
()
{
iv_weixin
=
findViewById
(
R
.
id
.
iv_weixin
)
ly_phone
=
findViewById
(
R
.
id
.
ly_phone
)
cb_checked
=
findViewById
(
R
.
id
.
cb_checked
)
tv_private
=
findViewById
(
R
.
id
.
tv_private
)
tv_regist
=
findViewById
(
R
.
id
.
tv_regist
)
// ly_phone?.setOnClickListener(this)
// RxUtils.onMultiClick(ly_phone) {
// if (cb_checked!!.isChecked) {
// startActivity(LoginActivity::class.java)
// mBottomSheetDialog!!.dismiss()
// } else {
// ToastUtils.showShort("请先同意用户协议与隐私政策")
// }
// }
}
}
\ No newline at end of file
app/src/main/res/drawable/shape_bg_guide_btn.xml
0 → 100644
View file @
04aba431
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<solid
android:color=
"#ffff9837"
/>
<corners
android:radius=
"25dp"
/>
<gradient
android:angle=
"90"
android:endColor=
"#4587FF"
android:startColor=
"#646BFF"
android:type=
"linear"
android:useLevel=
"true"
/>
</shape>
\ No newline at end of file
app/src/main/res/drawable/shape_bg_guide_tv.xml
View file @
04aba431
...
...
@@ -2,10 +2,10 @@
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:topLeftRadius=
"
2
0dp"
android:bottomLeftRadius=
"
2
0dp"
/>
android:topLeftRadius=
"
5
0dp"
android:bottomLeftRadius=
"
5
0dp"
/>
<gradient
android:startColor=
"#
73
FFFFFF"
android:startColor=
"#
C2
FFFFFF"
android:endColor=
"#00FFFFFF"
android:angle=
"0"
/>
</shape>
\ No newline at end of file
app/src/main/res/layout/activity_guide.xml
View file @
04aba431
...
...
@@ -9,64 +9,113 @@
type=
"com.mints.street.splash.GuideBindingViewModel"
/>
</data>
<LinearLayout
android:gravity=
"center"
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<View
android:id=
"@+id/ly_linear"
android:layout_width=
"wrap_content"
android:layout_height=
"20dp"
android:background=
"@color/ksad_translucent"
/>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/black
"
android:orientation=
"vertical
"
>
android:background=
"@mipmap/ic_bg_guide
"
android:gravity=
"center|bottom
"
>
<LinearLayout
android:id=
"@+id/ly_1"
android:layout_width=
"267dp"
android:layout_height=
"30dp"
android:layout_marginLeft=
"5dp"
android:background=
"@drawable/shape_bg_guide_tv"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/iv_earth"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
android:layout_width=
"20dp"
android:layout_height=
"20dp"
android:layout_marginLeft=
"12dp"
android:layout_marginTop=
"5dp"
android:layout_marginBottom=
"5dp"
android:src=
"@mipmap/icon_guide1"
/>
<RelativeLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
>
<TextView
android:layout_marginTop=
"20dp"
android:id=
"@+id/tv1"
android:textSize=
"20sp"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/shape_bg_guide_tv"
android:layout_gravity=
"center"
android:layout_marginLeft=
"3dp"
android:text=
"国内外全覆盖街景"
android:drawableLeft=
"@mipmap/satellite"
android:paddingLeft=
"10dp"
/>
android:textSize=
"18sp"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ly_2"
android:layout_width=
"267dp"
android:layout_height=
"30dp"
android:layout_below=
"@+id/ly_1"
android:layout_marginLeft=
"5dp"
android:layout_marginTop=
"17dp"
android:background=
"@drawable/shape_bg_guide_tv"
android:orientation=
"horizontal"
>
<ImageView
android:layout_width=
"20dp"
android:layout_height=
"20dp"
android:layout_marginLeft=
"12dp"
android:layout_marginTop=
"5dp"
android:layout_marginBottom=
"5dp"
android:src=
"@mipmap/icon_guide2"
/>
<TextView
android:layout_marginTop=
"20dp"
android:id=
"@+id/tv2"
android:layout_below=
"@+id/tv1"
android:textSize=
"20sp"
android:gravity=
"center"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/shape_bg_guide_tv"
android:layout_marginLeft=
"3dp"
android:layout_gravity=
"center"
android:text=
"VR沉浸式景点体验"
android:drawableLeft=
"@mipmap/satellite"
android:paddingLeft=
"10dp"
/>
android:textSize=
"18sp"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ly_3"
android:layout_width=
"267dp"
android:layout_height=
"30dp"
android:layout_below=
"@+id/ly_2"
android:layout_marginLeft=
"5dp"
android:layout_marginTop=
"17dp"
android:background=
"@drawable/shape_bg_guide_tv"
android:orientation=
"horizontal"
>
<ImageView
android:layout_width=
"20dp"
android:layout_height=
"20dp"
android:layout_marginLeft=
"12dp"
android:layout_marginTop=
"5dp"
android:layout_marginBottom=
"5dp"
android:src=
"@mipmap/icon_guide3"
/>
<TextView
android:layout_marginTop=
"20dp"
android:id=
"@+id/tv3"
android:layout_below=
"@+id/tv2"
android:textSize=
"20sp"
android:gravity=
"center"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/shape_bg_guide_tv"
android:layout_marginLeft=
"3dp"
android:layout_gravity=
"center"
android:text=
"高清卫星地图/历史影像"
android:drawableLeft=
"@mipmap/satellite"
android:paddingLeft=
"10dp"
/>
android:textSize=
"18sp"
/>
</LinearLayout>
<Button
android:id=
"@+id/bt_enter"
android:layout_marginTop=
"70dp"
android:layout_below=
"@+id/tv3"
android:layout_width=
"250dp"
android:layout_height=
"40dp"
android:textSize=
"18sp"
android:layout_width=
"292dp"
android:layout_height=
"47dp"
android:layout_below=
"@+id/ly_3"
android:layout_marginTop=
"97dp"
android:layout_marginBottom=
"87dp"
android:background=
"@drawable/shape_bg_guide_btn"
android:text=
"立即体验"
android:gravity=
"center"
android:background=
"@drawable/shape_login_bg"
/>
android:textSize=
"18sp"
/>
</RelativeLayout>
</FrameLayout>
</LinearLayout>
</layout>
\ No newline at end of file
app/src/main/res/layout/activity_main.xml
View file @
04aba431
<?xml version="1.0" encoding="utf-8"?>
<layout>
<data>
<variable
name=
"viewModel"
type=
"com.mints.street.main.MainViewModel"
/>
</data>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".main.MainActivity"
>
<androidx.viewpager2.widget.ViewPager2
android:id=
"@+id/mainViewpager"
android:layout_width=
"match_parent"
...
...
@@ -20,7 +24,7 @@
<FrameLayout
android:id=
"@+id/flMainBootom"
android:layout_width=
"
wrap_cont
ent"
android:layout_width=
"
match_par
ent"
android:layout_height=
"wrap_content"
app:layout_constraintBottom_toBottomOf=
"parent"
tools:ignore=
"MissingConstraints"
>
...
...
@@ -53,6 +57,5 @@
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
app/src/main/res/layout/dialog_showbenfit.xml
0 → 100644
View file @
04aba431
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"#00FFFFFF"
android:orientation=
"vertical"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"319dp"
android:layout_height=
"390dp"
android:background=
"@mipmap/dialog_bg_benfit"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/recyclerview"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintBottom_toTopOf=
"@+id/guideline17"
app:layout_constraintEnd_toStartOf=
"@+id/guideline19"
app:layout_constraintStart_toStartOf=
"@+id/guideline18"
app:layout_constraintTop_toTopOf=
"@+id/guideline12"
/>
<androidx.constraintlayout.widget.Guideline
android:id=
"@+id/guideline12"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
app:layout_constraintGuide_percent=
"0.35"
/>
<androidx.constraintlayout.widget.Guideline
android:id=
"@+id/guideline17"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
app:layout_constraintGuide_percent=
"0.95"
/>
<androidx.constraintlayout.widget.Guideline
android:id=
"@+id/guideline18"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
app:layout_constraintGuide_percent=
"0.08"
/>
<androidx.constraintlayout.widget.Guideline
android:id=
"@+id/guideline19"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
app:layout_constraintGuide_percent=
"0.92"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<ImageView
android:layout_width=
"26dp"
android:layout_height=
"26dp"
android:layout_gravity=
"center"
android:layout_marginTop=
"26dp"
android:src=
"@mipmap/dialog_close_benfit"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_home.xml
View file @
04aba431
...
...
@@ -164,9 +164,7 @@
android:layout_height=
"wrap_content"
android:text=
"搜索境内、境外地址"
android:textColor=
"#A2A4B1"
android:textSize=
"14sp"
/>
android:textSize=
"14sp"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
...
...
app/src/main/res/layout/item_grid_benfit_adpater.xml
0 → 100644
View file @
04aba431
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<data>
<variable
name=
"viewModel"
type=
"com.mints.street.adapter.GridBenfitAdapter"
/>
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/bg"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
>
<ImageView
android:id=
"@+id/imageView3"
android:layout_width=
"66dp"
android:layout_height=
"66dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:srcCompat=
"@mipmap/ic_launcher_main"
/>
<ImageView
android:id=
"@+id/imageView4"
android:layout_width=
"16dp"
android:layout_height=
"16dp"
app:layout_constraintBottom_toBottomOf=
"@+id/imageView3"
app:layout_constraintEnd_toEndOf=
"@+id/imageView3"
app:layout_constraintStart_toStartOf=
"@+id/imageView3"
app:layout_constraintTop_toTopOf=
"@+id/imageView3"
app:srcCompat=
"@mipmap/dialog_location_benfit"
/>
<TextView
android:id=
"@+id/textView"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"北京故宫"
android:textColor=
"@color/black"
android:textSize=
"14sp"
app:layout_constraintEnd_toEndOf=
"@+id/imageView3"
app:layout_constraintStart_toStartOf=
"@+id/imageView3"
app:layout_constraintTop_toBottomOf=
"@+id/imageView3"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
\ No newline at end of file
app/src/main/res/mipmap-xhdpi/dialog_bg_benfit.png
0 → 100644
View file @
04aba431
326 KB
app/src/main/res/mipmap-xhdpi/dialog_close_benfit.png
0 → 100644
View file @
04aba431
3.06 KB
app/src/main/res/mipmap-xhdpi/dialog_location_benfit.png
0 → 100644
View file @
04aba431
2.41 KB
app/src/main/res/mipmap-xhdpi/ic_bg_guide.png
0 → 100644
View file @
04aba431
This diff is collapsed.
Click to expand it.
app/src/main/res/mipmap-xhdpi/icon_guide1.png
0 → 100644
View file @
04aba431
2.74 KB
app/src/main/res/mipmap-xhdpi/icon_guide2.png
0 → 100644
View file @
04aba431
1.9 KB
app/src/main/res/mipmap-xhdpi/icon_guide3.png
0 → 100644
View file @
04aba431
3.17 KB
mvvmhabit/src/main/java/me/goldze/mvvmhabit/http/BaseArrayResponse.java
deleted
100644 → 0
View file @
072dc40d
//package me.goldze.mvvmhabit.http;
//
//import java.util.List;
//
///**
// * Created by goldze on 2017/5/10.
// * 该类仅供参考,实际业务返回的固定字段, 根据需求来定义,
// */
//public class BaseArrayResponse<T> extends BaseResponse<List<T>>{
//
//
// @Override
// public List<T> getResult() {
// return result;
// }
//
// @Override
// public void setResult(List<T> result) {
// this.result = result;
// }
//
//}
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