Skip to content

Commit

Permalink
Bump to 1.1.0: migrate to AndroidX
Browse files Browse the repository at this point in the history
Updated links to classes in README.md to AndroidX ones.
  • Loading branch information
lizapopova committed Feb 19, 2021
1 parent 50a3da5 commit 9e90bcc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Sectioned RecyclerView with pinnable (floating/sticky) headers

[![Bintray](https://img.shields.io/bintray/v/cruxlab/SectionedRecyclerView/SectionedRecyclerView?color=bright-green)](https://bintray.com/cruxlab/SectionedRecyclerView/SectionedRecyclerView/1.0.3)
[![Nuget](https://img.shields.io/nuget/v/Karamunting.Android.CruxLab.SectionedRecyclerView?color=bright-green)](https://www.nuget.org/packages/Karamunting.Android.CruxLab.SectionedRecyclerView/1.0.2)
[![Bintray](https://img.shields.io/bintray/v/cruxlab/SectionedRecyclerView/SectionedRecyclerView?color=bright-green)](https://bintray.com/cruxlab/SectionedRecyclerView/SectionedRecyclerView/1.1.0)
[![Nuget](https://img.shields.io/nuget/v/Karamunting.Android.CruxLab.SectionedRecyclerView?color=bright-green)](https://www.nuget.org/packages/Karamunting.Android.CruxLab.SectionedRecyclerView/1.0.3)
[![API](https://img.shields.io/badge/API-16%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=16)

This library allows you to divide items in your RecyclerView into groups called sections. Each section is represented by an adapter and can have a header. SectionAdapter is similar to Android’s [RecyclerView.Adapter](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter.html), which creates and binds ViewHolders. The header can be pinned, which means, that it will be displayed at the top of the RecyclerView above the corresponding section items. Pinned headers change automatically while scrolling or after dataset changes. You can also customize item swiping behavior for each section individually.
This library allows you to divide items in your RecyclerView into groups called sections. Each section is represented by an adapter and can have a header. SectionAdapter is similar to Android’s [RecyclerView.Adapter](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter), which creates and binds ViewHolders. The header can be pinned, which means, that it will be displayed at the top of the RecyclerView above the corresponding section items. Pinned headers change automatically while scrolling or after dataset changes. You can also customize item swiping behavior for each section individually.

## Demo

Expand All @@ -27,7 +27,7 @@ You can find demo project code [here](https://github.com/crux-lab/sectioned-recy
The Gradle dependency is available via [jCenter](https://bintray.com/cruxlab/SectionedRecyclerView/SectionedRecyclerView). Add this to your module's `build.gradle` file:

```gradle
implementation 'com.cruxlab:sectionedrecyclerview:1.0.3'
implementation 'com.cruxlab:sectionedrecyclerview:1.1.0'
```

### Initialization
Expand Down Expand Up @@ -103,7 +103,7 @@ public class MyItemViewHolder extends BaseSectionAdapter.ItemViewHolder {
}
```

As you can see, these classes are similar to Android’s [RecyclerView.Adapter](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter.html) and [RecyclerView.ViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ViewHolder.html).
As you can see, these classes are similar to Android’s [RecyclerView.Adapter](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter) and [RecyclerView.ViewHolder](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.ViewHolder).

Adapter for a section with header has some additional methods to override:

Expand Down Expand Up @@ -147,7 +147,7 @@ To use floating headers feature, you have to place your `RecyclerView` into `Sec
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
Expand Down Expand Up @@ -186,7 +186,7 @@ ItemTouchHelper itemTouchHelper = new ItemTouchHelper(callback);
itemTouchHelper.attachToRecyclerView(recyclerView);
```

Implement `SectionItemSwipeCallback`, which is similar to Android's [ItemTouchHelper.Callback](https://developer.android.com/reference/android/support/v7/widget/helper/ItemTouchHelper.Callback.html):
Implement `SectionItemSwipeCallback`, which is similar to Android's [ItemTouchHelper.Callback](https://developer.android.com/reference/androidx/recyclerview/widget/ItemTouchHelper.Callback):

```java
public class MySwipeCallback extends SectionItemSwipeCallback {
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
// implementation 'com.cruxlab:sectionedrecyclerview:1.0.3'
implementation project(':sectionedrecyclerview');
implementation 'com.cruxlab:sectionedrecyclerview:1.1.0'
// implementation project(':sectionedrecyclerview');
}
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion sectionedrecyclerview/publish.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'

version '1.0.3'
version '1.1.0'
group 'com.cruxlab'

publishing {
Expand Down

0 comments on commit 9e90bcc

Please sign in to comment.