Эх сурвалжийг харах

Add deprecation messages for newly added Kotlin migrations

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 2 жил өмнө
parent
commit
4574024aae

+ 1 - 0
app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLocationMessageViewHolder.kt

@@ -208,6 +208,7 @@ class IncomingLocationMessageViewHolder(incomingView: View, payload: Any) : Mess
         binding.webview.settings?.javaScriptEnabled = true
         binding.webview.settings?.javaScriptEnabled = true
 
 
         binding.webview.webViewClient = object : WebViewClient() {
         binding.webview.webViewClient = object : WebViewClient() {
+            @Deprecated("Use shouldOverrideUrlLoading(WebView view, WebResourceRequest request)")
             override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
             override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
                 return if (url != null && UriUtils.hasHttpProtocollPrefixed(url)
                 return if (url != null && UriUtils.hasHttpProtocollPrefixed(url)
                 ) {
                 ) {

+ 1 - 0
app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLocationMessageViewHolder.kt

@@ -161,6 +161,7 @@ class OutcomingLocationMessageViewHolder(incomingView: View) : MessageHolders
         binding.webview.settings?.javaScriptEnabled = true
         binding.webview.settings?.javaScriptEnabled = true
 
 
         binding.webview.webViewClient = object : WebViewClient() {
         binding.webview.webViewClient = object : WebViewClient() {
+            @Deprecated("Use shouldOverrideUrlLoading(WebView view, WebResourceRequest request)")
             override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
             override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
                 return if (url != null && UriUtils.hasHttpProtocollPrefixed(url)
                 return if (url != null && UriUtils.hasHttpProtocollPrefixed(url)
                 ) {
                 ) {

+ 17 - 0
app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt

@@ -213,6 +213,23 @@ import java.util.Locale
 import java.util.Objects
 import java.util.Objects
 import java.util.concurrent.ExecutionException
 import java.util.concurrent.ExecutionException
 import javax.inject.Inject
 import javax.inject.Inject
+import kotlin.collections.ArrayList
+import kotlin.collections.HashMap
+import kotlin.collections.LinkedHashMap
+import kotlin.collections.List
+import kotlin.collections.MutableList
+import kotlin.collections.MutableMap
+import kotlin.collections.chunked
+import kotlin.collections.indexOfFirst
+import kotlin.collections.indices
+import kotlin.collections.isNotEmpty
+import kotlin.collections.iterator
+import kotlin.collections.map
+import kotlin.collections.set
+import kotlin.collections.toList
+import kotlin.collections.toMap
+import kotlin.collections.toMutableMap
+import kotlin.collections.toTypedArray
 import kotlin.math.roundToInt
 import kotlin.math.roundToInt
 
 
 @AutoInjector(NextcloudTalkApplication::class)
 @AutoInjector(NextcloudTalkApplication::class)

+ 1 - 0
app/src/main/java/com/nextcloud/talk/controllers/LocationPickerController.kt

@@ -529,6 +529,7 @@ class LocationPickerController(args: Bundle) :
         myLocation = GeoPoint(location)
         myLocation = GeoPoint(location)
     }
     }
 
 
+    @Deprecated("Deprecated. This callback will never be invoked on Android Q and above.")
     override fun onStatusChanged(provider: String?, status: Int, extras: Bundle?) {
     override fun onStatusChanged(provider: String?, status: Int, extras: Bundle?) {
         // empty
         // empty
     }
     }

+ 2 - 0
app/src/main/java/com/nextcloud/talk/controllers/WebViewLoginController.kt

@@ -167,6 +167,7 @@ class WebViewLoginController(args: Bundle? = null) : BaseController(
                 webViewFidoBridge?.delegateOnPageStarted(view, url, favicon)
                 webViewFidoBridge?.delegateOnPageStarted(view, url, favicon)
             }
             }
 
 
+            @Deprecated("Use shouldOverrideUrlLoading(WebView view, WebResourceRequest request)")
             override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean {
             override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean {
                 if (url.startsWith(assembledPrefix!!)) {
                 if (url.startsWith(assembledPrefix!!)) {
                     parseAndLoginFromWebView(url)
                     parseAndLoginFromWebView(url)
@@ -302,6 +303,7 @@ class WebViewLoginController(args: Bundle? = null) : BaseController(
                 }
                 }
             }
             }
 
 
+            @Deprecated("Deprecated in super implementation")
             override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
             override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
                 super.onReceivedError(view, errorCode, description, failingUrl)
                 super.onReceivedError(view, errorCode, description, failingUrl)
             }
             }