Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
QuasselDroid-ng
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Janne Mareike Koschinski
QuasselDroid-ng
Commits
abb3f3ca
Verified
Commit
abb3f3ca
authored
6 years ago
by
Janne Mareike Koschinski
Browse files
Options
Downloads
Patches
Plain Diff
Removed unused functions
parent
b3b54710
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
viewmodel/src/main/java/de/kuschku/quasseldroid/util/helper/LiveDataHelper.kt
+0
-28
0 additions, 28 deletions
...ava/de/kuschku/quasseldroid/util/helper/LiveDataHelper.kt
with
0 additions
and
28 deletions
viewmodel/src/main/java/de/kuschku/quasseldroid/util/helper/LiveDataHelper.kt
+
0
−
28
View file @
abb3f3ca
...
@@ -22,7 +22,6 @@ package de.kuschku.quasseldroid.util.helper
...
@@ -22,7 +22,6 @@ package de.kuschku.quasseldroid.util.helper
import
androidx.annotation.MainThread
import
androidx.annotation.MainThread
import
androidx.lifecycle.*
import
androidx.lifecycle.*
import
io.reactivex.BackpressureStrategy
import
io.reactivex.Observable
import
io.reactivex.Observable
@MainThread
@MainThread
...
@@ -77,33 +76,6 @@ inline fun <X, Y> LiveData<X>.switchMapNotNull(
...
@@ -77,33 +76,6 @@ inline fun <X, Y> LiveData<X>.switchMapNotNull(
return
result
return
result
}
}
@MainThread
inline
fun
<
X
,
Y
>
LiveData
<
X
?>.
switchMapRx
(
strategy
:
BackpressureStrategy
,
crossinline
func
:
(
X
)
->
Observable
<
Y
>?
):
LiveData
<
Y
?>
{
val
result
=
MediatorLiveData
<
Y
>()
result
.
addSource
(
this
,
object
:
Observer
<
X
?>
{
var
mSource
:
LiveData
<
Y
>?
=
null
override
fun
onChanged
(
x
:
X
?)
{
val
newLiveData
=
if
(
x
==
null
)
null
else
func
(
x
)
?.
toLiveData
(
strategy
)
if
(
mSource
===
newLiveData
)
{
return
}
mSource
?.
let
(
result
::
removeSource
)
mSource
=
newLiveData
if
(
newLiveData
!=
null
)
{
result
.
addSource
(
newLiveData
)
{
y
->
result
.
value
=
y
}
}
else
{
result
.
value
=
null
}
}
})
return
result
}
@MainThread
@MainThread
inline
fun
<
X
,
Y
>
LiveData
<
out
X
?>.
map
(
inline
fun
<
X
,
Y
>
LiveData
<
out
X
?>.
map
(
crossinline
func
:
(
X
)
->
Y
?
crossinline
func
:
(
X
)
->
Y
?
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment