|
internal fun ISwipeable.getSwipeDirs(dirs: Int): Int { |
|
var directions = dirs |
|
if (!isDirectionSupported(ItemTouchHelper.LEFT)) { |
|
directions = dirs and ItemTouchHelper.LEFT.inv() |
|
} |
|
if (!isDirectionSupported(ItemTouchHelper.RIGHT)) { |
|
directions = dirs and ItemTouchHelper.RIGHT.inv() |
|
} |
|
return directions |
|
} |
In line 11 and 14 you need to write directions = directions ...
, otherwise you may lose the removement of the first flag if both flags are removed