From 4fdb33644455af2889ea3a9ab1921babacf248e8 Mon Sep 17 00:00:00 2001 From: Hemanth S Date: Mon, 12 Oct 2020 22:58:39 +0530 Subject: [PATCH] Artist album changes to card --- .../retromusic/adapter/album/HorizontalAlbumAdapter.kt | 2 +- .../monkey/retromusic/helper/HorizontalAdapterHelper.kt | 4 ++-- app/src/main/res/layout/item_image.xml | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/code/name/monkey/retromusic/adapter/album/HorizontalAlbumAdapter.kt b/app/src/main/java/code/name/monkey/retromusic/adapter/album/HorizontalAlbumAdapter.kt index 26a1958c..8a94b7a5 100644 --- a/app/src/main/java/code/name/monkey/retromusic/adapter/album/HorizontalAlbumAdapter.kt +++ b/app/src/main/java/code/name/monkey/retromusic/adapter/album/HorizontalAlbumAdapter.kt @@ -65,7 +65,7 @@ class HorizontalAlbumAdapter( } override fun getItemViewType(position: Int): Int { - return HorizontalAdapterHelper.getItemViewtype(position, itemCount) + return HorizontalAdapterHelper.getItemViewType(position, itemCount) } override fun getItemCount(): Int { diff --git a/app/src/main/java/code/name/monkey/retromusic/helper/HorizontalAdapterHelper.kt b/app/src/main/java/code/name/monkey/retromusic/helper/HorizontalAdapterHelper.kt index b155cbd9..f98508bf 100644 --- a/app/src/main/java/code/name/monkey/retromusic/helper/HorizontalAdapterHelper.kt +++ b/app/src/main/java/code/name/monkey/retromusic/helper/HorizontalAdapterHelper.kt @@ -20,7 +20,7 @@ import code.name.monkey.retromusic.R object HorizontalAdapterHelper { - const val LAYOUT_RES = R.layout.item_album_card + const val LAYOUT_RES = R.layout.item_image private const val TYPE_FIRST = 1 private const val TYPE_MIDDLE = 2 @@ -40,7 +40,7 @@ object HorizontalAdapterHelper { } } - fun getItemViewtype(position: Int, itemCount: Int): Int { + fun getItemViewType(position: Int, itemCount: Int): Int { return when (position) { 0 -> TYPE_FIRST itemCount - 1 -> TYPE_LAST diff --git a/app/src/main/res/layout/item_image.xml b/app/src/main/res/layout/item_image.xml index 1232577d..2a3f434a 100644 --- a/app/src/main/res/layout/item_image.xml +++ b/app/src/main/res/layout/item_image.xml @@ -7,14 +7,15 @@ android:background="?rectSelector" android:orientation="vertical"> - @@ -26,7 +27,7 @@ android:scaleType="centerCrop" tools:srcCompat="@tools:sample/backgrounds/scenic[16]" /> - +