Skip to content

Commit

Permalink
Tagged to v2.3.0 and added @SInCE to getPosition()
Browse files Browse the repository at this point in the history
  • Loading branch information
drakeet committed Dec 8, 2016
1 parent 7475a9a commit 0adcb76
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 17 deletions.
5 changes: 3 additions & 2 deletions README-zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ GitHub: [https://github.com/drakeet/MultiType](https://github.com/drakeet/MultiT

```groovy
dependencies {
compile 'me.drakeet.multitype:multitype:2.2.2'
compile 'me.drakeet.multitype:multitype:2.3.0'
}
```

Expand All @@ -39,7 +39,7 @@ public class TextItem {
}
```

#### Step 2. 创建一个 class 继承 `ItemViewProvider<C, V extends ViewHolder>`,示例:
#### Step 2. 创建一个 class 继承 `ItemViewProvider<T, V extends ViewHolder>`,示例:


```java
Expand All @@ -65,6 +65,7 @@ public class TextItemViewProvider
@Override
protected void onBindViewHolder(@NonNull TextHolder holder, @NonNull TextItem textItem) {
holder.text.setText("hello: " + textItem.text);
Log.d("demo", "position: " + getPosition());
}
}
```
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ In your `build.gradle`:

```groovy
dependencies {
compile 'me.drakeet.multitype:multitype:2.2.2'
compile 'me.drakeet.multitype:multitype:2.3.0'
}
```

Expand All @@ -41,7 +41,7 @@ public class TextItem {
}
```

#### Step 2. Create a class extends `ItemViewProvider<C, V extends ViewHolder>`, for example:
#### Step 2. Create a class extends `ItemViewProvider<T, V extends ViewHolder>`, for example:

```java
public class TextItemViewProvider
Expand All @@ -66,6 +66,7 @@ public class TextItemViewProvider
@Override
protected void onBindViewHolder(@NonNull TextHolder holder, @NonNull TextItem textItem) {
holder.text.setText("hello: " + textItem.text);
Log.d("demo", "position: " + getPosition());
}
}
```
Expand Down
10 changes: 4 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,22 @@
* limitations under the License.
*/

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:2.2.3'
}
}

allprojects {
repositories {
jcenter()
}
task javadoc(type: Javadoc) {
options.encoding = "utf-8"
}
}

task clean(type: Delete) {
Expand Down
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ android {
defaultConfig {
minSdkVersion 9
targetSdkVersion 24
versionCode 37
versionName "2.2.2"
versionCode 40
versionName "2.3.0"
}
buildTypes {
release {
Expand Down
4 changes: 2 additions & 2 deletions library/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ POM_NAME=MultiType
POM_ARTIFACT_ID=multitype
POM_PACKAGING=aar

VERSION_NAME=2.2.2
VERSION_CODE=37
VERSION_NAME=2.3.0
VERSION_CODE=40
GROUP=me.drakeet.multitype

POM_DESCRIPTION=An Android library to retrofit multiple item view types
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ public abstract class ItemViewProvider<T, V extends ViewHolder> {

/**
* Get the adapter position of current item,
* the internal position is equals {@link ViewHolder#getAdapterPosition()}.
* the internal position is equals RecyclerView.ViewHolder#getAdapterPosition().
*
* @return the adapter position
* @since v2.3.0
*/
protected final int getPosition() {
return position;
Expand Down
4 changes: 2 additions & 2 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ android {
applicationId "me.drakeet.multitype.sample"
minSdkVersion 14
targetSdkVersion 24
versionCode 37
versionName "2.2.2"
versionCode 40
versionName "2.3.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down

0 comments on commit 0adcb76

Please sign in to comment.