upgrade autodispose (#1490)

* upgrade autodispose

* set AutoDisposePlugins.setHideProxies to false
This commit is contained in:
Konrad Pozniak 2019-09-22 08:19:44 +02:00 committed by GitHub
parent 54a0d5406a
commit 546cb4bacc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 20 additions and 16 deletions

View file

@ -148,8 +148,8 @@ dependencies {
implementation 'io.reactivex.rxjava2:rxjava:2.2.12'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'io.reactivex.rxjava2:rxkotlin:2.4.0'
implementation 'com.uber.autodispose:autodispose-android-archcomponents:1.3.0'
implementation 'com.uber.autodispose:autodispose:1.3.0'
implementation 'com.uber.autodispose:autodispose-android-archcomponents:1.4.0'
implementation 'com.uber.autodispose:autodispose:1.4.0'
implementation 'androidx.paging:paging-runtime-ktx:2.1.0'
//Glide

View file

@ -36,6 +36,7 @@ import com.keylesspalace.tusky.viewmodel.AccountsInListViewModel
import com.keylesspalace.tusky.viewmodel.State
import com.uber.autodispose.android.lifecycle.AndroidLifecycleScopeProvider.from
import com.uber.autodispose.autoDisposable
import com.uber.autodispose.autoDispose
import io.reactivex.android.schedulers.AndroidSchedulers
import kotlinx.android.extensions.LayoutContainer
import kotlinx.android.synthetic.main.fragment_accounts_in_list.*
@ -106,7 +107,7 @@ class AccountsInListFragment : DialogFragment(), Injectable {
viewModel.state
.observeOn(AndroidSchedulers.mainThread())
.autoDisposable(from(this))
.autoDispose(from(this))
.subscribe { state ->
adapter.submitList(state.accounts.asRightOrNull() ?: listOf())

View file

@ -42,7 +42,7 @@ import com.keylesspalace.tusky.viewmodel.ListsViewModel.LoadingState.*
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.mikepenz.iconics.IconicsDrawable
import com.uber.autodispose.android.lifecycle.AndroidLifecycleScopeProvider.from
import com.uber.autodispose.autoDisposable
import com.uber.autodispose.autoDispose
import dagger.android.DispatchingAndroidInjector
import dagger.android.HasAndroidInjector
import io.reactivex.android.schedulers.AndroidSchedulers
@ -92,7 +92,7 @@ class ListsActivity : BaseActivity(), Injectable, HasAndroidInjector {
viewModel = viewModelFactory.create(ListsViewModel::class.java)
viewModel.state
.observeOn(AndroidSchedulers.mainThread())
.autoDisposable(from(this))
.autoDispose(from(this))
.subscribe(this::update)
viewModel.retryLoading()
@ -101,7 +101,7 @@ class ListsActivity : BaseActivity(), Injectable, HasAndroidInjector {
}
viewModel.events.observeOn(AndroidSchedulers.mainThread())
.autoDisposable(from(this))
.autoDispose(from(this))
.subscribe { event ->
@Suppress("WHEN_ENUM_CAN_BE_NULL_IN_JAVA")
when (event) {

View file

@ -32,7 +32,7 @@ import com.keylesspalace.tusky.di.Injectable
import com.keylesspalace.tusky.util.onTextChanged
import com.keylesspalace.tusky.util.visible
import com.uber.autodispose.android.lifecycle.AndroidLifecycleScopeProvider.from
import com.uber.autodispose.autoDisposable
import com.uber.autodispose.autoDispose
import io.reactivex.Single
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.activity_tab_preference.*
@ -252,7 +252,7 @@ class TabPreferenceActivity : BaseActivity(), Injectable, ItemInteractionListene
accountManager.saveAccount(it)
}
.subscribeOn(Schedulers.io())
.autoDisposable(from(this, Lifecycle.Event.ON_DESTROY))
.autoDispose(from(this, Lifecycle.Event.ON_DESTROY))
.subscribe()
}

View file

@ -30,6 +30,7 @@ import com.keylesspalace.tusky.di.AppInjector;
import com.keylesspalace.tusky.util.EmojiCompatFont;
import com.keylesspalace.tusky.util.LocaleManager;
import com.keylesspalace.tusky.util.NotificationPullJobCreator;
import com.uber.autodispose.AutoDisposePlugins;
import org.conscrypt.Conscrypt;
@ -86,6 +87,8 @@ public class TuskyApplication extends Application implements HasAndroidInjector
}
};
AutoDisposePlugins.setHideProxies(false);
initAppInjector();
initEmojiCompat();

View file

@ -50,7 +50,7 @@ import com.keylesspalace.tusky.pager.ImagePagerAdapter
import com.keylesspalace.tusky.util.getTemporaryMediaFilename
import com.keylesspalace.tusky.viewdata.AttachmentViewData
import com.uber.autodispose.android.lifecycle.AndroidLifecycleScopeProvider
import com.uber.autodispose.autoDisposable
import com.uber.autodispose.autoDispose
import io.reactivex.Single
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
@ -285,7 +285,7 @@ class ViewMediaActivity : BaseActivity(), ViewImageFragment.PhotoActionsListener
.doOnDispose {
futureTask.cancel(true)
}
.autoDisposable(AndroidLifecycleScopeProvider.from(this, Lifecycle.Event.ON_DESTROY))
.autoDispose(AndroidLifecycleScopeProvider.from(this, Lifecycle.Event.ON_DESTROY))
.subscribe(
{ result ->
Log.d(TAG, "Download image result: $result")

View file

@ -21,7 +21,7 @@ import com.keylesspalace.tusky.util.hide
import com.keylesspalace.tusky.util.show
import com.keylesspalace.tusky.view.EndlessOnScrollListener
import com.uber.autodispose.android.lifecycle.AndroidLifecycleScopeProvider.from
import com.uber.autodispose.autoDisposable
import com.uber.autodispose.autoDispose
import io.reactivex.android.schedulers.AndroidSchedulers
import kotlinx.android.synthetic.main.fragment_instance_list.*
import retrofit2.Call
@ -115,7 +115,7 @@ class InstanceListFragment: BaseFragment(), Injectable, InstanceActionListener {
api.domainBlocks(id, bottomId)
.observeOn(AndroidSchedulers.mainThread())
.autoDisposable(from(this, Lifecycle.Event.ON_DESTROY))
.autoDispose(from(this, Lifecycle.Event.ON_DESTROY))
.subscribe({ response ->
val instances = response.body()

View file

@ -50,7 +50,7 @@ import com.keylesspalace.tusky.util.NetworkState
import com.keylesspalace.tusky.viewdata.AttachmentViewData
import com.keylesspalace.tusky.viewdata.StatusViewData
import com.uber.autodispose.android.lifecycle.AndroidLifecycleScopeProvider.from
import com.uber.autodispose.autoDisposable
import com.uber.autodispose.autoDispose
import io.reactivex.android.schedulers.AndroidSchedulers
import kotlinx.android.synthetic.main.fragment_search.*
import java.util.*
@ -392,7 +392,7 @@ class SearchStatusesFragment : SearchFragment<Pair<Status, StatusViewData.Concre
.setPositiveButton(android.R.string.ok) { _, _ ->
viewModel.deleteStatus(id)
.observeOn(AndroidSchedulers.mainThread())
.autoDisposable(from(this, Lifecycle.Event.ON_DESTROY))
.autoDispose(from(this, Lifecycle.Event.ON_DESTROY))
.subscribe ({ deletedStatus ->
removeItem(position)

View file

@ -40,7 +40,7 @@ import com.keylesspalace.tusky.util.hide
import com.keylesspalace.tusky.util.show
import com.keylesspalace.tusky.view.EndlessOnScrollListener
import com.uber.autodispose.android.lifecycle.AndroidLifecycleScopeProvider.from
import com.uber.autodispose.autoDisposable
import com.uber.autodispose.autoDispose
import io.reactivex.Single
import io.reactivex.android.schedulers.AndroidSchedulers
import kotlinx.android.synthetic.main.fragment_account_list.*
@ -275,7 +275,7 @@ class AccountListFragment : BaseFragment(), AccountActionListener, Injectable {
getFetchCallByListType(type, id)
.observeOn(AndroidSchedulers.mainThread())
.autoDisposable(from(this, Lifecycle.Event.ON_DESTROY))
.autoDispose(from(this, Lifecycle.Event.ON_DESTROY))
.subscribe({ response ->
val accountList = response.body()