aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2020-09-16 18:54:00 +0530
committerJason A. Donenfeld <Jason@zx2c4.com>2020-09-16 18:01:06 +0200
commitdcd596907a172e071c5ae7f10b6bcd07abf6ca9b (patch)
treee5f0e134902364e837d46cbc58cb081eafec4e9b
parentLogViewerActivity: destroy process when coroutine scope is cancelled (diff)
downloadwireguard-android-dcd596907a172e071c5ae7f10b6bcd07abf6ca9b.tar.xz
wireguard-android-dcd596907a172e071c5ae7f10b6bcd07abf6ca9b.zip
ui: resolve getColor deprecation in LogViewerActivity
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
-rw-r--r--ui/src/main/java/com/wireguard/android/activity/LogViewerActivity.kt20
1 files changed, 6 insertions, 14 deletions
diff --git a/ui/src/main/java/com/wireguard/android/activity/LogViewerActivity.kt b/ui/src/main/java/com/wireguard/android/activity/LogViewerActivity.kt
index 7ef9222c..da1618f3 100644
--- a/ui/src/main/java/com/wireguard/android/activity/LogViewerActivity.kt
+++ b/ui/src/main/java/com/wireguard/android/activity/LogViewerActivity.kt
@@ -26,6 +26,7 @@ import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.ShareCompat
+import androidx.core.content.res.ResourcesCompat
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager
@@ -71,20 +72,15 @@ class LogViewerActivity : AppCompatActivity() {
yearFormatter.format(Date())
}
- @Suppress("Deprecation")
- private val defaultColor by lazy { resources.getColor(R.color.primary_text_color) }
+ private val defaultColor by lazy { ResourcesCompat.getColor(resources, R.color.primary_text_color, theme) }
- @Suppress("Deprecation")
- private val debugColor by lazy { resources.getColor(R.color.debug_tag_color) }
+ private val debugColor by lazy { ResourcesCompat.getColor(resources, R.color.debug_tag_color, theme) }
- @Suppress("Deprecation")
- private val errorColor by lazy { resources.getColor(R.color.error_tag_color) }
+ private val errorColor by lazy { ResourcesCompat.getColor(resources, R.color.error_tag_color, theme) }
- @Suppress("Deprecation")
- private val infoColor by lazy { resources.getColor(R.color.info_tag_color) }
+ private val infoColor by lazy { ResourcesCompat.getColor(resources, R.color.info_tag_color, theme) }
- @Suppress("Deprecation")
- private val warningColor by lazy { resources.getColor(R.color.warning_tag_color) }
+ private val warningColor by lazy { ResourcesCompat.getColor(resources, R.color.warning_tag_color, theme) }
private var lastUri: Uri? = null
@@ -131,10 +127,6 @@ class LogViewerActivity : AppCompatActivity() {
}
}
- override fun onDestroy() {
- super.onDestroy()
- }
-
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (requestCode == SHARE_ACTIVITY_REQUEST) {
revokeLastUri()