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
c656fecb
Commit
c656fecb
authored
Aug 20, 2021
by
张释方
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改!!问题
parent
d104c88c
Changes
26
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
103 additions
and
117 deletions
+103
-117
DialogMapContentAdapter.kt
.../java/com/mints/street/adapter/DialogMapContentAdapter.kt
+1
-1
DialogMapHeadAdapter.kt
...ain/java/com/mints/street/adapter/DialogMapHeadAdapter.kt
+1
-2
DialogMapTailAdapter.kt
...ain/java/com/mints/street/adapter/DialogMapTailAdapter.kt
+1
-2
GridMapAdapter.kt
app/src/main/java/com/mints/street/adapter/GridMapAdapter.kt
+2
-2
ItemHotViewAdapter.kt
.../main/java/com/mints/street/adapter/ItemHotViewAdapter.kt
+1
-1
MainApi.kt
app/src/main/java/com/mints/street/api/MainApi.kt
+1
-2
GoogleMapFragment.kt
...java/com/mints/street/main/googlemap/GoogleMapFragment.kt
+2
-2
HomeButtonItemVM.kt
.../main/java/com/mints/street/main/home/HomeButtonItemVM.kt
+2
-3
HomeFragment.kt
app/src/main/java/com/mints/street/main/home/HomeFragment.kt
+2
-2
HomeViewModel.kt
...src/main/java/com/mints/street/main/home/HomeViewModel.kt
+2
-2
BindMobileActivity.kt
.../main/java/com/mints/street/main/my/BindMobileActivity.kt
+1
-1
OpenvipActivity.kt
...src/main/java/com/mints/street/main/my/OpenvipActivity.kt
+7
-5
DetailedActivity.kt
...rc/main/java/com/mints/street/main/vr/DetailedActivity.kt
+3
-5
DetailedViewModel.kt
...c/main/java/com/mints/street/main/vr/DetailedViewModel.kt
+2
-2
FreeZoneFragment.kt
...rc/main/java/com/mints/street/main/vr/FreeZoneFragment.kt
+1
-5
ApiModel.kt
app/src/main/java/com/mints/street/model/ApiModel.kt
+1
-1
DialogMapStyle.kt
...ain/java/com/mints/street/widget/dialog/DialogMapStyle.kt
+2
-3
DialogUtils.kt
...c/main/java/com/mints/street/widget/dialog/DialogUtils.kt
+0
-1
HotViewDialog.kt
...main/java/com/mints/street/widget/dialog/HotViewDialog.kt
+14
-11
ShowBenfitDialog.kt
...n/java/com/mints/street/widget/dialog/ShowBenfitDialog.kt
+2
-3
UpgradeVipDialog.kt
...n/java/com/mints/street/widget/dialog/UpgradeVipDialog.kt
+0
-4
ViewRecommedDialog.kt
...java/com/mints/street/widget/dialog/ViewRecommedDialog.kt
+33
-40
WxLoginDialog.kt
...main/java/com/mints/street/widget/dialog/WxLoginDialog.kt
+13
-8
adapter.kt
..._base/src/main/java/com/fry/base/recycler_view/adapter.kt
+4
-2
HorizontalScrollView.kt
.../main/java/com/fry/base/ui/widget/HorizontalScrollView.kt
+1
-1
AndroidManifest.xml
mvvmhabit/src/main/AndroidManifest.xml
+4
-6
No files found.
app/src/main/java/com/mints/street/adapter/DialogMapContentAdapter.kt
View file @
c656fecb
...
...
@@ -20,7 +20,7 @@ import me.goldze.mvvmhabit.utils.RxUtils
* Created by 冯瑞雨 on 2021/8/9.
*/
class
DialogMapContentAdapter
(
val
context
:
Context
,
var
list
:
List
<
MapStyleList
>?,
val
context
:
Context
?
,
var
list
:
List
<
MapStyleList
>?,
private
val
onItemMapStyleChange
:
OnItemMapStyleChange
?
=
null
)
:
AbstractVLayoutBaseAdapter
<
DialogMapContentItemBinding
,
List
<
MapStyleList
>>(
context
,
list
,
2
)
{
...
...
app/src/main/java/com/mints/street/adapter/DialogMapHeadAdapter.kt
View file @
c656fecb
...
...
@@ -6,12 +6,11 @@ import com.fry.base.adapter.AbstractVLayoutBaseAdapter
import
com.fry.base.adapter.BindingViewHolder
import
com.mints.street.R
import
com.mints.street.databinding.DialogMapHearItemBinding
import
com.mints.street.databinding.DialogMapHearItemBindingImpl
/**
* Created by 冯瑞雨 on 2021/8/9.
*/
class
DialogMapHeadAdapter
(
val
context
:
Context
,
var
name
:
String
?)
:
class
DialogMapHeadAdapter
(
val
context
:
Context
?
,
var
name
:
String
?)
:
AbstractVLayoutBaseAdapter
<
DialogMapHearItemBinding
,
String
?
>(
context
,
name
,
1
)
{
override
fun
onBindViewHolder
(
...
...
app/src/main/java/com/mints/street/adapter/DialogMapTailAdapter.kt
View file @
c656fecb
...
...
@@ -9,12 +9,11 @@ import com.github.iielse.switchbutton.SwitchView
import
com.mints.street.R
import
com.mints.street.bean.MapStyleSortBean
import
com.mints.street.databinding.DialogMapTailItemBinding
import
com.mints.street.databinding.ItemGridMapAdapterBinding
/**
* Created by 冯瑞雨 on 2021/8/9.
*/
class
DialogMapTailAdapter
(
val
context
:
Context
,
private
var
mapStyleBean
:
MapStyleSortBean
?,
class
DialogMapTailAdapter
(
val
context
:
Context
?
,
private
var
mapStyleBean
:
MapStyleSortBean
?,
val
onDataChange
:
OnDataChange
?=
null
)
:
AbstractVLayoutBaseAdapter
<
DialogMapTailItemBinding
,
List
<
String
>>(
context
,
null
,
3
)
{
...
...
app/src/main/java/com/mints/street/adapter/GridMapAdapter.kt
View file @
c656fecb
...
...
@@ -17,7 +17,7 @@ import me.goldze.mvvmhabit.utils.RxUtils
/**
* Created by 冯瑞雨 on 2021/7/9.
*/
class
GridMapAdapter
(
val
context
:
Context
,
var
list
:
List
<
VrmapBean
.
Internal
>?)
:
class
GridMapAdapter
(
val
context
:
Context
?
,
var
list
:
List
<
VrmapBean
.
Internal
>?)
:
AbstractVLayoutBaseAdapter
<
ItemGridMapAdapterBinding
,
List
<
VrmapBean
.
Internal
>>(
context
,
list
,
2
)
{
override
fun
onBindViewHolder
(
...
...
@@ -52,7 +52,7 @@ class GridMapAdapter(val context: Context, var list: List<VrmapBean.Internal>?)
override
fun
getItemCount
()
=
list
!!
.
size
override
fun
getItemCount
()
=
list
?.
size
?:
0
override
fun
onCreateLayoutHelper
():
LayoutHelper
{
val
hp
:
GridLayoutHelper
=
GridLayoutHelper
(
2
)
...
...
app/src/main/java/com/mints/street/adapter/ItemHotViewAdapter.kt
View file @
c656fecb
...
...
@@ -36,7 +36,7 @@ class ItemHotViewAdapter(val context: Context, val dialog: BottomSheetDialog?, v
//设置名称
holder
.
binding
.
viewname
.
text
=
name
//设置距离
var
distance
:
Double
=
getDistance
(
LatLng
(
lat
!!
.
toDouble
(),
lng
!!
.
toDouble
()
),
LatLng
(
mCurrentLat
,
mCurrentLon
))
var
distance
:
Double
=
getDistance
(
LatLng
(
lat
?.
toDouble
()
?:
0.0
,
lng
?.
toDouble
()
?:
0.0
),
LatLng
(
mCurrentLat
,
mCurrentLon
))
holder
.
binding
.
tvDistance
.
text
=
"距离${DecimalFormat("
0.00
").format(distance / 1000).toString()}km"
//设置景点简介
holder
.
binding
.
tvDescribe
.
text
=
desc
...
...
app/src/main/java/com/mints/street/api/MainApi.kt
View file @
c656fecb
...
...
@@ -5,7 +5,6 @@ import com.mints.street.netwrok.common.HttpManager
import
io.reactivex.Observable
import
retrofit2.Response
import
retrofit2.http.Body
import
retrofit2.http.GET
import
retrofit2.http.POST
/**
...
...
@@ -142,7 +141,7 @@ interface MainApi {
* 精选体验详情
*/
@POST
(
"na/getChooseExperienceData"
)
fun
getChooseExperienceData
(
@Body
vo
:
@JvmSuppressWildcards
Map
<
String
,
Any
>):
Observable
<
Response
<
BaseResponse
<
DetailedBean
>>>
fun
getChooseExperienceData
(
@Body
vo
:
@JvmSuppressWildcards
Map
<
String
,
String
?
>):
Observable
<
Response
<
BaseResponse
<
DetailedBean
>>>
/**
...
...
app/src/main/java/com/mints/street/main/googlemap/GoogleMapFragment.kt
View file @
c656fecb
...
...
@@ -114,7 +114,7 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
viewModel
.
getMapStyle
()
}
else
{
if
(
this
@GoogleMapFragment
.
fragmentManager
!=
null
)
{
dialogMapStyle
?.
show
(
this
@GoogleMapFragment
.
fragmentManager
!!
,
"dialogMapStyle"
)
dialogMapStyle
?.
show
(
this
.
fragmentManager
!!
,
"dialogMapStyle"
)
}
}
}
//点击热门景点
...
...
@@ -440,7 +440,7 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
//获取地图展示样式
viewModel
.
mapStyleSortBean
.
observe
(
this
,
Observer
{
it
?.
apply
{
dialogMapStyle
=
DialogMapStyle
(
context
!!
,
it
,
dialogMapStyle
=
DialogMapStyle
(
context
,
it
,
object
:
DialogMapStyle
.
OnMapStyleDataChange
{
override
fun
onMapStyleItemChange
(
type
:
String
)
{
changeMapType
(
type
)
...
...
app/src/main/java/com/mints/street/main/home/HomeButtonItemVM.kt
View file @
c656fecb
package
com.mints.street.main.home
import
com.mints.street.webview.MintsWebViewActivity
import
me.goldze.mvvmhabit.base.ItemViewModel
import
me.goldze.mvvmhabit.binding.command.BindingAction
import
me.goldze.mvvmhabit.binding.command.BindingCommand
...
...
@@ -8,8 +7,8 @@ import me.goldze.mvvmhabit.binding.command.BindingCommand
/**
* Created by 冯瑞雨 on 2021/7/9.
*/
class
HomeButtonItemVM
(
viewModel
:
HomeViewModel
,
val
name
:
String
?,
val
image1
:
String
,
val
image2
:
String
,
val
image3
:
String
,
class
HomeButtonItemVM
(
viewModel
:
HomeViewModel
,
val
name
:
String
?,
val
image1
:
String
?
,
val
image2
:
String
?,
val
image3
:
String
?
,
var
latitude
:
String
?,
var
longitude
:
String
?,
val
isLook
:
Boolean
?=
false
)
:
ItemViewModel
<
HomeViewModel
?
>(
viewModel
)
{
val
onItemClick
=
BindingCommand
<
Any
?>(
BindingAction
{
...
...
app/src/main/java/com/mints/street/main/home/HomeFragment.kt
View file @
c656fecb
...
...
@@ -462,7 +462,7 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
val
builder
=
MapStatus
.
Builder
()
builder
.
target
(
latLng
).
zoom
(
18.5f
).
overlook
(-
21f
).
rotate
(
0f
)
// 更新地图状态
mBaiduMap
!!
.
animateMapStatus
(
MapStatusUpdateFactory
.
newMapStatus
(
builder
.
build
()),
300
)
mBaiduMap
?
.
animateMapStatus
(
MapStatusUpdateFactory
.
newMapStatus
(
builder
.
build
()),
300
)
//mMarker.setPosition(latLng)
}
}
\ No newline at end of file
app/src/main/java/com/mints/street/main/home/HomeViewModel.kt
View file @
c656fecb
...
...
@@ -131,10 +131,10 @@ class HomeViewModel(application: Application) : BaseViewModel(application) {
}
val
bean
=
mapBean
?.
homePlaces
?.
places
bean
?.
iterator
()
?.
forEach
{
item
->
if
(
item
.
images
==
null
||
item
.
images
?.
size
!!
<
3
)
{
if
(
item
.
images
==
null
||
item
.
images
?.
size
?:
0
<
3
)
{
return
}
addressList
.
add
(
addressList
?
.
add
(
HomeButtonItemVM
(
this
,
item
.
name
,
...
...
app/src/main/java/com/mints/street/main/my/BindMobileActivity.kt
View file @
c656fecb
...
...
@@ -53,7 +53,7 @@ class BindMobileActivity : BaseActivity<ActivityBindmobileBinding, BindMobileVie
// mobile = UserManager.getInstance().mobile
if
(!
TextUtils
.
isEmpty
(
mobile
))
{
etLoginMobile
.
setText
(
mobile
)
etLoginMobile
.
setSelection
(
mobile
!!
.
length
+
2
)
etLoginMobile
.
setSelection
(
mobile
?.
length
?:
0
+
2
)
}
}
...
...
app/src/main/java/com/mints/street/main/my/OpenvipActivity.kt
View file @
c656fecb
...
...
@@ -294,16 +294,18 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
//设置选中标记
private
fun
setpayweyflag
(
textflag
:
CharSequence
?)
{
if
(
textflag
!!
.
equals
(
"微信支付"
))
{
if
(
textflag
!=
null
)
{
if
(
textflag
.
equals
(
"微信支付"
))
{
currentPayType
=
"WEIXIN"
}
else
{
currentPayType
=
"ALIPAY"
}
}
}
private
fun
payVip
()
{
if
(
vipList
!=
null
&&
vipList
!!
.
size
>
0
&&
gridPaymentAdapter
!=
null
)
{
if
(
vipList
!=
null
&&
vipList
?.
size
?:
0
>
0
&&
gridPaymentAdapter
!=
null
)
{
if
(
TextUtils
.
equals
(
"WEIXIN"
,
currentPayType
))
{
viewModel
.
getVipPayParams
(
"WEIXIN"
,
gridPaymentAdapter
?.
getPid
())
}
else
{
...
...
app/src/main/java/com/mints/street/main/vr/DetailedActivity.kt
View file @
c656fecb
package
com.mints.street.main.vr
import
android.content.Intent
import
androidx.appcompat.app.AppCompatActivity
import
android.os.Bundle
import
android.view.View
import
android.widget.TextView
import
androidx.lifecycle.Observer
import
com.alibaba.android.vlayout.DelegateAdapter
import
com.alibaba.android.vlayout.VirtualLayoutManager
...
...
@@ -38,7 +36,7 @@ class DetailedActivity : BaseActivity<ActivityDetailedBinding, DetailedViewModel
private
fun
initView
()
{
//初始化布局管理器
// if (this == null) return
vLayout
=
VirtualLayoutManager
(
this
!!
);
vLayout
=
VirtualLayoutManager
(
this
);
mAdapter
=
DelegateAdapter
(
vLayout
,
false
)
binding
.
listview
.
layoutManager
=
vLayout
...
...
@@ -54,7 +52,7 @@ class DetailedActivity : BaseActivity<ActivityDetailedBinding, DetailedViewModel
override
fun
onResume
()
{
super
.
onResume
()
myintent
=
getIntent
();
viewModel
.
getChooseExperienceData
(
myintent
?.
getStringExtra
(
"area"
)
!!
)
viewModel
.
getChooseExperienceData
(
myintent
?.
getStringExtra
(
"area"
))
}
override
fun
initViewObservable
()
{
...
...
@@ -67,7 +65,7 @@ class DetailedActivity : BaseActivity<ActivityDetailedBinding, DetailedViewModel
gridVrMapAdapter
?.
list
=
it
.
list
mAdapter
?.
notifyDataSetChanged
()
binding
.
tvIntroduce
.
text
=
it
.
desc
binding
.
tvName
.
text
=
myintent
?.
getStringExtra
(
"area"
)
!!
binding
.
tvName
.
text
=
myintent
?.
getStringExtra
(
"area"
)
})
}
}
\ No newline at end of file
app/src/main/java/com/mints/street/main/vr/DetailedViewModel.kt
View file @
c656fecb
...
...
@@ -17,8 +17,8 @@ class DetailedViewModel(application: Application) : BaseViewModel(application) {
val
detailbean
:
MutableLiveData
<
DetailedBean
>
=
MutableLiveData
()
fun
getChooseExperienceData
(
name
:
String
){
val
vo
=
HashMap
<
String
,
Any
>()
fun
getChooseExperienceData
(
name
:
String
?
){
val
vo
=
HashMap
<
String
,
String
?
>()
vo
[
"area"
]
=
name
ApiModel
.
getChooseExperienceData
(
lifecycleProvider
,
vo
).
safeSubscribe
(
object
:
HttpSubscribeImpl
<
BaseResponse
<
DetailedBean
>>(
...
...
app/src/main/java/com/mints/street/main/vr/FreeZoneFragment.kt
View file @
c656fecb
...
...
@@ -9,13 +9,9 @@ import com.alibaba.android.vlayout.VirtualLayoutManager
import
com.fry.base.base.BaseFragment
import
com.mints.street.BR
import
com.mints.street.R
import
com.mints.street.adapter.EnterDestinationAdapter
import
com.mints.street.adapter.GridMapAdapter
import
com.mints.street.bean.VrmapBean
import
com.mints.street.databinding.FragmentFreeZoneBinding
import
com.scwang.smartrefresh.layout.api.RefreshLayout
import
com.scwang.smartrefresh.layout.listener.OnRefreshListener
import
me.goldze.mvvmhabit.utils.KLog
/**
* Created by 冯瑞雨 on 2021/7/9.
...
...
@@ -65,7 +61,7 @@ class FreeZoneFragment : BaseFragment<FragmentFreeZoneBinding, FreeZoneViewModel
// mAdapter?.addAdapter(enterDestinationAdapter)
// }
if
(
gridMapAdapter
==
null
){
gridMapAdapter
=
GridMapAdapter
(
context
!!
,
it
.
internal
)
gridMapAdapter
=
GridMapAdapter
(
context
,
it
.
internal
)
mAdapter
?.
addAdapter
(
gridMapAdapter
)
}
gridMapAdapter
?.
list
=
it
.
internal
...
...
app/src/main/java/com/mints/street/model/ApiModel.kt
View file @
c656fecb
...
...
@@ -109,7 +109,7 @@ object ApiModel {
/**
* 精选体验详情
*/
fun
getChooseExperienceData
(
lifecycleProvider
:
LifecycleProvider
<
Any
>?,
map
:
Map
<
String
,
Any
>):
Observable
<
Response
<
BaseResponse
<
DetailedBean
>>>{
fun
getChooseExperienceData
(
lifecycleProvider
:
LifecycleProvider
<
Any
>?,
map
:
Map
<
String
,
String
?
>):
Observable
<
Response
<
BaseResponse
<
DetailedBean
>>>{
return
HttpManager
.
getInstance
().
execute
(
lifecycleProvider
,
MainApi
.
newInstance
().
getChooseExperienceData
(
map
))
}
/**
...
...
app/src/main/java/com/mints/street/widget/dialog/DialogMapStyle.kt
View file @
c656fecb
...
...
@@ -6,7 +6,6 @@ import android.graphics.drawable.ColorDrawable
import
android.os.Bundle
import
android.util.DisplayMetrics
import
android.view.*
import
androidx.lifecycle.MutableLiveData
import
androidx.recyclerview.widget.RecyclerView
import
com.alibaba.android.vlayout.DelegateAdapter
import
com.alibaba.android.vlayout.VirtualLayoutManager
...
...
@@ -23,8 +22,8 @@ import com.mints.street.bean.MapStyleSortBean
* 弹出框
*/
class
DialogMapStyle
(
var
mContext
:
Context
,
var
mapStyleBean
:
MapStyleSortBean
?,
val
onMapStyleDataChange
:
OnMapStyleDataChange
?=
null
var
mContext
:
Context
?
,
var
mapStyleBean
:
MapStyleSortBean
?,
val
onMapStyleDataChange
:
OnMapStyleDataChange
?=
null
)
:
BaseDialogFragment
()
{
private
var
recycler
:
RecyclerView
?
=
null
private
var
vLayout
:
VirtualLayoutManager
?
=
null
...
...
app/src/main/java/com/mints/street/widget/dialog/DialogUtils.kt
View file @
c656fecb
...
...
@@ -6,7 +6,6 @@ import android.content.DialogInterface
import
android.content.Intent
import
android.net.Uri
import
android.provider.Settings
import
com.mints.street.adapter.GridBenfitViewModel
import
com.mints.street.bean.Places
import
com.mints.street.main.home.HomeViewModel
import
java.lang.ref.WeakReference
...
...
app/src/main/java/com/mints/street/widget/dialog/HotViewDialog.kt
View file @
c656fecb
...
...
@@ -14,12 +14,11 @@ import com.google.android.material.bottomsheet.BottomSheetDialog
import
com.mints.street.R
import
com.mints.street.adapter.ItemHotViewAdapter
import
com.mints.street.bean.HotViewBean
import
com.mints.street.main.home.HomeFragment
import
com.mints.street.main.home.HomeViewModel
import
com.mints.street.widget.GridItemDecoration
class
HotViewDialog
(
context
:
FragmentActivity
,
viewModel
:
HomeViewModel
,
mCurrentLat
:
Double
,
mCurrentLon
:
Double
,
fragment
:
Fragment
,
val
onHotItemClick
:
OnHotItemClick
?=
null
)
{
class
HotViewDialog
(
context
:
FragmentActivity
,
viewModel
:
HomeViewModel
,
mCurrentLat
:
Double
,
mCurrentLon
:
Double
,
fragment
:
Fragment
,
val
onHotItemClick
:
OnHotItemClick
?
=
null
)
{
private
var
mBottomSheetDialog
:
BottomSheetDialog
?
=
null
private
var
context
:
FragmentActivity
...
...
@@ -37,8 +36,8 @@ class HotViewDialog(context: FragmentActivity, viewModel: HomeViewModel, mCurren
this
.
context
=
context
this
.
viewModel
=
viewModel
this
.
fragment
=
fragment
this
.
mCurrentLat
=
mCurrentLat
this
.
mCurrentLon
=
mCurrentLon
this
.
mCurrentLat
=
mCurrentLat
this
.
mCurrentLon
=
mCurrentLon
}
//
...
...
@@ -48,8 +47,11 @@ class HotViewDialog(context: FragmentActivity, viewModel: HomeViewModel, mCurren
if
(
mBottomSheetDialog
!=
null
)
return
this
mBottomSheetDialog
=
BottomSheetDialog
(
context
)
val
view1
:
View
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
layout_hotview
,
null
)
mBottomSheetDialog
!!
.
setContentView
(
view1
)
mBottomSheetDialog
!!
.
window
!!
.
findViewById
<
View
>(
R
.
id
.
design_bottom_sheet
).
setBackgroundColor
(
Color
.
TRANSPARENT
)
if
(
mBottomSheetDialog
!=
null
)
{
mBottomSheetDialog
?.
setContentView
(
view1
)
mBottomSheetDialog
?.
window
?.
findViewById
<
View
>(
R
.
id
.
design_bottom_sheet
)
?.
setBackgroundColor
(
Color
.
TRANSPARENT
)
}
val
iv_close
:
ImageView
=
view1
.
findViewById
(
R
.
id
.
iv_close
)
val
recycler_view
:
RecyclerView
=
view1
.
findViewById
(
R
.
id
.
recycler_view
)
//添加下划线
...
...
@@ -65,13 +67,13 @@ class HotViewDialog(context: FragmentActivity, viewModel: HomeViewModel, mCurren
viewModel
?.
hotviewData
?.
observe
(
fragment
!!
,
androidx
.
lifecycle
.
Observer
{
if
(
itemHotViewAdapter
==
null
)
{
itemHotViewAdapter
=
ItemHotViewAdapter
(
context
,
mBottomSheetDialog
,
it
.
list
,
viewModel
!!
,
mCurrentLat
!!
,
mCurrentLon
!!
,
onHotItemClick
)
it
.
list
,
viewModel
!!
,
mCurrentLat
!!
,
mCurrentLon
!!
,
onHotItemClick
)
mAdapter
?.
addAdapter
(
itemHotViewAdapter
)
}
mAdapter
?.
notifyDataSetChanged
()
})
iv_close
.
setOnClickListener
{
mBottomSheetDialog
!!
.
dismiss
()
if
(
mBottomSheetDialog
!=
null
)
mBottomSheetDialog
?
.
dismiss
()
}
return
this
...
...
@@ -81,14 +83,15 @@ class HotViewDialog(context: FragmentActivity, viewModel: HomeViewModel, mCurren
* 展示
*/
fun
show
()
{
mBottomSheetDialog
!!
.
show
()
mBottomSheetDialog
?
.
show
()
}
fun
onDestroy
()
{
mBottomSheetDialog
=
null
}
interface
OnHotItemClick
{
fun
onItemClick
(
position
:
Int
,
itemBean
:
HotViewBean
.
Dataslist
?)
fun
onItemClick
(
position
:
Int
,
itemBean
:
HotViewBean
.
Dataslist
?)
}
}
app/src/main/java/com/mints/street/widget/dialog/ShowBenfitDialog.kt
View file @
c656fecb
...
...
@@ -10,13 +10,12 @@ 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.GridBenfit
ViewModel
import
com.mints.street.adapter.GridBenfit
Adapter
import
com.mints.street.bean.Places
import
com.mints.street.main.home.HomeViewModel
import
me.goldze.mvvmhabit.utils.RxUtils
import
com.mints.street.adapter.GridBenfitAdapter
as
GridBenfitAdapter
class
ShowBenfitDialog
(
context
:
Context
,
val
viewMode
:
HomeViewModel
,
places
:
List
<
Places
>?)
:
class
ShowBenfitDialog
(
context
:
Context
,
val
viewMode
:
HomeViewModel
?
,
places
:
List
<
Places
>?)
:
Dialog
(
context
,
R
.
style
.
dialog
)
{
private
val
lp
:
WindowManager
.
LayoutParams
...
...
app/src/main/java/com/mints/street/widget/dialog/UpgradeVipDialog.kt
View file @
c656fecb
...
...
@@ -8,12 +8,8 @@ import android.view.KeyEvent
import
android.view.WindowManager
import
android.widget.Button
import
android.widget.ImageView
import
androidx.fragment.app.FragmentActivity
import
com.alibaba.android.vlayout.DelegateAdapter
import
com.alibaba.android.vlayout.VirtualLayoutManager
import
com.blankj.utilcode.util.ActivityUtils.startActivity
import
com.mints.street.R
import
com.mints.street.adapter.GridBenfitAdapter
import
com.mints.street.main.my.OpenvipActivity
import
me.goldze.mvvmhabit.utils.RxUtils
...
...
app/src/main/java/com/mints/street/widget/dialog/ViewRecommedDialog.kt
View file @
c656fecb
...
...
@@ -5,73 +5,66 @@ import android.content.Intent
import
android.graphics.Color
import
android.view.LayoutInflater
import
android.view.View
import
android.widget.ImageView
import
android.widget.TextView
import
androidx.fragment.app.FragmentActivity
import
androidx.recyclerview.widget.DividerItemDecoration
import
androidx.recyclerview.widget.RecyclerView
import
com.alibaba.android.vlayout.DelegateAdapter
import
com.alibaba.android.vlayout.VirtualLayoutManager
import
com.baidu.mapapi.model.LatLng
import
com.baidu.mapapi.utils.DistanceUtil
import
com.fry.base.utils.ImageLoader
import
com.google.android.material.bottomsheet.BottomSheetDialog
import
com.mints.street.R
import
com.mints.street.adapter.ItemHotViewAdapter
import
com.mints.street.bean.GPS
import
com.mints.street.bean.ViewRecommedBean
import
com.mints.street.main.home.HomeFragment
import
com.mints.street.main.home.HomeViewModel
import
com.mints.street.main.my.OpenvipActivity
import
com.mints.street.manager.UserManager
import
com.mints.street.webview.MintsWebViewActivity
import
com.mints.street.widget.GridItemDecoration
import
com.mints.street.widget.XCRoundRectImageView
import
me.goldze.mvvmhabit.base.AppManager
import
me.goldze.mvvmhabit.utils.RxUtils
import
java.text.DecimalFormat
class
ViewRecommedDialog
(
context
:
Context
?,
bean
:
ViewRecommedBean
?,
gps
:
GPS
?,
homeViewModel
:
HomeViewModel
)
{
class
ViewRecommedDialog
(
context
:
Context
?,
bean
:
ViewRecommedBean
?,
gps
:
GPS
?,
homeViewModel
:
HomeViewModel
)
{
private
var
mBottomSheetDialog
:
BottomSheetDialog
?
=
null
private
var
context
:
Context
?
=
null
private
var
bean
:
ViewRecommedBean
?
=
null
private
var
homeViewModel
:
HomeViewModel
?
=
null
private
var
gps
:
GPS
?
=
null
private
var
mBottomSheetDialog
:
BottomSheetDialog
?
=
null
private
var
context
:
Context
?
=
null
private
var
bean
:
ViewRecommedBean
?
=
null
private
var
homeViewModel
:
HomeViewModel
?
=
null
private
var
gps
:
GPS
?
=
null
init
{
this
.
context
=
context
this
.
bean
=
bean
this
.
gps
=
gps
this
.
homeViewModel
=
homeViewModel
this
.
context
=
context
this
.
bean
=
bean
this
.
gps
=
gps
this
.
homeViewModel
=
homeViewModel
}
//
fun
init
():
ViewRecommedDialog
{
//创建弹窗
if
(
mBottomSheetDialog
!=
null
)
return
this
mBottomSheetDialog
=
BottomSheetDialog
(
context
!!
)
val
view1
:
View
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
layout_viewrecommed
,
null
)
mBottomSheetDialog
!!
.
setContentView
(
view1
)
mBottomSheetDialog
!!
.
window
!!
.
findViewById
<
View
>(
R
.
id
.
design_bottom_sheet
).
setBackgroundColor
(
Color
.
TRANSPARENT
)
val
viewname
:
TextView
=
view1
.
findViewById
(
R
.
id
.
viewname
)
val
tvDistance
:
TextView
=
view1
.
findViewById
(
R
.
id
.
tv_distance
)
val
image1
:
XCRoundRectImageView
=
view1
.
findViewById
(
R
.
id
.
image1
)
val
tvDescribe
:
TextView
=
view1
.
findViewById
(
R
.
id
.
tv_describe
)
val
textView5
:
TextView
=
view1
.
findViewById
(
R
.
id
.
textView5
)
if
(
mBottomSheetDialog
!=
null
)
return
this
mBottomSheetDialog
=
BottomSheetDialog
(
context
!!
)
val
view1
:
View
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
layout_viewrecommed
,
null
)
if
(
mBottomSheetDialog
!=
null
)
{
mBottomSheetDialog
?.
setContentView
(
view1
)
mBottomSheetDialog
?.
window
?.
findViewById
<
View
>(
R
.
id
.
design_bottom_sheet
)
?.
setBackgroundColor
(
Color
.
TRANSPARENT
)
}
val
viewname
:
TextView
=
view1
.
findViewById
(
R
.
id
.
viewname
)
val
tvDistance
:
TextView
=
view1
.
findViewById
(
R
.
id
.
tv_distance
)
val
image1
:
XCRoundRectImageView
=
view1
.
findViewById
(
R
.
id
.
image1
)
val
tvDescribe
:
TextView
=
view1
.
findViewById
(
R
.
id
.
tv_describe
)
val
textView5
:
TextView
=
view1
.
findViewById
(
R
.
id
.
textView5
)
viewname
.
text
=
bean
?.
name
val
a
=
DistanceUtil
.
getDistance
(
LatLng
(
bean
?.
blat
?.
toDouble
()
?:
0.0
,
bean
?.
blng
?.
toDouble
()
?:
0.0
)
,
LatLng
(
gps
?.
lat
?:
0.0
,
gps
?.
lng
?:
0.0
))
tvDistance
.
text
=
"距离${DecimalFormat("
0.00
").format(a
/
1000).toString()}km"
val
a
=
DistanceUtil
.
getDistance
(
LatLng
(
bean
?.
blat
?.
toDouble
()
?:
0.0
,
bean
?.
blng
?.
toDouble
()
?:
0.0
),
LatLng
(
gps
?.
lat
?:
0.0
,
gps
?.
lng
?:
0.0
))
tvDistance
.
text
=
"距离${DecimalFormat("
0.00
").format(a
/
1000).toString()}km"
ImageLoader
.
ImageBuilder
.
with
(
context
)
.
setUrl
(
bean
?.
img
).
setTargetView
(
image1
).
start
()
tvDescribe
.
text
=
bean
?.
desc
RxUtils
.
onMultiClick
(
textView5
){
if
(
UserManager
.
INSTANCE
.
getVipFlag
())
{
homeViewModel
?.
authorized
(
bean
?.
bvid
,
bean
?.
name
)
}
else
{
RxUtils
.
onMultiClick
(
textView5
)
{
if
(
UserManager
.
INSTANCE
.
getVipFlag
())
{
homeViewModel
?.
authorized
(
bean
?.
bvid
,
bean
?.
name
)
}
else
{
AppManager
.
getAppManager
().
currentActivity
?.
apply
{
this
.
startActivity
(
Intent
(
this
,
OpenvipActivity
::
class
.
java
))
}
...
...
@@ -84,7 +77,7 @@ class ViewRecommedDialog (context: Context?, bean: ViewRecommedBean?,gps:GPS?,ho
* 展示
*/
fun
show
()
{
mBottomSheetDialog
!!
.
show
()
mBottomSheetDialog
?
.
show
()
}
fun
onDestroy
()
{
...
...
app/src/main/java/com/mints/street/widget/dialog/WxLoginDialog.kt
View file @
c656fecb
...
...
@@ -53,9 +53,10 @@ class WxLoginDialog(context: FragmentActivity) : OnLoginListener {
mBottomSheetDialog
=
BottomSheetDialog
(
context
)
val
view1
:
View
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
layout_popupwindow
,
null
)
mBottomSheetDialog
!!
.
setContentView
(
view1
)
mBottomSheetDialog
!!
.
window
!!
.
findViewById
<
View
>(
design_bottom_sheet
).
setBackgroundColor
(
Color
.
TRANSPARENT
)
if
(
mBottomSheetDialog
!=
null
)
{
mBottomSheetDialog
?.
setContentView
(
view1
)
mBottomSheetDialog
?.
window
?.
findViewById
<
View
>(
design_bottom_sheet
)
?.
setBackgroundColor
(
Color
.
TRANSPARENT
)
}
val
iv_weixin
:
ImageView
=
view1
.
findViewById
(
R
.
id
.
iv_weixin
)
val
ly_phone
:
LinearLayoutCompat
=
view1
.
findViewById
(
R
.
id
.
ly_phone
)
val
cb_checked
:
CheckBox
=
view1
.
findViewById
(
R
.
id
.
cb_checked
)
...
...
@@ -69,7 +70,7 @@ class WxLoginDialog(context: FragmentActivity) : OnLoginListener {
MintsWebViewActivity
.
startWebView
(
name
=
"隐私协议"
,
url
=
Constant
.
PRIVACY_URL
)
}
iv_weixin
.
setOnClickListener
{
if
(
cb_checked
!!
.
isChecked
)
{
if
(
cb_checked
.
isChecked
)
{
val
wechat
=
ShareSDK
.
getPlatform
(
Wechat
.
NAME
)
if
(!
wechat
.
isClientValid
)
{
ToastUtils
.
showShort
(
"请先安装微信"
)
...
...
@@ -83,19 +84,23 @@ class WxLoginDialog(context: FragmentActivity) : OnLoginListener {
loginApi
.
setPlatform
(
Wechat
.
NAME
)
loginApi
.
login
(
context
)
}
else
{
DialogUtils
.
showPermissionDialog
(
context
,
"设备"
)
DialogUtils
.
showPermissionDialog
(
context
,
"设备"
)
}
})
mBottomSheetDialog
!!
.
dismiss
()
if
(
mBottomSheetDialog
!=
null
)
{
mBottomSheetDialog
?.
dismiss
()
}
}
else
{
ToastUtils
.
showLong
(
"请先同意用户协议与隐私政策"
)
}
}
RxUtils
.
onMultiClick
(
ly_phone
)
{
if
(
cb_checked
!!
.
isChecked
)
{
if
(
cb_checked
.
isChecked
)
{
context
.
startActivity
(
Intent
(
context
,
LoginActivity
::
class
.
java
))
mBottomSheetDialog
!!
.
dismiss
()
if
(
mBottomSheetDialog
!=
null
)
{
mBottomSheetDialog
?.
dismiss
()
}
}
else
{
ToastUtils
.
showLong
(
"请先同意用户协议与隐私政策"
)
}
...
...
library_base/src/main/java/com/fry/base/recycler_view/adapter.kt
View file @
c656fecb
...
...
@@ -95,14 +95,16 @@ abstract class VHModel {
class
VH
<
Model
:
VHModel
>(
view
:
View
)
:
RecyclerView
.
ViewHolder
(
view
)
{
private
val
binding
=
DataBindingUtil
.
bind
<
ViewDataBinding
>(
view
)
!!
private
val
binding
=
DataBindingUtil
.
bind
<
ViewDataBinding
>(
view
)
private
var
model
:
Model
?
=
null
private
var
isBinding
:
Boolean
=
false
fun
onBind
(
newModel
:
Model
)
{
val
oldModel
=
model
oldModel
?.
onUnBind
()
if
(
binding
!=
null
)
{
newModel
.
onBind
(
binding
)
}
model
=
newModel
isBinding
=
true
}
...
...
library_base/src/main/java/com/fry/base/ui/widget/HorizontalScrollView.kt
View file @
c656fecb
...
...
@@ -19,7 +19,7 @@ class HorizontalScrollView (context: Context, attributeSet: AttributeSet): Horiz
override
fun
onScrollChanged
(
l
:
Int
,
t
:
Int
,
oldl
:
Int
,
oldt
:
Int
)
{
super
.
onScrollChanged
(
l
,
t
,
oldl
,
oldt
)
if
(
mListener
!=
null
)
{
mListener
!!
(
this
,
l
,
t
,
oldl
,
oldt
)
mListener
?.
invoke
(
this
,
l
,
t
,
oldl
,
oldt
)
}
}
}
\ No newline at end of file
mvvmhabit/src/main/AndroidManifest.xml
View file @
c656fecb
...
...
@@ -8,14 +8,12 @@
<application>
<activity
android:name=
".base.ContainerActivity"
android:screenOrientation=
"portrait"
></activity>
android:screenOrientation=
"portrait"
></activity>
<activity
android:configChanges=
"screenLayout|screenSize|smallestScreenSize|orientation|keyboardHidden"
android:name=
".crash.DefaultErrorActivity"
android:configChanges=
"screenLayout|screenSize|smallestScreenSize|orientation|keyboardHidden"
android:process=
":error_activity"
android:screenOrientation=
"portrait"
/>
android:screenOrientation=
"portrait"
/>
<provider
android:name=
".crash.CaocInitProvider"
...
...
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