Skip to content

Commit

Permalink
Merge pull request #30 from rubensousa/2.1.0
Browse files Browse the repository at this point in the history
2.1.0
  • Loading branch information
rubensousa authored Nov 15, 2022
2 parents 3d4d9e3 + 260536e commit ff8e74b
Show file tree
Hide file tree
Showing 27 changed files with 299 additions and 386 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/dev.yml

This file was deleted.

21 changes: 12 additions & 9 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,30 @@ name: Release
on:
push:
paths-ignore:
- '**/*.md'
- '**/*.txt'
- '**.md'
- '**.MD'
branches:
- 'master'

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v2
- name: setup JDK 11
uses: actions/setup-java@v3
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
distribution: temurin
java-version: '11'

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Install Android SDK
uses: malinskiy/action-android/install-sdk@release/0.1.2
uses: malinskiy/action-android/install-sdk@release/0.1.4

- name: Run unit tests
run: ./gradlew testDebugUnitTest --stacktrace

- name: Assemble library
run: ./gradlew assembleRelease
32 changes: 20 additions & 12 deletions .github/workflows/pull_requests.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
name: Pull Requests
name: Pull requests

on:
pull_request:
paths-ignore:
- '**/*.md'
- '**/*.txt'
- '**.md'
- '**.MD'
branches:
- 'dev'
- 'master'

concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v2
- name: setup JDK 1.8
uses: actions/setup-java@v1
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 1.8
distribution: temurin
java-version: '11'

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Install Android SDK
uses: malinskiy/action-android/install-sdk@release/0.1.0
uses: malinskiy/action-android/install-sdk@release/0.1.4

- name: Run unit tests
run: ./gradlew testDebugUnitTest
run: ./gradlew testDebugUnitTest --stacktrace

- name: Assemble library
run: ./gradlew assembleRelease
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# 2.1.0

- Do not split decoration size in LinearMarginDecoration: [#27](https://github.com/rubensousa/Decorator/issues/27)
- Fixed decorations not being applied for items removed: [#28](https://github.com/rubensousa/Decorator/issues/28)
- **BREAKING CHANGE**: DecorationLookup now passes the current ViewHolder [#29](https://github.com/rubensousa/Decorator/issues/29):

Before:

```kotlin
interface DecorationLookup {
fun shouldApplyDecoration(position: Int, itemCount: Int): Boolean
}
```

After:

```kotlin
interface DecorationLookup {
fun shouldApplyDecoration(viewHolder: RecyclerView.ViewHolder, itemCount: Int): Boolean
}
```

# 2.0.2

- Moved `setDecorationLookup` to `AbstractMarginDecoration`
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Decorator is a library that helps creating composable margins and dividers in Re
## Install

```groovy
implementation 'com.rubensousa:decorator:2.0.2'
implementation 'com.rubensousa:decorator:2.1.0'
```

## How to use
Expand Down Expand Up @@ -175,12 +175,10 @@ You can also decide if an item at a given position should have a decoration appl
```kotlin

decoration.setDecorationLookup(object : DecorationLookup {

// Don't apply the decoration on position 4
override fun shouldApplyDecoration(position: Int, itemCount: Int): Boolean {
return position != 4
override fun shouldApplyDecoration(viewHolder: RecyclerView.ViewHolder, itemCount: Int): Boolean {
return viewHolder.layoutPosition != 4
}

})
```

Expand Down
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.6.21'
ext.kotlin_version = '1.7.10'
ext.nav_version = '2.4.1'

repositories {
Expand All @@ -8,10 +8,9 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.android.tools.build:gradle:7.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$kotlin_version"
}

}
Expand Down
21 changes: 13 additions & 8 deletions decorator/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'org.jetbrains.dokka'
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
}

apply from: 'publish.gradle'

android {
compileSdkVersion 32
Expand All @@ -18,17 +21,19 @@ android {
}
}

publishing {
singleVariant('release') {
withSourcesJar()
withJavadocJar()
}
}

}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
api "androidx.recyclerview:recyclerview:1.2.1"
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'androidx.core:core-ktx:1.8.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}


apply from: 'publish.gradle'
2 changes: 1 addition & 1 deletion decorator/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
LIBRARY_VERSION=2.0.2
LIBRARY_VERSION=2.1.0
LIBRARY_GROUP=com.rubensousa
LIBRARY_ARTIFACT=decorator
# POM info
Expand Down
Loading

0 comments on commit ff8e74b

Please sign in to comment.