diff --git a/build.gradle b/build.gradle index 1ba710d8b..11f05aed5 100644 --- a/build.gradle +++ b/build.gradle @@ -35,7 +35,7 @@ allprojects { subprojects { buildscript { ext { - kotlinVersion = '1.1.2-5' + kotlinVersion = '1.1.3-2' pluginVersions = [ AndroidSvgDrawable: '3.0.0', Fabric : '1.22.1', diff --git a/twidere/src/main/kotlin/org/mariotaku/ktextension/MenuExtensions.kt b/twidere/src/main/kotlin/org/mariotaku/ktextension/MenuExtensions.kt index 1f1994bb2..1acb27711 100644 --- a/twidere/src/main/kotlin/org/mariotaku/ktextension/MenuExtensions.kt +++ b/twidere/src/main/kotlin/org/mariotaku/ktextension/MenuExtensions.kt @@ -23,7 +23,6 @@ import android.content.Context import android.graphics.drawable.Drawable import android.support.annotation.DrawableRes import android.support.v4.content.ContextCompat -import android.support.v4.view.MenuItemCompat import android.view.Menu import android.view.MenuItem import android.view.SubMenu @@ -63,14 +62,12 @@ fun Menu.setMenuItemTitle(id: Int, title: Int) { fun Menu.setMenuItemShowAsActionFlags(id: Int, flags: Int) { val item = findItem(id) ?: return item.setShowAsActionFlags(flags) - MenuItemCompat.setShowAsAction(item, flags) } fun Menu.findSubmenu(id: Int): SubMenu? { return findItem(id)?.subMenu } - fun MenuItem.setActionIcon(context: Context, @DrawableRes iconRes: Int) { val oldIcon = this.icon if (oldIcon is ActionIconDrawable) { diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/activity/BrowserSignInActivity.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/activity/BrowserSignInActivity.kt index 04ba8fe60..70d7a001b 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/activity/BrowserSignInActivity.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/activity/BrowserSignInActivity.kt @@ -249,9 +249,9 @@ class BrowserSignInActivity : BaseActivity() { webSettings.applyDefault() webView.webViewClient = object : WebViewClient() { @Suppress("OverridingDeprecatedMember") - override fun shouldOverrideUrlLoading(view: WebView?, url: String?) = false + override fun shouldOverrideUrlLoading(wv: WebView?, url: String?) = false - override fun shouldOverrideUrlLoading(view: WebView?, request: WebResourceRequest?) = false + override fun shouldOverrideUrlLoading(wv: WebView?, request: WebResourceRequest?) = false } webView.webChromeClient = object : WebChromeClient() { override fun onCloseWindow(window: WebView) { diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/activity/ComposeActivity.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/activity/ComposeActivity.kt index c0b52791a..239374610 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/activity/ComposeActivity.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/activity/ComposeActivity.kt @@ -1516,7 +1516,7 @@ class ComposeActivity : BaseActivity(), OnMenuItemClickListener, OnClickListener private fun discardTweet() { val context = applicationContext val media = mediaList - task { media.forEach { media -> Utils.deleteMedia(context, Uri.parse(media.uri)) } } + task { media.forEach { Utils.deleteMedia(context, Uri.parse(it.uri)) } } } private fun getStatusUpdate(checkLength: Boolean): ParcelableStatusUpdate { diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/StatusFragment.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/StatusFragment.kt index b0b039370..ac3eb49e0 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/StatusFragment.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/StatusFragment.kt @@ -426,7 +426,7 @@ class StatusFragment : BaseFragment(), LoaderCallbacks>) { diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/task/ExceptionHandlingAbstractTask.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/task/ExceptionHandlingAbstractTask.kt index b0c8c9326..5096ab409 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/task/ExceptionHandlingAbstractTask.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/task/ExceptionHandlingAbstractTask.kt @@ -50,8 +50,9 @@ abstract class ExceptionHandlingAbstractTask { try { return SingleResponse(onExecute(params)) - } catch (tr: TaskException) { - return SingleResponse(tr) + } catch (tr: Exception) { + if (exceptionClass.isInstance(tr)) return SingleResponse(tr) + throw tr } } diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/util/view/ViewProperties.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/util/view/ViewProperties.kt index c123c6a37..56513893b 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/util/view/ViewProperties.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/util/view/ViewProperties.kt @@ -20,10 +20,11 @@ package org.mariotaku.twidere.util.view import android.util.FloatProperty +import android.util.Property import android.view.View object ViewProperties { - val TRANSLATION_X_RELATIVE = object : FloatProperty("xRelative") { + val TRANSLATION_X_RELATIVE: Property = object : FloatProperty("xRelative") { override fun setValue(obj: View, value: Float) { obj.translationX = value * obj.width }