Upgrade api level to Android 10, implement new sharing api (#1537)

* upgrade api level to Android 10, resolve compile errors

* use androidx.preference.PreferenceManager instead of deprecated platform class

* add hyphenation to important TextViews

*  setBottomSheetCallback -> addBottomSheetCallback

* implement new sharing api

* improve TuskyTileService so it shows account picker when multiple accounts are present

* delete unused AccountChooserService

* fix test

* improve ShareShortcutHelper

* remove debug log statement

* improve image loading fallback behavior in ShareShortcutHelper

* improve behavior on foldable devices
This commit is contained in:
Konrad Pozniak 2019-10-22 21:18:20 +02:00 committed by GitHub
commit 78b5aa8baf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 283 additions and 265 deletions

View file

@ -49,7 +49,7 @@ import retrofit2.Response
* Created by charlag on 3/7/18.
*/
@Config(application = FakeTuskyApplication::class)
@Config(application = FakeTuskyApplication::class, sdk = [28])
@RunWith(AndroidJUnit4::class)
class ComposeActivityTest {

View file

@ -24,7 +24,7 @@ import retrofit2.Callback
import retrofit2.Response
import java.util.*
@Config(application = FakeTuskyApplication::class)
@Config(application = FakeTuskyApplication::class, sdk = [28])
@RunWith(AndroidJUnit4::class)
class FilterTest {

View file

@ -100,15 +100,10 @@ class SpanUtilsTest {
spans.add(BoundedSpan(what, start, end))
}
override fun <T : Any?> getSpans(start: Int, end: Int, type: Class<T>?): Array<T> {
val matching = if (type == null) {
ArrayList<T>()
} else {
spans.filter { it.start >= start && it.end <= end && type.isAssignableFrom(it.span?.javaClass) }
override fun <T : Any> getSpans(start: Int, end: Int, type: Class<T>): Array<T> {
return spans.filter { it.start >= start && it.end <= end && type.isInstance(it)}
.map { it.span }
.let { ArrayList(it) }
}
return matching.toArray() as Array<T>
.toTypedArray() as Array<T>
}
override fun removeSpan(what: Any?) {

View file

@ -11,7 +11,7 @@ import org.junit.runner.RunWith
import org.robolectric.Robolectric
import org.robolectric.annotation.Config
@Config(application = FakeTuskyApplication::class)
@Config(application = FakeTuskyApplication::class, sdk = [28])
@RunWith(AndroidJUnit4::class)
class RickRollTest {
private lateinit var activity: Activity

View file

@ -9,7 +9,7 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.annotation.Config
@Config(application = FakeTuskyApplication::class)
@Config(application = FakeTuskyApplication::class, sdk = [28])
@RunWith(AndroidJUnit4::class)
class SmartLengthInputFilterTest {