diff --git a/app/build.gradle b/app/build.gradle index 28929ca405..1fa77edb17 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -22,7 +22,7 @@ final def CUSTOM_INSTANCE = "" final def SUPPORT_ACCOUNT_URL = "https://mastodon.social/@Tusky" android { - compileSdk 33 + compileSdk 34 namespace "com.keylesspalace.tusky" defaultConfig { applicationId APP_ID diff --git a/app/src/main/java/com/keylesspalace/tusky/components/preference/PreferencesActivity.kt b/app/src/main/java/com/keylesspalace/tusky/components/preference/PreferencesActivity.kt index 9b79f3ce7b..91d87e9f98 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/preference/PreferencesActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/preference/PreferencesActivity.kt @@ -144,7 +144,9 @@ class PreferencesActivity : super.onSaveInstanceState(outState) } - override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) { + override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) { + sharedPreferences ?: return + key ?: return when (key) { APP_THEME -> { val theme = sharedPreferences.getNonNullString(APP_THEME, AppTheme.DEFAULT.value) diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/ViewVideoFragment.kt b/app/src/main/java/com/keylesspalace/tusky/fragment/ViewVideoFragment.kt index 6cd13c076c..688f0217dc 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/ViewVideoFragment.kt +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/ViewVideoFragment.kt @@ -155,7 +155,7 @@ class ViewVideoFragment : ViewMediaFragment(), Injectable { /** A fling up/down should dismiss the fragment */ override fun onFling( - e1: MotionEvent, + e1: MotionEvent?, e2: MotionEvent, velocityX: Float, velocityY: Float diff --git a/app/src/main/java/com/keylesspalace/tusky/view/ClickableSpanTextView.kt b/app/src/main/java/com/keylesspalace/tusky/view/ClickableSpanTextView.kt index 4caf47c149..0c60a04c44 100644 --- a/app/src/main/java/com/keylesspalace/tusky/view/ClickableSpanTextView.kt +++ b/app/src/main/java/com/keylesspalace/tusky/view/ClickableSpanTextView.kt @@ -347,21 +347,21 @@ class ClickableSpanTextView @JvmOverloads constructor( return firstDiff < secondDiff } - override fun onDraw(canvas: Canvas?) { + override fun onDraw(canvas: Canvas) { super.onDraw(canvas) // Paint span boundaries. Optimised out on release builds, or debug builds where // showSpanBoundaries is false. if (BuildConfig.DEBUG && showSpanBoundaries) { - canvas?.save() + canvas.save() for (entry in delegateRects) { - canvas?.drawRect(entry.key, paddingDebugPaint) + canvas.drawRect(entry.key, paddingDebugPaint) } for (entry in spanRects) { - canvas?.drawRect(entry.key, spanDebugPaint) + canvas.drawRect(entry.key, spanDebugPaint) } - canvas?.restore() + canvas.restore() } } diff --git a/app/src/main/java/com/keylesspalace/tusky/view/GraphView.kt b/app/src/main/java/com/keylesspalace/tusky/view/GraphView.kt index 2aecad08d6..e6a54a2bce 100644 --- a/app/src/main/java/com/keylesspalace/tusky/view/GraphView.kt +++ b/app/src/main/java/com/keylesspalace/tusky/view/GraphView.kt @@ -265,14 +265,14 @@ class GraphView @JvmOverloads constructor( private fun dataSpacing(data: List) = width.toFloat() / max(data.size - 1, 1).toFloat() - override fun onDraw(canvas: Canvas?) { + override fun onDraw(canvas: Canvas) { super.onDraw(canvas) if (primaryLinePath.isEmpty && width > 0) { initializeVertices() } - canvas?.apply { + canvas.apply { drawRect(sizeRect, graphPaint) val pointDistance = dataSpacing(primaryLineData)