From cc125986acb5b8c5c60c82c650062310dbc015ac Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 31 Dec 2019 15:04:20 +0100 Subject: [PATCH] stats layout --- .../androidaps/activities/StatsActivity.kt | 4 +- .../activities/LogSettingActivity.kt | 4 +- .../main/res/layout/activity_logsetting.xml | 75 ++++++++++++++++--- ...{stats_activity.xml => activity_stats.xml} | 41 ++++++---- 4 files changed, 97 insertions(+), 27 deletions(-) rename app/src/main/res/layout/{stats_activity.xml => activity_stats.xml} (73%) diff --git a/app/src/main/java/info/nightscout/androidaps/activities/StatsActivity.kt b/app/src/main/java/info/nightscout/androidaps/activities/StatsActivity.kt index 25864eed1e..cde6a5ce67 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/StatsActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/StatsActivity.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.utils.OKDialog import info.nightscout.androidaps.utils.stats.TddCalculator import info.nightscout.androidaps.utils.stats.TirCalculator import info.nightscout.androidaps.utils.resources.ResourceHelper -import kotlinx.android.synthetic.main.stats_activity.* +import kotlinx.android.synthetic.main.activity_stats.* import javax.inject.Inject class StatsActivity : NoSplashAppCompatActivity() { @@ -18,7 +18,7 @@ class StatsActivity : NoSplashAppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.stats_activity) + setContentView(R.layout.activity_stats) stats_tdds.text = tddCalculator.stats() stats_tir.text = tirCalculator.stats() diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/LogSettingActivity.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/LogSettingActivity.kt index 4f72107f84..c6cdaa4397 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/LogSettingActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/LogSettingActivity.kt @@ -22,6 +22,7 @@ class LogSettingActivity : NoSplashAppCompatActivity() { L.resetToDefaults() createViewsForSettings() } + ok.setOnClickListener { finish() } } private fun createViewsForSettings() { @@ -34,7 +35,8 @@ class LogSettingActivity : NoSplashAppCompatActivity() { } internal inner class LogViewHolder(element: L.LogElement) { - var baseView: LinearLayout = layoutInflater.inflate(R.layout.logsettings_item, null) as LinearLayout + @Suppress("InflateParams") + var baseView = layoutInflater.inflate(R.layout.logsettings_item, null) as LinearLayout init { (baseView.findViewById(R.id.logsettings_description) as TextView).text = element.name diff --git a/app/src/main/res/layout/activity_logsetting.xml b/app/src/main/res/layout/activity_logsetting.xml index feee7bd38a..2f226e726d 100644 --- a/app/src/main/res/layout/activity_logsetting.xml +++ b/app/src/main/res/layout/activity_logsetting.xml @@ -1,21 +1,50 @@ - -