Update Dagger & other deps (#1315)
* update dagger * update remaining deps
This commit is contained in:
parent
d8f7845be5
commit
05d939b68a
13 changed files with 77 additions and 114 deletions
|
@ -86,7 +86,8 @@ project.tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ext.daggerVersion = '2.22.1'
|
ext.daggerVersion = '2.23.1'
|
||||||
|
ext.retrofitVersion = '2.6.0'
|
||||||
|
|
||||||
// if libraries are changed here, they should also be changed in LicenseActivity
|
// if libraries are changed here, they should also be changed in LicenseActivity
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@ -102,9 +103,9 @@ dependencies {
|
||||||
implementation 'androidx.exifinterface:exifinterface:1.0.0'
|
implementation 'androidx.exifinterface:exifinterface:1.0.0'
|
||||||
implementation 'androidx.cardview:cardview:1.0.0'
|
implementation 'androidx.cardview:cardview:1.0.0'
|
||||||
implementation 'androidx.preference:preference:1.1.0-alpha04'
|
implementation 'androidx.preference:preference:1.1.0-alpha04'
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
|
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
|
implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
|
||||||
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.5.0'
|
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"
|
||||||
implementation 'com.squareup.okhttp3:okhttp:3.14.2'
|
implementation 'com.squareup.okhttp3:okhttp:3.14.2'
|
||||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.14.2'
|
implementation 'com.squareup.okhttp3:logging-interceptor:3.14.2'
|
||||||
implementation 'org.conscrypt:conscrypt-android:2.1.0'
|
implementation 'org.conscrypt:conscrypt-android:2.1.0'
|
||||||
|
@ -133,20 +134,19 @@ dependencies {
|
||||||
implementation "com.google.dagger:dagger-android:$daggerVersion"
|
implementation "com.google.dagger:dagger-android:$daggerVersion"
|
||||||
implementation "com.google.dagger:dagger-android-support:$daggerVersion"
|
implementation "com.google.dagger:dagger-android-support:$daggerVersion"
|
||||||
kapt "com.google.dagger:dagger-android-processor:$daggerVersion"
|
kapt "com.google.dagger:dagger-android-processor:$daggerVersion"
|
||||||
testImplementation 'org.robolectric:robolectric:4.2.1'
|
testImplementation 'org.robolectric:robolectric:4.3'
|
||||||
testImplementation 'org.mockito:mockito-inline:2.27.0'
|
testImplementation 'org.mockito:mockito-inline:2.28.2'
|
||||||
testImplementation 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0'
|
testImplementation 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0'
|
||||||
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.1', {
|
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.1', {
|
||||||
exclude group: 'com.android.support', module: 'support-annotations'
|
exclude group: 'com.android.support', module: 'support-annotations'
|
||||||
})
|
})
|
||||||
androidTestImplementation 'android.arch.persistence.room:testing:1.1.1'
|
androidTestImplementation 'android.arch.persistence.room:testing:1.1.1'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||||
testImplementation 'androidx.test.ext:junit:1.1.0'
|
testImplementation 'androidx.test.ext:junit:1.1.1'
|
||||||
debugImplementation 'im.dino:dbinspector:3.4.1@aar'
|
debugImplementation 'im.dino:dbinspector:3.4.1@aar'
|
||||||
implementation 'io.reactivex.rxjava2:rxjava:2.2.8'
|
implementation 'io.reactivex.rxjava2:rxjava:2.2.9'
|
||||||
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
|
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
|
||||||
implementation 'io.reactivex.rxjava2:rxkotlin:2.3.0'
|
implementation 'io.reactivex.rxjava2:rxkotlin:2.3.0'
|
||||||
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.5.0'
|
|
||||||
implementation 'com.uber.autodispose:autodispose-android-archcomponents:1.3.0'
|
implementation 'com.uber.autodispose:autodispose-android-archcomponents:1.3.0'
|
||||||
implementation 'com.uber.autodispose:autodispose:1.3.0'
|
implementation 'com.uber.autodispose:autodispose:1.3.0'
|
||||||
implementation 'androidx.paging:paging-runtime-ktx:2.1.0'
|
implementation 'androidx.paging:paging-runtime-ktx:2.1.0'
|
||||||
|
|
|
@ -33,7 +33,6 @@ import androidx.appcompat.app.AlertDialog
|
||||||
import androidx.core.app.ActivityOptionsCompat
|
import androidx.core.app.ActivityOptionsCompat
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.emoji.text.EmojiCompat
|
import androidx.emoji.text.EmojiCompat
|
||||||
import androidx.fragment.app.Fragment
|
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
import androidx.lifecycle.ViewModelProviders
|
import androidx.lifecycle.ViewModelProviders
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
@ -53,18 +52,17 @@ import com.keylesspalace.tusky.interfaces.ReselectableFragment
|
||||||
import com.keylesspalace.tusky.pager.AccountPagerAdapter
|
import com.keylesspalace.tusky.pager.AccountPagerAdapter
|
||||||
import com.keylesspalace.tusky.util.*
|
import com.keylesspalace.tusky.util.*
|
||||||
import com.keylesspalace.tusky.viewmodel.AccountViewModel
|
import com.keylesspalace.tusky.viewmodel.AccountViewModel
|
||||||
import dagger.android.AndroidInjector
|
|
||||||
import dagger.android.DispatchingAndroidInjector
|
import dagger.android.DispatchingAndroidInjector
|
||||||
import dagger.android.support.HasSupportFragmentInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import kotlinx.android.synthetic.main.activity_account.*
|
import kotlinx.android.synthetic.main.activity_account.*
|
||||||
import kotlinx.android.synthetic.main.view_account_moved.*
|
import kotlinx.android.synthetic.main.view_account_moved.*
|
||||||
import java.text.NumberFormat
|
import java.text.NumberFormat
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasSupportFragmentInjector, LinkListener {
|
class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInjector, LinkListener {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector<Fragment>
|
lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector<Any>
|
||||||
@Inject
|
@Inject
|
||||||
lateinit var viewModelFactory: ViewModelFactory
|
lateinit var viewModelFactory: ViewModelFactory
|
||||||
|
|
||||||
|
@ -711,9 +709,7 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasSupportF
|
||||||
} else null
|
} else null
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun supportFragmentInjector(): AndroidInjector<Fragment> {
|
override fun androidInjector() = dispatchingAndroidInjector
|
||||||
return dispatchingAndroidInjector
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
|
|
|
@ -18,22 +18,17 @@ package com.keylesspalace.tusky
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.fragment.app.Fragment
|
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
|
|
||||||
import com.keylesspalace.tusky.fragment.AccountListFragment
|
import com.keylesspalace.tusky.fragment.AccountListFragment
|
||||||
|
import dagger.android.DispatchingAndroidInjector
|
||||||
|
import dagger.android.HasAndroidInjector
|
||||||
|
import kotlinx.android.synthetic.main.toolbar_basic.*
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
class AccountListActivity : BaseActivity(), HasAndroidInjector {
|
||||||
import dagger.android.DispatchingAndroidInjector
|
|
||||||
import dagger.android.support.HasSupportFragmentInjector
|
|
||||||
import kotlinx.android.synthetic.main.toolbar_basic.*
|
|
||||||
|
|
||||||
class AccountListActivity : BaseActivity(), HasSupportFragmentInjector {
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector<Fragment>
|
lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector<Any>
|
||||||
|
|
||||||
enum class Type {
|
enum class Type {
|
||||||
FOLLOWS,
|
FOLLOWS,
|
||||||
|
@ -83,9 +78,7 @@ class AccountListActivity : BaseActivity(), HasSupportFragmentInjector {
|
||||||
return super.onOptionsItemSelected(item)
|
return super.onOptionsItemSelected(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun supportFragmentInjector(): AndroidInjector<Fragment>? {
|
override fun androidInjector() = dispatchingAndroidInjector
|
||||||
return dispatchingAndroidInjector
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val EXTRA_TYPE = "type"
|
private const val EXTRA_TYPE = "type"
|
||||||
|
|
|
@ -16,14 +16,13 @@
|
||||||
package com.keylesspalace.tusky;
|
package com.keylesspalace.tusky;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.Fragment;
|
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
|
||||||
import androidx.appcompat.app.ActionBar;
|
import androidx.appcompat.app.ActionBar;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
import android.view.MenuItem;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
|
|
||||||
import com.keylesspalace.tusky.fragment.TimelineFragment;
|
import com.keylesspalace.tusky.fragment.TimelineFragment;
|
||||||
|
|
||||||
|
@ -31,12 +30,12 @@ import javax.inject.Inject;
|
||||||
|
|
||||||
import dagger.android.AndroidInjector;
|
import dagger.android.AndroidInjector;
|
||||||
import dagger.android.DispatchingAndroidInjector;
|
import dagger.android.DispatchingAndroidInjector;
|
||||||
import dagger.android.support.HasSupportFragmentInjector;
|
import dagger.android.HasAndroidInjector;
|
||||||
|
|
||||||
public class FavouritesActivity extends BottomSheetActivity implements HasSupportFragmentInjector {
|
public class FavouritesActivity extends BottomSheetActivity implements HasAndroidInjector {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public DispatchingAndroidInjector<Fragment> dispatchingAndroidInjector;
|
public DispatchingAndroidInjector<Object> dispatchingAndroidInjector;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
@ -70,7 +69,7 @@ public class FavouritesActivity extends BottomSheetActivity implements HasSuppor
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AndroidInjector<Fragment> supportFragmentInjector() {
|
public AndroidInjector<Object> androidInjector() {
|
||||||
return dispatchingAndroidInjector;
|
return dispatchingAndroidInjector;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,6 @@ import android.view.ViewGroup
|
||||||
import android.widget.*
|
import android.widget.*
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import androidx.fragment.app.Fragment
|
|
||||||
import androidx.recyclerview.widget.*
|
import androidx.recyclerview.widget.*
|
||||||
import androidx.recyclerview.widget.ListAdapter
|
import androidx.recyclerview.widget.ListAdapter
|
||||||
import at.connyduck.sparkbutton.helpers.Utils
|
import at.connyduck.sparkbutton.helpers.Utils
|
||||||
|
@ -45,7 +44,7 @@ import com.mikepenz.iconics.IconicsDrawable
|
||||||
import com.uber.autodispose.android.lifecycle.AndroidLifecycleScopeProvider.from
|
import com.uber.autodispose.android.lifecycle.AndroidLifecycleScopeProvider.from
|
||||||
import com.uber.autodispose.autoDisposable
|
import com.uber.autodispose.autoDisposable
|
||||||
import dagger.android.DispatchingAndroidInjector
|
import dagger.android.DispatchingAndroidInjector
|
||||||
import dagger.android.support.HasSupportFragmentInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||||
import kotlinx.android.synthetic.main.activity_lists.*
|
import kotlinx.android.synthetic.main.activity_lists.*
|
||||||
import kotlinx.android.synthetic.main.toolbar_basic.*
|
import kotlinx.android.synthetic.main.toolbar_basic.*
|
||||||
|
@ -55,7 +54,7 @@ import javax.inject.Inject
|
||||||
* Created by charlag on 1/4/18.
|
* Created by charlag on 1/4/18.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ListsActivity : BaseActivity(), Injectable, HasSupportFragmentInjector {
|
class ListsActivity : BaseActivity(), Injectable, HasAndroidInjector {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
|
@ -68,7 +67,7 @@ class ListsActivity : BaseActivity(), Injectable, HasSupportFragmentInjector {
|
||||||
lateinit var viewModelFactory: ViewModelFactory
|
lateinit var viewModelFactory: ViewModelFactory
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector<Fragment>
|
lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector<Any>
|
||||||
|
|
||||||
private lateinit var viewModel: ListsViewModel
|
private lateinit var viewModel: ListsViewModel
|
||||||
private val adapter = ListsAdapter()
|
private val adapter = ListsAdapter()
|
||||||
|
@ -207,7 +206,7 @@ class ListsActivity : BaseActivity(), Injectable, HasSupportFragmentInjector {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun supportFragmentInjector() = dispatchingAndroidInjector
|
override fun androidInjector() = dispatchingAndroidInjector
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
if (item.itemId == android.R.id.home) {
|
if (item.itemId == android.R.id.home) {
|
||||||
|
|
|
@ -77,7 +77,7 @@ import javax.inject.Inject;
|
||||||
|
|
||||||
import dagger.android.AndroidInjector;
|
import dagger.android.AndroidInjector;
|
||||||
import dagger.android.DispatchingAndroidInjector;
|
import dagger.android.DispatchingAndroidInjector;
|
||||||
import dagger.android.support.HasSupportFragmentInjector;
|
import dagger.android.HasAndroidInjector;
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
|
||||||
import static com.keylesspalace.tusky.util.MediaUtilsKt.deleteStaleCachedMedia;
|
import static com.keylesspalace.tusky.util.MediaUtilsKt.deleteStaleCachedMedia;
|
||||||
|
@ -85,7 +85,7 @@ import static com.uber.autodispose.AutoDispose.autoDisposable;
|
||||||
import static com.uber.autodispose.android.lifecycle.AndroidLifecycleScopeProvider.from;
|
import static com.uber.autodispose.android.lifecycle.AndroidLifecycleScopeProvider.from;
|
||||||
|
|
||||||
public final class MainActivity extends BottomSheetActivity implements ActionButtonActivity,
|
public final class MainActivity extends BottomSheetActivity implements ActionButtonActivity,
|
||||||
HasSupportFragmentInjector {
|
HasAndroidInjector {
|
||||||
|
|
||||||
private static final String TAG = "MainActivity"; // logging tag
|
private static final String TAG = "MainActivity"; // logging tag
|
||||||
private static final long DRAWER_ITEM_ADD_ACCOUNT = -13;
|
private static final long DRAWER_ITEM_ADD_ACCOUNT = -13;
|
||||||
|
@ -102,7 +102,7 @@ public final class MainActivity extends BottomSheetActivity implements ActionBut
|
||||||
public static final String STATUS_URL = "statusUrl";
|
public static final String STATUS_URL = "statusUrl";
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public DispatchingAndroidInjector<Fragment> fragmentInjector;
|
public DispatchingAndroidInjector<Object> androidInjector;
|
||||||
@Inject
|
@Inject
|
||||||
public EventHub eventHub;
|
public EventHub eventHub;
|
||||||
@Inject
|
@Inject
|
||||||
|
@ -624,7 +624,7 @@ public final class MainActivity extends BottomSheetActivity implements ActionBut
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AndroidInjector<Fragment> supportFragmentInjector() {
|
public AndroidInjector<Object> androidInjector() {
|
||||||
return fragmentInjector;
|
return androidInjector;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -3,18 +3,16 @@ package com.keylesspalace.tusky
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import com.google.android.material.floatingactionbutton.FloatingActionButton
|
|
||||||
import androidx.fragment.app.Fragment
|
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
|
import com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
import com.keylesspalace.tusky.fragment.TimelineFragment
|
import com.keylesspalace.tusky.fragment.TimelineFragment
|
||||||
import com.keylesspalace.tusky.interfaces.ActionButtonActivity
|
import com.keylesspalace.tusky.interfaces.ActionButtonActivity
|
||||||
import dagger.android.AndroidInjector
|
|
||||||
import dagger.android.DispatchingAndroidInjector
|
import dagger.android.DispatchingAndroidInjector
|
||||||
import dagger.android.support.HasSupportFragmentInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import kotlinx.android.synthetic.main.toolbar_basic.*
|
import kotlinx.android.synthetic.main.toolbar_basic.*
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
class ModalTimelineActivity : BottomSheetActivity(), ActionButtonActivity, HasSupportFragmentInjector {
|
class ModalTimelineActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInjector {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val ARG_KIND = "kind"
|
private const val ARG_KIND = "kind"
|
||||||
|
@ -32,7 +30,7 @@ class ModalTimelineActivity : BottomSheetActivity(), ActionButtonActivity, HasSu
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector<Fragment>
|
lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector<Any>
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
@ -66,8 +64,6 @@ class ModalTimelineActivity : BottomSheetActivity(), ActionButtonActivity, HasSu
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun supportFragmentInjector(): AndroidInjector<Fragment> {
|
override fun androidInjector() = dispatchingAndroidInjector
|
||||||
return dispatchingAndroidInjector
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,21 +28,21 @@ import com.keylesspalace.tusky.appstore.PreferenceChangedEvent
|
||||||
import com.keylesspalace.tusky.fragment.preference.*
|
import com.keylesspalace.tusky.fragment.preference.*
|
||||||
import com.keylesspalace.tusky.util.ThemeUtils
|
import com.keylesspalace.tusky.util.ThemeUtils
|
||||||
import com.keylesspalace.tusky.util.getNonNullString
|
import com.keylesspalace.tusky.util.getNonNullString
|
||||||
import dagger.android.AndroidInjector
|
|
||||||
import dagger.android.DispatchingAndroidInjector
|
import dagger.android.DispatchingAndroidInjector
|
||||||
import dagger.android.support.HasSupportFragmentInjector
|
|
||||||
import kotlinx.android.synthetic.main.toolbar_basic.*
|
import kotlinx.android.synthetic.main.toolbar_basic.*
|
||||||
import java.lang.IllegalArgumentException
|
import java.lang.IllegalArgumentException
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
import androidx.appcompat.app.AppCompatDelegate
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
|
import dagger.android.HasAndroidInjector
|
||||||
|
|
||||||
class PreferencesActivity : BaseActivity(), SharedPreferences.OnSharedPreferenceChangeListener, HasSupportFragmentInjector {
|
class PreferencesActivity : BaseActivity(), SharedPreferences.OnSharedPreferenceChangeListener,
|
||||||
|
HasAndroidInjector {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
lateinit var eventHub: EventHub
|
lateinit var eventHub: EventHub
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
lateinit var fragmentInjector: DispatchingAndroidInjector<Fragment>
|
lateinit var androidInjector: DispatchingAndroidInjector<Any>
|
||||||
|
|
||||||
private var restartActivitiesOnExit: Boolean = false
|
private var restartActivitiesOnExit: Boolean = false
|
||||||
|
|
||||||
|
@ -173,9 +173,7 @@ class PreferencesActivity : BaseActivity(), SharedPreferences.OnSharedPreference
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun supportFragmentInjector(): AndroidInjector<Fragment> {
|
override fun androidInjector() = androidInjector
|
||||||
return fragmentInjector
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
|
|
|
@ -20,14 +20,14 @@ import android.app.SearchableInfo;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.Fragment;
|
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
|
||||||
import androidx.appcompat.app.ActionBar;
|
import androidx.appcompat.app.ActionBar;
|
||||||
import androidx.appcompat.widget.SearchView;
|
import androidx.appcompat.widget.SearchView;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import android.view.Menu;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
import android.view.MenuItem;
|
|
||||||
|
|
||||||
import com.keylesspalace.tusky.fragment.SearchFragment;
|
import com.keylesspalace.tusky.fragment.SearchFragment;
|
||||||
|
|
||||||
|
@ -35,13 +35,13 @@ import javax.inject.Inject;
|
||||||
|
|
||||||
import dagger.android.AndroidInjector;
|
import dagger.android.AndroidInjector;
|
||||||
import dagger.android.DispatchingAndroidInjector;
|
import dagger.android.DispatchingAndroidInjector;
|
||||||
import dagger.android.support.HasSupportFragmentInjector;
|
import dagger.android.HasAndroidInjector;
|
||||||
|
|
||||||
public class SearchActivity extends BottomSheetActivity implements SearchView.OnQueryTextListener,
|
public class SearchActivity extends BottomSheetActivity implements SearchView.OnQueryTextListener,
|
||||||
HasSupportFragmentInjector {
|
HasAndroidInjector {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public DispatchingAndroidInjector<Fragment> fragmentInjector;
|
public DispatchingAndroidInjector<Object> androidInjector;
|
||||||
|
|
||||||
private String currentQuery;
|
private String currentQuery;
|
||||||
|
|
||||||
|
@ -136,8 +136,8 @@ public class SearchActivity extends BottomSheetActivity implements SearchView.On
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AndroidInjector<Fragment> supportFragmentInjector() {
|
public AndroidInjector<Object> androidInjector() {
|
||||||
return fragmentInjector;
|
return androidInjector;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,15 +15,13 @@
|
||||||
|
|
||||||
package com.keylesspalace.tusky;
|
package com.keylesspalace.tusky;
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.app.Service;
|
|
||||||
import androidx.room.Room;
|
|
||||||
import android.content.BroadcastReceiver;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
|
||||||
import androidx.emoji.text.EmojiCompat;
|
import androidx.emoji.text.EmojiCompat;
|
||||||
|
import androidx.room.Room;
|
||||||
|
|
||||||
import com.evernote.android.job.JobManager;
|
import com.evernote.android.job.JobManager;
|
||||||
import com.keylesspalace.tusky.db.AccountManager;
|
import com.keylesspalace.tusky.db.AccountManager;
|
||||||
|
@ -41,17 +39,12 @@ import javax.inject.Inject;
|
||||||
|
|
||||||
import dagger.android.AndroidInjector;
|
import dagger.android.AndroidInjector;
|
||||||
import dagger.android.DispatchingAndroidInjector;
|
import dagger.android.DispatchingAndroidInjector;
|
||||||
import dagger.android.HasActivityInjector;
|
import dagger.android.HasAndroidInjector;
|
||||||
import dagger.android.HasBroadcastReceiverInjector;
|
|
||||||
import dagger.android.HasServiceInjector;
|
|
||||||
|
|
||||||
public class TuskyApplication extends Application implements HasActivityInjector, HasServiceInjector, HasBroadcastReceiverInjector {
|
public class TuskyApplication extends Application implements HasAndroidInjector {
|
||||||
@Inject
|
@Inject
|
||||||
DispatchingAndroidInjector<Activity> dispatchingAndroidInjector;
|
DispatchingAndroidInjector<Object> androidInjector;
|
||||||
@Inject
|
|
||||||
DispatchingAndroidInjector<Service> dispatchingServiceInjector;
|
|
||||||
@Inject
|
|
||||||
DispatchingAndroidInjector<BroadcastReceiver> dispatchingBroadcastReceiverInjector;
|
|
||||||
@Inject
|
@Inject
|
||||||
NotificationPullJobCreator notificationPullJobCreator;
|
NotificationPullJobCreator notificationPullJobCreator;
|
||||||
|
|
||||||
|
@ -142,18 +135,8 @@ public class TuskyApplication extends Application implements HasActivityInjector
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AndroidInjector<Activity> activityInjector() {
|
public AndroidInjector<Object> androidInjector() {
|
||||||
return dispatchingAndroidInjector;
|
return androidInjector;
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public AndroidInjector<Service> serviceInjector() {
|
|
||||||
return dispatchingServiceInjector;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public AndroidInjector<BroadcastReceiver> broadcastReceiverInjector() {
|
|
||||||
return dispatchingBroadcastReceiverInjector;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface ServiceLocator {
|
public interface ServiceLocator {
|
||||||
|
|
|
@ -18,14 +18,13 @@ package com.keylesspalace.tusky;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.Fragment;
|
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
|
||||||
import androidx.appcompat.app.ActionBar;
|
import androidx.appcompat.app.ActionBar;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
import android.view.MenuItem;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
|
|
||||||
import com.keylesspalace.tusky.fragment.TimelineFragment;
|
import com.keylesspalace.tusky.fragment.TimelineFragment;
|
||||||
|
|
||||||
|
@ -33,13 +32,14 @@ import javax.inject.Inject;
|
||||||
|
|
||||||
import dagger.android.AndroidInjector;
|
import dagger.android.AndroidInjector;
|
||||||
import dagger.android.DispatchingAndroidInjector;
|
import dagger.android.DispatchingAndroidInjector;
|
||||||
import dagger.android.support.HasSupportFragmentInjector;
|
import dagger.android.HasAndroidInjector;
|
||||||
|
|
||||||
|
public class ViewTagActivity extends BottomSheetActivity implements HasAndroidInjector {
|
||||||
|
|
||||||
public class ViewTagActivity extends BottomSheetActivity implements HasSupportFragmentInjector {
|
|
||||||
private static final String HASHTAG = "hashtag";
|
private static final String HASHTAG = "hashtag";
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public DispatchingAndroidInjector<Fragment> dispatchingAndroidInjector;
|
public DispatchingAndroidInjector<Object> dispatchingAndroidInjector;
|
||||||
|
|
||||||
public static Intent getIntent(Context context, String tag){
|
public static Intent getIntent(Context context, String tag){
|
||||||
Intent intent = new Intent(context,ViewTagActivity.class);
|
Intent intent = new Intent(context,ViewTagActivity.class);
|
||||||
|
@ -82,7 +82,7 @@ public class ViewTagActivity extends BottomSheetActivity implements HasSupportFr
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AndroidInjector<Fragment> supportFragmentInjector() {
|
public AndroidInjector<Object> androidInjector() {
|
||||||
return dispatchingAndroidInjector;
|
return dispatchingAndroidInjector;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@ import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.Fragment;
|
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
import androidx.appcompat.app.ActionBar;
|
import androidx.appcompat.app.ActionBar;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
@ -33,9 +32,9 @@ import javax.inject.Inject;
|
||||||
|
|
||||||
import dagger.android.AndroidInjector;
|
import dagger.android.AndroidInjector;
|
||||||
import dagger.android.DispatchingAndroidInjector;
|
import dagger.android.DispatchingAndroidInjector;
|
||||||
import dagger.android.support.HasSupportFragmentInjector;
|
import dagger.android.HasAndroidInjector;
|
||||||
|
|
||||||
public class ViewThreadActivity extends BottomSheetActivity implements HasSupportFragmentInjector {
|
public class ViewThreadActivity extends BottomSheetActivity implements HasAndroidInjector {
|
||||||
|
|
||||||
public static final int REVEAL_BUTTON_HIDDEN = 1;
|
public static final int REVEAL_BUTTON_HIDDEN = 1;
|
||||||
public static final int REVEAL_BUTTON_REVEAL = 2;
|
public static final int REVEAL_BUTTON_REVEAL = 2;
|
||||||
|
@ -55,7 +54,7 @@ public class ViewThreadActivity extends BottomSheetActivity implements HasSuppor
|
||||||
private int revealButtonState = REVEAL_BUTTON_HIDDEN;
|
private int revealButtonState = REVEAL_BUTTON_HIDDEN;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public DispatchingAndroidInjector<Fragment> dispatchingAndroidInjector;
|
public DispatchingAndroidInjector<Object> dispatchingAndroidInjector;
|
||||||
|
|
||||||
private ViewThreadFragment fragment;
|
private ViewThreadFragment fragment;
|
||||||
|
|
||||||
|
@ -128,7 +127,7 @@ public class ViewThreadActivity extends BottomSheetActivity implements HasSuppor
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AndroidInjector<Fragment> supportFragmentInjector() {
|
public AndroidInjector<Object> androidInjector() {
|
||||||
return dispatchingAndroidInjector;
|
return dispatchingAndroidInjector;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,8 @@ import androidx.fragment.app.FragmentActivity
|
||||||
import androidx.fragment.app.FragmentManager
|
import androidx.fragment.app.FragmentManager
|
||||||
import com.keylesspalace.tusky.TuskyApplication
|
import com.keylesspalace.tusky.TuskyApplication
|
||||||
import dagger.android.AndroidInjection
|
import dagger.android.AndroidInjection
|
||||||
|
import dagger.android.HasAndroidInjector
|
||||||
import dagger.android.support.AndroidSupportInjection
|
import dagger.android.support.AndroidSupportInjection
|
||||||
import dagger.android.support.HasSupportFragmentInjector
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by charlag on 3/24/18.
|
* Created by charlag on 3/24/18.
|
||||||
|
@ -63,7 +63,7 @@ object AppInjector {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleActivity(activity: Activity) {
|
private fun handleActivity(activity: Activity) {
|
||||||
if (activity is HasSupportFragmentInjector || activity is Injectable) {
|
if (activity is HasAndroidInjector || activity is Injectable) {
|
||||||
AndroidInjection.inject(activity)
|
AndroidInjection.inject(activity)
|
||||||
}
|
}
|
||||||
if (activity is FragmentActivity) {
|
if (activity is FragmentActivity) {
|
||||||
|
|
Loading…
Reference in a new issue