Bug 1000149 - Part 2: Remove edit separator. r=lucasr

This commit is contained in:
Michael Comella 2014-04-30 10:25:42 -07:00
Родитель 6a9ee790af
Коммит 39365f1c37
5 изменённых файлов: 5 добавлений и 62 удалений

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

@ -1,12 +0,0 @@
<?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/. -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#a6aeb4"/>
<size android:width="1dp" />
</shape>

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

@ -1,12 +0,0 @@
<?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/. -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#222"/>
<size android:width="1dp" />
</shape>

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

@ -1,15 +0,0 @@
<?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/. -->
<!-- Note that android:color="@color/toolbar_separator" (which uses a selector)
directly in the <shape> does not appear to work, so instead we select
between two shapes with different colors. -->
<selector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gecko="http://schemas.android.com/apk/res-auto">
<item gecko:state_private="true" android:drawable="@drawable/toolbar_separator_pb"/>
<item android:drawable="@drawable/toolbar_separator"/>
</selector>

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

@ -106,20 +106,9 @@
android:contentDescription="@string/edit_mode_cancel"
android:visibility="invisible"/>
<org.mozilla.gecko.widget.ThemedView android:id="@+id/edit_separator"
android:layout_toLeftOf="@id/edit_cancel"
android:layout_width="1dip"
android:layout_height="match_parent"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="2dp"
android:background="@drawable/toolbar_separator_selector"
android:visibility="invisible"/>
<org.mozilla.gecko.toolbar.ToolbarEditLayout android:id="@+id/edit_layout"
style="@style/UrlBar.Button"
android:layout_toLeftOf="@id/edit_separator"
android:layout_toLeftOf="@id/edit_cancel"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:paddingLeft="8dp"

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

@ -34,7 +34,6 @@ import org.mozilla.gecko.util.MenuUtils;
import org.mozilla.gecko.widget.ThemedImageButton;
import org.mozilla.gecko.widget.ThemedImageView;
import org.mozilla.gecko.widget.ThemedRelativeLayout;
import org.mozilla.gecko.widget.ThemedView;
import android.content.Context;
import android.content.res.Resources;
@ -137,7 +136,6 @@ public class BrowserToolbar extends ThemedRelativeLayout
private MenuPopup menuPopup;
private List<View> focusOrder;
private final ThemedView editSeparator;
private final View editCancel;
private boolean shouldShrinkURLBar = false;
@ -220,7 +218,6 @@ public class BrowserToolbar extends ThemedRelativeLayout
actionItemBar = (LinearLayout) findViewById(R.id.menu_items);
hasSoftMenuButton = !HardwareUtils.hasMenuButton();
editSeparator = (ThemedView) findViewById(R.id.edit_separator);
editCancel = findViewById(R.id.edit_cancel);
// We use different layouts on phones and tablets, so adjust the focus
@ -601,15 +598,15 @@ public class BrowserToolbar extends ThemedRelativeLayout
}
private int getUrlBarEntryTranslation() {
if (editSeparator == null) {
if (editCancel == null) {
// We are on tablet, and there is no animation so return a translation of 0.
return 0;
}
// We would ideally use the right-most point of the edit layout instead of the
// edit separator and its margin, but it is not inflated when this code initially runs.
final LayoutParams lp = (LayoutParams) editSeparator.getLayoutParams();
return editSeparator.getLeft() - lp.leftMargin - urlBarEntry.getRight();
final LayoutParams lp = (LayoutParams) editCancel.getLayoutParams();
return editCancel.getLeft() - lp.leftMargin - urlBarEntry.getRight();
}
private int getUrlBarCurveTranslation() {
@ -897,8 +894,7 @@ public class BrowserToolbar extends ThemedRelativeLayout
}
private void setCancelVisibility(final int visibility) {
if (editSeparator != null && editCancel != null) {
editSeparator.setVisibility(visibility);
if (editCancel != null) {
editCancel.setVisibility(visibility);
}
}
@ -1338,9 +1334,6 @@ public class BrowserToolbar extends ThemedRelativeLayout
menuButton.setPrivateMode(isPrivate);
menuIcon.setPrivateMode(isPrivate);
urlEditLayout.setPrivateMode(isPrivate);
if (editSeparator != null) {
editSeparator.setPrivateMode(isPrivate);
}
if (backButton instanceof BackButton) {
((BackButton) backButton).setPrivateMode(isPrivate);