Created
July 16, 2020 12:22
-
-
Save monkeydone/59e2264f561032d4bc1c2a04bd714798 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#注解使用 | |
@IntDef({ALIGN_BOTTOM, ALIGN_BASELINE, ALIGN_TOP, ALIGN_CENTER}) | |
@Retention(RetentionPolicy.SOURCE) | |
public @interface Alignment { | |
} | |
public AlignImageSpan(Drawable d, @Alignment int verticalAlignment) { | |
super(d, verticalAlignment); | |
} | |
val span: ImageSpan = AlignImageSpan(drawable, AlignImageSpan.ALIGN_CENTER) |
通用item
package com.x.media.entity
import com.chad.library.adapter.base.entity.MultiItemEntity
/**
* 文 件 名: MultipleItem
* 创 建 人: Allen
* 创建日期: 2017/6/13 14:20
* 修改时间:
* 修改备注:
*/
class CommonMultiItem<T> : MultiItemEntity {
private var itemType: Int = 0
var spanSize: Int = 0
constructor(itemType: Int, spanSize: Int, content: T) {
this.itemType = itemType
this.spanSize = spanSize
this.content = content
}
constructor(itemType: Int, spanSize: Int) {
this.itemType = itemType
this.spanSize = spanSize
}
var content: T? = null
override fun getItemType(): Int {
return itemType
}
companion object {
const val ITEM_HEADER = 1
const val ITEM_ONE = 2
}
}
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.47'
maven { url "https://jitpack.io" }
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
DataBinding 启用配置
其中
apply plugin: "kotlin-kapt"
最重要