Merge pull request #1503 from Andries-Smit/fix/bg-color-dialog
Fix backgound color dialog
This commit is contained in:
commit
79aee31279
10 changed files with 24 additions and 13 deletions
|
@ -10,7 +10,7 @@
|
|||
android:scaleX="0.8"
|
||||
android:scaleY="0.8">
|
||||
<path
|
||||
android:fillColor="#000"
|
||||
android:fillColor="?attr/colorControlNormal"
|
||||
android:pathData="M15,20A1,1 0 0,0 16,19V4H8A1,1 0 0,0 7,5V16H5V5A3,3 0 0,1 8,2H19A3,3 0 0,1 22,5V6H20V5A1,1 0 0,0 19,4A1,1 0 0,0 18,5V9L18,19A3,3 0 0,1 15,22H5A3,3 0 0,1 2,19V18H13A2,2 0 0,0 15,20M9,6H14V8H9V6M9,10H14V12H9V10M9,14H14V16H9V14Z" />
|
||||
</group>
|
||||
</vector>
|
|
@ -30,7 +30,7 @@
|
|||
android:contentDescription="@string/system_automation"
|
||||
android:scaleX="0.9"
|
||||
android:scaleY="0.9"
|
||||
android:src="@drawable/ic_notif_aaps"
|
||||
android:src="@drawable/ic_aaps"
|
||||
app:layout_constraintBottom_toTopOf="@+id/iconLayout"
|
||||
app:layout_constraintEnd_toStartOf="@+id/eventTitle"
|
||||
app:layout_constraintStart_toEndOf="@+id/enabled"
|
||||
|
|
|
@ -8,7 +8,6 @@ import android.widget.TextView
|
|||
import androidx.annotation.DrawableRes
|
||||
import androidx.annotation.LayoutRes
|
||||
import androidx.annotation.StyleRes
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.appcompat.view.ContextThemeWrapper
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import info.nightscout.androidaps.core.R
|
||||
|
@ -22,7 +21,7 @@ object AlertDialogHelper {
|
|||
fun buildCustomTitle(context: Context, title: String,
|
||||
@DrawableRes iconResource: Int = R.drawable.ic_check_while_48dp,
|
||||
@StyleRes themeResId: Int = R.style.AppTheme,
|
||||
@LayoutRes layoutResource: Int = R.layout.dialog_alert_custom): View? {
|
||||
@LayoutRes layoutResource: Int = R.layout.dialog_alert_custom_title): View? {
|
||||
val titleLayout = LayoutInflater.from(ContextThemeWrapper(context, themeResId)).inflate(layoutResource, null)
|
||||
(titleLayout.findViewById<View>(R.id.alertdialog_title) as TextView).text = title
|
||||
(titleLayout.findViewById<View>(R.id.alertdialog_icon) as ImageView).setImageResource(iconResource)
|
||||
|
|
|
@ -101,7 +101,7 @@ class UserEntryPresentationHelper @Inject constructor(
|
|||
Sources.Stats -> R.drawable.ic_cp_stats
|
||||
Sources.ConfigBuilder -> R.drawable.ic_cogs
|
||||
Sources.Overview -> R.drawable.ic_home
|
||||
Sources.Aaps -> R.drawable.ic_notif_aaps
|
||||
Sources.Aaps -> R.drawable.ic_aaps
|
||||
Sources.Unknown -> R.drawable.ic_generic_icon
|
||||
}
|
||||
|
||||
|
|
12
core/src/main/res/drawable/ic_aaps.xml
Normal file
12
core/src/main/res/drawable/ic_aaps.xml
Normal file
|
@ -0,0 +1,12 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M22.107,7.852c-1.11,-2.694 -3.265,-4.849 -5.959,-5.959C14.869,1.365 13.468,1.074 12,1.074c-1.468,0 -2.869,0.292 -4.148,0.819c-2.694,1.11 -4.849,3.265 -5.959,5.959C1.365,9.131 1.074,10.532 1.074,12c0,1.468 0.292,2.869 0.819,4.148c1.11,2.694 3.265,4.849 5.959,5.959c1.28,0.527 2.681,0.819 4.148,0.819c1.468,0 2.869,-0.292 4.148,-0.819c2.694,-1.11 4.849,-3.265 5.959,-5.959c0.527,-1.28 0.819,-2.681 0.819,-4.148C22.926,10.532 22.635,9.131 22.107,7.852zM18.837,7.97c-0.694,-1.216 -1.645,-2.172 -2.852,-2.866c-0.527,-0.303 -1.079,-0.539 -1.658,-0.71c-0.638,-0.188 -1.274,0.312 -1.274,0.977v0c0,0.449 0.3,0.831 0.727,0.969c0.386,0.125 0.755,0.293 1.108,0.503c0.874,0.523 1.564,1.236 2.068,2.139c0.504,0.904 0.756,1.916 0.756,3.037c0,1.122 -0.252,2.134 -0.756,3.037c-0.504,0.903 -1.193,1.611 -2.068,2.125c-0.236,0.138 -0.481,0.253 -0.732,0.354v-4.045c0,-0.32 -0.104,-0.584 -0.311,-0.791c-0.208,-0.207 -0.471,-0.311 -0.792,-0.311c-0.302,0 -0.561,0.104 -0.778,0.311c-0.217,0.208 -0.325,0.471 -0.325,0.791v5.246c0,0.302 0.108,0.561 0.325,0.778c0.217,0.217 0.476,0.325 0.778,0.325c0.171,0 0.325,-0.033 0.464,-0.096c0.558,-0.131 1.091,-0.322 1.598,-0.581c1.027,-0.523 1.872,-1.24 2.538,-2.153v1.711c0,0.174 0.031,0.33 0.092,0.468c-1.576,1.262 -3.574,2.018 -5.745,2.018c-5.077,0 -9.208,-4.131 -9.208,-9.208S6.923,2.792 12,2.792S21.208,6.923 21.208,12c0,1.742 -0.486,3.372 -1.33,4.762V12.02C19.878,10.537 19.531,9.187 18.837,7.97z"
|
||||
android:fillColor="?attr/colorControlNormal"/>
|
||||
<path
|
||||
android:pathData="M10.847,4.131c-0.135,0 -0.26,0.024 -0.378,0.066C9.559,4.353 8.705,4.649 7.914,5.104C6.707,5.798 5.756,6.754 5.062,7.97c-0.694,1.217 -1.041,2.567 -1.041,4.05c0,1.483 0.337,2.829 1.012,4.035c0.675,1.208 1.597,2.158 2.766,2.852c0.545,0.324 1.12,0.571 1.725,0.742c0.661,0.188 1.321,-0.302 1.321,-0.989c0,-0.459 -0.309,-0.849 -0.746,-0.989c-0.383,-0.122 -0.751,-0.285 -1.103,-0.489c-0.884,-0.514 -1.578,-1.222 -2.082,-2.125C6.412,14.154 6.16,13.142 6.16,12.02c0,-1.122 0.252,-2.134 0.756,-3.037C7.42,8.08 8.114,7.367 8.998,6.844c0.241,-0.142 0.491,-0.26 0.746,-0.363v3.999c0,0.302 0.108,0.561 0.325,0.778c0.217,0.217 0.476,0.325 0.778,0.325c0.32,0 0.584,-0.108 0.792,-0.325c0.207,-0.216 0.311,-0.475 0.311,-0.778V5.233c0,-0.32 -0.104,-0.584 -0.311,-0.791C11.431,4.235 11.167,4.131 10.847,4.131z"
|
||||
android:fillColor="?attr/colorControlNormal"/>
|
||||
</vector>
|
|
@ -1,5 +1,6 @@
|
|||
<vector android:height="48dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="48dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z"/>
|
||||
<path android:fillColor="?attr/colorControlNormal"
|
||||
android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z"/>
|
||||
</vector>
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M22.107,7.852c-1.11,-2.694 -3.265,-4.849 -5.959,-5.959C14.869,1.365 13.468,1.074 12,1.074c-1.468,0 -2.869,0.292 -4.148,0.819c-2.694,1.11 -4.849,3.265 -5.959,5.959C1.365,9.131 1.074,10.532 1.074,12c0,1.468 0.292,2.869 0.819,4.148c1.11,2.694 3.265,4.849 5.959,5.959c1.28,0.527 2.681,0.819 4.148,0.819c1.468,0 2.869,-0.292 4.148,-0.819c2.694,-1.11 4.849,-3.265 5.959,-5.959c0.527,-1.28 0.819,-2.681 0.819,-4.148C22.926,10.532 22.635,9.131 22.107,7.852zM18.837,7.97c-0.694,-1.216 -1.645,-2.172 -2.852,-2.866c-0.527,-0.303 -1.079,-0.539 -1.658,-0.71c-0.638,-0.188 -1.274,0.312 -1.274,0.977v0c0,0.449 0.3,0.831 0.727,0.969c0.386,0.125 0.755,0.293 1.108,0.503c0.874,0.523 1.564,1.236 2.068,2.139c0.504,0.904 0.756,1.916 0.756,3.037c0,1.122 -0.252,2.134 -0.756,3.037c-0.504,0.903 -1.193,1.611 -2.068,2.125c-0.236,0.138 -0.481,0.253 -0.732,0.354v-4.045c0,-0.32 -0.104,-0.584 -0.311,-0.791c-0.208,-0.207 -0.471,-0.311 -0.792,-0.311c-0.302,0 -0.561,0.104 -0.778,0.311c-0.217,0.208 -0.325,0.471 -0.325,0.791v5.246c0,0.302 0.108,0.561 0.325,0.778c0.217,0.217 0.476,0.325 0.778,0.325c0.171,0 0.325,-0.033 0.464,-0.096c0.558,-0.131 1.091,-0.322 1.598,-0.581c1.027,-0.523 1.872,-1.24 2.538,-2.153v1.711c0,0.174 0.031,0.33 0.092,0.468c-1.576,1.262 -3.574,2.018 -5.745,2.018c-5.077,0 -9.208,-4.131 -9.208,-9.208S6.923,2.792 12,2.792S21.208,6.923 21.208,12c0,1.742 -0.486,3.372 -1.33,4.762V12.02C19.878,10.537 19.531,9.187 18.837,7.97z"
|
||||
android:fillColor="?attr/colorControlNormal"/>
|
||||
android:fillColor="@color/white"/>
|
||||
<path
|
||||
android:pathData="M10.847,4.131c-0.135,0 -0.26,0.024 -0.378,0.066C9.559,4.353 8.705,4.649 7.914,5.104C6.707,5.798 5.756,6.754 5.062,7.97c-0.694,1.217 -1.041,2.567 -1.041,4.05c0,1.483 0.337,2.829 1.012,4.035c0.675,1.208 1.597,2.158 2.766,2.852c0.545,0.324 1.12,0.571 1.725,0.742c0.661,0.188 1.321,-0.302 1.321,-0.989c0,-0.459 -0.309,-0.849 -0.746,-0.989c-0.383,-0.122 -0.751,-0.285 -1.103,-0.489c-0.884,-0.514 -1.578,-1.222 -2.082,-2.125C6.412,14.154 6.16,13.142 6.16,12.02c0,-1.122 0.252,-2.134 0.756,-3.037C7.42,8.08 8.114,7.367 8.998,6.844c0.241,-0.142 0.491,-0.26 0.746,-0.363v3.999c0,0.302 0.108,0.561 0.325,0.778c0.217,0.217 0.476,0.325 0.778,0.325c0.32,0 0.584,-0.108 0.792,-0.325c0.207,-0.216 0.311,-0.475 0.311,-0.778V5.233c0,-0.32 -0.104,-0.584 -0.311,-0.791C11.431,4.235 11.167,4.131 10.847,4.131z"
|
||||
android:fillColor="?attr/colorControlNormal"/>
|
||||
android:fillColor="@color/white"/>
|
||||
</vector>
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
style="@style/StyleDialog"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
style="@style/StyleDialogHeader"
|
|
@ -8,7 +8,7 @@
|
|||
<item name="dialogTitleBackground">@color/dialog_title_background</item>
|
||||
<item name="dialogTitleColor">@color/dialog_title_color</item>
|
||||
<item name="dialogTitleIconTint">@color/dialog_title_icon_tint</item>
|
||||
<!-- New MaterialComponents attributes. -->dialogTitleBackground
|
||||
<!-- New MaterialComponents attributes. -->
|
||||
<item name="colorSecondary">@color/secondaryColorDefault</item>
|
||||
<item name="colorPrimaryVariant">@color/primaryLightColorDefault</item>
|
||||
<item name="colorSecondaryVariant">@color/secondaryLightColorDefault</item>
|
||||
|
@ -205,7 +205,7 @@
|
|||
|
||||
<!-- Alert Dialogs -->
|
||||
<style name="DialogTheme" parent="ThemeOverlay.MaterialComponents.Dialog.Alert">
|
||||
<item name="backgroundColor">@color/background_dark</item>
|
||||
<item name="colorSurface">#212121</item> <!-- workaround; color compensated elevation -->
|
||||
<item name="buttonBarNegativeButtonStyle">@style/DialogOkCancelButtonStyle</item>
|
||||
<item name="buttonBarPositiveButtonStyle">@style/DialogOkCancelButtonStyle</item>
|
||||
<item name="buttonBarNeutralButtonStyle">@style/DialogOkCancelButtonStyle</item>
|
||||
|
|
|
@ -212,7 +212,6 @@
|
|||
|
||||
<!-- Alert Dialogs -->
|
||||
<style name="DialogTheme" parent="ThemeOverlay.MaterialComponents.Dialog.Alert">
|
||||
<item name="backgroundColor">@color/dialog_title_background</item>
|
||||
<item name="buttonBarNegativeButtonStyle">@style/DialogOkCancelButtonStyle</item>
|
||||
<item name="buttonBarPositiveButtonStyle">@style/DialogOkCancelButtonStyle</item>
|
||||
<item name="dialogTitleBackground">@color/dialog_title_background</item>
|
||||
|
|
Loading…
Reference in a new issue