Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_fiveworld
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_fiveworld
Commits
2dbbc88f
Commit
2dbbc88f
authored
Jul 21, 2021
by
fengruiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
搜索页面的item背景和UI优化已完成
parent
3064de6c
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
137 additions
and
14 deletions
+137
-14
HistoryRecordAdapter.kt
...ain/java/com/mints/street/adapter/HistoryRecordAdapter.kt
+0
-1
PopularSceneAdapter.kt
...main/java/com/mints/street/adapter/PopularSceneAdapter.kt
+36
-3
TableBean.kt
app/src/main/java/com/mints/street/db/TableBean.kt
+3
-1
SearchMapActivity.kt
...main/java/com/mints/street/main/home/SearchMapActivity.kt
+1
-3
search_item_bg.xml
app/src/main/res/drawable/search_item_bg.xml
+65
-0
activity_search_map.xml
app/src/main/res/layout/activity_search_map.xml
+1
-1
item_popular_scene_adapter.xml
app/src/main/res/layout/item_popular_scene_adapter.xml
+30
-5
sort_icon_1.png
app/src/main/res/mipmap-xxhdpi/sort_icon_1.png
+0
-0
sort_icon_2.png
app/src/main/res/mipmap-xxhdpi/sort_icon_2.png
+0
-0
sort_icon_3.png
app/src/main/res/mipmap-xxhdpi/sort_icon_3.png
+0
-0
colors.xml
app/src/main/res/values/colors.xml
+1
-0
No files found.
app/src/main/java/com/mints/street/adapter/HistoryRecordAdapter.kt
View file @
2dbbc88f
...
@@ -121,7 +121,6 @@ class HistoryRecordItemVHM(val activity: SearchMapActivity,val viewModel: Search
...
@@ -121,7 +121,6 @@ class HistoryRecordItemVHM(val activity: SearchMapActivity,val viewModel: Search
}
}
val
onClick
=
BindingCommand
<
Any
>(
BindingAction
{
val
onClick
=
BindingCommand
<
Any
>(
BindingAction
{
activity
.
goTOSearch
(
historyBean
.
name
)
viewModel
.
searchName
.
value
=
HistoryBean
(
name
=
historyBean
.
name
,
viewModel
.
searchName
.
value
=
HistoryBean
(
name
=
historyBean
.
name
,
latitude
=
historyBean
.
latitude
,
longitude
=
historyBean
.
longitude
)
latitude
=
historyBean
.
latitude
,
longitude
=
historyBean
.
longitude
)
val
intent
=
Intent
()
val
intent
=
Intent
()
...
...
app/src/main/java/com/mints/street/adapter/PopularSceneAdapter.kt
View file @
2dbbc88f
package
com.mints.street.adapter
package
com.mints.street.adapter
import
android.content.Context
import
android.content.Context
import
android.view.View
import
com.alibaba.android.vlayout.layout.LinearLayoutHelper
import
com.alibaba.android.vlayout.layout.LinearLayoutHelper
import
com.bumptech.glide.GlideBuilder
import
com.bumptech.glide.GlideBuilder
import
com.fry.base.adapter.AbstractVLayoutBaseAdapter
import
com.fry.base.adapter.AbstractVLayoutBaseAdapter
...
@@ -37,6 +38,35 @@ class PopularSceneAdapter(val context: Context, var list: List<Places>? = null)
...
@@ -37,6 +38,35 @@ class PopularSceneAdapter(val context: Context, var list: List<Places>? = null)
}
}
holder
.
binding
.
tvName
.
text
=
list
?.
get
(
position
)
?.
name
holder
.
binding
.
tvName
.
text
=
list
?.
get
(
position
)
?.
name
when
(
position
){
0
->{
holder
.
binding
.
sortIm
.
visibility
=
View
.
VISIBLE
holder
.
binding
.
sortTvName
.
text
=
""
ImageLoader
.
ImageBuilder
.
with
(
context
)
.
setTargetView
(
holder
.
binding
.
sortIm
)
.
setDrawable
(
R
.
mipmap
.
sort_icon_1
).
start
()
}
1
->{
holder
.
binding
.
sortIm
.
visibility
=
View
.
VISIBLE
holder
.
binding
.
sortTvName
.
text
=
""
ImageLoader
.
ImageBuilder
.
with
(
context
)
.
setTargetView
(
holder
.
binding
.
sortIm
)
.
setDrawable
(
R
.
mipmap
.
sort_icon_2
).
start
()
}
2
->{
holder
.
binding
.
sortIm
.
visibility
=
View
.
VISIBLE
holder
.
binding
.
sortTvName
.
text
=
""
ImageLoader
.
ImageBuilder
.
with
(
context
)
.
setTargetView
(
holder
.
binding
.
sortIm
)
.
setDrawable
(
R
.
mipmap
.
sort_icon_3
).
start
()
}
else
->{
holder
.
binding
.
sortIm
.
visibility
=
View
.
GONE
holder
.
binding
.
sortTvName
.
text
=
"No.${position+1}"
}
}
if
(
list
?.
get
(
position
)
?.
images
!=
null
){
if
(
list
?.
get
(
position
)
?.
images
!=
null
){
for
(
index
in
list
?.
get
(
position
)
?.
images
!!
.
indices
){
for
(
index
in
list
?.
get
(
position
)
?.
images
!!
.
indices
){
if
(
list
?.
get
(
position
)
?.
images
?.
get
(
index
)==
null
)
return
if
(
list
?.
get
(
position
)
?.
images
?.
get
(
index
)==
null
)
return
...
@@ -44,17 +74,20 @@ class PopularSceneAdapter(val context: Context, var list: List<Places>? = null)
...
@@ -44,17 +74,20 @@ class PopularSceneAdapter(val context: Context, var list: List<Places>? = null)
0
->
{
0
->
{
ImageLoader
.
ImageBuilder
.
with
(
context
)
ImageLoader
.
ImageBuilder
.
with
(
context
)
.
setUrl
(
list
?.
get
(
position
)
?.
images
?.
get
(
index
))
.
setUrl
(
list
?.
get
(
position
)
?.
images
?.
get
(
index
))
.
setTargetView
(
holder
.
binding
.
image1
).
start
()
.
setTargetView
(
holder
.
binding
.
image1
)
.
setCornerDp
(
4
).
start
()
}
}
1
->
{
1
->
{
ImageLoader
.
ImageBuilder
.
with
(
context
)
ImageLoader
.
ImageBuilder
.
with
(
context
)
.
setUrl
(
list
?.
get
(
position
)
?.
images
?.
get
(
index
))
.
setUrl
(
list
?.
get
(
position
)
?.
images
?.
get
(
index
))
.
setTargetView
(
holder
.
binding
.
image2
).
start
()
.
setTargetView
(
holder
.
binding
.
image2
)
.
setCornerDp
(
4
).
start
()
}
}
else
->
{
else
->
{
ImageLoader
.
ImageBuilder
.
with
(
context
)
ImageLoader
.
ImageBuilder
.
with
(
context
)
.
setUrl
(
list
?.
get
(
position
)
?.
images
?.
get
(
index
))
.
setUrl
(
list
?.
get
(
position
)
?.
images
?.
get
(
index
))
.
setTargetView
(
holder
.
binding
.
image3
).
start
()
.
setTargetView
(
holder
.
binding
.
image3
)
.
setCornerDp
(
4
).
start
()
}
}
}
}
}
}
...
...
app/src/main/java/com/mints/street/db/TableBean.kt
View file @
2dbbc88f
...
@@ -20,5 +20,7 @@ class ScenicSpotBean(
...
@@ -20,5 +20,7 @@ class ScenicSpotBean(
//景区 名称
//景区 名称
var
name
:
String
?
=
null
,
var
name
:
String
?
=
null
,
//景区 图片
//景区 图片
var
images
:
List
<
String
>?
=
null
var
images
:
List
<
String
>?
=
null
,
//景区 星级 默认0-5
var
starRating
:
Int
?
=
null
)
)
\ No newline at end of file
app/src/main/java/com/mints/street/main/home/SearchMapActivity.kt
View file @
2dbbc88f
...
@@ -108,9 +108,7 @@ class SearchMapActivity : BaseActivity<ActivitySearchMapBinding, SearchMapViewMo
...
@@ -108,9 +108,7 @@ class SearchMapActivity : BaseActivity<ActivitySearchMapBinding, SearchMapViewMo
}
}
fun
goTOSearch
(
text
:
String
?){
binding
.
et
.
setSelection
(
text
?.
length
?:
0
)
}
private
fun
update
()
{
private
fun
update
()
{
historyRecordAdapter
?.
apply
{
historyRecordAdapter
?.
apply
{
...
...
app/src/main/res/drawable/search_item_bg.xml
0 → 100644
View file @
2dbbc88f
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item>
<shape
android:shape=
"rectangle"
>
<padding
android:bottom=
"1dp"
android:left=
"1dp"
android:right=
"1dp"
android:top=
"1dp"
/>
<solid
android:color=
"#0DCCCCCC"
/>
<corners
android:radius=
"8dp"
/>
</shape>
</item>
<item>
<shape
android:shape=
"rectangle"
>
<padding
android:bottom=
"1dp"
android:left=
"1dp"
android:right=
"1dp"
android:top=
"1dp"
/>
<solid
android:color=
"#10CCCCCC"
/>
<corners
android:radius=
"8dp"
/>
</shape>
</item>
<item>
<shape
android:shape=
"rectangle"
>
<padding
android:bottom=
"1dp"
android:left=
"1dp"
android:right=
"1dp"
android:top=
"1dp"
/>
<solid
android:color=
"#15CCCCCC"
/>
<corners
android:radius=
"8dp"
/>
</shape>
</item>
<item>
<shape
android:shape=
"rectangle"
>
<padding
android:bottom=
"1dp"
android:left=
"1dp"
android:right=
"1dp"
android:top=
"1dp"
/>
<solid
android:color=
"#20CCCCCC"
/>
<corners
android:radius=
"8dp"
/>
</shape>
</item>
<item>
<shape
android:shape=
"rectangle"
>
<padding
android:bottom=
"1dp"
android:left=
"1dp"
android:right=
"1dp"
android:top=
"1dp"
/>
<solid
android:color=
"#25CCCCCC"
/>
<corners
android:radius=
"8dp"
/>
</shape>
</item>
<item>
<shape>
<solid
android:color=
"#FFFFFF"
/>
<corners
android:radius=
"8dp"
/>
</shape>
</item>
</layer-list>
\ No newline at end of file
app/src/main/res/layout/activity_search_map.xml
View file @
2dbbc88f
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/
white
"
android:background=
"@color/
color_FEFFFF
"
>
>
<View
<View
...
...
app/src/main/res/layout/item_popular_scene_adapter.xml
View file @
2dbbc88f
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
<layout
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tool=
"http://schemas.android.com/tools"
>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/bg"
android:id=
"@+id/bg"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"1
3
8dp"
android:layout_height=
"1
5
8dp"
android:background=
"@
mipmap/vip_google
_bg"
android:background=
"@
drawable/search_item
_bg"
android:layout_marginStart=
"5dp"
android:layout_marginStart=
"5dp"
android:layout_marginEnd=
"5dp"
android:layout_marginEnd=
"5dp"
android:padding=
"10dp"
android:paddingBottom=
"10dp"
android:paddingEnd=
"10dp"
android:layout_marginTop=
"5dp"
>
>
<ImageView
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
android:id=
"@+id/sort_im"
android:layout_width=
"50dp"
android:layout_height=
"24dp"
/>
<TextView
<TextView
android:id=
"@+id/tv_name"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
android:id=
"@+id/sort_tv_name"
android:layout_width=
"50dp"
android:layout_height=
"24dp"
tool:text=
"NO.4"
android:textColor=
"#F78515"
android:textSize=
"16sp"
android:gravity=
"center"
/>
<TextView
android:layout_marginStart=
"10dp"
android:id=
"@+id/tv_name"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/sort_tv_name"
app:layout_constraintBottom_toTopOf=
"@id/image1"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"测试"
android:text=
"测试"
...
@@ -22,6 +45,8 @@
...
@@ -22,6 +45,8 @@
android:textStyle=
"bold"
android:textStyle=
"bold"
/>
/>
<ImageView
<ImageView
android:layout_marginStart=
"10dp"
android:id=
"@+id/image1"
android:id=
"@+id/image1"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"80dp"
android:layout_height=
"80dp"
...
...
app/src/main/res/mipmap-xxhdpi/sort_icon_1.png
0 → 100644
View file @
2dbbc88f
10.3 KB
app/src/main/res/mipmap-xxhdpi/sort_icon_2.png
0 → 100644
View file @
2dbbc88f
10.2 KB
app/src/main/res/mipmap-xxhdpi/sort_icon_3.png
0 → 100644
View file @
2dbbc88f
9.2 KB
app/src/main/res/values/colors.xml
View file @
2dbbc88f
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
<color
name=
"color_668BFF"
>
#668BFF
</color>
<color
name=
"color_668BFF"
>
#668BFF
</color>
<color
name=
"color_7EE2FF"
>
#7EE2FF
</color>
<color
name=
"color_7EE2FF"
>
#7EE2FF
</color>
<color
name=
"color_A7BCFE"
>
#A7BCFE
</color>
<color
name=
"color_A7BCFE"
>
#A7BCFE
</color>
<color
name=
"color_FEFFFF"
>
#FEFFFF
</color>
<color
name=
"color_323334"
>
#323334
</color>
<color
name=
"color_323334"
>
#323334
</color>
<color
name=
"color_333"
>
#333333
</color>
<color
name=
"color_333"
>
#333333
</color>
<color
name=
"color_172B54"
>
#172B54
</color>
<color
name=
"color_172B54"
>
#172B54
</color>
...
...
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