Bug 739355: Tablet UI URL bar. [r=mfinkle]

This commit is contained in:
Sriram Ramasubramanian 2012-05-24 15:47:49 -07:00
parent 4cc1437822
commit af3d2ce791
61 changed files with 401 additions and 23 deletions

View File

@ -35,6 +35,8 @@ public class BrowserToolbar {
private LinearLayout mLayout;
private Button mAwesomeBar;
private ImageButton mTabs;
private ImageView mBack;
private ImageView mForward;
public ImageButton mFavicon;
public ImageButton mStop;
public ImageButton mSiteSecurity;
@ -119,13 +121,19 @@ public class BrowserToolbar {
TextView text = new TextView(mContext);
text.setGravity(Gravity.CENTER);
if (Build.VERSION.SDK_INT >= 11) {
if (GeckoApp.mOrientation == Configuration.ORIENTATION_PORTRAIT)
text.setTextSize(24);
else
text.setTextSize(20);
if (Build.VERSION.SDK_INT >= 14) {
if (!GeckoApp.mAppContext.isTablet()) {
if (GeckoApp.mOrientation == Configuration.ORIENTATION_PORTRAIT)
text.setTextSize(24);
else
text.setTextSize(20);
} else {
text.setTextSize(26);
}
} else if (Build.VERSION.SDK_INT >= 11) {
text.setTextSize(24);
} else {
text.setTextSize(22);
text.setTextSize(24);
}
text.setTextColor(mCounterColor);
@ -136,6 +144,20 @@ public class BrowserToolbar {
mTabsCount.setText("0");
mCount = 0;
mBack = (ImageButton) mLayout.findViewById(R.id.back);
mBack.setOnClickListener(new Button.OnClickListener() {
public void onClick(View view) {
Tabs.getInstance().getSelectedTab().doBack();
}
});
mForward = (ImageButton) mLayout.findViewById(R.id.forward);
mForward.setOnClickListener(new Button.OnClickListener() {
public void onClick(View view) {
Tabs.getInstance().getSelectedTab().doForward();
}
});
mFavicon = (ImageButton) mLayout.findViewById(R.id.favicon);
mSiteSecurity = (ImageButton) mLayout.findViewById(R.id.site_security);
mSiteSecurity.setOnClickListener(new Button.OnClickListener() {
@ -324,6 +346,16 @@ public class BrowserToolbar {
mLayout.requestFocusFromTouch();
}
public void updateBackButton(boolean enabled) {
mBack.setColorFilter(enabled ? 0 : 0xFF999999);
mBack.setEnabled(enabled);
}
public void updateForwardButton(boolean enabled) {
mForward.setColorFilter(enabled ? 0 : 0xFF999999);
mForward.setEnabled(enabled);
}
public void show() {
if (Build.VERSION.SDK_INT >= 11)
GeckoActionBar.show(GeckoApp.mAppContext);
@ -348,6 +380,8 @@ public class BrowserToolbar {
setProgressVisibility(tab.getState() == Tab.STATE_LOADING);
setShadowVisibility((url == null) || !url.startsWith("about:"));
updateTabCount(Tabs.getInstance().getCount());
updateBackButton(tab.canDoBack());
updateForwardButton(tab.canDoForward());
}
}
}

View File

@ -658,11 +658,8 @@ abstract public class GeckoApp
mMainHandler.post(new Runnable() {
public void run() {
if (Tabs.getInstance().isSelectedTab(tab)) {
mBrowserToolbar.setTitle(uri);
mBrowserToolbar.setFavicon(null);
mBrowserToolbar.setSecurityMode(tab.getSecurityMode());
mBrowserToolbar.refresh();
mDoorHangerPopup.updatePopup();
mBrowserToolbar.setShadowVisibility(!(tab.getURL().startsWith("about:")));
if (tab != null)
hidePlugins(tab);
@ -695,10 +692,7 @@ abstract public class GeckoApp
mMainHandler.post(new Runnable() {
public void run() {
if (Tabs.getInstance().isSelectedTab(tab)) {
mBrowserToolbar.setTitle(tab.getDisplayTitle());
mBrowserToolbar.setFavicon(tab.getFavicon());
mBrowserToolbar.setSecurityMode(tab.getSecurityMode());
mBrowserToolbar.setProgressVisibility(tab.getState() == Tab.STATE_LOADING);
mBrowserToolbar.refresh();
}
}
});
@ -1229,6 +1223,8 @@ abstract public class GeckoApp
public void run() {
if (Tabs.getInstance().isSelectedTab(tab)) {
mBrowserToolbar.setSecurityMode(tab.getSecurityMode());
mBrowserToolbar.updateBackButton(tab.canDoBack());
mBrowserToolbar.updateForwardButton(tab.canDoForward());
if (showProgress && tab.getState() == Tab.STATE_LOADING)
mBrowserToolbar.setProgressVisibility(true);
}
@ -1246,8 +1242,11 @@ abstract public class GeckoApp
mMainHandler.post(new Runnable() {
public void run() {
if (Tabs.getInstance().isSelectedTab(tab))
if (Tabs.getInstance().isSelectedTab(tab)) {
mBrowserToolbar.updateBackButton(tab.canDoBack());
mBrowserToolbar.updateForwardButton(tab.canDoForward());
mBrowserToolbar.setProgressVisibility(false);
}
Tabs.getInstance().notifyListeners(tab, Tabs.TabEvents.STOP);
}
});
@ -1598,6 +1597,9 @@ abstract public class GeckoApp
if (Build.VERSION.SDK_INT == 11 || Build.VERSION.SDK_INT == 12)
refreshActionBar();
mBrowserToolbar.updateBackButton(false);
mBrowserToolbar.updateForwardButton(false);
Intent intent = getIntent();
String action = intent.getAction();
String args = intent.getStringExtra("args");

View File

@ -286,6 +286,14 @@ RES_LAYOUT_LAND_V14 = \
res/layout-land-v14/browser_toolbar.xml \
$(NULL)
RES_LAYOUT_XLARGE = \
res/layout-xlarge/browser_toolbar.xml \
$(NULL)
RES_LAYOUT_SW600DP = \
res/layout-sw600dp/browser_toolbar.xml \
$(NULL)
RES_VALUES = \
$(SYNC_RES_VALUES) \
res/values/attrs.xml \
@ -344,6 +352,7 @@ RES_DRAWABLE_BASE = \
res/drawable/ic_awesomebar_go.png \
res/drawable/ic_awesomebar_search.png \
res/drawable/ic_awesomebar_star.png \
res/drawable/ic_menu_back.xml \
res/drawable/ic_menu_bookmark_add.png \
res/drawable/ic_menu_bookmark_remove.png \
res/drawable/ic_menu_find_in_page.png \
@ -360,6 +369,9 @@ RES_DRAWABLE_BASE = \
res/drawable/tabs_pressed.png \
res/drawable/tabs_more.png \
res/drawable/tabs_plus.png \
res/drawable/address_bar_back_button.xml \
res/drawable/address_bar_back_button_bg.xml \
res/drawable/address_bar_back_button_pressed_bg.xml \
res/drawable/address_bar_texture_port.png \
res/drawable/address_bar_pressed_texture_port.png \
res/drawable/address_bar_url_bg.9.png \
@ -440,6 +452,7 @@ RES_DRAWABLE_HDPI = \
$(NULL)
RES_DRAWABLE_MDPI_V11 = \
res/drawable-mdpi-v11/ic_menu_back.png \
res/drawable-mdpi-v11/ic_menu_bookmark_add.png \
res/drawable-mdpi-v11/ic_menu_bookmark_remove.png \
res/drawable-mdpi-v11/ic_menu_find_in_page.png \
@ -451,6 +464,7 @@ RES_DRAWABLE_MDPI_V11 = \
$(NULL)
RES_DRAWABLE_HDPI_V11 = \
res/drawable-hdpi-v11/ic_menu_back.png \
res/drawable-hdpi-v11/ic_menu_bookmark_add.png \
res/drawable-hdpi-v11/ic_menu_bookmark_remove.png \
res/drawable-hdpi-v11/ic_menu_find_in_page.png \
@ -478,6 +492,7 @@ RES_DRAWABLE_XHDPI_V11 = \
res/drawable-xhdpi-v11/ic_awesomebar_go.png \
res/drawable-xhdpi-v11/ic_awesomebar_search.png \
res/drawable-xhdpi-v11/ic_awesomebar_star.png \
res/drawable-xhdpi-v11/ic_menu_back.png \
res/drawable-xhdpi-v11/ic_menu_bookmark_add.png \
res/drawable-xhdpi-v11/ic_menu_bookmark_remove.png \
res/drawable-xhdpi-v11/ic_menu_find_in_page.png \
@ -572,32 +587,74 @@ RES_DRAWABLE_XLARGE_MDPI = \
res/drawable-xlarge-mdpi/address_bar_pressed_bg.xml \
res/drawable-xlarge-mdpi/address_bar_texture_tablet.png \
res/drawable-xlarge-mdpi/address_bar_pressed_texture_tablet.png \
res/drawable-xlarge-mdpi/address_bar_back_button_bg.png \
res/drawable-xlarge-mdpi/address_bar_back_button_pressed_bg.png \
res/drawable-xlarge-mdpi/tabs_normal.png \
res/drawable-xlarge-mdpi/tabs_pressed.png \
res/drawable-xlarge-mdpi/tabs_more.png \
res/drawable-xlarge-mdpi/tabs_plus.png \
res/drawable-xlarge-mdpi/urlbar_stop.png \
$(NULL)
RES_DRAWABLE_XLARGE_HDPI = \
res/drawable-xlarge-hdpi/address_bar_texture_tablet.png \
res/drawable-xlarge-hdpi/address_bar_pressed_texture_tablet.png \
res/drawable-xlarge-hdpi/address_bar_back_button_bg.png \
res/drawable-xlarge-hdpi/address_bar_back_button_pressed_bg.png \
res/drawable-xlarge-hdpi/tabs_normal.png \
res/drawable-xlarge-hdpi/tabs_pressed.png \
res/drawable-xlarge-hdpi/tabs_more.png \
res/drawable-xlarge-hdpi/tabs_plus.png \
res/drawable-xlarge-hdpi/urlbar_stop.png \
$(NULL)
RES_DRAWABLE_XLARGE_XHDPI = \
res/drawable-xlarge-xhdpi/address_bar_texture_tablet.png \
res/drawable-xlarge-xhdpi/address_bar_pressed_texture_tablet.png \
res/drawable-xlarge-xhdpi/address_bar_back_button_bg.png \
res/drawable-xlarge-xhdpi/address_bar_back_button_pressed_bg.png \
res/drawable-xlarge-xhdpi/tabs_normal.png \
res/drawable-xlarge-xhdpi/tabs_pressed.png \
res/drawable-xlarge-xhdpi/tabs_more.png \
res/drawable-xlarge-xhdpi/tabs_plus.png \
res/drawable-xlarge-xhdpi/urlbar_stop.png \
$(NULL)
RES_DRAWABLE_SW600DP_MDPI = \
res/drawable-sw600dp-mdpi/address_bar_bg.xml \
res/drawable-sw600dp-mdpi/address_bar_texture_tablet.png \
res/drawable-sw600dp-mdpi/address_bar_pressed_texture_tablet.png \
res/drawable-sw600dp-mdpi/address_bar_back_button_bg.png \
res/drawable-sw600dp-mdpi/address_bar_back_button_pressed_bg.png \
res/drawable-sw600dp-mdpi/tabs_normal.png \
res/drawable-sw600dp-mdpi/tabs_pressed.png \
res/drawable-sw600dp-mdpi/tabs_more.png \
res/drawable-sw600dp-mdpi/tabs_plus.png \
res/drawable-sw600dp-mdpi/urlbar_stop.png \
$(NULL)
RES_DRAWABLE_SW600DP_HDPI = \
res/drawable-sw600dp-hdpi/address_bar_texture_tablet.png \
res/drawable-sw600dp-hdpi/address_bar_pressed_texture_tablet.png \
res/drawable-sw600dp-hdpi/address_bar_back_button_bg.png \
res/drawable-sw600dp-hdpi/address_bar_back_button_pressed_bg.png \
res/drawable-sw600dp-hdpi/tabs_normal.png \
res/drawable-sw600dp-hdpi/tabs_pressed.png \
res/drawable-sw600dp-hdpi/tabs_more.png \
res/drawable-sw600dp-hdpi/tabs_plus.png \
res/drawable-sw600dp-hdpi/urlbar_stop.png \
$(NULL)
RES_DRAWABLE_SW600DP_XHDPI = \
res/drawable-sw600dp-xhdpi/address_bar_texture_tablet.png \
res/drawable-sw600dp-xhdpi/address_bar_pressed_texture_tablet.png \
res/drawable-sw600dp-xhdpi/address_bar_back_button_bg.png \
res/drawable-sw600dp-xhdpi/address_bar_back_button_pressed_bg.png \
res/drawable-sw600dp-xhdpi/tabs_normal.png \
res/drawable-sw600dp-xhdpi/tabs_pressed.png \
res/drawable-sw600dp-xhdpi/tabs_more.png \
res/drawable-sw600dp-xhdpi/tabs_plus.png \
res/drawable-sw600dp-xhdpi/urlbar_stop.png \
$(NULL)
RES_COLOR = \
@ -664,12 +721,14 @@ MOZ_ANDROID_DRAWABLES += \
MOZ_ANDROID_DRAWABLES += $(shell if test -e $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources.mn; then cat $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources.mn | tr '\n' ' '; fi)
RESOURCES=$(RES_LAYOUT) $(RES_LAYOUT_V11) $(RES_LAYOUT_LAND_V14) $(RES_VALUES) $(RES_VALUES_V11) $(RES_VALUES_XLARGE) $(RES_VALUES_SW600DP) $(RES_XML) $(RES_ANIM) $(RES_DRAWABLE_NODPI) $(RES_DRAWABLE_BASE) $(RES_DRAWABLE_LDPI) $(RES_DRAWABLE_HDPI) $(RES_DRAWABLE_MDPI_V11) $(RES_DRAWABLE_HDPI_V11) $(RES_DRAWABLE_XHDPI_V11) $(RES_DRAWABLE_LAND_V14) $(RES_DRAWABLE_LAND_MDPI_V14) $(RES_DRAWABLE_LAND_HDPI_V14) $(RES_DRAWABLE_LAND_XHDPI_V14) $(RES_DRAWABLE_XLARGE_MDPI) $(RES_DRAWABLE_XLARGE_HDPI) $(RES_DRAWABLE_XLARGE_XHDPI) $(RES_DRAWABLE_SW600DP_MDPI) $(RES_DRAWABLE_SW600DP_HDPI) $(RES_DRAWABLE_SW600DP_XHDPI) $(RES_COLOR) $(RES_MENU)
RESOURCES=$(RES_LAYOUT) $(RES_LAYOUT_V11) $(RES_LAYOUT_LAND_V14) $(RES_LAYOUT_XLARGE) $(RES_LAYOUT_SW600DP) $(RES_VALUES) $(RES_VALUES_V11) $(RES_VALUES_XLARGE) $(RES_VALUES_SW600DP) $(RES_XML) $(RES_ANIM) $(RES_DRAWABLE_NODPI) $(RES_DRAWABLE_BASE) $(RES_DRAWABLE_LDPI) $(RES_DRAWABLE_HDPI) $(RES_DRAWABLE_MDPI_V11) $(RES_DRAWABLE_HDPI_V11) $(RES_DRAWABLE_XHDPI_V11) $(RES_DRAWABLE_LAND_V14) $(RES_DRAWABLE_LAND_MDPI_V14) $(RES_DRAWABLE_LAND_HDPI_V14) $(RES_DRAWABLE_LAND_XHDPI_V14) $(RES_DRAWABLE_XLARGE_MDPI) $(RES_DRAWABLE_XLARGE_HDPI) $(RES_DRAWABLE_XLARGE_XHDPI) $(RES_DRAWABLE_SW600DP_MDPI) $(RES_DRAWABLE_SW600DP_HDPI) $(RES_DRAWABLE_SW600DP_XHDPI) $(RES_COLOR) $(RES_MENU)
RES_DIRS= \
res/layout \
res/layout-v11 \
res/layout-land-v14 \
res/layout-xlarge \
res/layout-sw600dp \
res/values \
res/values-v11 \
res/values-xlarge \

View File

@ -361,6 +361,10 @@ public final class Tab {
return true;
}
public boolean canDoBack() {
return (mHistoryIndex < 1 ? false : true);
}
public boolean doBack() {
if (mHistoryIndex < 1) {
return false;

View File

@ -63,6 +63,8 @@ public class Tabs implements GeckoEventListener {
GeckoApp.mAppContext.mMainHandler.post(new Runnable() {
public void run() {
GeckoApp.mBrowserToolbar.updateTabCountAndAnimate(getCount());
GeckoApp.mBrowserToolbar.updateBackButton(false);
GeckoApp.mBrowserToolbar.updateForwardButton(false);
}
});
}
@ -101,12 +103,8 @@ public class Tabs implements GeckoEventListener {
GeckoApp.mFormAssistPopup.hide();
if (isSelectedTab(tab)) {
String url = tab.getURL();
GeckoApp.mBrowserToolbar.setTitle(tab.getDisplayTitle());
GeckoApp.mBrowserToolbar.setFavicon(tab.getFavicon());
GeckoApp.mBrowserToolbar.setSecurityMode(tab.getSecurityMode());
GeckoApp.mBrowserToolbar.setProgressVisibility(tab.getState() == Tab.STATE_LOADING);
GeckoApp.mBrowserToolbar.refresh();
GeckoApp.mDoorHangerPopup.updatePopup();
GeckoApp.mBrowserToolbar.setShadowVisibility((url == null) || !url.startsWith("about:"));
notifyListeners(tab, TabEvents.SELECTED);
if (oldTab != null)
@ -263,7 +261,7 @@ public class Tabs implements GeckoEventListener {
mRestoringSession = false;
GeckoApp.mAppContext.mMainHandler.post(new Runnable() {
public void run() {
GeckoApp.mBrowserToolbar.updateTabCount(getCount());
GeckoApp.mBrowserToolbar.refresh();
}
});
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 405 B

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 339 B

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -0,0 +1,11 @@
<?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">
<item android:state_pressed="true" android:drawable="@drawable/address_bar_back_button_pressed_bg"/>
<item android:drawable="@drawable/address_bar_back_button_bg"/>
</selector>

View File

@ -0,0 +1,11 @@
<?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="@android:color/transparent"/>
</shape>

View File

@ -0,0 +1,11 @@
<?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="@android:color/transparent"/>
</shape>

View File

@ -0,0 +1,11 @@
<?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="@android:color/transparent"/>
</shape>

View File

@ -10,6 +10,12 @@
<RelativeLayout android:id="@+id/address_bar"
style="@style/AddressBar"
android:background="@drawable/address_bar_bg">
<ImageButton android:id="@+id/back"
style="@style/AddressBar.ImageButton.Unused"/>
<ImageButton android:id="@+id/forward"
style="@style/AddressBar.ImageButton.Unused"/>
<Button android:id="@+id/awesome_bar"
style="@style/AddressBar.Button"

View File

@ -0,0 +1,109 @@
<?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/. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/browser_toolbar"
style="@style/BrowserToolbar">
<RelativeLayout android:id="@+id/address_bar"
style="@style/AddressBar"
android:background="@android:color/transparent">
<ImageButton android:id="@+id/tabs"
style="@style/AddressBar.ImageButton"
android:layout_width="84dip"
android:layout_alignParentLeft="true"
android:background="@drawable/tabs_button"
android:gravity="center_vertical"
android:src="@drawable/tabs_level"
android:paddingTop="6dip"
android:paddingLeft="12dip"
android:paddingRight="44dip"/>
<TextSwitcher android:id="@+id/tabs_count"
style="@style/AddressBar.ImageButton"
android:layout_width="52dip"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_alignLeft="@id/tabs"
android:gravity="center_horizontal"
android:visibility="gone"/>
<Button android:id="@+id/awesome_bar"
style="@style/AddressBar.Button"
android:layout_width="fill_parent"
android:layout_marginLeft="0dp"
android:layout_marginTop="6dp"
android:layout_marginBottom="6dp"
android:layout_marginRight="6dp"
android:layout_toRightOf="@id/tabs"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:background="@drawable/address_bar_url_default"
android:singleLine="true"
android:gravity="center_vertical|left"
android:hint="@string/awesomebar_default_text"
android:textColor="#222222"
android:paddingLeft="105dip"
android:paddingRight="10dip"/>
<ImageButton android:id="@+id/forward"
style="@style/AddressBar.ImageButton"
android:layout_width="64dip"
android:layout_height="38dip"
android:layout_centerVertical="true"
android:layout_alignLeft="@id/awesome_bar"
android:paddingLeft="22dp"
android:src="@drawable/ic_menu_forward"
android:background="@drawable/action_bar_button"/>
<ImageButton android:id="@+id/back"
style="@style/AddressBar.ImageButton"
android:layout_width="50dip"
android:layout_height="50dip"
android:layout_centerVertical="true"
android:layout_marginLeft="-28dp"
android:layout_alignLeft="@id/awesome_bar"
android:src="@drawable/ic_menu_back"
android:background="@drawable/address_bar_back_button"/>
<ImageButton android:id="@+id/favicon"
style="@style/AddressBar.ImageButton"
android:layout_width="21.33dip"
android:layout_height="21.33dip"
android:layout_marginLeft="10dip"
android:layout_centerVertical="true"
android:src="@drawable/favicon"
android:layout_toRightOf="@id/forward"/>
<ImageButton android:id="@+id/stop"
style="@style/AddressBar.ImageButton"
android:layout_width="28dip"
android:layout_height="28dip"
android:layout_marginRight="10dip"
android:layout_centerVertical="true"
android:src="@drawable/urlbar_stop"
android:layout_alignRight="@id/awesome_bar"
android:visibility="gone"/>
<ImageButton android:id="@+id/site_security"
style="@style/AddressBar.ImageButton"
android:layout_width="24dip"
android:layout_height="24dip"
android:layout_marginRight="10dip"
android:layout_centerVertical="true"
android:src="@drawable/site_security_level"
android:layout_alignRight="@id/awesome_bar"/>
<ImageView android:id="@+id/shadow"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:layout_alignParentBottom="true"
android:background="@drawable/address_bar_bg_shadow_repeat"
android:visibility="gone"/>
</RelativeLayout>
</LinearLayout>

View File

@ -0,0 +1,109 @@
<?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/. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/browser_toolbar"
style="@style/BrowserToolbar">
<RelativeLayout android:id="@+id/address_bar"
style="@style/AddressBar"
android:background="@android:color/transparent">
<ImageButton android:id="@+id/tabs"
style="@style/AddressBar.ImageButton"
android:layout_width="84dip"
android:layout_alignParentLeft="true"
android:background="@drawable/tabs_button"
android:gravity="center_vertical"
android:src="@drawable/tabs_level"
android:paddingTop="6dip"
android:paddingLeft="12dip"
android:paddingRight="44dip"/>
<TextSwitcher android:id="@+id/tabs_count"
style="@style/AddressBar.ImageButton"
android:layout_width="52dip"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_alignLeft="@id/tabs"
android:gravity="center_horizontal"
android:visibility="gone"/>
<Button android:id="@+id/awesome_bar"
style="@style/AddressBar.Button"
android:layout_width="fill_parent"
android:layout_marginLeft="0dp"
android:layout_marginTop="6dp"
android:layout_marginBottom="6dp"
android:layout_marginRight="6dp"
android:layout_toRightOf="@id/tabs"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:background="@drawable/address_bar_url_default"
android:singleLine="true"
android:gravity="center_vertical|left"
android:hint="@string/awesomebar_default_text"
android:textColor="#222222"
android:paddingLeft="105dip"
android:paddingRight="10dip"/>
<ImageButton android:id="@+id/forward"
style="@style/AddressBar.ImageButton"
android:layout_width="64dip"
android:layout_height="38dip"
android:layout_centerVertical="true"
android:layout_alignLeft="@id/awesome_bar"
android:paddingLeft="22dp"
android:src="@drawable/ic_menu_forward"
android:background="@drawable/action_bar_button"/>
<ImageButton android:id="@+id/back"
style="@style/AddressBar.ImageButton"
android:layout_width="50dip"
android:layout_height="50dip"
android:layout_centerVertical="true"
android:layout_marginLeft="-28dp"
android:layout_alignLeft="@id/awesome_bar"
android:src="@drawable/ic_menu_back"
android:background="@drawable/address_bar_back_button"/>
<ImageButton android:id="@+id/favicon"
style="@style/AddressBar.ImageButton"
android:layout_width="21.33dip"
android:layout_height="21.33dip"
android:layout_marginLeft="10dip"
android:layout_centerVertical="true"
android:src="@drawable/favicon"
android:layout_toRightOf="@id/forward"/>
<ImageButton android:id="@+id/stop"
style="@style/AddressBar.ImageButton"
android:layout_width="28dip"
android:layout_height="28dip"
android:layout_marginRight="10dip"
android:layout_centerVertical="true"
android:src="@drawable/urlbar_stop"
android:layout_alignRight="@id/awesome_bar"
android:visibility="gone"/>
<ImageButton android:id="@+id/site_security"
style="@style/AddressBar.ImageButton"
android:layout_width="24dip"
android:layout_height="24dip"
android:layout_marginRight="10dip"
android:layout_centerVertical="true"
android:src="@drawable/site_security_level"
android:layout_alignRight="@id/awesome_bar"/>
<ImageView android:id="@+id/shadow"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:layout_alignParentBottom="true"
android:background="@drawable/address_bar_bg_shadow_repeat"
android:visibility="gone"/>
</RelativeLayout>
</LinearLayout>

View File

@ -10,7 +10,13 @@
<RelativeLayout android:id="@+id/address_bar"
style="@style/AddressBar"
android:background="@drawable/address_bar_bg">
<ImageButton android:id="@+id/back"
style="@style/AddressBar.ImageButton.Unused"/>
<ImageButton android:id="@+id/forward"
style="@style/AddressBar.ImageButton.Unused"/>
<Button android:id="@+id/awesome_bar"
style="@style/AddressBar.Button"
android:layout_width="fill_parent"

View File

@ -59,6 +59,13 @@
<item name="android:background">@android:color/transparent</item>
</style>
<!-- Address bar - Image Button - Unused -->
<style name="AddressBar.ImageButton.Unused">
<item name="android:layout_width">0dip</item>
<item name="android:layout_height">0dip</item>
<item name="android:visibility">gone</item>
</style>
<!-- AwesomeBar -->
<style name="AwesomeBar">
<item name="android:layout_width">fill_parent</item>