Skip to content

Vension/V-CommonListAdapter

Repository files navigation

Latest Stable Version Build Status Min Sdk Version License Author QQ Group

Preview

Download Download

 implementation 'com.vension:CommonListAdapter:1.0.2'

Usage

  • 具体使用查看demo示例
val mList = ArrayList<TestBean>()
        for (i in 0..5) {
            val mBean = TestBean( R.drawable.image_03,"我是标题$i", "我是简介$i")
            mList.add(mBean)
        }
        mAdapter = object : CommonListAdapter<TestBean>(this,mList,R.layout.item_list){
            override fun convert(holder: CommonListViewHolder, position: Int, item: TestBean) {
                holder.setImageResource(R.id.iv_image,item.imageRes)
                holder.setText(R.id.tv_title,item.title)
                holder.setText(R.id.tv_desc,item.desc)
            }
        }

        listview.adapter = mAdapter

update

  • V1.0.2: <修改构造方法参数>
  • V1.0.1: <新增kotlin版本>
  • V1.0.0: <首次提交Java版本>

About Me

License

 Copyright 2018, Vension

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

About

👉A Common Adapter for ListView And GridView(ListView 和 GridView 的通用适配器)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published