Skip to content

Commit b4470bf

Browse files
committed
- cleaned up code
- edited build gradle
1 parent 33b1388 commit b4470bf

File tree

6 files changed

+4
-8
lines changed

6 files changed

+4
-8
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ dependencies {
3232
testImplementation 'junit:junit:4.12'
3333
androidTestImplementation 'com.android.support.test:runner:1.0.1'
3434
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
35-
compile project(path: ':swipeaction')
35+
compile project(':swipeaction')
3636
}

app/src/main/java/de/taop/swipeactionsample/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class MainActivity : AppCompatActivity() {
2121
setContentView(R.layout.activity_main)
2222
setSupportActionBar(toolbar)
2323

24-
fab.setOnClickListener { view ->
24+
fab.setOnClickListener {
2525
(list.adapter as DummyAdapter).addItem(DummyItem())
2626
}
2727

app/src/main/java/de/taop/swipeactionsample/dummyItems/DummyAdapter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class DummyAdapter(var items: ArrayList<DummyItem>, val itemClick: (DummyItem) -
4848
holder.bindView(items[position], position)
4949
}
5050

51-
override fun getItemCount(): Int = items.size ?: 0
51+
override fun getItemCount(): Int = items.size
5252

5353
class DummyViewHolder(val view: View, val itemClick: (DummyItem) -> Unit) : RecyclerView.ViewHolder(view) {
5454

swipeaction/build.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@ apply plugin: 'kotlin-android'
44
android {
55
compileSdkVersion 26
66

7-
8-
97
defaultConfig {
108
minSdkVersion 14
119
targetSdkVersion 26
1210
versionCode 1
1311
versionName "1.0"
1412

1513
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
16-
1714
}
1815

1916
buildTypes {

swipeaction/src/main/java/de/taop/swipeaction/SwipeActionSetupHelper.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ class SwipeActionSetupHelper {
5757
}
5858

5959
override fun onSwiped(viewHolder: RecyclerView.ViewHolder, swipeDir: Int) {
60-
val swipedPosition = viewHolder.adapterPosition
6160
when (swipeDir) {
6261
ItemTouchHelper.LEFT -> {
6362
leftAction.performAction(viewHolder, ItemTouchHelper.LEFT)

swipeaction/src/main/java/de/taop/swipeaction/actions/DeleteAction.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class DeleteAction(recyclerView: RecyclerView, @IdRes val snackBarParentID: Int,
5252
*/
5353
var itemsDeletedCallback: (IntArray) -> Unit = {}
5454

55-
private lateinit var pendingRunnable: Runnable
55+
private var pendingRunnable: Runnable
5656

5757
init { // create the snackbar and pending runnable
5858
adapter as SwipeActionAdapter

0 commit comments

Comments
 (0)