update deps, fix some lint warnings

This commit is contained in:
Conny Duck 2018-11-16 13:31:03 +01:00
parent 35f4512e6c
commit 15d607b799
10 changed files with 32 additions and 41 deletions

View file

@ -59,7 +59,7 @@ android {
}
ext.supportLibraryVersion = '28.0.0'
ext.daggerVersion = '2.17'
ext.daggerVersion = '2.19'
// if libraries are changed here, they should also be changed in LicenseActivity
@ -105,16 +105,16 @@ dependencies {
implementation "com.google.dagger:dagger-android:$daggerVersion"
implementation "com.google.dagger:dagger-android-support:$daggerVersion"
kapt "com.google.dagger:dagger-android-processor:$daggerVersion"
testImplementation 'org.robolectric:robolectric:4.0-alpha-3'
testImplementation 'org.mockito:mockito-inline:2.21.0'
testImplementation 'org.robolectric:robolectric:4.0.2'
testImplementation 'org.mockito:mockito-inline:2.23.0'
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
debugImplementation 'im.dino:dbinspector:3.4.1@aar'
implementation 'io.reactivex.rxjava2:rxjava:2.2.1'
implementation 'io.reactivex.rxjava2:rxjava:2.2.3'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'io.reactivex.rxjava2:rxkotlin:2.3.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
implementation 'com.uber.autodispose:autodispose-android-archcomponents:1.0.0-RC2'
implementation 'com.uber.autodispose:autodispose-ktx:1.0.0-RC2'
implementation 'com.uber.autodispose:autodispose-android-archcomponents:1.0.0-RC3'
implementation 'com.uber.autodispose:autodispose-ktx:1.0.0-RC3'
}

View file

@ -373,9 +373,9 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasSupportF
accountFollowingTextView.text = numberFormat.format(account.followingCount)
accountStatusesTextView.text = numberFormat.format(account.statusesCount)
accountFloatingActionButton.setOnClickListener { _ -> mention() }
accountFloatingActionButton.setOnClickListener { mention() }
accountFollowButton.setOnClickListener { _ ->
accountFollowButton.setOnClickListener {
if (isSelf) {
val intent = Intent(this@AccountActivity, EditProfileActivity::class.java)
startActivity(intent)

View file

@ -142,7 +142,7 @@ class EditProfileActivity : BaseActivity(), Injectable {
}
}
is Error -> {
val snackbar = Snackbar.make(avatarButton, R.string.error_generic, Snackbar.LENGTH_LONG);
val snackbar = Snackbar.make(avatarButton, R.string.error_generic, Snackbar.LENGTH_LONG)
snackbar.setAction(R.string.action_retry) {
viewModel.obtainProfile()
}

View file

@ -139,7 +139,7 @@ class ViewMediaActivity : BaseActivity(), ViewImageFragment.PhotoActionsListener
actionBar.setDisplayShowHomeEnabled(true)
actionBar.title = adapter.getPageTitle(initialPosition)
}
toolbar.setNavigationOnClickListener { _ -> supportFinishAfterTransition() }
toolbar.setNavigationOnClickListener { supportFinishAfterTransition() }
toolbar.setOnMenuItemClickListener { item: MenuItem ->
when (item.itemId) {
R.id.action_download -> downloadMedia()
@ -194,7 +194,7 @@ class ViewMediaActivity : BaseActivity(), ViewImageFragment.PhotoActionsListener
if (grantResults.isNotEmpty() && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
downloadMedia()
} else {
showErrorDialog(toolbar, R.string.error_media_download_permission, R.string.action_retry) { _ -> downloadMedia() }
showErrorDialog(toolbar, R.string.error_media_download_permission, R.string.action_retry) { downloadMedia() }
}
}
}

View file

@ -49,10 +49,6 @@ class ViewImageFragment : ViewMediaFragment() {
private lateinit var toolbar: View
override lateinit var descriptionView : TextView
companion object {
private const val TAG = "ViewImageFragment"
}
override fun onAttach(context: Context) {
super.onAttach(context)
photoActionsListener = context as PhotoActionsListener
@ -64,9 +60,9 @@ class ViewImageFragment : ViewMediaFragment() {
attacher = PhotoViewAttacher(photoView)
// Clicking outside the photo closes the viewer.
attacher.setOnOutsidePhotoTapListener { _ -> photoActionsListener.onDismiss() }
attacher.setOnOutsidePhotoTapListener { photoActionsListener.onDismiss() }
attacher.setOnClickListener { _ -> onMediaTap() }
attacher.setOnClickListener { onMediaTap() }
/* A vertical swipe motion also closes the viewer. This is especially useful when the photo
* mostly fills the screen so clicking outside is difficult. */

View file

@ -37,7 +37,6 @@ abstract class ViewMediaFragment : BaseFragment() {
@JvmStatic protected val ARG_START_POSTPONED_TRANSITION = "startPostponedTransition"
@JvmStatic protected val ARG_ATTACHMENT = "attach"
@JvmStatic protected val ARG_AVATAR_URL = "avatarUrl"
private const val TAG = "ViewMediaFragment"
@JvmStatic
fun newInstance(attachment: Attachment, shouldStartPostponedTransition: Boolean): ViewMediaFragment {

View file

@ -49,10 +49,6 @@ class ViewVideoFragment : ViewMediaFragment() {
override lateinit var descriptionView : TextView
private lateinit var mediaController : MediaController
companion object {
private const val TAG = "ViewVideoFragment"
}
override fun setUserVisibleHint(isVisibleToUser: Boolean) {
// Start/pause/resume video playback as fragment is shown/hidden
super.setUserVisibleHint(isVisibleToUser)

View file

@ -42,21 +42,21 @@ class PreferencesFragment : PreferenceFragmentCompat() {
textSizePreference.icon = IconicsDrawable(context, GoogleMaterial.Icon.gmd_format_size).sizePx(iconSize).color(ThemeUtils.getColor(context, R.attr.toolbar_icon_tint))
val timelineFilterPreferences = findPreference("timelineFilterPreferences")
timelineFilterPreferences.setOnPreferenceClickListener { _ ->
activity?.let {
val intent = PreferencesActivity.newIntent(it, PreferencesActivity.TAB_FILTER_PREFERENCES)
it.startActivity(intent)
it.overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left)
timelineFilterPreferences.setOnPreferenceClickListener {
activity?.let { activity ->
val intent = PreferencesActivity.newIntent(activity, PreferencesActivity.TAB_FILTER_PREFERENCES)
activity.startActivity(intent)
activity.overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left)
}
true
}
val httpProxyPreferences = findPreference("httpProxyPreferences")
httpProxyPreferences.setOnPreferenceClickListener { _ ->
activity?.let {
val intent = PreferencesActivity.newIntent(it, PreferencesActivity.PROXY_PREFERENCES)
it.startActivity(intent)
it.overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left)
httpProxyPreferences.setOnPreferenceClickListener {
activity?.let { activity ->
val intent = PreferencesActivity.newIntent(activity, PreferencesActivity.PROXY_PREFERENCES)
activity.startActivity(intent)
activity.overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left)
}
true
}

View file

@ -2,7 +2,7 @@ package com.keylesspalace.tusky
import android.text.Spannable
import com.keylesspalace.tusky.util.highlightSpans
import junit.framework.Assert
import org.junit.Assert
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
@ -21,7 +21,7 @@ class SpanUtilsTest {
fun doesntMergeAdjacentURLs() {
val firstURL = "http://first.thing"
val secondURL = "https://second.thing"
val inputSpannable = FakeSpannable("${firstURL} ${secondURL}")
val inputSpannable = FakeSpannable("$firstURL $secondURL")
highlightSpans(inputSpannable, 0xffffff)
val spans = inputSpannable.spans
Assert.assertEquals(2, spans.size)
@ -55,7 +55,7 @@ class SpanUtilsTest {
@Test
fun matchesSpanNotAtStart() {
val inputSpannable = FakeSpannable(" ${thingToHighlight}")
val inputSpannable = FakeSpannable(" $thingToHighlight")
highlightSpans(inputSpannable, 0xffffff)
val spans = inputSpannable.spans
Assert.assertEquals(1, spans.size)
@ -82,12 +82,12 @@ class SpanUtilsTest {
fun spansDoNotOverlap() {
val begin = "@begin"
val end = "#end"
val inputSpannable = FakeSpannable("${begin} ${thingToHighlight} ${end}")
val inputSpannable = FakeSpannable("$begin $thingToHighlight $end")
highlightSpans(inputSpannable, 0xffffff)
val spans = inputSpannable.spans
Assert.assertEquals(3, spans.size)
val middleSpan = spans.single ({ span -> span.start > 0 && span.end < inputSpannable.lastIndex })
val middleSpan = spans.single { span -> span.start > 0 && span.end < inputSpannable.lastIndex }
Assert.assertEquals(begin.length + 1, middleSpan.start)
Assert.assertEquals(inputSpannable.length - end.length - 1, middleSpan.end)
}
@ -104,15 +104,15 @@ class SpanUtilsTest {
val matching = if (type == null) {
ArrayList<T>()
} else {
spans.filter ({ it.start >= start && it.end <= end && type?.isAssignableFrom(it.span?.javaClass) })
.map({ it -> it.span })
spans.filter { it.start >= start && it.end <= end && type.isAssignableFrom(it.span?.javaClass) }
.map { it -> it.span }
.let { ArrayList(it) }
}
return matching.toArray() as Array<T>
}
override fun removeSpan(what: Any?) {
spans.removeIf({ span -> span.span == what})
spans.removeIf { span -> span.span == what}
}
override fun toString(): String {

View file

@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.2.71'
ext.kotlin_version = '1.3.0'
repositories {
jcenter()
google()