1.8 fixes (#637)

* fix lint warnings

* upgrade dependencies

* auto cancel notifications

* improve dependency injection

* fix tests

* remove old comment from BaseActivity

* fix missing injectors
This commit is contained in:
Konrad Pozniak 2018-05-08 19:15:10 +02:00 committed by GitHub
commit 27b4cf8739
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 34 additions and 135 deletions

View file

@ -30,6 +30,7 @@ import retrofit2.Callback
import retrofit2.Response
import java.net.URI
import java.net.URISyntaxException
import javax.inject.Inject
/** this is the base class for all activities that open links
* links are checked against the api if they are mastodon links so they can be openend in Tusky
@ -41,7 +42,8 @@ abstract class BottomSheetActivity : BaseActivity() {
lateinit var bottomSheet: BottomSheetBehavior<LinearLayout>
var searchUrl: String? = null
abstract fun getMastodonApi(): MastodonApi
@Inject
lateinit var mastodonApi: MastodonApi
override fun onPostCreate(savedInstanceState: Bundle?) {
super.onPostCreate(savedInstanceState)
@ -67,7 +69,7 @@ abstract class BottomSheetActivity : BaseActivity() {
return
}
val call = getMastodonApi().search(url, true)
val call = mastodonApi.search(url, true)
call.enqueue(object : Callback<SearchResults> {
override fun onResponse(call: Call<SearchResults>, response: Response<SearchResults>) {
if (getCancelSearchRequested(url)) {