Backed out changesets 5fdcf5a9697f, da1a4740a722, and f16921967806 (bug 935628) for robocop failures.

CLOSED TREE
This commit is contained in:
Ryan VanderMeulen 2013-11-11 15:56:27 -05:00
parent 68525e359d
commit 5d1d4d7c5f
7 changed files with 56 additions and 35 deletions

View File

@ -6,7 +6,6 @@
package org.mozilla.gecko;
import org.mozilla.gecko.animation.PropertyAnimator;
import org.mozilla.gecko.animation.ViewHelper;
import org.mozilla.gecko.db.BrowserContract.Combined;
import org.mozilla.gecko.db.BrowserDB;
import org.mozilla.gecko.favicons.Favicons;
@ -662,7 +661,7 @@ abstract public class BrowserApp extends GeckoApp
}
mHomePagerContainer.setPadding(0, 0, 0, 0);
if (mBrowserToolbar != null) {
ViewHelper.setTranslationY(mBrowserToolbar, 0);
mBrowserToolbar.scrollTo(0, 0);
}
}
@ -920,7 +919,7 @@ abstract public class BrowserApp extends GeckoApp
final int marginTop = Math.round(aMetrics.marginTop);
ThreadUtils.postToUiThread(new Runnable() {
public void run() {
ViewHelper.setTranslationY(toolbarLayout, marginTop - toolbarLayout.getHeight());
toolbarLayout.scrollTo(0, toolbarLayout.getHeight() - marginTop);
}
});

View File

@ -120,6 +120,7 @@ public class BrowserToolbar extends GeckoRelativeLayout
private CustomEditText mUrlEditText;
private View mUrlBarEntry;
private ImageView mUrlBarRightEdge;
private BrowserToolbarBackground mUrlBarBackground;
private GeckoTextView mTitle;
private int mTitlePadding;
private boolean mSiteSecurityVisible;
@ -184,8 +185,6 @@ public class BrowserToolbar extends GeckoRelativeLayout
private final ForegroundColorSpan mDomainColor;
private final ForegroundColorSpan mPrivateDomainColor;
private final LightweightTheme mTheme;
private boolean mShowUrl;
private boolean mTrimURLs;
@ -197,7 +196,6 @@ public class BrowserToolbar extends GeckoRelativeLayout
public BrowserToolbar(Context context, AttributeSet attrs) {
super(context, attrs);
mTheme = ((GeckoApplication) context.getApplicationContext()).getLightweightTheme();
// BrowserToolbar is attached to BrowserApp only.
mActivity = (BrowserApp) context;
@ -274,6 +272,7 @@ public class BrowserToolbar extends GeckoRelativeLayout
mAnimatingEntry = false;
mUrlBarBackground = (BrowserToolbarBackground) findViewById(R.id.url_bar_bg);
mUrlBarViewOffset = res.getDimensionPixelSize(R.dimen.url_bar_offset_left);
mDefaultForwardMargin = res.getDimensionPixelSize(R.dimen.forward_default_offset);
mUrlDisplayContainer = findViewById(R.id.url_display_container);
@ -1357,10 +1356,6 @@ public class BrowserToolbar extends GeckoRelativeLayout
mStartEditingListener.onStartEditing();
}
if (mUrlBarRightEdge != null) {
mUrlBarRightEdge.setVisibility(View.VISIBLE);
}
final int entryTranslation = getUrlBarEntryTranslation();
final int curveTranslation = getUrlBarCurveTranslation();
@ -1538,10 +1533,6 @@ public class BrowserToolbar extends GeckoRelativeLayout
@Override
public void onPropertyAnimationEnd() {
if (mUrlBarRightEdge != null) {
mUrlBarRightEdge.setVisibility(View.INVISIBLE);
}
PropertyAnimator buttonsAnimator = new PropertyAnimator(300);
// Fade toolbar buttons (page actions, stop) after the entry
@ -1789,6 +1780,7 @@ public class BrowserToolbar extends GeckoRelativeLayout
updateForwardButton(canDoForward(tab));
final boolean isPrivate = tab.isPrivate();
mUrlBarBackground.setPrivateMode(isPrivate);
setPrivateMode(isPrivate);
mTabs.setPrivateMode(isPrivate);
mTitle.setPrivateMode(isPrivate);
@ -1876,22 +1868,4 @@ public class BrowserToolbar extends GeckoRelativeLayout
}
}
}
@Override
public void onLightweightThemeChanged() {
Drawable drawable = mTheme.getDrawable(this);
if (drawable == null)
return;
StateListDrawable stateList = new StateListDrawable();
stateList.addState(PRIVATE_STATE_SET, getColorDrawable(R.color.background_private));
stateList.addState(EMPTY_STATE_SET, drawable);
setBackgroundDrawable(stateList);
}
@Override
public void onLightweightThemeReset() {
setBackgroundResource(R.drawable.url_bar_bg);
}
}

View File

@ -0,0 +1,39 @@
/* 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/. */
package org.mozilla.gecko;
import org.mozilla.gecko.widget.GeckoLinearLayout;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable;
import android.util.AttributeSet;
public class BrowserToolbarBackground extends GeckoLinearLayout {
private final LightweightTheme mTheme;
public BrowserToolbarBackground(Context context, AttributeSet attrs) {
super(context, attrs);
mTheme = ((GeckoApplication) context.getApplicationContext()).getLightweightTheme();
}
@Override
public void onLightweightThemeChanged() {
final Drawable drawable = mTheme.getDrawable(this);
if (drawable == null)
return;
final StateListDrawable stateList = new StateListDrawable();
stateList.addState(PRIVATE_STATE_SET, getColorDrawable(R.color.background_private));
stateList.addState(EMPTY_STATE_SET, drawable);
setBackgroundDrawable(stateList);
}
@Override
public void onLightweightThemeReset() {
setBackgroundResource(R.drawable.url_bar_bg);
}
}

View File

@ -94,6 +94,7 @@ gbjar.sources += [
'BaseGeckoInterface.java',
'BrowserApp.java',
'BrowserToolbar.java',
'BrowserToolbarBackground.java',
'CameraImageResultHandler.java',
'CameraVideoResultHandler.java',
'CanvasDelegate.java',

View File

@ -6,6 +6,11 @@
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gecko="http://schemas.android.com/apk/res-auto">
<org.mozilla.gecko.BrowserToolbarBackground android:id="@+id/url_bar_bg"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/url_bar_bg"/>
<org.mozilla.gecko.ShapedButton android:id="@+id/tabs"
style="@style/UrlBar.ImageButton"
android:layout_width="84dip"

View File

@ -12,6 +12,11 @@
<ImageButton android:id="@+id/forward"
style="@style/UrlBar.ImageButton.Unused"/>
<org.mozilla.gecko.BrowserToolbarBackground android:id="@+id/url_bar_bg"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/url_bar_bg"/>
<ImageView android:id="@+id/url_bar_entry"
style="@style/UrlBar.Button"
android:layout_marginLeft="4dp"
@ -37,7 +42,6 @@
android:duplicateParentState="true"
android:clickable="false"
android:focusable="false"
android:visibility="invisible"
android:src="@drawable/url_bar_right_edge"
android:scaleType="fitXY"/>

View File

@ -72,8 +72,7 @@
android:layout_width="fill_parent"
android:layout_height="@dimen/browser_toolbar_height"
android:clickable="true"
android:focusable="true"
android:background="@drawable/url_bar_bg"/>
android:focusable="true"/>
</view>