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
d1913046
Commit
d1913046
authored
Aug 09, 2021
by
fengruiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
地图样式弹出框已完成
parent
f6e839cc
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
359 additions
and
11 deletions
+359
-11
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
+33
-0
HomeFragment.kt
app/src/main/java/com/mints/street/main/home/HomeFragment.kt
+18
-4
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 @
d1913046
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 @
d1913046
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 @
d1913046
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
,
Any
>(
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/main/home/HomeFragment.kt
View file @
d1913046
...
@@ -28,6 +28,7 @@ import com.mints.street.databinding.FragmentHomeBinding
...
@@ -28,6 +28,7 @@ import com.mints.street.databinding.FragmentHomeBinding
import
com.mints.street.main.MainActivity
import
com.mints.street.main.MainActivity
import
com.mints.street.manager.UmengManager
import
com.mints.street.manager.UmengManager
import
com.mints.street.widget.ScrollLayout
import
com.mints.street.widget.ScrollLayout
import
com.mints.street.widget.dialog.DialogMapStyle
import
com.mints.street.widget.dialog.DialogUtils
import
com.mints.street.widget.dialog.DialogUtils
import
com.mints.street.widget.dialog.DialogUtils.showupgradevipDialog
import
com.mints.street.widget.dialog.DialogUtils.showupgradevipDialog
import
me.goldze.mvvmhabit.base.AppManager
import
me.goldze.mvvmhabit.base.AppManager
...
@@ -84,6 +85,9 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
...
@@ -84,6 +85,9 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
private
var
isFirstLoc
=
true
private
var
isFirstLoc
=
true
private
var
myLocationData
:
MyLocationData
?
=
null
private
var
myLocationData
:
MyLocationData
?
=
null
//弹出框
private
var
dialogMapStyle
:
DialogMapStyle
?=
null
override
fun
initContentView
(
override
fun
initContentView
(
inflater
:
LayoutInflater
?,
inflater
:
LayoutInflater
?,
...
@@ -100,9 +104,6 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
...
@@ -100,9 +104,6 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
uploadDeviceInfo
()
uploadDeviceInfo
()
}
}
private
fun
uploadDeviceInfo
()
{
private
fun
uploadDeviceInfo
()
{
UmengManager
.
initUm
()
UmengManager
.
initUm
()
...
@@ -117,7 +118,20 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
...
@@ -117,7 +118,20 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
SearchMapActivity
.
startSearchMapActivity
(
this
)
SearchMapActivity
.
startSearchMapActivity
(
this
)
}
}
RxUtils
.
onMultiClick
(
binding
.
ivClick
)
{
RxUtils
.
onMultiClick
(
binding
.
ivClick
)
{
viewModel
.
authorized
(
""
,
currentLat
.
toString
(),
currentLon
.
toString
(),
false
)
viewModel
.
authorized
(
""
,
currentLat
.
toString
(),
currentLon
.
toString
(),
false
)
}
RxUtils
.
onMultiClick
(
binding
.
imageMapChangeIcon
){
context
?.
apply
{
if
(
dialogMapStyle
==
null
){
dialogMapStyle
=
DialogMapStyle
(
this
)
}
if
(
this
@HomeFragment
.
fragmentManager
!=
null
){
dialogMapStyle
?.
show
(
this
@HomeFragment
.
fragmentManager
!!
,
"dialogMapStyle"
)
}
}
}
}
viewModel
.
getMapBean
()
viewModel
.
getMapBean
()
}
}
...
...
app/src/main/java/com/mints/street/widget/dialog/DialogMapStyle.kt
0 → 100644
View file @
d1913046
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 @
d1913046
<?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 @
d1913046
<?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 @
d1913046
<?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 @
d1913046
<?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 @
d1913046
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
android:id=
"@+id/bmapView"
android:id=
"@+id/bmapView"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"0dp"
android:layout_height=
"0dp"
android:layout_marginBottom=
"
4
0dp"
android:layout_marginBottom=
"
9
0dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
...
@@ -58,6 +58,16 @@
...
@@ -58,6 +58,16 @@
android:src=
"@mipmap/location_icon"
android:src=
"@mipmap/location_icon"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"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
<LinearLayout
android:id=
"@+id/map_a_d"
android:id=
"@+id/map_a_d"
...
...
app/src/main/res/mipmap-xxhdpi/map_select_icon.png
0 → 100644
View file @
d1913046
1.48 KB
app/src/main/res/values/styles.xml
View file @
d1913046
...
@@ -67,4 +67,8 @@
...
@@ -67,4 +67,8 @@
<style
name=
"CustomCheckboxTheme"
parent=
"@android:style/Widget.CompoundButton.CheckBox"
>
<style
name=
"CustomCheckboxTheme"
parent=
"@android:style/Widget.CompoundButton.CheckBox"
>
<item
name=
"android:button"
>
@drawable/checkbox_style
</item>
<item
name=
"android:button"
>
@drawable/checkbox_style
</item>
</style>
</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>
</resources>
\ No newline at end of file
library_base/src/main/res/anim/slide_in_from_right.xml
View file @
d1913046
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<set
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<translate
<translate
android:
duration=
"250
"
android:
fromXDelta=
"-100%p
"
android:
fromXDelta=
"100%p
"
android:
toXDelta=
"0
"
android:
toXDelta=
"0.0%p"
/>
android:
duration=
"300"
/>
</set>
</set>
\ No newline at end of file
library_base/src/main/res/anim/slide_out_to_right.xml
View file @
d1913046
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<set
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<translate
<translate
android:duration=
"250"
android:fromXDelta=
"0"
android:fromXDelta=
"0.0%p"
android:toXDelta=
"-100%p"
android:toXDelta=
"100%p"
/>
android:duration=
"300"
/>
</set>
</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