From e2bc7a769be9492571ca928a4d631f469c0ce848 Mon Sep 17 00:00:00 2001 From: Sascha Huth Date: Sat, 24 Mar 2018 10:02:17 +0000 Subject: [PATCH] fix adapter generic --- sequencelayout/build.gradle | 2 +- .../java/com/transferwise/sequencelayout/SequenceAdapter.kt | 2 +- .../main/java/com/transferwise/sequencelayout/SequenceLayout.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sequencelayout/build.gradle b/sequencelayout/build.gradle index 8fad050..0230e7b 100644 --- a/sequencelayout/build.gradle +++ b/sequencelayout/build.gradle @@ -18,7 +18,7 @@ android { buildTypes { release { - minifyEnabled true + minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } diff --git a/sequencelayout/src/main/java/com/transferwise/sequencelayout/SequenceAdapter.kt b/sequencelayout/src/main/java/com/transferwise/sequencelayout/SequenceAdapter.kt index 4769c7b..7acba8d 100644 --- a/sequencelayout/src/main/java/com/transferwise/sequencelayout/SequenceAdapter.kt +++ b/sequencelayout/src/main/java/com/transferwise/sequencelayout/SequenceAdapter.kt @@ -3,7 +3,7 @@ package com.transferwise.sequencelayout /** * Adapter to bind data to [com.transferwise.sequencelayout.SequenceStep]s for a [com.transferwise.sequencelayout.SequenceLayout]. */ -public abstract class SequenceAdapter { +public abstract class SequenceAdapter where T : Any { abstract fun getCount(): Int diff --git a/sequencelayout/src/main/java/com/transferwise/sequencelayout/SequenceLayout.kt b/sequencelayout/src/main/java/com/transferwise/sequencelayout/SequenceLayout.kt index 31dee8a..103096e 100644 --- a/sequencelayout/src/main/java/com/transferwise/sequencelayout/SequenceLayout.kt +++ b/sequencelayout/src/main/java/com/transferwise/sequencelayout/SequenceLayout.kt @@ -105,7 +105,7 @@ public class SequenceLayout(context: Context?, attrs: AttributeSet?, defStyleAtt /** * Replaces all contained [com.transferwise.sequencelayout.SequenceStep]s with those provided and bound by the adapter */ - public fun setAdapter(adapter: SequenceAdapter) { + public fun setAdapter(adapter: SequenceAdapter) where T : Any { removeAllSteps() val count = adapter.getCount() for (i in 0 until count) {