From 22ff4f581bbd5cfe7337ffdb822d719f615b50cb Mon Sep 17 00:00:00 2001 From: Nazar-Kutz Date: Mon, 5 Oct 2020 21:43:08 +0300 Subject: [PATCH] Fix LogcatActivity after review --- OsmAnd-telegram/AndroidManifest.xml | 2 +- .../res/layout/item_description_long.xml | 2 +- OsmAnd-telegram/res/values/dimens.xml | 3 ++- .../osmand/telegram/TelegramApplication.kt | 2 +- .../telegram/ui/SettingsDialogFragment.kt | 1 - .../ui}/TrackerLogcatActivity.kt | 23 ++++++++++--------- 6 files changed, 17 insertions(+), 16 deletions(-) rename OsmAnd-telegram/src/net/osmand/{ => telegram/ui}/TrackerLogcatActivity.kt (95%) diff --git a/OsmAnd-telegram/AndroidManifest.xml b/OsmAnd-telegram/AndroidManifest.xml index 2146f9b89a..73e2e856ca 100644 --- a/OsmAnd-telegram/AndroidManifest.xml +++ b/OsmAnd-telegram/AndroidManifest.xml @@ -20,7 +20,7 @@ android:screenOrientation="unspecified" android:supportsRtl="true" android:theme="@style/AppTheme"> - + 89dp 48dp - 44dp + 44dp + 42dp 56dp 48dp diff --git a/OsmAnd-telegram/src/net/osmand/telegram/TelegramApplication.kt b/OsmAnd-telegram/src/net/osmand/telegram/TelegramApplication.kt index 97652148b2..b6927dc610 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/TelegramApplication.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/TelegramApplication.kt @@ -9,7 +9,7 @@ import android.net.NetworkInfo import android.os.Build import android.os.Handler import net.osmand.PlatformUtil -import net.osmand.TrackerLogcatActivity +import net.osmand.telegram.ui.TrackerLogcatActivity import net.osmand.telegram.helpers.* import net.osmand.telegram.helpers.OsmandAidlHelper.OsmandHelperListener import net.osmand.telegram.helpers.OsmandAidlHelper.UpdatesListener diff --git a/OsmAnd-telegram/src/net/osmand/telegram/ui/SettingsDialogFragment.kt b/OsmAnd-telegram/src/net/osmand/telegram/ui/SettingsDialogFragment.kt index 2e8793bcb3..447275815e 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/ui/SettingsDialogFragment.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/ui/SettingsDialogFragment.kt @@ -14,7 +14,6 @@ import android.widget.* import androidx.appcompat.widget.ListPopupWindow import androidx.appcompat.widget.Toolbar import androidx.core.content.ContextCompat -import net.osmand.TrackerLogcatActivity import net.osmand.telegram.R import net.osmand.telegram.TelegramSettings import net.osmand.telegram.TelegramSettings.ListPreference diff --git a/OsmAnd-telegram/src/net/osmand/TrackerLogcatActivity.kt b/OsmAnd-telegram/src/net/osmand/telegram/ui/TrackerLogcatActivity.kt similarity index 95% rename from OsmAnd-telegram/src/net/osmand/TrackerLogcatActivity.kt rename to OsmAnd-telegram/src/net/osmand/telegram/ui/TrackerLogcatActivity.kt index 5ed551636a..ee62ab4407 100644 --- a/OsmAnd-telegram/src/net/osmand/TrackerLogcatActivity.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/ui/TrackerLogcatActivity.kt @@ -1,4 +1,4 @@ -package net.osmand +package net.osmand.telegram.ui import android.os.AsyncTask import android.os.Bundle @@ -9,33 +9,26 @@ import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.widget.Toolbar import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import net.osmand.PlatformUtil import net.osmand.telegram.R import net.osmand.telegram.TelegramApplication import java.io.* import java.lang.ref.WeakReference import java.util.* -private const val LOGCAT_PATH = "logcat.log" -private const val MAX_BUFFER_LOG = 10000 -private const val SHARE_ID = 0 -private const val LEVEL_ID = 1 -private val log = PlatformUtil.getLog(TrackerLogcatActivity::class.java) - class TrackerLogcatActivity : AppCompatActivity() { private var logcatAsyncTask: LogcatAsyncTask? = null private val logs: MutableList = ArrayList() private var adapter: LogcatAdapter? = null private val LEVELS = arrayOf("D", "I", "W", "E") private var filterLevel = 1 - private var recyclerView: RecyclerView? = null + private lateinit var recyclerView: RecyclerView override fun onCreate(savedInstanceState: Bundle?) { val app: TelegramApplication = getApplication() as TelegramApplication super.onCreate(savedInstanceState) setContentView(R.layout.activity_tracker_logcat) - log.debug("text to test") - val toolbar = findViewById(R.id.toolbar).apply { navigationIcon = app.uiUtils.getThemedIcon(R.drawable.ic_arrow_back) setNavigationOnClickListener { onBackPressed() } @@ -44,7 +37,7 @@ class TrackerLogcatActivity : AppCompatActivity() { setupIntermediateProgressBar() adapter = LogcatAdapter() - recyclerView = findViewById(R.id.recycler_view) as RecyclerView? + recyclerView = findViewById(R.id.recycler_view) as RecyclerView recyclerView!!.layoutManager = LinearLayoutManager(this) recyclerView!!.adapter = adapter } @@ -267,4 +260,12 @@ class TrackerLogcatActivity : AppCompatActivity() { this.filterLevel = filterLevel } } + + companion object { + private const val LOGCAT_PATH = "logcat.log" + private const val MAX_BUFFER_LOG = 10000 + private const val SHARE_ID = 0 + private const val LEVEL_ID = 1 + private val log = PlatformUtil.getLog(TrackerLogcatActivity::class.java) + } }