Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
Version 1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
thesurix committed Jul 5, 2018
1 parent bc9612c commit e54406a
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 97 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ To use this library in your android project, just simply add the following depen

```sh
dependencies {
compile 'com.thesurix.gesturerecycler:gesture-recycler:1.5.0'
compile 'com.thesurix.gesturerecycler:gesture-recycler:1.6.0'
}
```

Expand Down Expand Up @@ -183,8 +183,9 @@ adapter.setUndoSize(2);
See examples.

# To do
* kotlin
* tests?
* bindable ViewHolder
* examples with data binding
* tests

# Licence

Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.41"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}

Expand All @@ -23,4 +23,4 @@ allprojects {

task clean(type: Delete) {
delete rootProject.buildDir
}
}
7 changes: 1 addition & 6 deletions example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ android {

dependencies {
implementation project(':gesture-recycler')
implementation files('libs/glide-full-4.6.0.jar')
implementation files('libs/glide-full-4.7.0.jar')
implementation viewDependencies.butterKnife
annotationProcessor viewDependencies.butterKnifeAnnotation
implementation supportDependencies.cardView
Expand All @@ -34,9 +34,4 @@ dependencies {
implementation supportDependencies.design
implementation langDependencies.kotlin

testCompile 'junit:junit:4.12'

}
repositories {
mavenCentral()
}
Binary file not shown.

This file was deleted.

This file was deleted.

33 changes: 30 additions & 3 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

def version = '1.5.0'
ext {
bintrayRepo = 'maven'
bintrayName = 'gesture-recycler'

publishedGroupId = 'com.thesurix.gesturerecycler'
libraryName = 'Gesture Recycler'
artifact = 'gesture-recycler'

libraryDescription = ' This library provides swipe & drag and drop support for RecyclerView. '

siteUrl = 'https://github.com/thesurix/gesture-recycler'
gitUrl = 'https://github.com/thesurix/gesture-recycler.git'

libraryVersion = '1.6.0'

developerId = 'thesurix'
developerName = 'Pawel Surowka'
developerEmail = '[email protected]'
organization = 'thesurix'

licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}

ext {
PUBLISH_GROUP_ID = 'com.thesurix.gesturerecycler'
Expand All @@ -28,10 +51,14 @@ android {
}

dependencies {
testCompile 'junit:junit:4.12'
implementation supportDependencies.recyclerView
implementation supportDependencies.appCompat
implementation langDependencies.kotlin
}

apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle'
tasks.withType(Javadoc).all {
enabled = false
}

apply from: 'https://raw.githubusercontent.com/quangctkm9207/template-files/master/android/gradle/install.gradle'
apply from: 'https://raw.githubusercontent.com/quangctkm9207/template-files/master/android/gradle/bintray.gradle'

This file was deleted.

12 changes: 1 addition & 11 deletions library/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
<manifest package="com.thesurix.gesturerecycler"
xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
android:label="@string/app_name"
android:supportsRtl="true">

</application>

</manifest>
<manifest package="com.thesurix.gesturerecycler"/>
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ class GestureManager {
* @param recyclerView RecyclerView instance
*/
class Builder(val recyclerView: RecyclerView) {
var swipeFlags = INVALID_FLAG
internal var swipeFlags = INVALID_FLAG
private set
var dragFlags = INVALID_FLAG
internal var dragFlags = INVALID_FLAG
private set
var isSwipeEnabled = false
internal var isSwipeEnabled = false
private set
var isDragEnabled = false
internal var isDragEnabled = false
private set
var isManualDragEnabled = false
internal var isManualDragEnabled = false
private set

/**
Expand Down Expand Up @@ -139,7 +139,7 @@ class GestureManager {
* @param dragFlags flags for drag gesture
* @return returns builder instance
*/
@Deprecated("")
@Deprecated("Use setSwipeFlags() and setDragFlags() methods.")
fun setGestureFlags(swipeFlags: Int, dragFlags: Int): Builder {
this.swipeFlags = swipeFlags
this.dragFlags = dragFlags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ import com.thesurix.gesturerecycler.LayoutFlags.*
* @param adapter adapter
* @author thesurix
*/
class GestureTouchHelperCallback(private val mGestureAdapter: GestureAdapter<*, *>) : ItemTouchHelper.Callback() {
class GestureTouchHelperCallback(private val gestureAdapter: GestureAdapter<*, *>) : ItemTouchHelper.Callback() {

/** Flag that enables or disables swipe gesture */
var swipeEnabled = false
/** Flag that enables or disables manual drag gesture */
var manualDragEnabled = false
set(enabled) {
field = enabled
mGestureAdapter.allowManualDrag(manualDragEnabled)
gestureAdapter.allowManualDrag(manualDragEnabled)
}
/** Flag that enables long press drag gesture */
var longPressDragEnabled = false
Expand All @@ -39,11 +39,11 @@ class GestureTouchHelperCallback(private val mGestureAdapter: GestureAdapter<*,
}

override fun onMove(recyclerView: RecyclerView, source: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean {
return mGestureAdapter.onItemMove(source.adapterPosition, target.adapterPosition)
return gestureAdapter.onItemMove(source.adapterPosition, target.adapterPosition)
}

override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) {
mGestureAdapter.onItemDismissed(viewHolder.adapterPosition)
gestureAdapter.onItemDismissed(viewHolder.adapterPosition)
}

override fun onSelectedChanged(viewHolder: RecyclerView.ViewHolder?, actionState: Int) {
Expand Down Expand Up @@ -73,7 +73,7 @@ class GestureTouchHelperCallback(private val mGestureAdapter: GestureAdapter<*,

override fun clearView(recyclerView: RecyclerView?, viewHolder: RecyclerView.ViewHolder) {
super.clearView(recyclerView, viewHolder)
mGestureAdapter.onItemMoved()
gestureAdapter.onItemMoved()
if (viewHolder is GestureViewHolder) {
viewHolder.onItemClear()

Expand Down

This file was deleted.

0 comments on commit e54406a

Please sign in to comment.