This commit is contained in:
h4h13 2019-01-28 16:15:51 +05:30
parent 63c417cd61
commit a81536ab9a
96 changed files with 729 additions and 724 deletions

View file

@ -59,20 +59,21 @@ class MetalRecyclerViewPager : RecyclerView {
fun updateDisplayMetrics() {
itemWidth = if (RetroUtil.isTablet()) {
displayMetrics.widthPixels / 2 - itemMargin * 3
} else if (RetroUtil.isLandscape()) {
((displayMetrics.widthPixels / 1.5f) - itemMargin).toInt()
} else {
displayMetrics.widthPixels - itemMargin
}
}
override fun onBindViewHolder(holder: VH, position: Int) {
var currentItemWidth = itemWidth
val currentItemWidth = itemWidth
if (position == 0) {
currentItemWidth += itemMargin
holder.rootLayout.setPadding(0, 0, 0, 0)
//currentItemWidth += itemMargin;
holder.rootLayout.setPadding(0, 0, 0, 0);
} else if (position == itemCount - 1) {
currentItemWidth += itemMargin
holder.rootLayout.setPadding(0, 0, 0, 0)
//currentItemWidth += itemMargin;
holder.rootLayout.setPadding(0, 0, 0, 0);
}
val height = holder.rootLayout.layoutParams.height