Bug 1019595 - Use light cancel edit button with dark lightweight themes. r=bnicholson

--HG--
rename : mobile/android/base/resources/drawable-hdpi/close_edit_mode.png => mobile/android/base/resources/drawable-hdpi/close_edit_mode_light.png
rename : mobile/android/base/resources/drawable-mdpi/close_edit_mode.png => mobile/android/base/resources/drawable-mdpi/close_edit_mode_light.png
rename : mobile/android/base/resources/drawable-xhdpi/close_edit_mode.png => mobile/android/base/resources/drawable-xhdpi/close_edit_mode_light.png
This commit is contained in:
Michael Comella 2014-06-05 11:58:17 -07:00
Родитель 92f019622b
Коммит 6302a915d6
10 изменённых файлов: 37 добавлений и 18 удалений

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 480 B

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 550 B

После

Ширина:  |  Высота:  |  Размер: 550 B

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 437 B

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 473 B

После

Ширина:  |  Высота:  |  Размер: 473 B

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 574 B

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 679 B

После

Ширина:  |  Высота:  |  Размер: 679 B

Просмотреть файл

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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 http://mozilla.org/MPL/2.0/. -->
<selector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gecko="http://schemas.android.com/apk/res-auto">
<item gecko:state_dark="true"
android:drawable="@drawable/close_edit_mode_dark"/>
<item android:drawable="@drawable/close_edit_mode_light"/>
</selector>

Просмотреть файл

@ -109,10 +109,11 @@
<!-- We draw after the menu items so when they are hidden, the cancel button, <!-- We draw after the menu items so when they are hidden, the cancel button,
which is thus drawn on top, may be pressed. --> which is thus drawn on top, may be pressed. -->
<ImageView android:id="@+id/edit_cancel" <org.mozilla.gecko.widget.ThemedImageView
android:id="@+id/edit_cancel"
style="@style/UrlBar.ImageButton.Icon" style="@style/UrlBar.ImageButton.Icon"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:src="@drawable/close_edit_mode" android:src="@drawable/close_edit_mode_selector"
android:paddingLeft="2dp" android:paddingLeft="2dp"
android:paddingRight="2dp" android:paddingRight="2dp"
android:contentDescription="@string/edit_mode_cancel" android:contentDescription="@string/edit_mode_cancel"

Просмотреть файл

@ -97,10 +97,11 @@
<!-- Note that the edit components are invisible so that the views <!-- Note that the edit components are invisible so that the views
depending on their location can properly layout. --> depending on their location can properly layout. -->
<ImageView android:id="@+id/edit_cancel" <org.mozilla.gecko.widget.ThemedImageView
android:id="@+id/edit_cancel"
style="@style/UrlBar.ImageButton.Icon" style="@style/UrlBar.ImageButton.Icon"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:src="@drawable/close_edit_mode" android:src="@drawable/close_edit_mode_selector"
android:paddingLeft="2dp" android:paddingLeft="2dp"
android:paddingRight="2dp" android:paddingRight="2dp"
android:contentDescription="@string/edit_mode_cancel" android:contentDescription="@string/edit_mode_cancel"

Просмотреть файл

@ -141,7 +141,7 @@ public class BrowserToolbar extends ThemedRelativeLayout
private MenuPopup menuPopup; private MenuPopup menuPopup;
private List<View> focusOrder; private List<View> focusOrder;
private final ImageView editCancel; private final ThemedImageView editCancel;
private final View[] tabletDisplayModeViews; private final View[] tabletDisplayModeViews;
private boolean hidForwardButtonOnStartEditing = false; private boolean hidForwardButtonOnStartEditing = false;
@ -234,7 +234,7 @@ public class BrowserToolbar extends ThemedRelativeLayout
actionItemBar = (LinearLayout) findViewById(R.id.menu_items); actionItemBar = (LinearLayout) findViewById(R.id.menu_items);
hasSoftMenuButton = !HardwareUtils.hasMenuButton(); hasSoftMenuButton = !HardwareUtils.hasMenuButton();
editCancel = (ImageView) findViewById(R.id.edit_cancel); editCancel = (ThemedImageView) findViewById(R.id.edit_cancel);
// We use different layouts on phones and tablets, so adjust the focus // We use different layouts on phones and tablets, so adjust the focus
// order appropriately. // order appropriately.
@ -1455,10 +1455,13 @@ public class BrowserToolbar extends ThemedRelativeLayout
stateList.addState(EMPTY_STATE_SET, drawable); stateList.addState(EMPTY_STATE_SET, drawable);
setBackgroundDrawable(stateList); setBackgroundDrawable(stateList);
editCancel.onLightweightThemeChanged();
} }
@Override @Override
public void onLightweightThemeReset() { public void onLightweightThemeReset() {
setBackgroundResource(R.drawable.url_bar_bg); setBackgroundResource(R.drawable.url_bar_bg);
editCancel.onLightweightThemeReset();
} }
} }