diff --git a/app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt b/app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt index df32da9a79..749913c9a1 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt @@ -1,5 +1,6 @@ package info.nightscout.androidaps.activities +import android.content.res.ColorStateList import android.os.Bundle import android.text.Editable import android.text.TextWatcher @@ -251,6 +252,7 @@ class ProfileHelperActivity : NoSplashAppCompatActivity() { tabSelected = tab typeSelected[tabSelected] = newContent + profilehelper_profiletype_title.setDefaultHintTextColor(ColorStateList.valueOf(resourceHelper.gc(if (tab == 0) R.color.tabBgColorSelected else R.color.examinedProfile))) // show new content profilehelper_profiletype.setText( @@ -281,6 +283,6 @@ class ProfileHelperActivity : NoSplashAppCompatActivity() { private fun setBackgroundColorOnSelected(tab: Int) { profilehelper_menu1.setBackgroundColor(resourceHelper.gc(if (tab == 1) R.color.defaultbackground else R.color.tabBgColorSelected)) - profilehelper_menu2.setBackgroundColor(resourceHelper.gc(if (tab == 0) R.color.defaultbackground else R.color.tabBgColorSelected)) + profilehelper_menu2.setBackgroundColor(resourceHelper.gc(if (tab == 0) R.color.defaultbackground else R.color.examinedProfile)) } } diff --git a/app/src/main/res/layout/activity_profilehelper.xml b/app/src/main/res/layout/activity_profilehelper.xml index f7cee31409..effa56b112 100644 --- a/app/src/main/res/layout/activity_profilehelper.xml +++ b/app/src/main/res/layout/activity_profilehelper.xml @@ -17,7 +17,7 @@ style="@style/ButtonMediumFontStyle" android:layout_width="match_parent" android:layout_height="wrap_content" - android:drawableStart="@drawable/ic_auto_delta" + android:drawableStart="@drawable/ic_compare_profiles" android:text="@string/comapareprofile" /> profileview_units.text = profile1.units profileview_dia.text = HtmlHelper.fromHtml(formatColors("", profile1.dia, profile1.dia, DecimalFormat("0.00"), resourceHelper.gs(R.string.shorthour))) - profileview_activeprofile.text = profileName + val profileNames =profileName!!.split("\n").toTypedArray() + profileview_activeprofile.text = HtmlHelper.fromHtml(formatColors(profileNames[0], profileNames[1])) profileview_date.text = date profileview_ic.text = ics(profile1, profile2) profileview_isf.text = isfs(profile1, profile2) @@ -177,6 +179,13 @@ class ProfileViewerDialog : DaggerDialogFragment() { return s } + private fun formatColors(text1: String, text2: String): String { + var s = "$text1" + s += "
" + s += "$text2" + return s + } + private fun basals(profile1: Profile, profile2: Profile): Spanned { var prev1 = 0.0 var prev2 = 0.0 diff --git a/core/src/main/res/drawable/ic_compare_profiles.xml b/core/src/main/res/drawable/ic_compare_profiles.xml new file mode 100644 index 0000000000..d63aae66b2 --- /dev/null +++ b/core/src/main/res/drawable/ic_compare_profiles.xml @@ -0,0 +1,12 @@ + + + + diff --git a/icons/compare_profiles.svg b/icons/compare_profiles.svg new file mode 100644 index 0000000000..123653d167 --- /dev/null +++ b/icons/compare_profiles.svg @@ -0,0 +1,26 @@ + + + + + + + +