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
71ab39c9
Commit
71ab39c9
authored
Aug 10, 2021
by
张释方
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_1.0.0' of
http://gitlab.mints-id.com/android/android_street
into branch_zsf_2
parents
133881c9
a59fc2ca
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
448 additions
and
66 deletions
+448
-66
DialogMapContentAdapter.kt
.../java/com/mints/street/adapter/DialogMapContentAdapter.kt
+37
-0
DialogMapHeadAdapter.kt
...ain/java/com/mints/street/adapter/DialogMapHeadAdapter.kt
+29
-0
DialogMapTailAdapter.kt
...ain/java/com/mints/street/adapter/DialogMapTailAdapter.kt
+32
-0
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
+87
-47
DialogMapStyle.kt
...ain/java/com/mints/street/widget/dialog/DialogMapStyle.kt
+73
-0
dialog_map_content_item.xml
app/src/main/res/layout/dialog_map_content_item.xml
+43
-0
dialog_map_hear_item.xml
app/src/main/res/layout/dialog_map_hear_item.xml
+22
-0
dialog_map_style.xml
app/src/main/res/layout/dialog_map_style.xml
+11
-0
dialog_map_tail_item.xml
app/src/main/res/layout/dialog_map_tail_item.xml
+70
-0
fragment_home.xml
app/src/main/res/layout/fragment_home.xml
+11
-1
map_select_icon.png
app/src/main/res/mipmap-xxhdpi/map_select_icon.png
+0
-0
styles.xml
app/src/main/res/values/styles.xml
+4
-0
slide_in_from_right.xml
library_base/src/main/res/anim/slide_in_from_right.xml
+3
-3
slide_out_to_right.xml
library_base/src/main/res/anim/slide_out_to_right.xml
+5
-3
No files found.
app/src/main/java/com/mints/street/adapter/DialogMapContentAdapter.kt
0 → 100644
View file @
71ab39c9
package
com.mints.street.adapter
import
android.content.Context
import
com.alibaba.android.vlayout.LayoutHelper
import
com.alibaba.android.vlayout.layout.GridLayoutHelper
import
com.alibaba.android.vlayout.layout.LinearLayoutHelper
import
com.fry.base.adapter.AbstractVLayoutBaseAdapter
import
com.fry.base.adapter.BindingViewHolder
import
com.mints.street.R
import
com.mints.street.databinding.DialogMapContentItemBinding
import
com.mints.street.databinding.DialogMapContentItemBindingImpl
import
com.mints.street.databinding.ItemGridMapAdapterBinding
/**
* Created by 冯瑞雨 on 2021/8/9.
*/
class
DialogMapContentAdapter
(
val
context
:
Context
,
var
list
:
List
<
String
>?)
:
AbstractVLayoutBaseAdapter
<
DialogMapContentItemBinding
,
List
<
String
>>(
context
,
list
,
2
)
{
override
fun
onBindViewHolder
(
holder
:
BindingViewHolder
<
DialogMapContentItemBinding
>,
position
:
Int
)
{
// holder.binding.
}
override
fun
getItemCount
()
=
list
?.
size
?:
0
override
fun
onCreateLayoutHelper
():
LayoutHelper
{
val
helper
=
GridLayoutHelper
(
2
)
helper
.
setAutoExpand
(
false
)
return
helper
}
override
fun
getLayoutId
(
viewType
:
Int
)
=
R
.
layout
.
dialog_map_content_item
}
\ No newline at end of file
app/src/main/java/com/mints/street/adapter/DialogMapHeadAdapter.kt
0 → 100644
View file @
71ab39c9
package
com.mints.street.adapter
import
android.content.Context
import
com.alibaba.android.vlayout.layout.LinearLayoutHelper
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
?)
:
AbstractVLayoutBaseAdapter
<
DialogMapHearItemBinding
,
String
?
>(
context
,
name
,
1
)
{
override
fun
onBindViewHolder
(
holder
:
BindingViewHolder
<
DialogMapHearItemBinding
>,
position
:
Int
)
{
holder
.
binding
.
title
.
text
=
name
}
override
fun
getItemCount
()
=
1
override
fun
onCreateLayoutHelper
()
=
LinearLayoutHelper
()
override
fun
getLayoutId
(
viewType
:
Int
)
=
R
.
layout
.
dialog_map_hear_item
}
\ No newline at end of file
app/src/main/java/com/mints/street/adapter/DialogMapTailAdapter.kt
0 → 100644
View file @
71ab39c9
package
com.mints.street.adapter
import
android.content.Context
import
com.alibaba.android.vlayout.LayoutHelper
import
com.alibaba.android.vlayout.layout.LinearLayoutHelper
import
com.fry.base.adapter.AbstractVLayoutBaseAdapter
import
com.fry.base.adapter.BindingViewHolder
import
com.mints.street.R
import
com.mints.street.databinding.ItemGridMapAdapterBinding
/**
* Created by 冯瑞雨 on 2021/8/9.
*/
class
DialogMapTailAdapter
(
val
context
:
Context
)
:
AbstractVLayoutBaseAdapter
<
ItemGridMapAdapterBinding
,
List
<
String
>>(
context
,
null
,
3
)
{
override
fun
onBindViewHolder
(
holder
:
BindingViewHolder
<
ItemGridMapAdapterBinding
>,
position
:
Int
)
{
}
override
fun
getItemCount
()
=
1
override
fun
onCreateLayoutHelper
():
LayoutHelper
{
return
LinearLayoutHelper
()
}
override
fun
getLayoutId
(
viewType
:
Int
)
=
R
.
layout
.
dialog_map_tail_item
}
\ No newline at end of file
app/src/main/java/com/mints/street/adapter/GridMapAdapter.kt
View file @
71ab39c9
package
com.mints.street.adapter
import
android.app.ActionBar
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.layout.GridLayoutHelper
import
com.bumptech.glide.Glide
...
...
@@ -14,10 +10,8 @@ import com.fry.base.binding.setMargin
import
com.mints.street.R
import
com.mints.street.bean.VrmapBean
import
com.mints.street.databinding.ItemGridMapAdapterBinding
import
com.mints.street.main.vr.PanoramicActivity
import
com.mints.street.webview.MintsWebViewActivity
import
me.goldze.mvvmhabit.utils.AppUtils
import
me.goldze.mvvmhabit.utils.KLog
import
me.goldze.mvvmhabit.utils.RxUtils
/**
...
...
app/src/main/java/com/mints/street/adapter/HistoryRecordAdapter.kt
View file @
71ab39c9
...
...
@@ -64,7 +64,7 @@ class HistoryRecordAdapter(val activity: SearchMapActivity,val viewModel: Search
}
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"
})
if
(
TextUtils
.
isEmpty
(
string
))
{
return
null
...
...
app/src/main/java/com/mints/street/main/MainActivity.kt
View file @
71ab39c9
...
...
@@ -4,10 +4,10 @@ import android.Manifest
import
android.os.Build
import
android.os.Bundle
import
android.view.KeyEvent
import
android.view.MotionEvent
import
android.view.View
import
android.view.ViewGroup
import
androidx.fragment.app.Fragment
import
androidx.fragment.app.FragmentActivity
import
androidx.viewpager2.adapter.FragmentStateAdapter
import
androidx.viewpager2.widget.ViewPager2
import
com.fry.base.base.BaseActivity
...
...
@@ -19,7 +19,6 @@ import com.mints.street.databinding.ActivityMainBinding
import
com.mints.street.main.googlemap.GoogleMapFragment
import
com.mints.street.main.home.HomeFragment
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.manager.UserManager
import
com.mints.street.manager.oaid.OaidManager
...
...
@@ -38,13 +37,14 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
override
fun
getStatusBarHeightView
():
View
?
{
return
null
}
private
val
homeFragment
=
HomeFragment
()
override
fun
initData
()
{
super
.
initData
()
OaidManager
.
init
()
//初始化viewpager2
binding
.
mainViewpager
.
initMain
(
this
)
binding
.
mainViewpager
.
initMain
(
this
,
homeFragment
)
//初始化 bottomBarF
binding
.
mainBottom
.
init
{
when
(
it
)
{
...
...
@@ -108,6 +108,21 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
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
return
this
}
private
fun
ViewPager2
.
initMain
(
activity
:
MainActivity
):
ViewPager2
{
private
fun
ViewPager2
.
initMain
(
activity
:
MainActivity
,
homeFragment
:
HomeFragment
):
ViewPager2
{
//是否可滑动
this
.
isUserInputEnabled
=
false
//预加载
...
...
@@ -135,7 +150,7 @@ private fun ViewPager2.initMain(activity: MainActivity): ViewPager2 {
return
when
(
position
)
{
0
->
{
//首页
HomeFragment
()
homeFragment
}
1
->
{
//广场
...
...
app/src/main/java/com/mints/street/main/home/HomeFragment.kt
View file @
71ab39c9
This diff is collapsed.
Click to expand it.
app/src/main/java/com/mints/street/widget/dialog/DialogMapStyle.kt
0 → 100644
View file @
71ab39c9
package
com.mints.street.widget.dialog
import
android.content.Context
import
android.graphics.Color
import
android.graphics.drawable.ColorDrawable
import
android.os.Bundle
import
android.util.DisplayMetrics
import
android.view.*
import
androidx.recyclerview.widget.RecyclerView
import
com.alibaba.android.vlayout.DelegateAdapter
import
com.alibaba.android.vlayout.VirtualLayoutManager
import
com.fry.base.base.BaseDialogFragment
import
com.mints.street.R
import
com.mints.street.adapter.DialogMapContentAdapter
import
com.mints.street.adapter.DialogMapHeadAdapter
import
com.mints.street.adapter.DialogMapTailAdapter
/**MutableList<?>
* @author 冯瑞雨
* @date 2020/6/18 14:27
* 弹出框
*/
class
DialogMapStyle
(
var
mContext
:
Context
)
:
BaseDialogFragment
()
{
private
var
recycler
:
RecyclerView
?=
null
private
var
vLayout
:
VirtualLayoutManager
?
=
null
private
var
mAdapter
:
DelegateAdapter
?
=
null
override
fun
onStart
()
{
super
.
onStart
()
val
window
=
dialog
?.
window
window
?.
setBackgroundDrawable
(
ColorDrawable
())
val
dm
=
DisplayMetrics
()
activity
?.
windowManager
?.
defaultDisplay
?.
getMetrics
(
dm
)
window
?.
setLayout
((
dm
.
widthPixels
*
0.7
).
toInt
(),
WindowManager
.
LayoutParams
.
MATCH_PARENT
)
val
params
=
window
?.
attributes
params
?.
gravity
=
Gravity
.
START
// params?.windowAnimations = R.style.EndDialogAnim
window
?.
attributes
=
params
window
?.
decorView
?.
systemUiVisibility
=
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
)
window
?.
statusBarColor
=
Color
.
TRANSPARENT
}
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?
):
View
{
val
inflate
:
View
=
inflater
.
inflate
(
R
.
layout
.
dialog_map_style
,
container
,
false
)
recycler
=
inflate
.
findViewById
(
R
.
id
.
list_view
)
vLayout
=
VirtualLayoutManager
(
context
!!
)
mAdapter
=
DelegateAdapter
(
vLayout
,
false
)
recycler
?.
layoutManager
=
vLayout
recycler
?.
adapter
=
mAdapter
return
inflate
}
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
super
.
onViewCreated
(
view
,
savedInstanceState
)
for
(
index
in
1
..
3
){
mAdapter
?.
addAdapter
(
DialogMapHeadAdapter
(
mContext
,
"google"
))
mAdapter
?.
addAdapter
(
DialogMapContentAdapter
(
mContext
,
listOf
(
"1"
,
"2"
,
"3"
)))
}
mAdapter
?.
addAdapter
(
DialogMapHeadAdapter
(
mContext
,
"google"
))
mAdapter
?.
addAdapter
(
DialogMapTailAdapter
(
mContext
))
}
}
app/src/main/res/layout/dialog_map_content_item.xml
0 → 100644
View file @
71ab39c9
<?xml version="1.0" encoding="utf-8"?>
<layout
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"
>
<data>
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/bg"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<ImageView
android:layout_marginTop=
"15dp"
android:id=
"@+id/image"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:src=
"@mipmap/vip_google_bg"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintEnd_toEndOf=
"@id/image"
app:layout_constraintBottom_toBottomOf=
"@id/image"
android:src=
"@mipmap/map_select_icon"
/>
<TextView
android:paddingTop=
"10dp"
app:layout_constraintTop_toBottomOf=
"@+id/image"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"@color/color_121B32"
tools:text=
"天地图卫星"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
\ No newline at end of file
app/src/main/res/layout/dialog_map_hear_item.xml
0 → 100644
View file @
71ab39c9
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/color_E6E6E6"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:padding=
"10dp"
android:textColor=
"@color/black"
android:textSize=
"14sp"
tools:text=
"常用"
/>
</LinearLayout>
</layout>
\ No newline at end of file
app/src/main/res/layout/dialog_map_style.xml
0 → 100644
View file @
71ab39c9
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/cl"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/list_view"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
</FrameLayout>
\ No newline at end of file
app/src/main/res/layout/dialog_map_tail_item.xml
0 → 100644
View file @
71ab39c9
<?xml version="1.0" encoding="utf-8"?>
<layout
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"
>
<data>
<variable
name=
"viewModel"
type=
"com.mints.street.adapter.DialogMapHeadAdapter"
/>
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/bg"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/recommend"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"@color/color_333"
android:text=
"景点推荐"
android:textSize=
"16sp"
android:padding=
"10dp"
/>
<TextView
android:id=
"@+id/street_view"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/recommend"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"@color/color_333"
android:text=
"街景地图"
android:textSize=
"16sp"
android:padding=
"10dp"
/>
<com.github.iielse.switchbutton.SwitchView
android:id=
"@+id/sv_recommend"
app:primaryColor=
"#2196F3"
android:layout_width=
"wrap_content"
android:layout_height=
"20dp"
android:layout_alignParentEnd=
"true"
app:isOpened=
"true"
android:layout_marginRight=
"10dp"
app:layout_constraintTop_toTopOf=
"@id/recommend"
app:layout_constraintBottom_toBottomOf=
"@id/recommend"
app:layout_constraintEnd_toEndOf=
"parent"
/>
<com.github.iielse.switchbutton.SwitchView
android:id=
"@+id/sv_street_view"
app:primaryColor=
"#2196F3"
android:layout_width=
"wrap_content"
android:layout_height=
"20dp"
android:layout_alignParentEnd=
"true"
app:isOpened=
"true"
android:layout_marginRight=
"10dp"
app:layout_constraintTop_toTopOf=
"@id/street_view"
app:layout_constraintBottom_toBottomOf=
"@id/street_view"
app:layout_constraintEnd_toEndOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
\ No newline at end of file
app/src/main/res/layout/fragment_home.xml
View file @
71ab39c9
...
...
@@ -11,7 +11,7 @@
android:id=
"@+id/bmapView"
android:layout_width=
"0dp"
android:layout_height=
"0dp"
android:layout_marginBottom=
"
4
0dp"
android:layout_marginBottom=
"
9
0dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
...
...
@@ -67,6 +67,16 @@
android:src=
"@mipmap/location_icon"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
/>
<ImageView
android:id=
"@+id/image_map_change_icon"
android:layout_width=
"35dp"
android:layout_height=
"35dp"
android:layout_marginBottom=
"220dp"
android:layout_marginTop=
"15dp"
android:src=
"@mipmap/map_change_icon"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
/>
<LinearLayout
android:id=
"@+id/map_a_d"
...
...
app/src/main/res/mipmap-xxhdpi/map_select_icon.png
0 → 100644
View file @
71ab39c9
1.48 KB
app/src/main/res/values/styles.xml
View file @
71ab39c9
...
...
@@ -67,4 +67,8 @@
<style
name=
"CustomCheckboxTheme"
parent=
"@android:style/Widget.CompoundButton.CheckBox"
>
<item
name=
"android:button"
>
@drawable/checkbox_style
</item>
</style>
<style
name=
"EndDialogAnim"
>
<item
name=
"android:windowEnterAnimation"
>
@anim/slide_in_from_right
</item>
<item
name=
"android:windowExitAnimation"
>
@anim/slide_out_to_right
</item>
</style>
</resources>
\ No newline at end of file
library_base/src/main/res/anim/slide_in_from_right.xml
View file @
71ab39c9
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<translate
android:
duration=
"250
"
android:
fromXDelta=
"100%p
"
android:
toXDelta=
"0.0%p"
/>
android:
fromXDelta=
"-100%p
"
android:
toXDelta=
"0
"
android:
duration=
"300"
/>
</set>
\ No newline at end of file
library_base/src/main/res/anim/slide_out_to_right.xml
View file @
71ab39c9
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<translate
android:duration=
"250"
android:fromXDelta=
"0.0%p"
android:toXDelta=
"100%p"
/>
android:fromXDelta=
"0"
android:toXDelta=
"-100%p"
android:duration=
"300"
/>
</set>
\ No newline at end of file
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