From 4da6da79627e689936782ce3132b2f808d8938dc Mon Sep 17 00:00:00 2001 From: Barryrowe Date: Mon, 28 Oct 2019 09:49:45 -0400 Subject: [PATCH 1/2] Expand setup instructions While getting started with this library, I was initially confused as to what the setup looks like. This adds additional information so it's clear that `CardStackAdapter` is a custom implementation and what needs to be done to make the adapter work. --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 50f6533f..84ef9086 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,18 @@ # Setup +1. Add a `[CardStackView](cardstackview/src/main/java/com/yuyakaido/android/cardstackview/CardStackView.java)` to your layout +```xml + +``` + +2. Implement an adapter for your stack view. This should be a ([RecyclerView.Adapter](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter)). There is a [Sample CardStackAdapter](sample/src/main/java/com/yuyakaido/android/cardstackview/sample/CardStackAdapter.kt) in this project. You may also want to use a [ListAdapter](https://developer.android.com/reference/android/support/v7/recyclerview/extensions/ListAdapter) for less boilerplate code, and automatically handled range updates (especially helpful if your data updates as the user interacts). + +3. Wire up your view with your Adapter. ```kotlin val cardStackView = findViewById(R.id.card_stack_view) cardStackView.layoutManager = CardStackLayoutManager() From 813acb66c5ff931bdad1bd875ba610a559201063 Mon Sep 17 00:00:00 2001 From: Barryrowe Date: Mon, 28 Oct 2019 09:51:18 -0400 Subject: [PATCH 2/2] Remove code formatting around CardStackView link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 84ef9086..0f5c9f96 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ # Setup -1. Add a `[CardStackView](cardstackview/src/main/java/com/yuyakaido/android/cardstackview/CardStackView.java)` to your layout +1. Add a [CardStackView](cardstackview/src/main/java/com/yuyakaido/android/cardstackview/CardStackView.java) to your layout ```xml