fun updateOrdering(database: SQLiteDatabase, originalPosition: Long, newPosition: Long) { Log.d("ItemDAO", "original: $originalPosition, newPosition:$newPosition") if (originalPosition > newPosition) { database.execSQL( UPDATE_ORDER_MORE, arrayOf(newPosition.toString(), originalPosition.toString()) ) } else { database.execSQL( UPDATE_ORDER_LESS, arrayOf(originalPosition.toString(), newPosition.toString()) ) } }
Updates the orderings between the original and new positions