Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_street
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_street
Commits
a019a86d
Commit
a019a86d
authored
Jul 21, 2021
by
张释方
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化vr和推荐套餐显示方式
parent
a7165474
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
33 deletions
+42
-33
GridMapAdapter.kt
app/src/main/java/com/mints/street/adapter/GridMapAdapter.kt
+34
-30
GridPaymentAdapter.kt
.../main/java/com/mints/street/adapter/GridPaymentAdapter.kt
+7
-2
item_grid_map_adapter.xml
app/src/main/res/layout/item_grid_map_adapter.xml
+1
-1
No files found.
app/src/main/java/com/mints/street/adapter/GridMapAdapter.kt
View file @
a019a86d
...
...
@@ -24,43 +24,47 @@ class GridMapAdapter(val context: Context, var list: List<VrmapBean.Internal>?)
holder
:
BindingViewHolder
<
ItemGridMapAdapterBinding
>,
position
:
Int
)
{
// var a = holder.binding.bg.layoutParams
// if (position % 2 == 0) {
// holder.binding.bg.setMargin(AppUtils.dp2Px(context, 10F), AppUtils.dp2Px(context, 10F),
// AppUtils.dp2Px(context, 10F), 0, null, null, null)
// } else {
// holder.binding.bg.setMargin(0, AppUtils.dp2Px(context, 10F), AppUtils.dp2Px(context, 10F),
// 0, null, null, null)
// }
//
// datalist?.let {
// var databean = it[position]
// //设置图片
// Glide.with(mContext).load(databean.img).into(holder.binding.image)
// //设置标题
// holder.binding.tvName.text = databean.name
//// //设置星星数量
//// var i = 0
//// while (i < 5) {
//// holder.binding.lyStar.addView(View.inflate(context, R.layout.include_start_show, null))
//// i += 1
//// }
// //设置点击跳转
// holder.itemView.setOnClickListener {
// //页面跳转
// MintsWebViewActivity.startWebView(databean.name, url = databean.url)
var
a
=
holder
.
binding
.
bg
.
layoutParams
if
(
position
%
2
==
0
)
{
holder
.
binding
.
bg
.
setMargin
(
AppUtils
.
dp2Px
(
context
,
10F
),
AppUtils
.
dp2Px
(
context
,
10F
),
AppUtils
.
dp2Px
(
context
,
10F
),
0
,
null
,
null
,
null
)
}
else
{
holder
.
binding
.
bg
.
setMargin
(
0
,
AppUtils
.
dp2Px
(
context
,
10F
),
AppUtils
.
dp2Px
(
context
,
10F
),
0
,
null
,
null
,
null
)
}
datalist
?.
let
{
var
databean
=
it
[
position
]
//设置图片
Glide
.
with
(
mContext
).
load
(
databean
.
img
).
into
(
holder
.
binding
.
image
)
//设置标题
holder
.
binding
.
tvName
.
text
=
databean
.
name
// //设置星星数量
// var i = 0
// while (i < 5) {
// holder.binding.lyStar.addView(View.inflate(context, R.layout.include_start_show, null))
// i += 1
// }
//设置点击跳转
holder
.
itemView
.
setOnClickListener
{
//页面跳转
MintsWebViewActivity
.
startWebView
(
databean
.
name
,
url
=
databean
.
url
)
}
}
// RxUtils.onMultiClick(holder.binding.bg) {
// PanoramicActivity.starPanoramicActivity(context, ""
// , PanoramicActivity.WGS84, lat = 39.906283536127169, lon = 116.39129554889048)
// }
//// RxUtils.onMultiClick(holder.binding.bg) {
//// PanoramicActivity.starPanoramicActivity(context, ""
//// , PanoramicActivity.WGS84, lat = 39.906283536127169, lon = 116.39129554889048)
//// }
}
override
fun
getItemCount
()
=
list
!!
.
size
override
fun
onCreateLayoutHelper
()
=
GridLayoutHelper
(
2
)
override
fun
onCreateLayoutHelper
():
LayoutHelper
{
val
hp
:
GridLayoutHelper
=
GridLayoutHelper
(
2
)
hp
.
setAutoExpand
(
false
)
return
hp
}
override
fun
getLayoutId
(
viewType
:
Int
)
=
R
.
layout
.
item_grid_map_adapter
...
...
app/src/main/java/com/mints/street/adapter/GridPaymentAdapter.kt
View file @
a019a86d
...
...
@@ -2,6 +2,7 @@ package com.mints.street.adapter
import
android.content.Context
import
android.graphics.Paint
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
...
...
@@ -65,11 +66,15 @@ class GridPaymentAdapter(val context: Context, val list: List<VipBean.ListBean>)
}
}
override
fun
onCreateLayoutHelper
()
=
GridLayoutHelper
(
3
)
override
fun
getLayoutId
(
viewType
:
Int
)
=
R
.
layout
.
item_grid_payment_adpater
fun
getPosition
()=
mposition
fun
getPosition
()
=
mposition
override
fun
onCreateLayoutHelper
():
LayoutHelper
{
val
hp
:
GridLayoutHelper
=
GridLayoutHelper
(
3
)
hp
.
setAutoExpand
(
false
)
return
hp
}
}
app/src/main/res/layout/item_grid_map_adapter.xml
View file @
a019a86d
...
...
@@ -13,7 +13,7 @@
<LinearLayout
android:layout_margin=
"15dp"
android:id=
"@+id/bg"
android:layout_width=
"
100dp
"
android:layout_width=
"
wrap_content
"
android:layout_height=
"230dp"
android:background=
"@drawable/shape_bg_vrdata"
android:elevation=
"5dp"
...
...
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