List editing (#1104)

* List editing groundwork

* Add ability to add/remove accounts from list, delete lists

* Rename list, improve lists UI

* Add error handling, extract strings

* Revert gradle.properties

* Apply feedback suggestions

* Apply feedback

* Update license header
This commit is contained in:
Ivan Kupalov 2019-03-16 13:36:16 +01:00 committed by Konrad Pozniak
commit 520e0d6e7a
23 changed files with 1047 additions and 222 deletions

View file

@ -27,6 +27,8 @@ sealed class Either<out L, out R> {
fun isRight() = this is Right
fun isLeft() = this is Left
fun asLeftOrNull() = (this as? Left<L, R>)?.value
fun asRightOrNull() = (this as? Right<L, R>)?.value
@ -34,4 +36,12 @@ sealed class Either<out L, out R> {
fun asLeft(): L = (this as Left<L, R>).value
fun asRight(): R = (this as Right<L, R>).value
inline fun <N> map(crossinline mapper: (R) -> N): Either<L, N> {
return if (this.isLeft()) {
Left(this.asLeft())
} else {
Right(mapper(this.asRight()))
}
}
}