зеркало из https://github.com/mozilla/gecko-dev.git
Bug 935628 - Remove BrowserToolbarBackground from toolbar (r=sriram)
This commit is contained in:
Родитель
7326350fe4
Коммит
114bc8b06f
|
@ -289,7 +289,6 @@ gbjar.sources += [
|
||||||
'toolbar/AutocompleteHandler.java',
|
'toolbar/AutocompleteHandler.java',
|
||||||
'toolbar/BackButton.java',
|
'toolbar/BackButton.java',
|
||||||
'toolbar/BrowserToolbar.java',
|
'toolbar/BrowserToolbar.java',
|
||||||
'toolbar/BrowserToolbarBackground.java',
|
|
||||||
'toolbar/CanvasDelegate.java',
|
'toolbar/CanvasDelegate.java',
|
||||||
'toolbar/ForwardButton.java',
|
'toolbar/ForwardButton.java',
|
||||||
'toolbar/PageActionLayout.java',
|
'toolbar/PageActionLayout.java',
|
||||||
|
|
|
@ -6,11 +6,6 @@
|
||||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:gecko="http://schemas.android.com/apk/res-auto">
|
xmlns:gecko="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<org.mozilla.gecko.toolbar.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.toolbar.ShapedButton android:id="@+id/tabs"
|
<org.mozilla.gecko.toolbar.ShapedButton android:id="@+id/tabs"
|
||||||
style="@style/UrlBar.ImageButton"
|
style="@style/UrlBar.ImageButton"
|
||||||
android:layout_width="84dip"
|
android:layout_width="84dip"
|
||||||
|
|
|
@ -12,11 +12,6 @@
|
||||||
<ImageButton android:id="@+id/forward"
|
<ImageButton android:id="@+id/forward"
|
||||||
style="@style/UrlBar.ImageButton.Unused"/>
|
style="@style/UrlBar.ImageButton.Unused"/>
|
||||||
|
|
||||||
<org.mozilla.gecko.toolbar.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"
|
<ImageView android:id="@+id/url_bar_entry"
|
||||||
style="@style/UrlBar.Button"
|
style="@style/UrlBar.Button"
|
||||||
android:layout_marginLeft="4dp"
|
android:layout_marginLeft="4dp"
|
||||||
|
|
|
@ -73,7 +73,8 @@
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="@dimen/browser_toolbar_height"
|
android:layout_height="@dimen/browser_toolbar_height"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"/>
|
android:focusable="true"
|
||||||
|
android:background="@drawable/url_bar_bg"/>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,6 @@ public class BrowserToolbar extends GeckoRelativeLayout
|
||||||
private CustomEditText mUrlEditText;
|
private CustomEditText mUrlEditText;
|
||||||
private View mUrlBarEntry;
|
private View mUrlBarEntry;
|
||||||
private ImageView mUrlBarRightEdge;
|
private ImageView mUrlBarRightEdge;
|
||||||
private BrowserToolbarBackground mUrlBarBackground;
|
|
||||||
private GeckoTextView mTitle;
|
private GeckoTextView mTitle;
|
||||||
private int mTitlePadding;
|
private int mTitlePadding;
|
||||||
private boolean mSiteSecurityVisible;
|
private boolean mSiteSecurityVisible;
|
||||||
|
@ -196,6 +195,8 @@ public class BrowserToolbar extends GeckoRelativeLayout
|
||||||
private final ForegroundColorSpan mDomainColor;
|
private final ForegroundColorSpan mDomainColor;
|
||||||
private final ForegroundColorSpan mPrivateDomainColor;
|
private final ForegroundColorSpan mPrivateDomainColor;
|
||||||
|
|
||||||
|
private final LightweightTheme mTheme;
|
||||||
|
|
||||||
private boolean mShowUrl;
|
private boolean mShowUrl;
|
||||||
private boolean mTrimURLs;
|
private boolean mTrimURLs;
|
||||||
|
|
||||||
|
@ -207,6 +208,7 @@ public class BrowserToolbar extends GeckoRelativeLayout
|
||||||
|
|
||||||
public BrowserToolbar(Context context, AttributeSet attrs) {
|
public BrowserToolbar(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
|
mTheme = ((GeckoApplication) context.getApplicationContext()).getLightweightTheme();
|
||||||
|
|
||||||
// BrowserToolbar is attached to BrowserApp only.
|
// BrowserToolbar is attached to BrowserApp only.
|
||||||
mActivity = (BrowserApp) context;
|
mActivity = (BrowserApp) context;
|
||||||
|
@ -283,7 +285,6 @@ public class BrowserToolbar extends GeckoRelativeLayout
|
||||||
|
|
||||||
mAnimatingEntry = false;
|
mAnimatingEntry = false;
|
||||||
|
|
||||||
mUrlBarBackground = (BrowserToolbarBackground) findViewById(R.id.url_bar_bg);
|
|
||||||
mUrlBarViewOffset = res.getDimensionPixelSize(R.dimen.url_bar_offset_left);
|
mUrlBarViewOffset = res.getDimensionPixelSize(R.dimen.url_bar_offset_left);
|
||||||
mDefaultForwardMargin = res.getDimensionPixelSize(R.dimen.forward_default_offset);
|
mDefaultForwardMargin = res.getDimensionPixelSize(R.dimen.forward_default_offset);
|
||||||
mUrlDisplayContainer = findViewById(R.id.url_display_container);
|
mUrlDisplayContainer = findViewById(R.id.url_display_container);
|
||||||
|
@ -1791,7 +1792,6 @@ public class BrowserToolbar extends GeckoRelativeLayout
|
||||||
updateForwardButton(canDoForward(tab));
|
updateForwardButton(canDoForward(tab));
|
||||||
|
|
||||||
final boolean isPrivate = tab.isPrivate();
|
final boolean isPrivate = tab.isPrivate();
|
||||||
mUrlBarBackground.setPrivateMode(isPrivate);
|
|
||||||
setPrivateMode(isPrivate);
|
setPrivateMode(isPrivate);
|
||||||
mTabs.setPrivateMode(isPrivate);
|
mTabs.setPrivateMode(isPrivate);
|
||||||
mTitle.setPrivateMode(isPrivate);
|
mTitle.setPrivateMode(isPrivate);
|
||||||
|
@ -1879,4 +1879,22 @@ 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче