parent
d5f941b7c1
commit
63c424e1a0
@ -0,0 +1,37 @@ |
||||
package net.pokeranalytics.android.ui.adapter |
||||
|
||||
import android.content.Context |
||||
import android.util.AttributeSet |
||||
import androidx.core.content.ContextCompat |
||||
import androidx.recyclerview.widget.DividerItemDecoration |
||||
import androidx.recyclerview.widget.RecyclerView |
||||
import net.pokeranalytics.android.R |
||||
|
||||
|
||||
class RowRepresentableRecyclerView : RecyclerView { |
||||
/** |
||||
* Constructors |
||||
*/ |
||||
constructor(context: Context) : super(context) { |
||||
init() |
||||
} |
||||
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) { |
||||
init() |
||||
} |
||||
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) { |
||||
init() |
||||
} |
||||
|
||||
/** |
||||
* Init |
||||
* |
||||
* @param attrs |
||||
*/ |
||||
private fun init() { |
||||
val itemDecorator = DividerItemDecoration(this.context, DividerItemDecoration.VERTICAL) |
||||
itemDecorator.setDrawable(ContextCompat.getDrawable(this.context!!, R.drawable.separator)!!) |
||||
this.addItemDecoration(itemDecorator) |
||||
} |
||||
} |
||||
@ -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="@color/white_transparent"/> |
||||
<size android:height="0.5dp"/> |
||||
</shape> |
||||
Loading…
Reference in new issue