Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_freeworld
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_freeworld
Commits
a59fc2ca
Commit
a59fc2ca
authored
Aug 10, 2021
by
fengruiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
百度地图的sdk 地图缩放不移动,移动不缩放功能已完成
parent
d1913046
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
98 additions
and
64 deletions
+98
-64
DialogMapTailAdapter.kt
...ain/java/com/mints/street/adapter/DialogMapTailAdapter.kt
+1
-2
GridMapAdapter.kt
app/src/main/java/com/mints/street/adapter/GridMapAdapter.kt
+0
-6
HistoryRecordAdapter.kt
...ain/java/com/mints/street/adapter/HistoryRecordAdapter.kt
+1
-1
MainActivity.kt
app/src/main/java/com/mints/street/main/MainActivity.kt
+20
-5
HomeFragment.kt
app/src/main/java/com/mints/street/main/home/HomeFragment.kt
+76
-50
No files found.
app/src/main/java/com/mints/street/adapter/DialogMapTailAdapter.kt
View file @
a59fc2ca
...
@@ -12,7 +12,7 @@ import com.mints.street.databinding.ItemGridMapAdapterBinding
...
@@ -12,7 +12,7 @@ import com.mints.street.databinding.ItemGridMapAdapterBinding
* Created by 冯瑞雨 on 2021/8/9.
* Created by 冯瑞雨 on 2021/8/9.
*/
*/
class
DialogMapTailAdapter
(
val
context
:
Context
)
:
class
DialogMapTailAdapter
(
val
context
:
Context
)
:
AbstractVLayoutBaseAdapter
<
ItemGridMapAdapterBinding
,
Any
>(
context
,
null
,
3
)
{
AbstractVLayoutBaseAdapter
<
ItemGridMapAdapterBinding
,
List
<
String
>
>(
context
,
null
,
3
)
{
override
fun
onBindViewHolder
(
override
fun
onBindViewHolder
(
holder
:
BindingViewHolder
<
ItemGridMapAdapterBinding
>,
holder
:
BindingViewHolder
<
ItemGridMapAdapterBinding
>,
...
@@ -21,7 +21,6 @@ class DialogMapTailAdapter(val context: Context) :
...
@@ -21,7 +21,6 @@ class DialogMapTailAdapter(val context: Context) :
}
}
override
fun
getItemCount
()
=
1
override
fun
getItemCount
()
=
1
override
fun
onCreateLayoutHelper
():
LayoutHelper
{
override
fun
onCreateLayoutHelper
():
LayoutHelper
{
...
...
app/src/main/java/com/mints/street/adapter/GridMapAdapter.kt
View file @
a59fc2ca
package
com.mints.street.adapter
package
com.mints.street.adapter
import
android.app.ActionBar
import
android.content.Context
import
android.content.Context
import
android.icu.number.IntegerWidth
import
android.view.WindowManager
import
android.widget.ImageView
import
com.alibaba.android.vlayout.LayoutHelper
import
com.alibaba.android.vlayout.LayoutHelper
import
com.alibaba.android.vlayout.layout.GridLayoutHelper
import
com.alibaba.android.vlayout.layout.GridLayoutHelper
import
com.bumptech.glide.Glide
import
com.bumptech.glide.Glide
...
@@ -14,10 +10,8 @@ import com.fry.base.binding.setMargin
...
@@ -14,10 +10,8 @@ import com.fry.base.binding.setMargin
import
com.mints.street.R
import
com.mints.street.R
import
com.mints.street.bean.VrmapBean
import
com.mints.street.bean.VrmapBean
import
com.mints.street.databinding.ItemGridMapAdapterBinding
import
com.mints.street.databinding.ItemGridMapAdapterBinding
import
com.mints.street.main.vr.PanoramicActivity
import
com.mints.street.webview.MintsWebViewActivity
import
com.mints.street.webview.MintsWebViewActivity
import
me.goldze.mvvmhabit.utils.AppUtils
import
me.goldze.mvvmhabit.utils.AppUtils
import
me.goldze.mvvmhabit.utils.KLog
import
me.goldze.mvvmhabit.utils.RxUtils
import
me.goldze.mvvmhabit.utils.RxUtils
/**
/**
...
...
app/src/main/java/com/mints/street/adapter/HistoryRecordAdapter.kt
View file @
a59fc2ca
...
@@ -64,7 +64,7 @@ class HistoryRecordAdapter(val activity: SearchMapActivity,val viewModel: Search
...
@@ -64,7 +64,7 @@ class HistoryRecordAdapter(val activity: SearchMapActivity,val viewModel: Search
}
}
private
fun
getHistoryData
():
MutableList
<
HistoryBean
>?
{
private
fun
getHistoryData
():
MutableList
<
HistoryBean
>?
{
val
instance
=
SPUtils
.
getInstance
(
SearchMapActivity
.
HISTORY_NAME
)
val
instance
=
SPUtils
.
getInstance
(
SearchMapActivity
.
HISTORY_NAME
)
val
string
=
instance
.
decodeString
(
if
(
type
==
0
){
"Territory"
}
else
{
"Abroad"
})
val
string
=
instance
.
decodeString
(
if
(
type
==
0
){
"Territory"
}
else
{
"Abroad"
})
if
(
TextUtils
.
isEmpty
(
string
))
{
if
(
TextUtils
.
isEmpty
(
string
))
{
return
null
return
null
...
...
app/src/main/java/com/mints/street/main/MainActivity.kt
View file @
a59fc2ca
...
@@ -4,10 +4,10 @@ import android.Manifest
...
@@ -4,10 +4,10 @@ import android.Manifest
import
android.os.Build
import
android.os.Build
import
android.os.Bundle
import
android.os.Bundle
import
android.view.KeyEvent
import
android.view.KeyEvent
import
android.view.MotionEvent
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
androidx.fragment.app.Fragment
import
androidx.fragment.app.Fragment
import
androidx.fragment.app.FragmentActivity
import
androidx.viewpager2.adapter.FragmentStateAdapter
import
androidx.viewpager2.adapter.FragmentStateAdapter
import
androidx.viewpager2.widget.ViewPager2
import
androidx.viewpager2.widget.ViewPager2
import
com.fry.base.base.BaseActivity
import
com.fry.base.base.BaseActivity
...
@@ -19,7 +19,6 @@ import com.mints.street.databinding.ActivityMainBinding
...
@@ -19,7 +19,6 @@ import com.mints.street.databinding.ActivityMainBinding
import
com.mints.street.main.googlemap.GoogleMapFragment
import
com.mints.street.main.googlemap.GoogleMapFragment
import
com.mints.street.main.home.HomeFragment
import
com.mints.street.main.home.HomeFragment
import
com.mints.street.main.my.MyFragment
import
com.mints.street.main.my.MyFragment
import
com.mints.street.main.my.OpenvipActivity
import
com.mints.street.main.vr.VRFragment
import
com.mints.street.main.vr.VRFragment
import
com.mints.street.manager.UserManager
import
com.mints.street.manager.UserManager
import
com.mints.street.manager.oaid.OaidManager
import
com.mints.street.manager.oaid.OaidManager
...
@@ -38,13 +37,14 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
...
@@ -38,13 +37,14 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
override
fun
getStatusBarHeightView
():
View
?
{
override
fun
getStatusBarHeightView
():
View
?
{
return
null
return
null
}
}
private
val
homeFragment
=
HomeFragment
()
override
fun
initData
()
{
override
fun
initData
()
{
super
.
initData
()
super
.
initData
()
OaidManager
.
init
()
OaidManager
.
init
()
//初始化viewpager2
//初始化viewpager2
binding
.
mainViewpager
.
initMain
(
this
)
binding
.
mainViewpager
.
initMain
(
this
,
homeFragment
)
//初始化 bottomBarF
//初始化 bottomBarF
binding
.
mainBottom
.
init
{
binding
.
mainBottom
.
init
{
when
(
it
)
{
when
(
it
)
{
...
@@ -108,6 +108,21 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
...
@@ -108,6 +108,21 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
return
true
return
true
}
}
override
fun
dispatchTouchEvent
(
ev
:
MotionEvent
):
Boolean
{
if
(
ev
.
action
==
MotionEvent
.
ACTION_MOVE
){
//触点的个数,就是有几个手指同时接触屏幕
if
(
ev
.
pointerCount
==
1
){
homeFragment
.
updateGesture
(
true
)
}
else
{
homeFragment
.
updateGesture
(
false
)
}
}
return
super
.
dispatchTouchEvent
(
ev
)
}
}
}
...
@@ -123,7 +138,7 @@ private fun BottomNavigationViewEx.init(navigationItemSelectedAction: (Int) -> U
...
@@ -123,7 +138,7 @@ private fun BottomNavigationViewEx.init(navigationItemSelectedAction: (Int) -> U
return
this
return
this
}
}
private
fun
ViewPager2
.
initMain
(
activity
:
MainActivity
):
ViewPager2
{
private
fun
ViewPager2
.
initMain
(
activity
:
MainActivity
,
homeFragment
:
HomeFragment
):
ViewPager2
{
//是否可滑动
//是否可滑动
this
.
isUserInputEnabled
=
false
this
.
isUserInputEnabled
=
false
//预加载
//预加载
...
@@ -135,7 +150,7 @@ private fun ViewPager2.initMain(activity: MainActivity): ViewPager2 {
...
@@ -135,7 +150,7 @@ private fun ViewPager2.initMain(activity: MainActivity): ViewPager2 {
return
when
(
position
)
{
return
when
(
position
)
{
0
->
{
0
->
{
//首页
//首页
HomeFragment
()
homeFragment
}
}
1
->
{
1
->
{
//广场
//广场
...
...
app/src/main/java/com/mints/street/main/home/HomeFragment.kt
View file @
a59fc2ca
This diff is collapsed.
Click to expand it.
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