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,13 +109,14 @@
<!-- 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
style="@style/UrlBar.ImageButton.Icon" android:id="@+id/edit_cancel"
android:layout_alignParentRight="true" style="@style/UrlBar.ImageButton.Icon"
android:src="@drawable/close_edit_mode" android:layout_alignParentRight="true"
android:paddingLeft="2dp" android:src="@drawable/close_edit_mode_selector"
android:paddingRight="2dp" android:paddingLeft="2dp"
android:contentDescription="@string/edit_mode_cancel" android:paddingRight="2dp"
android:visibility="gone"/> android:contentDescription="@string/edit_mode_cancel"
android:visibility="gone"/>
</merge> </merge>

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

@ -97,14 +97,15 @@
<!-- 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
style="@style/UrlBar.ImageButton.Icon" android:id="@+id/edit_cancel"
android:layout_alignParentRight="true" style="@style/UrlBar.ImageButton.Icon"
android:src="@drawable/close_edit_mode" android:layout_alignParentRight="true"
android:paddingLeft="2dp" android:src="@drawable/close_edit_mode_selector"
android:paddingRight="2dp" android:paddingLeft="2dp"
android:contentDescription="@string/edit_mode_cancel" android:paddingRight="2dp"
android:visibility="invisible"/> android:contentDescription="@string/edit_mode_cancel"
android:visibility="invisible"/>
<!-- The space to the left of the cancel button would be larger than the right because <!-- The space to the left of the cancel button would be larger than the right because
the url bar drawable contains some whitespace, so we compensate by removing the url bar drawable contains some whitespace, so we compensate by removing

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

@ -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();
} }
} }