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
c0c3b24c
Commit
c0c3b24c
authored
Aug 06, 2021
by
张释方
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成热门景点功能2
parent
d3618d3f
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
19 deletions
+81
-19
MainApi.kt
app/src/main/java/com/mints/street/api/MainApi.kt
+6
-0
HomeViewModel.kt
...src/main/java/com/mints/street/main/home/HomeViewModel.kt
+23
-0
ApiModel.kt
app/src/main/java/com/mints/street/model/ApiModel.kt
+5
-0
fragment_home.xml
app/src/main/res/layout/fragment_home.xml
+29
-19
layout_hotview.xml
app/src/main/res/layout/layout_hotview.xml
+18
-0
icon_hotview.png
app/src/main/res/mipmap-xhdpi/icon_hotview.png
+0
-0
No files found.
app/src/main/java/com/mints/street/api/MainApi.kt
View file @
c0c3b24c
...
...
@@ -138,4 +138,10 @@ interface MainApi {
@POST
(
"na/getChooseExperienceData"
)
fun
getChooseExperienceData
(
@Body
vo
:
@JvmSuppressWildcards
Map
<
String
,
Any
>):
Observable
<
Response
<
BaseResponse
<
DetailedBean
>>>
/**
* 热门景点
*/
@POST
(
"xx/xxx"
)
fun
getHotView
(
@Body
vo
:
@JvmSuppressWildcards
Map
<
String
,
Any
>):
Observable
<
Response
<
BaseResponse
<
HotViewBean
>>>
}
\ No newline at end of file
app/src/main/java/com/mints/street/main/home/HomeViewModel.kt
View file @
c0c3b24c
...
...
@@ -183,5 +183,28 @@ class HomeViewModel(application: Application) : BaseViewModel(application) {
}
}
}
/**
* 获取人们景点数据
*/
var
hotviewData
=
MutableLiveData
<
HotViewBean
>()
fun
getHotView
()
{
val
vo
=
java
.
util
.
HashMap
<
String
,
Any
>()
vo
[
"status"
]
=
1
ApiModel
.
getHotView
(
lifecycleProvider
,
vo
).
safeSubscribe
(
object
:
HttpSubscribeImpl
<
BaseResponse
<
HotViewBean
>>(
this
@HomeViewModel
,
true
)
{
override
fun
onBusinessSuccess
(
response
:
BaseResponse
<
HotViewBean
>)
{
hotviewData
.
value
=
response
.
result
KLog
.
e
(
"getmyInfo"
,
response
.
result
.
toString
())
}
override
fun
onError
(
e
:
Throwable
)
{
super
.
onError
(
e
)
KLog
.
e
(
"getmyInfo"
,
"用户登录信息请求失败"
)
}
}
)
}
}
\ No newline at end of file
app/src/main/java/com/mints/street/model/ApiModel.kt
View file @
c0c3b24c
...
...
@@ -146,4 +146,9 @@ object ApiModel {
fun
authorizedA
():
Observable
<
Response
<
BaseResponse
<
AuthorizedBean
>>>{
return
HttpManager
.
getInstance
().
execute
(
null
,
MainApi
.
newInstance
().
authorizedA
())
}
fun
getHotView
(
lifecycleProvider
:
LifecycleProvider
<
Any
>?,
map
:
Map
<
String
,
Any
>):
Observable
<
Response
<
BaseResponse
<
HotViewBean
>>>{
return
HttpManager
.
getInstance
().
execute
(
lifecycleProvider
,
MainApi
.
newInstance
().
getHotView
(
map
))
}
}
\ No newline at end of file
app/src/main/res/layout/fragment_home.xml
View file @
c0c3b24c
...
...
@@ -16,12 +16,13 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<ImageView
android:id=
"@+id/iv_click"
android:layout_marginBottom=
"40dp"
android:layout_width=
"80dp"
android:layout_height=
"80dp"
android:layout_centerInParent=
"true"
android:layout_marginBottom=
"40dp"
android:src=
"@mipmap/positioning_icon"
app:layout_constraintBottom_toBottomOf=
"@id/bmapView"
app:layout_constraintEnd_toEndOf=
"parent"
...
...
@@ -39,22 +40,31 @@
app:layout_constraintTop_toTopOf=
"parent"
/>
<ImageView
android:visibility=
"gone"
android:id=
"@+id/image_map_history"
android:layout_width=
"35dp"
android:layout_height=
"35dp"
android:layout_marginTop=
"15dp"
android:src=
"@mipmap/map_history_icon"
android:visibility=
"gone"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/image_map_change"
/>
<ImageView
android:id=
"@+id/ly_hotview"
android:layout_width=
"35dp"
android:layout_height=
"35dp"
android:layout_margin=
"20dp"
android:src=
"@mipmap/icon_hotview"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/image_map_history"
/>
<ImageView
android:id=
"@+id/image_location_icon"
android:layout_width=
"35dp"
android:layout_height=
"35dp"
android:layout_marginBottom=
"220dp"
android:layout_marginTop=
"15dp"
android:layout_marginBottom=
"220dp"
android:src=
"@mipmap/location_icon"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
/>
...
...
@@ -63,8 +73,8 @@
android:id=
"@+id/map_a_d"
android:layout_width=
"31dp"
android:layout_height=
"63dp"
android:layout_marginBottom=
"10dp"
android:layout_marginEnd=
"2dp"
android:layout_marginBottom=
"10dp"
android:background=
"@drawable/shape_gold_card"
android:orientation=
"vertical"
app:layout_constraintBottom_toTopOf=
"@id/image_location_icon"
...
...
@@ -89,8 +99,8 @@
<View
android:layout_width=
"wrap_content"
android:layout_height=
"0.5dp"
android:layout_marginEnd=
"12dp"
android:layout_marginStart=
"12dp"
android:layout_marginEnd=
"12dp"
android:background=
"@color/color_333"
/>
</LinearLayout>
...
...
@@ -110,8 +120,8 @@
android:layout_height=
"wrap_content"
android:background=
"@drawable/cursor_bg"
android:gravity=
"center_horizontal"
android:
paddingBottom=
"10dp
"
android:
orientation=
"vertical
"
>
android:
orientation=
"vertical
"
android:
paddingBottom=
"10dp
"
>
<ImageView
android:id=
"@+id/image_under"
...
...
@@ -127,53 +137,53 @@
android:id=
"@+id/stb_bg_search"
android:layout_width=
"match_parent"
android:layout_height=
"37dp"
android:layout_marginEnd=
"10dp"
android:layout_marginStart=
"10dp"
android:layout_marginEnd=
"10dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/image_under"
app:stv_corner=
"20dp"
app:stv_solid=
"#F5F9FA"
app:stv_stroke_color=
"#ffe1e1e1"
app:stv_stroke_width=
"1dp"
/>
app:stv_stroke_width=
"1dp"
/>
<ImageView
android:layout_marginStart=
"16dp"
android:id=
"@+id/im_search"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:src=
"@mipmap/search_icon"
app:layout_constraintBottom_toBottomOf=
"@id/stb_bg_search"
app:layout_constraintStart_toStartOf=
"@id/stb_bg_search"
app:layout_constraintTop_toTopOf=
"@id/stb_bg_search"
/>
<View
android:background=
"#A1A3AF"
android:layout_width=
"0.5dp"
android:layout_height=
"14dp"
android:layout_marginStart=
"16dp"
android:background=
"#A1A3AF"
app:layout_constraintBottom_toBottomOf=
"@id/stb_bg_search"
app:layout_constraintStart_toEndOf=
"@id/im_search"
app:layout_constraintTop_toTopOf=
"@id/stb_bg_search"
/>
<TextView
android:layout_marginStart=
"27dp"
app:layout_constraintBottom_toBottomOf=
"@id/stb_bg_search"
app:layout_constraintStart_toEndOf=
"@id/im_search"
app:layout_constraintTop_toTopOf=
"@id/stb_bg_search"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"27dp"
android:text=
"搜索境内、境外地址"
android:textColor=
"#A2A4B1"
android:textSize=
"14sp"
/>
android:textSize=
"14sp"
app:layout_constraintBottom_toBottomOf=
"@id/stb_bg_search"
app:layout_constraintStart_toEndOf=
"@id/im_search"
app:layout_constraintTop_toTopOf=
"@id/stb_bg_search"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<com.mints.street.widget.ScrollRecyclerView
android:background=
"@color/white"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
app:itemBinding=
"@{viewModel.addressItemBinding}"
app:items=
"@{viewModel.addressList}"
tools:listitem=
"@layout/item_home_button"
>
...
...
app/src/main/res/layout/layout_hotview.xml
0 → 100644
View file @
c0c3b24c
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"350dp"
android:orientation=
"vertical"
android:background=
"@drawable/shape_dialog_bg"
>
<ImageView
android:id=
"@+id/iv_close"
android:layout_width=
"20dp"
android:layout_height=
"20dp"
android:layout_margin=
"10dp"
android:src=
"@mipmap/icon_hot_view_close"
android:layout_gravity=
"end"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/recycler_view"
android:layout_height=
"300dp"
android:layout_width=
"match_parent"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/mipmap-xhdpi/icon_hotview.png
0 → 100644
View file @
c0c3b24c
3.77 KB
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