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
После Ширина: | Высота: | Размер: 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,
|
||||
which is thus drawn on top, may be pressed. -->
|
||||
<ImageView android:id="@+id/edit_cancel"
|
||||
style="@style/UrlBar.ImageButton.Icon"
|
||||
android:layout_alignParentRight="true"
|
||||
android:src="@drawable/close_edit_mode"
|
||||
android:paddingLeft="2dp"
|
||||
android:paddingRight="2dp"
|
||||
android:contentDescription="@string/edit_mode_cancel"
|
||||
android:visibility="gone"/>
|
||||
<org.mozilla.gecko.widget.ThemedImageView
|
||||
android:id="@+id/edit_cancel"
|
||||
style="@style/UrlBar.ImageButton.Icon"
|
||||
android:layout_alignParentRight="true"
|
||||
android:src="@drawable/close_edit_mode_selector"
|
||||
android:paddingLeft="2dp"
|
||||
android:paddingRight="2dp"
|
||||
android:contentDescription="@string/edit_mode_cancel"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</merge>
|
||||
|
|
|
@ -97,14 +97,15 @@
|
|||
|
||||
<!-- Note that the edit components are invisible so that the views
|
||||
depending on their location can properly layout. -->
|
||||
<ImageView android:id="@+id/edit_cancel"
|
||||
style="@style/UrlBar.ImageButton.Icon"
|
||||
android:layout_alignParentRight="true"
|
||||
android:src="@drawable/close_edit_mode"
|
||||
android:paddingLeft="2dp"
|
||||
android:paddingRight="2dp"
|
||||
android:contentDescription="@string/edit_mode_cancel"
|
||||
android:visibility="invisible"/>
|
||||
<org.mozilla.gecko.widget.ThemedImageView
|
||||
android:id="@+id/edit_cancel"
|
||||
style="@style/UrlBar.ImageButton.Icon"
|
||||
android:layout_alignParentRight="true"
|
||||
android:src="@drawable/close_edit_mode_selector"
|
||||
android:paddingLeft="2dp"
|
||||
android:paddingRight="2dp"
|
||||
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 url bar drawable contains some whitespace, so we compensate by removing
|
||||
|
|
|
@ -141,7 +141,7 @@ public class BrowserToolbar extends ThemedRelativeLayout
|
|||
private MenuPopup menuPopup;
|
||||
private List<View> focusOrder;
|
||||
|
||||
private final ImageView editCancel;
|
||||
private final ThemedImageView editCancel;
|
||||
|
||||
private final View[] tabletDisplayModeViews;
|
||||
private boolean hidForwardButtonOnStartEditing = false;
|
||||
|
@ -234,7 +234,7 @@ public class BrowserToolbar extends ThemedRelativeLayout
|
|||
actionItemBar = (LinearLayout) findViewById(R.id.menu_items);
|
||||
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
|
||||
// order appropriately.
|
||||
|
@ -1455,10 +1455,13 @@ public class BrowserToolbar extends ThemedRelativeLayout
|
|||
stateList.addState(EMPTY_STATE_SET, drawable);
|
||||
|
||||
setBackgroundDrawable(stateList);
|
||||
|
||||
editCancel.onLightweightThemeChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLightweightThemeReset() {
|
||||
setBackgroundResource(R.drawable.url_bar_bg);
|
||||
editCancel.onLightweightThemeReset();
|
||||
}
|
||||
}
|
||||
|
|