This repository was archived by the owner on Jun 12, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
drag-drop-swipe-recyclerview-sample
drag-drop-swipe-recyclerview
java/com/ernestoyaquello/dragdropswiperecyclerview Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,9 +5,9 @@ buildscript {
55 mavenCentral()
66 }
77 dependencies {
8- classpath ' com.android.tools.build:gradle:7.0.4 '
9- classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21 "
10- classpath ' io.github.gradle-nexus:publish-plugin:1.1 .0'
8+ classpath ' com.android.tools.build:gradle:8.1.1 '
9+ classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10 "
10+ classpath ' io.github.gradle-nexus:publish-plugin:1.3 .0'
1111 }
1212}
1313
Original file line number Diff line number Diff line change @@ -2,12 +2,12 @@ apply plugin: 'com.android.application'
22apply plugin : ' kotlin-android'
33
44android {
5- compileSdkVersion 31
5+ compileSdk 34
66
77 defaultConfig {
88 applicationId " com.ernestoyaquello.dragdropswiperecyclerviewsample"
99 minSdkVersion 19
10- targetSdkVersion 31
10+ targetSdkVersion 34
1111 versionCode 1
1212 versionName " 1.0"
1313 }
@@ -22,13 +22,20 @@ android {
2222 buildFeatures {
2323 viewBinding true
2424 }
25+
26+ compileOptions {
27+ sourceCompatibility JavaVersion . VERSION_17
28+ targetCompatibility JavaVersion . VERSION_17
29+ }
30+
31+ namespace ' com.ernestoyaquello.dragdropswiperecyclerviewsample'
2532}
2633
2734dependencies {
2835 implementation fileTree(dir : ' libs' , include : [' *.jar' ])
2936
30- implementation ' com.google.android.material:material:1.4 .0'
31- implementation ' androidx.appcompat:appcompat:1.4.0 '
37+ implementation ' com.google.android.material:material:1.9 .0'
38+ implementation ' androidx.appcompat:appcompat:1.6.1 '
3239 implementation ' androidx.vectordrawable:vectordrawable:1.1.0'
3340 implementation ' androidx.cardview:cardview:1.0.0'
3441
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
2- <manifest xmlns : android =" http://schemas.android.com/apk/res/android"
3- package =" com.ernestoyaquello.dragdropswiperecyclerviewsample" >
2+ <manifest xmlns : android =" http://schemas.android.com/apk/res/android" >
43
54 <application
65 android : allowBackup =" true"
1211
1312 <activity
1413 android : name =" .MainActivity"
15- android : label =" @string/app_name"
1614 android : exported =" true" >
1715 <intent-filter >
1816 <action android : name =" android.intent.action.MAIN" />
Original file line number Diff line number Diff line change @@ -2,13 +2,11 @@ apply plugin: 'com.android.library'
22apply plugin : ' kotlin-android'
33
44android {
5- compileSdkVersion 31
5+ compileSdk 34
66
77 defaultConfig {
88 minSdkVersion 19
9- targetSdkVersion 31
10- versionCode 18
11- versionName ' 1.1.1'
9+ targetSdkVersion 34
1210 }
1311
1412 buildTypes {
@@ -17,11 +15,18 @@ android {
1715 proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
1816 }
1917 }
18+
19+ compileOptions {
20+ sourceCompatibility JavaVersion . VERSION_17
21+ targetCompatibility JavaVersion . VERSION_17
22+ }
23+
24+ namespace ' com.ernestoyaquello.dragdropswiperecyclerview'
2025}
2126
2227dependencies {
23- implementation ' androidx.appcompat:appcompat:1.4.0 '
24- api ' androidx.recyclerview:recyclerview:1.2 .1'
28+ implementation ' androidx.appcompat:appcompat:1.6.1 '
29+ api ' androidx.recyclerview:recyclerview:1.3 .1'
2530}
2631
2732ext {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ package com.ernestoyaquello.dragdropswiperecyclerview
33import android.content.Context
44import android.graphics.Color
55import android.graphics.drawable.Drawable
6+ import android.os.Build
7+ import android.os.Build.VERSION.SDK_INT
68import android.os.Parcelable
79import androidx.appcompat.content.res.AppCompatResources
810import androidx.recyclerview.widget.GridLayoutManager
@@ -676,7 +678,10 @@ open class DragDropSwipeRecyclerView @JvmOverloads constructor(
676678 var superState = state
677679
678680 if (isSaveEnabled && state is Bundle ) {
679- superState = state.getParcelable(SUPER_STATE_KEY )
681+ superState = when {
682+ SDK_INT >= Build .VERSION_CODES .TIRAMISU -> state.getParcelable(SUPER_STATE_KEY , Parcelable ::class .java)
683+ else -> @Suppress(" DEPRECATION" ) state.getParcelable(SUPER_STATE_KEY )
684+ }
680685 itemLayoutId = state.getInt(ITEM_LAYOUT_ID_KEY , 0 )
681686 dividerDrawableId = state.getInt(DIVIDER_DRAWABLE_ID_KEY , 0 )
682687 behindSwipedItemIconDrawableId = state.getInt(BEHIND_SWIPED_ITEM_ICON_DRAWABLE_ID_KEY , 0 )
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ internal class DragDropSwipeItemDecoration(var divider: Drawable) : RecyclerView
3838 drawHorizontalDividers(child, c, divider)
3939 drawVerticalDividers(child, c, divider)
4040 }
41+
42+ null -> {}
4143 }
4244 }
4345 } else throw TypeCastException (" The recycler view must be an extension of DragDropSwipeRecyclerView." )
@@ -67,6 +69,8 @@ internal class DragDropSwipeItemDecoration(var divider: Drawable) : RecyclerView
6769 if (position >= parent.numOfRowsPerColumnInGridList)
6870 outRect.left = divider.intrinsicWidth
6971 }
72+
73+ null -> {}
7074 }
7175 }
7276 } else throw TypeCastException (" The recycler view must be an extension of DragDropSwipeRecyclerView." )
Original file line number Diff line number Diff line change 1+ android.defaults.buildfeatures.buildconfig =true
12android.enableJetifier =true
3+ android.nonFinalResIds =false
4+ android.nonTransitiveRClass =false
25android.useAndroidX =true
36org.gradle.jvmargs =-Xmx1536m
47systemProp.org.gradle.internal.publish.checksums.insecure =true
Original file line number Diff line number Diff line change @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33distributionPath =wrapper/dists
44zipStoreBase =GRADLE_USER_HOME
55zipStorePath =wrapper/dists
6- distributionUrl =https\://services.gradle.org/distributions/gradle-7.0 .2-all.zip
6+ distributionUrl =https\://services.gradle.org/distributions/gradle-8 .2-all.zip
You can’t perform that action at this time.
0 commit comments