タブレットモードで区切り線の下に空白が増えていく現象の対策
This commit is contained in:
parent
397aac5846
commit
00096ac693
|
@ -408,7 +408,10 @@ class ColumnViewHolder(
|
|||
tvColumnStatus.text = "?"
|
||||
|
||||
listView.adapter = null
|
||||
listView.addItemDecoration(ListDivider(activity))
|
||||
if(listView.itemDecorationCount == 0) {
|
||||
listView.addItemDecoration(ListDivider(activity))
|
||||
}
|
||||
|
||||
val status_adapter = ItemListAdapter(activity, column, this, bSimpleList)
|
||||
this.status_adapter = status_adapter
|
||||
|
||||
|
|
|
@ -246,13 +246,7 @@ internal class ItemViewHolder(
|
|||
bSimpleList : Boolean,
|
||||
item : TimelineItem
|
||||
) {
|
||||
// // LGT32で区切り線の下の余白が増えていく件の対策?
|
||||
// (this.viewRoot.layoutParams as? RecyclerView.LayoutParams)?.let {
|
||||
// it.topMargin = 0
|
||||
// it.bottomMargin = 0
|
||||
// it.setDirtyInset()
|
||||
// }
|
||||
|
||||
|
||||
this.list_adapter = list_adapter
|
||||
this.column = column
|
||||
this.bSimpleList = bSimpleList
|
||||
|
|
|
@ -746,28 +746,6 @@ fun View.showKeyboard() {
|
|||
}
|
||||
}
|
||||
|
||||
fun getPrivateField( clazz: Class<*> ,name:String) : Field? {
|
||||
return try{
|
||||
clazz.getDeclaredField(name).apply{
|
||||
isAccessible = true
|
||||
}
|
||||
}catch(_:Throwable){
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
private val RVLP_Clazz = RecyclerView.LayoutParams::class.java
|
||||
private val RVLP_mDecorInsets = getPrivateField(RVLP_Clazz,"mDecorInsets")
|
||||
private val RVLP_mInsetsDirty = getPrivateField(RVLP_Clazz,"mInsetsDirty")
|
||||
|
||||
fun RecyclerView.LayoutParams.setDirtyInset() {
|
||||
val rect = (RVLP_mDecorInsets?.get(this) as? Rect) ?: return
|
||||
if(rect.bottom != 0){
|
||||
rect.set(0,0,0,0)
|
||||
RVLP_mInsetsDirty?.setBoolean(this, true)
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// context
|
||||
|
||||
|
|
Loading…
Reference in New Issue