二级联动测试
This commit is contained in:
parent
33e89003ca
commit
b967c7b5c2
@ -156,6 +156,12 @@
|
|||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||||
|
|
||||||
|
<activity android:name=".ui.MarketsActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation|locale"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:windowSoftInputMode="adjustPan|stateHidden"
|
||||||
|
></activity>
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
@ -39,3 +39,17 @@ data class CarBean(
|
|||||||
val avatar: String="",
|
val avatar: String="",
|
||||||
var isSelect: Boolean = false
|
var isSelect: Boolean = false
|
||||||
)
|
)
|
||||||
|
data class CaptainBean(
|
||||||
|
val auditStatus: String,
|
||||||
|
val businessEnterpriseName: String,
|
||||||
|
val businessLegalPerson: String,
|
||||||
|
val captainId: Int,
|
||||||
|
val captainName: String,
|
||||||
|
val captainType: String,
|
||||||
|
val contactName: String,
|
||||||
|
val idcardName: String,
|
||||||
|
val isRealName: String,
|
||||||
|
val status: String,
|
||||||
|
var isSelect: Boolean = false
|
||||||
|
)
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import com.dahe.glex.bean.*
|
import com.dahe.glex.bean.*
|
||||||
import com.dahe.mylibrary.net.CommonResponseBean
|
import com.dahe.mylibrary.net.CommonResponseBean
|
||||||
import com.dhsd.glowner.BuildConfig
|
import com.dhsd.glowner.BuildConfig
|
||||||
|
import com.dhsd.glowner.bean.CaptainBean
|
||||||
import com.dhsd.glowner.bean.CarBean
|
import com.dhsd.glowner.bean.CarBean
|
||||||
import com.dhsd.glowner.bean.LoginBean
|
import com.dhsd.glowner.bean.LoginBean
|
||||||
import io.reactivex.rxjava3.core.Observable
|
import io.reactivex.rxjava3.core.Observable
|
||||||
@ -72,4 +73,20 @@ interface Api {
|
|||||||
fun dispatchVehicles(@Body bean: DispatchBean): Observable<CommonResponseBean<Any>>
|
fun dispatchVehicles(@Body bean: DispatchBean): Observable<CommonResponseBean<Any>>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询车队列表
|
||||||
|
* @return Observable<CommonResponseBean<Any>>
|
||||||
|
*/
|
||||||
|
@GET(BASE_URL+"devApi/business/ft/common/dict/onlyCaptain")
|
||||||
|
fun getCaptainList(): Observable<CommonResponseBean<MutableList<CaptainBean>>>
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询车队下的司机与车辆列表
|
||||||
|
* @param captainId String 车队ID
|
||||||
|
* @return Observable<CommonResponseBean<MutableList<CaptainBean>>>
|
||||||
|
*/
|
||||||
|
@GET(BASE_URL+"devApi/business/ft/common/dict/captain/driverAndCar")
|
||||||
|
fun driverAndCarList(@Query("captainId") captainId:String): Observable<CommonResponseBean<MutableList<CaptainBean>>>
|
||||||
}
|
}
|
33
app/src/main/java/com/dhsd/glowner/ui/MarketsActivity.kt
Normal file
33
app/src/main/java/com/dhsd/glowner/ui/MarketsActivity.kt
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
package com.dhsd.glowner.ui
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import com.dhsd.glowner.databinding.MarketsActivityBinding
|
||||||
|
import pokercc.android.expandablerecyclerview.ExpandableItemAnimator
|
||||||
|
|
||||||
|
class MarketsActivity : AppCompatActivity() {
|
||||||
|
companion object {
|
||||||
|
fun start(context: Context) {
|
||||||
|
context.startActivity(Intent(context, MarketsActivity::class.java))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private val binding by lazy { MarketsActivityBinding.inflate(layoutInflater) }
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
setContentView(binding.root)
|
||||||
|
binding.more.setOnClickListener {
|
||||||
|
// MenuActivity.start(it.context)
|
||||||
|
}
|
||||||
|
with(binding.recyclerView) {
|
||||||
|
adapter = MarketsAdapter()
|
||||||
|
itemAnimator = ExpandableItemAnimator(this, animChildrenItem = true)
|
||||||
|
addItemDecoration(MarketsItemDecoration())
|
||||||
|
layoutManager = LinearLayoutManager(context)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
146
app/src/main/java/com/dhsd/glowner/ui/MarketsAdapter.kt
Normal file
146
app/src/main/java/com/dhsd/glowner/ui/MarketsAdapter.kt
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
package com.dhsd.glowner.ui
|
||||||
|
|
||||||
|
import android.animation.ArgbEvaluator
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.graphics.drawable.ShapeDrawable
|
||||||
|
import android.graphics.drawable.shapes.OvalShape
|
||||||
|
import android.graphics.drawable.shapes.RoundRectShape
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import com.dahe.mylibrary.utils.BaseUtils
|
||||||
|
import com.dahe.mylibrary.utils.ToastUtils
|
||||||
|
import com.dhsd.glowner.databinding.MarketsChildItemBinding
|
||||||
|
import com.dhsd.glowner.databinding.MarketsParentItemBinding
|
||||||
|
import pokercc.android.expandablerecyclerview.ExpandableAdapter
|
||||||
|
|
||||||
|
class MarketChildVH(val binding: MarketsChildItemBinding) :
|
||||||
|
ExpandableAdapter.ViewHolder(binding.root)
|
||||||
|
|
||||||
|
class MarketParentVH(val binding: MarketsParentItemBinding) :
|
||||||
|
ExpandableAdapter.ViewHolder(binding.root)
|
||||||
|
|
||||||
|
private val names = listOf(
|
||||||
|
"Nathaniel Fitzgerald",
|
||||||
|
"Lawrence Fuller",
|
||||||
|
"Jacob Mullins",
|
||||||
|
"Jesus Lewis",
|
||||||
|
"Johnny Marr"
|
||||||
|
)
|
||||||
|
|
||||||
|
private val titles = listOf(
|
||||||
|
"title1",
|
||||||
|
"Ltitle2",
|
||||||
|
"Jtitle3",
|
||||||
|
"title4",
|
||||||
|
"title5",
|
||||||
|
"title6"
|
||||||
|
)
|
||||||
|
|
||||||
|
class MarketsAdapter : ExpandableAdapter<ExpandableAdapter.ViewHolder>() {
|
||||||
|
override fun onCreateGroupViewHolder(
|
||||||
|
viewGroup: ViewGroup,
|
||||||
|
viewType: Int
|
||||||
|
): ExpandableAdapter.ViewHolder = LayoutInflater.from(viewGroup.context)
|
||||||
|
.let { MarketsParentItemBinding.inflate(it, viewGroup, false) }
|
||||||
|
.let { MarketParentVH(it) }
|
||||||
|
|
||||||
|
|
||||||
|
override fun onCreateChildViewHolder(
|
||||||
|
viewGroup: ViewGroup,
|
||||||
|
viewType: Int
|
||||||
|
): ExpandableAdapter.ViewHolder = LayoutInflater.from(viewGroup.context)
|
||||||
|
.let { MarketsChildItemBinding.inflate(it, viewGroup, false) }
|
||||||
|
.let { MarketChildVH(it) }
|
||||||
|
|
||||||
|
override fun onBindChildViewHolder(
|
||||||
|
holder: ExpandableAdapter.ViewHolder,
|
||||||
|
groupPosition: Int,
|
||||||
|
childPosition: Int,
|
||||||
|
payloads: List<Any>
|
||||||
|
) {
|
||||||
|
holder as MarketChildVH
|
||||||
|
holder.binding.title.text = names.getOrNull(childPosition)
|
||||||
|
val childCount = getChildCount(groupPosition)
|
||||||
|
val radius = 4f
|
||||||
|
val shape = when {
|
||||||
|
childCount == 1 -> {
|
||||||
|
RoundRectShape(FloatArray(8) { radius }, null, null)
|
||||||
|
}
|
||||||
|
childPosition == 0 -> {
|
||||||
|
RoundRectShape(
|
||||||
|
floatArrayOf(radius, radius, radius, radius, 0f, 0f, 0f, 0f),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
)
|
||||||
|
}
|
||||||
|
childPosition == childCount - 1 -> {
|
||||||
|
RoundRectShape(
|
||||||
|
floatArrayOf(0f, 0f, 0f, 0f, radius, radius, radius, radius),
|
||||||
|
null, null
|
||||||
|
)
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
RoundRectShape(null, null, null)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
holder.binding.root.background = ShapeDrawable(shape).apply {
|
||||||
|
paint.color = Color.WHITE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBindGroupViewHolder(
|
||||||
|
holder: ExpandableAdapter.ViewHolder,
|
||||||
|
groupPosition: Int,
|
||||||
|
expand: Boolean,
|
||||||
|
payloads: List<Any>
|
||||||
|
) {
|
||||||
|
holder as MarketParentVH
|
||||||
|
if (payloads.isEmpty()) {
|
||||||
|
|
||||||
|
val arrowImage = holder.binding.arrowImage
|
||||||
|
holder.binding.title.text = titles[groupPosition]
|
||||||
|
arrowImage.rotation = if (expand) -180f else 0f
|
||||||
|
val circleDrawable = CircleDrawable()
|
||||||
|
arrowImage.background = circleDrawable
|
||||||
|
circleDrawable.progress = if (expand) 1f else 0f
|
||||||
|
// holder.binding.shadowView.alpha = if (expand) 1f else 0f
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onGroupViewHolderExpandChange(
|
||||||
|
holder: ExpandableAdapter.ViewHolder,
|
||||||
|
groupPosition: Int,
|
||||||
|
animDuration: Long,
|
||||||
|
expand: Boolean
|
||||||
|
) {
|
||||||
|
holder as MarketParentVH
|
||||||
|
val arrowImage = holder.binding.arrowImage
|
||||||
|
ToastUtils.showToast(holder.binding.root.context, "dianjile")
|
||||||
|
arrowImage.animate()
|
||||||
|
.setDuration(animDuration)
|
||||||
|
.rotation(if (expand) -180f else 0f)
|
||||||
|
.setUpdateListener {
|
||||||
|
val progress = if (expand) it.animatedFraction else 1 - it.animatedFraction
|
||||||
|
(arrowImage.background as CircleDrawable).progress = progress
|
||||||
|
// holder.binding.shadowView.alpha = progress
|
||||||
|
}
|
||||||
|
.start()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getGroupCount(): Int = 6
|
||||||
|
|
||||||
|
override fun getChildCount(groupPosition: Int): Int = 5
|
||||||
|
}
|
||||||
|
|
||||||
|
private class CircleDrawable : ShapeDrawable(OvalShape()) {
|
||||||
|
private val argbEvaluator = ArgbEvaluator()
|
||||||
|
private val startColor = 0xff494949.toInt()
|
||||||
|
private val endColor = 0xfff64637.toInt()
|
||||||
|
var progress: Float = 0f
|
||||||
|
set(value) {
|
||||||
|
paint.color = argbEvaluator.evaluate(value, startColor, endColor) as Int
|
||||||
|
invalidateSelf()
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,71 @@
|
|||||||
|
package com.dhsd.glowner.ui
|
||||||
|
|
||||||
|
import android.graphics.Canvas
|
||||||
|
import android.graphics.Paint
|
||||||
|
import android.graphics.Rect
|
||||||
|
import android.view.View
|
||||||
|
import androidx.core.view.iterator
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import com.dahe.mylibrary.utils.BaseSPUtils
|
||||||
|
import com.dahe.mylibrary.utils.BaseUtils
|
||||||
|
import com.dahe.mylibrary.utils.StringUtils
|
||||||
|
import pokercc.android.expandablerecyclerview.ExpandableAdapter
|
||||||
|
import pokercc.android.expandablerecyclerview.ExpandableRecyclerView
|
||||||
|
|
||||||
|
class MarketsItemDecoration : RecyclerView.ItemDecoration() {
|
||||||
|
private val linePaint = Paint().apply {
|
||||||
|
color = 0xfff6f6f8.toInt()
|
||||||
|
strokeWidth = 1F
|
||||||
|
// strokeWidth = BaseUtils.dip2px(this@MarketsItemDecoration.con, 1F).toFloat()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDrawOver(c: Canvas, parent: RecyclerView, state: RecyclerView.State) {
|
||||||
|
super.onDrawOver(c, parent, state)
|
||||||
|
parent as ExpandableRecyclerView
|
||||||
|
val adapter = parent.requireAdapter()
|
||||||
|
val layoutManager = parent.layoutManager!!
|
||||||
|
|
||||||
|
// Draw divide line between children item.
|
||||||
|
for (view in parent) {
|
||||||
|
val viewHolder = parent.getChildViewHolder(view)
|
||||||
|
val params = viewHolder.itemView.layoutParams as RecyclerView.LayoutParams
|
||||||
|
viewHolder as ExpandableAdapter.ViewHolder
|
||||||
|
val (groupPosition, childPosition) = adapter.getItemLayoutPosition(viewHolder)
|
||||||
|
val childCount = adapter.getChildCount(groupPosition)
|
||||||
|
if (!adapter.isGroup(viewHolder.itemViewType) && childPosition != childCount - 1) {
|
||||||
|
val y = layoutManager.getDecoratedBottom(view) + view.translationY
|
||||||
|
parent.clipAndDrawChild(c, view) {
|
||||||
|
it.drawLine(
|
||||||
|
parent.paddingStart + 10f + params.marginStart, y,
|
||||||
|
parent.width - parent.paddingEnd.toFloat() - params.marginEnd, y,
|
||||||
|
linePaint
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemOffsets(
|
||||||
|
outRect: Rect,
|
||||||
|
view: View,
|
||||||
|
parent: RecyclerView,
|
||||||
|
state: RecyclerView.State
|
||||||
|
) {
|
||||||
|
super.getItemOffsets(outRect, view, parent, state)
|
||||||
|
parent as ExpandableRecyclerView
|
||||||
|
val adapter = parent.requireAdapter()
|
||||||
|
val viewHolder = parent.getChildViewHolder(view)
|
||||||
|
|
||||||
|
//Give bottom margin when it is group type or it is the last one of group.
|
||||||
|
val isGroup = adapter.isGroup(viewHolder.itemViewType)
|
||||||
|
val firstChild = {
|
||||||
|
adapter.getItemLayoutPosition(viewHolder as ExpandableAdapter.ViewHolder).childPosition == 0
|
||||||
|
}
|
||||||
|
if (isGroup || firstChild()) {
|
||||||
|
outRect.top = 12f.toInt()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -31,6 +31,7 @@ import com.dhsd.glowner.adapter.WaybillAdapter
|
|||||||
import com.dhsd.glowner.bean.PopBean
|
import com.dhsd.glowner.bean.PopBean
|
||||||
import com.dhsd.glowner.cuspop.OnCarSelectListener
|
import com.dhsd.glowner.cuspop.OnCarSelectListener
|
||||||
import com.dhsd.glowner.databinding.FragmentHomeBinding
|
import com.dhsd.glowner.databinding.FragmentHomeBinding
|
||||||
|
import com.dhsd.glowner.ui.MarketsActivity
|
||||||
import com.dhsd.glowner.ui.home.activtiy.SendGoodsActivity
|
import com.dhsd.glowner.ui.home.activtiy.SendGoodsActivity
|
||||||
import com.dhsd.glowner.ui.mine.activity.ChoiceCarActivity
|
import com.dhsd.glowner.ui.mine.activity.ChoiceCarActivity
|
||||||
import com.dhsd.glowner.utils.CommonPopUtils
|
import com.dhsd.glowner.utils.CommonPopUtils
|
||||||
@ -66,10 +67,11 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(), RefreshCallBack {
|
|||||||
binding.tvMar.isSelected = true
|
binding.tvMar.isSelected = true
|
||||||
|
|
||||||
binding.ivNor.setOnClickListener {
|
binding.ivNor.setOnClickListener {
|
||||||
|
// ActivityUtils.startActivity(mContext, MarketsActivity::class.java)
|
||||||
ActivityUtils.startActivity(mContext, SendGoodsActivity::class.java)
|
ActivityUtils.startActivity(mContext, SendGoodsActivity::class.java)
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.ivNor.setOnClickListener {
|
binding.ivMul.setOnClickListener {
|
||||||
ActivityUtils.startActivity(mContext, SendGoodsActivity::class.java)
|
ActivityUtils.startActivity(mContext, SendGoodsActivity::class.java)
|
||||||
}
|
}
|
||||||
initData()
|
initData()
|
||||||
|
@ -41,7 +41,7 @@ import io.reactivex.rxjava3.schedulers.Schedulers
|
|||||||
class ChoiceCarActivity : BaseActivity<ActivityChoiceCarBinding>(), OnLimitClickListener {
|
class ChoiceCarActivity : BaseActivity<ActivityChoiceCarBinding>(), OnLimitClickListener {
|
||||||
|
|
||||||
lateinit var adapter: DriverCarsAdapter
|
lateinit var adapter: DriverCarsAdapter
|
||||||
var searchValue: String = ""
|
private var searchValue: String = ""
|
||||||
private var orderId: String = ""
|
private var orderId: String = ""
|
||||||
private var selectCar: CarBean? = null
|
private var selectCar: CarBean? = null
|
||||||
override fun initView(savedInstanceState: Bundle?) {
|
override fun initView(savedInstanceState: Bundle?) {
|
||||||
|
@ -1,8 +1,27 @@
|
|||||||
package com.dhsd.glowner.ui.mine.activity
|
package com.dhsd.glowner.ui.mine.activity
|
||||||
|
|
||||||
|
import BaseObserver
|
||||||
|
import DataManager
|
||||||
|
import RxHttpCallBack
|
||||||
|
import android.graphics.Color
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.LinearLayout
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.dahe.mylibrary.base.BaseActivity
|
import com.dahe.mylibrary.base.BaseActivity
|
||||||
|
import com.dahe.mylibrary.net.CommonResponseBean
|
||||||
|
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
|
||||||
|
import com.dahe.mylibrary.utils.ConvertUtils
|
||||||
|
import com.dahe.mylibrary.utils.ToastUtils
|
||||||
|
import com.dhsd.glowner.R
|
||||||
|
import com.dhsd.glowner.adapter.DriverCarsAdapter
|
||||||
|
import com.dhsd.glowner.bean.CaptainBean
|
||||||
|
import com.dhsd.glowner.bean.CarBean
|
||||||
import com.dhsd.glowner.databinding.ActivityChoiceFleetCarBinding
|
import com.dhsd.glowner.databinding.ActivityChoiceFleetCarBinding
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
|
import io.reactivex.rxjava3.core.Scheduler
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName ChoiceFleetActivity
|
* @ClassName ChoiceFleetActivity
|
||||||
@ -12,10 +31,52 @@ import com.dhsd.glowner.databinding.ActivityChoiceFleetCarBinding
|
|||||||
*/
|
*/
|
||||||
class ChoiceFleetActivity : BaseActivity<ActivityChoiceFleetCarBinding>() {
|
class ChoiceFleetActivity : BaseActivity<ActivityChoiceFleetCarBinding>() {
|
||||||
override fun initView(savedInstanceState: Bundle?) {
|
override fun initView(savedInstanceState: Bundle?) {
|
||||||
TODO("Not yet implemented")
|
setStatusBarColor(R.color.white)
|
||||||
|
setTitleBar("选择车队/车辆", View.OnClickListener { finish() }, true, "我的熟车") {
|
||||||
|
ToastUtils.showToast(mContext, "我的熟车")
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.run {
|
||||||
|
recycler.run {
|
||||||
|
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
|
||||||
|
addItemDecoration(
|
||||||
|
RecycleViewDivider(
|
||||||
|
LinearLayout.VERTICAL,
|
||||||
|
ConvertUtils.dp2px(12.0f),
|
||||||
|
Color.TRANSPARENT
|
||||||
|
)
|
||||||
|
)
|
||||||
|
adapter = DriverCarsAdapter()
|
||||||
|
adapter as DriverCarsAdapter
|
||||||
|
}.apply {
|
||||||
|
isStateViewEnable = true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun initDate() {
|
override fun initDate() {
|
||||||
TODO("Not yet implemented")
|
DataManager.getInstance().getCaptainList()
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(BaseObserver(mContext,object :RxHttpCallBack<MutableList<CaptainBean>>(){
|
||||||
|
override fun onSuccess(t: CommonResponseBean<MutableList<CaptainBean>>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initList(rows: List<CarBean>) {
|
||||||
|
// if (rows.isEmpty()) {
|
||||||
|
// adapter.submitList(null)
|
||||||
|
// adapter.setStateViewLayout(mContext, R.layout.empty_view)
|
||||||
|
// } else {
|
||||||
|
// if (mRefreshPage === 1) {
|
||||||
|
// adapter?.submitList(rows)
|
||||||
|
// } else {
|
||||||
|
// adapter?.addAll(rows)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
BIN
app/src/main/res/drawable-xxhdpi/arrow_down.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/arrow_down.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/market_arrow.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/market_arrow.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 493 B |
7
app/src/main/res/drawable/markets_bg.xml
Normal file
7
app/src/main/res/drawable/markets_bg.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<solid android:color="#f6f6f8" />
|
||||||
|
<corners android:radius="15dp" />
|
||||||
|
</shape>
|
6
app/src/main/res/drawable/markets_child_item_bg.xml
Normal file
6
app/src/main/res/drawable/markets_child_item_bg.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<solid android:color="#fff" />
|
||||||
|
</shape>
|
10
app/src/main/res/drawable/markets_group_shadow.xml
Normal file
10
app/src/main/res/drawable/markets_group_shadow.xml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<gradient
|
||||||
|
android:angle="-90"
|
||||||
|
android:endColor="#0000"
|
||||||
|
android:gradientRadius="200dp"
|
||||||
|
android:startColor="#10000000"
|
||||||
|
android:type="radial" />
|
||||||
|
</shape>
|
7
app/src/main/res/drawable/markets_parent_item_bg.xml
Normal file
7
app/src/main/res/drawable/markets_parent_item_bg.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<solid android:color="#fff" />
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
</shape>
|
6
app/src/main/res/drawable/markets_price_bg.xml
Normal file
6
app/src/main/res/drawable/markets_price_bg.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<solid android:color="#48c082" />
|
||||||
|
<corners android:radius="3dp" />
|
||||||
|
</shape>
|
16
app/src/main/res/drawable/text_book_grade_bg.xml
Normal file
16
app/src/main/res/drawable/text_book_grade_bg.xml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item android:state_selected="true">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#0298FE" />
|
||||||
|
<corners android:radius="5dp"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item android:state_selected="false">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#F6F3F7" />
|
||||||
|
<corners android:radius="5dp"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
@ -39,10 +39,9 @@
|
|||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginLeft="@dimen/dp_6"
|
android:layout_marginLeft="@dimen/dp_6"
|
||||||
android:background="#00000000"
|
android:background="#00000000"
|
||||||
android:hint="请输入车牌号/手机号进行搜索"
|
android:hint="请输入车队名称,车队长/司机姓名,手机号或车牌号"
|
||||||
android:inputType="text|textAutoComplete"
|
android:inputType="text|textAutoComplete"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text=""
|
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
63
app/src/main/res/layout/markets_activity.xml
Normal file
63
app/src/main/res/layout/markets_activity.xml
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout 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"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#fff64637"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- <pokercc.android.expandablerecyclerview.sample.StateBar-->
|
||||||
|
<!-- android:layout_width="match_parent"-->
|
||||||
|
<!-- android:layout_height="0dp" />-->
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
|
android:background="@drawable/markets_bg"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:text="Markets"
|
||||||
|
android:textColor="#000"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/more"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:text="More"
|
||||||
|
android:textColor="#7a7a7a"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/title"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/title"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
|
<pokercc.android.expandablerecyclerview.ExpandableRecyclerView
|
||||||
|
android:id="@+id/recycler_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginBottom="15dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/title" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
44
app/src/main/res/layout/markets_child_item.xml
Normal file
44
app/src/main/res/layout/markets_child_item.xml
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:background="@drawable/markets_child_item_bg"
|
||||||
|
android:elevation="3dp">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:layout_marginBottom="15dp"
|
||||||
|
android:text="Total Points"
|
||||||
|
android:textColor="#7a7a7a"
|
||||||
|
android:textSize="15sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:background="@drawable/markets_price_bg"
|
||||||
|
android:paddingStart="10dp"
|
||||||
|
android:paddingTop="4dp"
|
||||||
|
android:paddingEnd="10dp"
|
||||||
|
android:paddingBottom="4dp"
|
||||||
|
android:text="$3.45"
|
||||||
|
android:textColor="#fff"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
43
app/src/main/res/layout/markets_parent_item.xml
Normal file
43
app/src/main/res/layout/markets_parent_item.xml
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||||
|
android:id="@+id/content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:background="@drawable/markets_parent_item_bg"
|
||||||
|
android:elevation="3dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:layout_marginBottom="15dp"
|
||||||
|
android:text="Total Points"
|
||||||
|
android:textColor="#000"
|
||||||
|
android:textSize="15sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/arrow_image"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:src="@drawable/market_arrow"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:background="#f00" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -86,6 +86,8 @@ dependencies {
|
|||||||
api 'pub.devrel:easypermissions:3.0.0'
|
api 'pub.devrel:easypermissions:3.0.0'
|
||||||
api 'io.github.lucksiege:compress:v3.11.2'
|
api 'io.github.lucksiege:compress:v3.11.2'
|
||||||
api 'androidx.cardview:cardview:1.0.0'
|
api 'androidx.cardview:cardview:1.0.0'
|
||||||
|
api "com.github.pokercc:ExpandableRecyclerView:0.9.3"
|
||||||
|
|
||||||
|
|
||||||
api rootProject.ext.dependencies["WheelPicker"]
|
api rootProject.ext.dependencies["WheelPicker"]
|
||||||
api rootProject.ext.dependencies["AddressPicker"]
|
api rootProject.ext.dependencies["AddressPicker"]
|
||||||
|
Loading…
Reference in New Issue
Block a user