Commit 47dd46b0 authored by Sinan Sahin's avatar Sinan Sahin Committed by Commit Bot

Update Find in page colors for dark mode

Bug: 944632
Change-Id: I766d30e56d8a663acfccde9f42e905413f6ffb11
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1559169Reviewed-by: default avatarBecky Zhou <huayinz@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Sinan Sahin <sinansahin@google.com>
Cr-Commit-Position: refs/heads/master@{#649180}
parent 8d9b6e06
......@@ -39,8 +39,7 @@
android:layout_height="match_parent"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="#000000"
android:alpha="0.1" />
android:background="@color/divider_bg_color" />
<org.chromium.ui.widget.ChromeImageButton
android:id="@+id/find_prev_button"
style="@style/ToolbarButton"
......
......@@ -157,7 +157,7 @@
<color name="find_result_bar_active_border_color">#C37E3B</color>
<color name="find_in_page_query_white_color">@android:color/white</color>
<color name="find_in_page_query_incognito_hint_color">@color/white_alpha_70</color>
<color name="find_in_page_failed_results_status_color">#DB4437</color>
<color name="find_in_page_failed_results_status_color">@color/default_red</color>
<color name="find_in_page_query_default_hint_color">@color/search_box_hint</color>
<!-- App Background Colors -->
......
......@@ -76,6 +76,7 @@ public class FindToolbar extends LinearLayout
protected ImageButton mCloseFindButton;
protected ImageButton mFindPrevButton;
protected ImageButton mFindNextButton;
protected View mDivider;
private FindResultBar mResultBar;
......@@ -335,6 +336,8 @@ public class FindToolbar extends LinearLayout
deactivate();
}
});
mDivider = findViewById(R.id.find_separator);
}
// Overriden by subclasses.
......@@ -762,8 +765,8 @@ public class FindToolbar extends LinearLayout
* @return The color of the status text.
*/
protected int getStatusColor(boolean failed, boolean incognito) {
int colorResourceId =
failed ? R.color.find_in_page_failed_results_status_color : R.color.black_alpha_38;
int colorResourceId = failed ? R.color.find_in_page_failed_results_status_color
: R.color.disabled_text_color;
return ApiCompatibilityUtils.getColor(getContext().getResources(), colorResourceId);
}
......
......@@ -43,6 +43,7 @@ public class FindToolbarPhone extends FindToolbar {
protected void updateVisualsForTabModel(boolean isIncognito) {
int queryTextColorId;
int queryHintTextColorId;
int dividerColorId;
if (isIncognito) {
setBackgroundColor(ColorUtils.getDefaultThemeColor(getResources(), true));
ColorStateList white = ColorUtils.getIconTint(getContext(), true);
......@@ -51,7 +52,7 @@ public class FindToolbarPhone extends FindToolbar {
ApiCompatibilityUtils.setImageTintList(mCloseFindButton, white);
queryTextColorId = R.color.find_in_page_query_white_color;
queryHintTextColorId = R.color.find_in_page_query_incognito_hint_color;
dividerColorId = R.color.white_alpha_12;
} else {
setBackgroundColor(ColorUtils.getDefaultThemeColor(getResources(), false));
ColorStateList dark = ColorUtils.getIconTint(getContext(), false);
......@@ -60,20 +61,21 @@ public class FindToolbarPhone extends FindToolbar {
ApiCompatibilityUtils.setImageTintList(mCloseFindButton, dark);
queryTextColorId = R.color.default_text_color;
queryHintTextColorId = R.color.find_in_page_query_default_hint_color;
dividerColorId = R.color.divider_bg_color;
}
mFindQuery.setTextColor(
ApiCompatibilityUtils.getColor(getContext().getResources(), queryTextColorId));
mFindQuery.setHintTextColor(
ApiCompatibilityUtils.getColor(getContext().getResources(), queryHintTextColorId));
mDivider.setBackgroundResource(dividerColorId);
}
@Override
protected int getStatusColor(boolean failed, boolean incognito) {
if (!failed && incognito) {
return ApiCompatibilityUtils.getColor(
getContext().getResources(), R.color.white_alpha_50);
if (incognito) {
final int colorResourceId = failed ? R.color.default_red_light : R.color.white_alpha_50;
return ApiCompatibilityUtils.getColor(getContext().getResources(), colorResourceId);
}
return super.getStatusColor(failed, incognito);
}
}
......@@ -24,6 +24,7 @@
<color name="black_alpha_38">#61000000</color>
<color name="white_alpha_10" tools:ignore="UnusedResources">#1AFFFFFF</color>
<color name="white_alpha_12" tools:ignore="UnusedResources">#1FFFFFFF</color>
<color name="white_alpha_20">#33FFFFFF</color>
<color name="white_alpha_38" tools:ignore="UnusedResources">#61FFFFFF</color>
<color name="white_alpha_50" tools:ignore="UnusedResources">#80FFFFFF</color>
......
......@@ -65,14 +65,15 @@
<!-- Ripple colors for clickable widgets -->
<color name="ripple_color_blue">@color/modern_blue_600</color>
<!-- Chip colors -->
<color name="chip_text_color_default">@color/default_text_color_secondary</color>
<color name="chip_text_color_selected">@color/default_text_color_link</color>
<color name="chip_background_color_disabled">@color/modern_grey_100_alpha_38</color>
<!-- Other colors -->
<color name="default_red">@color/default_red_dark</color>
<color name="default_green" tools:ignore="UnusedResources">@color/default_green_dark</color>
<color name="filled_button_bg_color">@color/modern_blue_600</color>
<color name="filled_button_bg_color_disabled">@color/modern_grey_800_alpha_38</color>
<!-- Chip colors -->
<color name="chip_text_color_default">@color/default_text_color_secondary</color>
<color name="chip_text_color_selected">@color/default_text_color_link</color>
<color name="chip_background_color_disabled">@color/modern_grey_100_alpha_38</color>
<color name="divider_bg_color" tools:ignore="UnusedResources">@color/modern_grey_300</color>
</resources>
......@@ -32,14 +32,15 @@
<!-- Ripple colors for clickable widgets -->
<color name="ripple_color_blue">@color/modern_blue_300</color>
<!-- Chip colors -->
<color name="chip_text_color_default">@color/default_text_color_dark_secondary</color>
<color name="chip_text_color_selected">@color/default_text_color_dark</color>
<color name="chip_background_color_disabled">@color/modern_grey_300_alpha_38</color>
<!-- Other colors -->
<color name="default_red">@color/default_red_light</color>
<color name="default_green">@color/default_green_light</color>
<color name="filled_button_bg_color">@color/modern_blue_300</color>
<color name="filled_button_bg_color_disabled">@color/modern_grey_300_alpha_38</color>
<!-- Chip colors -->
<color name="chip_text_color_default">@color/default_text_color_dark_secondary</color>
<color name="chip_text_color_selected">@color/default_text_color_dark</color>
<color name="chip_background_color_disabled">@color/modern_grey_300_alpha_38</color>
<color name="divider_bg_color">@color/white_alpha_12</color>
</resources>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment