Skip to content

Commit

Permalink
dark and light mode for chromium dialog (uplift to 1.47.x) (#16721)
Browse files Browse the repository at this point in the history
  • Loading branch information
sujitacharya2005 authored Jan 19, 2023
1 parent b39ff0a commit 4cfe575
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 10 deletions.
2 changes: 2 additions & 0 deletions android/brave_java_resources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,9 @@ brave_java_resources = [
"java/res/drawable/modern_toolbar_background_grey_middle_segment.xml",
"java/res/drawable/monthly_selector.xml",
"java/res/drawable/news_button_bg.xml",
"java/res/drawable/notification_button_rounded_bg.xml",
"java/res/drawable/notification_on_button_background.xml",
"java/res/drawable/notification_rationale_dialog_background.xml",
"java/res/drawable/orange_rounded_button.xml",
"java/res/drawable/progress_indeterminate.xml",
"java/res/drawable/progress_indeterminate_orange.xml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
android:pathData="M0,0h200v164h-200z"/>
<path
android:pathData="M193.81,115.68C193.73,115.7 193.65,115.72 193.58,115.72C193.26,115.72 192.96,115.51 192.85,115.19C192.72,114.79 192.94,114.36 193.34,114.23C195.29,113.6 196.6,111.76 196.6,109.65C196.6,107.56 195.26,105.67 193.33,105.05C192.93,104.92 192.71,104.5 192.84,104.1C192.97,103.7 193.39,103.48 193.79,103.61C196.38,104.44 198.13,106.86 198.13,109.65C198.13,112.42 196.39,114.84 193.81,115.68ZM195.12,109.65C195.12,111.32 193.76,112.68 192.08,112.68C191.66,112.68 191.32,112.34 191.32,111.92C191.32,111.5 191.66,111.16 192.08,111.16C192.92,111.16 193.6,110.48 193.6,109.65C193.6,108.81 192.92,108.13 192.08,108.13C191.66,108.13 191.32,107.79 191.32,107.37C191.32,106.95 191.66,106.61 192.08,106.61C193.76,106.61 195.12,107.97 195.12,109.65ZM190.11,117.93C190.01,117.97 189.9,118 189.79,118C189.61,118 189.44,117.93 189.3,117.81L184.19,113.44H181.43C180.59,113.44 179.91,112.76 179.91,111.92V107.37C179.91,106.53 180.59,105.85 181.43,105.85H184.19L189.3,101.48C189.52,101.29 189.84,101.24 190.11,101.37C190.38,101.49 190.55,101.76 190.55,102.06V117.24C190.55,117.53 190.38,117.8 190.11,117.93ZM189.03,103.71L184.96,107.19C184.94,107.21 184.9,107.22 184.87,107.24C184.83,107.27 184.78,107.3 184.73,107.32C184.68,107.33 184.63,107.34 184.58,107.35C184.54,107.35 184.51,107.37 184.47,107.37H181.43V111.92H184.47C184.51,111.92 184.54,111.94 184.58,111.95C184.63,111.95 184.68,111.96 184.73,111.98C184.78,112 184.83,112.03 184.87,112.05C184.9,112.07 184.94,112.08 184.96,112.11L189.03,115.59V103.71Z"
android:fillColor="#D1E8EB"
android:fillColor="@color/notification_volume_icon_color"
android:fillType="evenOdd"/>
<path
android:strokeWidth="1"
Expand All @@ -33,28 +33,28 @@
android:fillColor="#F4F6F8"/>
<path
android:pathData="M115.32,16.75V25.58C115.32,25.96 115.1,26.31 114.76,26.48C114.62,26.55 114.46,26.58 114.31,26.58C114.1,26.58 113.89,26.51 113.71,26.38L110.28,23.81L106.86,26.38C106.56,26.61 106.15,26.65 105.81,26.48C105.46,26.31 105.25,25.96 105.25,25.58V16.75C103.41,15.27 102.23,13.01 102.23,10.47C102.23,6.03 105.84,2.42 110.28,2.42C114.72,2.42 118.34,6.03 118.34,10.47C118.34,13.01 117.16,15.27 115.32,16.75ZM107.26,23.56L109.68,21.75C110.04,21.48 110.53,21.48 110.89,21.75L113.31,23.56V17.93C112.37,18.31 111.35,18.53 110.28,18.53C109.21,18.53 108.2,18.31 107.26,17.93V23.56ZM110.28,4.43C106.95,4.43 104.24,7.14 104.24,10.47C104.24,13.8 106.95,16.51 110.28,16.51C113.62,16.51 116.32,13.8 116.32,10.47C116.32,7.14 113.62,4.43 110.28,4.43ZM111.39,14.5H109.38C108.82,14.5 108.37,14.05 108.37,13.49C108.37,12.94 108.82,12.49 109.38,12.49V9.88L109.08,10.18C108.69,10.57 108.05,10.57 107.66,10.18C107.26,9.78 107.26,9.15 107.66,8.75L109.67,6.74C109.96,6.45 110.39,6.37 110.77,6.52C111.15,6.68 111.29,7.08 111.29,7.49V12.49H111.39C111.95,12.49 112.4,12.94 112.4,13.49C112.4,14.05 111.95,14.5 111.39,14.5Z"
android:fillColor="#C2A5D1"
android:fillColor="@color/notification_badge_icon_color"
android:fillType="evenOdd"/>
<path
android:pathData="M174.54,50.11L168.63,40.71V35.58L179.22,53.23L174.54,50.11ZM161.55,52.19H173.18L176.95,54.71H157.15L161.55,52.19ZM166.14,40.71L160.25,50.07L155.98,52.51L166.14,35.58V40.71ZM167.38,43.4L171.35,49.71H163.42L167.38,43.4ZM183.37,55.31L168.45,30.45C168.41,30.39 168.36,30.33 168.31,30.28C168.08,30.02 167.76,29.85 167.38,29.85C167.01,29.85 166.69,30.02 166.46,30.28C166.41,30.33 166.36,30.38 166.32,30.45L151.4,55.31C151.34,55.41 151.3,55.51 151.27,55.62C151.27,55.63 151.27,55.64 151.26,55.64C151.23,55.77 151.23,55.91 151.24,56.04C151.24,56.08 151.24,56.11 151.25,56.15C151.27,56.29 151.31,56.43 151.38,56.56C151.39,56.56 151.39,56.56 151.39,56.57C151.39,56.57 151.39,56.57 151.39,56.57C151.41,56.6 151.44,56.63 151.46,56.66C151.5,56.72 151.54,56.78 151.59,56.83C151.63,56.88 151.69,56.91 151.74,56.95C151.78,56.98 151.81,57.01 151.85,57.03C151.9,57.06 151.96,57.08 152.03,57.1C152.07,57.12 152.1,57.14 152.14,57.15C152.24,57.18 152.33,57.19 152.43,57.19C152.44,57.19 152.45,57.2 152.47,57.2H182.3C182.75,57.2 183.16,56.95 183.38,56.56C183.6,56.17 183.6,55.7 183.37,55.31V55.31Z"
android:fillColor="#F195A4"
android:fillColor="@color/notification_bat2_icon_color"
android:fillType="evenOdd"/>
<path
android:pathData="M22.22,32.8L19.01,27.71V24.93L24.75,34.49L22.22,32.8ZM15.18,33.93H21.48L23.52,35.29H12.8L15.18,33.93ZM17.67,27.71L14.48,32.78L12.16,34.1L17.67,24.93V27.71ZM18.34,29.17L20.49,32.58H16.19L18.34,29.17ZM27,35.62L18.92,22.15C18.9,22.12 18.87,22.09 18.84,22.06C18.72,21.92 18.54,21.82 18.34,21.82C18.14,21.82 17.96,21.92 17.84,22.06C17.81,22.09 17.78,22.12 17.76,22.15L9.68,35.62C9.65,35.67 9.63,35.73 9.61,35.78C9.61,35.79 9.61,35.79 9.61,35.8C9.59,35.87 9.59,35.94 9.59,36.01C9.6,36.03 9.6,36.05 9.6,36.07C9.61,36.15 9.63,36.22 9.67,36.29C9.68,36.29 9.68,36.29 9.68,36.3C9.68,36.3 9.68,36.3 9.68,36.3C9.69,36.32 9.7,36.33 9.72,36.35C9.74,36.38 9.76,36.41 9.78,36.44C9.81,36.46 9.84,36.48 9.87,36.5C9.89,36.52 9.9,36.53 9.92,36.55C9.96,36.56 9.99,36.57 10.02,36.59C10.04,36.59 10.06,36.61 10.09,36.61C10.14,36.63 10.19,36.63 10.24,36.63C10.25,36.63 10.25,36.64 10.26,36.64H26.42C26.66,36.64 26.88,36.51 27,36.29C27.12,36.08 27.12,35.82 27,35.62Z"
android:fillColor="#FEDED6"
android:fillColor="@color/notification_bat1_icon_color"
android:fillType="evenOdd"/>
<path
android:pathData="M153.55,155.51L149.89,149.69V146.52L156.45,157.44L153.55,155.51ZM145.51,156.8H152.71L155.04,158.36H142.79L145.51,156.8ZM148.35,149.69L144.71,155.49L142.06,157L148.35,146.52V149.69ZM149.12,151.36L151.58,155.26H146.67L149.12,151.36ZM159.01,158.73L149.78,143.34C149.76,143.3 149.73,143.27 149.7,143.24C149.55,143.08 149.35,142.97 149.12,142.97C148.89,142.97 148.69,143.08 148.55,143.24C148.52,143.27 148.49,143.3 148.46,143.34L139.23,158.73C139.19,158.79 139.17,158.86 139.15,158.92C139.15,158.93 139.15,158.93 139.15,158.94C139.13,159.02 139.12,159.1 139.13,159.18C139.13,159.21 139.13,159.23 139.14,159.25C139.15,159.34 139.17,159.43 139.22,159.51C139.22,159.51 139.22,159.51 139.22,159.51C139.22,159.51 139.22,159.51 139.22,159.51C139.23,159.53 139.25,159.55 139.27,159.57C139.29,159.6 139.32,159.64 139.35,159.67C139.37,159.7 139.41,159.72 139.44,159.75C139.46,159.76 139.48,159.78 139.5,159.79C139.54,159.81 139.58,159.83 139.62,159.84C139.64,159.85 139.66,159.86 139.69,159.87C139.75,159.88 139.81,159.89 139.87,159.89C139.88,159.89 139.88,159.9 139.89,159.9H158.35C158.63,159.9 158.89,159.75 159.02,159.51C159.16,159.26 159.16,158.97 159.01,158.73Z"
android:fillColor="#E2E2FC"
android:fillColor="@color/notification_bat3_icon_color"
android:fillType="evenOdd"/>
<path
android:pathData="M37.26,104.17C36.87,104.17 36.5,104.09 36.16,103.97L28.66,109.86C28.75,110.16 28.81,110.47 28.81,110.8C28.81,112.62 27.3,114.11 25.44,114.11C23.57,114.11 22.06,112.62 22.06,110.8C22.06,110.78 22.06,110.76 22.06,110.74L16.04,108.12C15.43,108.74 14.57,109.14 13.62,109.14C13.46,109.14 13.3,109.11 13.15,109.09L6.62,116.21C6.77,116.58 6.86,116.99 6.86,117.42C6.86,119.25 5.34,120.73 3.48,120.73C1.62,120.73 0.11,119.25 0.11,117.42C0.11,115.59 1.62,114.11 3.48,114.11C3.65,114.11 3.8,114.13 3.96,114.15L10.48,107.05C10.33,106.67 10.24,106.26 10.24,105.83C10.24,104 11.75,102.51 13.62,102.51C15.12,102.51 16.39,103.49 16.82,104.83L23.84,107.89C24.32,107.64 24.86,107.48 25.44,107.48C25.69,107.48 25.93,107.51 26.17,107.57L33.94,101.47C33.9,101.27 33.88,101.07 33.88,100.86C33.88,99.03 35.39,97.54 37.26,97.54C39.12,97.54 40.63,99.03 40.63,100.86C40.63,102.68 39.12,104.17 37.26,104.17Z"
android:fillColor="#A6ABE8"
android:fillColor="@color/notification_graph_icon_color"
android:fillType="evenOdd"/>
<path
android:pathData="M77.26,144.56H61.96C61.11,144.56 60.43,143.85 60.43,142.97V138.21C60.43,137.77 60.77,137.41 61.19,137.41C61.61,137.41 61.96,137.77 61.96,138.21V142.97H77.26V138.21C77.26,137.77 77.6,137.41 78.03,137.41C78.45,137.41 78.79,137.77 78.79,138.21V142.97C78.79,143.85 78.11,144.56 77.26,144.56ZM70.15,139.55C70.08,139.63 70,139.69 69.9,139.73C69.81,139.77 69.71,139.79 69.61,139.79C69.51,139.79 69.41,139.77 69.32,139.73C69.22,139.69 69.14,139.63 69.07,139.56C69.07,139.56 69.07,139.56 69.07,139.56C69.07,139.55 69.07,139.55 69.07,139.55L65.24,135.59C64.94,135.28 64.94,134.78 65.24,134.47C65.54,134.16 66.02,134.16 66.32,134.47L68.84,137.08V126.28C68.84,125.84 69.19,125.49 69.61,125.49C70.03,125.49 70.37,125.84 70.37,126.28V137.08L72.9,134.47C73.19,134.16 73.68,134.16 73.98,134.47C74.28,134.78 74.28,135.28 73.98,135.59L70.15,139.55Z"
android:strokeAlpha="0.3"
android:fillColor="#F092C5"
android:fillColor="@color/notification_download_icon_color"
android:fillType="evenOdd"
android:fillAlpha="0.3"/>
</group>
Expand Down
6 changes: 6 additions & 0 deletions android/java/res/drawable/notification_button_rounded_bg.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/notification_button_color" />
<corners android:radius="48dp" />
</shape>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2022 The Brave Authors. All rights reserved.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this file,
You can obtain one at https://mozilla.org/MPL/2.0/.
-->

<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/notification_rationale_dialog_card_bg_color" />
<corners android:radius="16dp" />
</shape>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@drawable/ad_free_card_bg"
android:background="@drawable/notification_rationale_dialog_background"
android:padding="24dp">

<ImageView
Expand Down Expand Up @@ -42,7 +42,7 @@
android:fontFamily="sans-serif"
android:text="@string/brave_notification_permission_rationale_dialog_message"
android:textSize="16sp"
android:textColor="@color/news_promoted_background_color"
android:textColor="@color/wallet_secondary_layout_text_color"
app:layout_constraintBottom_toTopOf="@+id/notification_continue_button"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/notification_permission_rationale_title" />
Expand All @@ -65,7 +65,7 @@
android:layout_width="96dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:background="@drawable/blue_48_rounded_bg"
android:background="@drawable/notification_button_rounded_bg"
android:text="@string/continue_text"
android:textAllCaps="false"
android:textColor="@android:color/white"
Expand Down
9 changes: 9 additions & 0 deletions android/java/res/values-night/brave_colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,13 @@
<color name="search_widget_promo_add_widget_text_color">#FFFFFF</color>
<color name="search_widget_promo_not_now_text_color">#8389E0</color>
<color name="search_widget_promo_bg_color">#1E2025</color>

<color name="notification_volume_icon_color">#F0F2FF</color>
<color name="notification_bat1_icon_color">#A0A5EB</color>
<color name="notification_bat2_icon_color">#FF7654</color>
<color name="notification_bat3_icon_color">#A0A5EB</color>
<color name="notification_graph_icon_color">#FF7654</color>
<color name="notification_badge_icon_color">#737ADE</color>
<color name="notification_download_icon_color">#F0F2FF</color>
<color name="notification_rationale_dialog_card_bg_color">#17171F</color>
</resources>
9 changes: 9 additions & 0 deletions android/java/res/values/brave_colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,13 @@
<color name="search_widget_promo_bg_color">#FFFFFF</color>

<color name="notification_button_color">#423EEE</color>

<color name="notification_volume_icon_color">#D1E8EB</color>
<color name="notification_bat1_icon_color">#FEDED6</color>
<color name="notification_bat2_icon_color">#F195A4</color>
<color name="notification_bat3_icon_color">#E2E2FC</color>
<color name="notification_graph_icon_color">#A6ABE8</color>
<color name="notification_badge_icon_color">#C2A5D1</color>
<color name="notification_download_icon_color">#F092C5</color>
<color name="notification_rationale_dialog_card_bg_color">@android:color/white</color>
</resources>

0 comments on commit 4cfe575

Please sign in to comment.