Bug 785246: Replace curves on tabs button. [r=mfinkle]

--HG--
rename : mobile/android/base/resources/drawable/tabs_full_button.xml => mobile/android/base/resources/drawable/tabs_button.xml
rename : mobile/android/base/resources/layout-land-v14/browser_toolbar.xml => mobile/android/base/resources/layout-land-v14/browser_toolbar.xml.in
rename : mobile/android/base/resources/layout-land-v14/browser_toolbar_menu.xml => mobile/android/base/resources/layout-land-v14/browser_toolbar_menu.xml.in
rename : mobile/android/base/resources/layout-large-v11/browser_toolbar_menu.xml => mobile/android/base/resources/layout-large-v11/browser_toolbar_menu.xml.in
rename : mobile/android/base/resources/layout-xlarge-v11/awesomebar_search.xml => mobile/android/base/resources/layout-xlarge-v11/awesomebar_search.xml.in
rename : mobile/android/base/resources/layout-xlarge-v11/browser_toolbar_menu.xml => mobile/android/base/resources/layout-xlarge-v11/browser_toolbar_menu.xml.in
rename : mobile/android/base/resources/layout/browser_toolbar.xml => mobile/android/base/resources/layout/browser_toolbar.xml.in
rename : mobile/android/base/resources/layout/browser_toolbar_menu.xml => mobile/android/base/resources/layout/browser_toolbar_menu.xml.in
extra : rebase_source : 13ec55b2f121e056f1ce545bee556aebe3ca953e
This commit is contained in:
Sriram Ramasubramanian 2012-08-31 12:00:24 -07:00
parent e61817be35
commit aafabe1af8
70 changed files with 320 additions and 193 deletions

View File

@ -6,8 +6,8 @@ package org.mozilla.gecko;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Path;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PorterDuffXfermode;
import android.graphics.PorterDuff.Mode;
import android.os.Build;

View File

@ -52,6 +52,8 @@ public final class GeckoViewsFactory implements LayoutInflater.Factory {
return new LinkTextView(context, attrs);
else if (TextUtils.equals(viewName, "FindInPageBar"))
return new FindInPageBar(context, attrs);
else if (TextUtils.equals(viewName, "TabsButton"))
return new TabsButton(context, attrs);
else if (TextUtils.equals(viewName, "TabsPanel"))
return new TabsPanel(context, attrs);
else if (TextUtils.equals(viewName, "TextSelectionHandle"))

View File

@ -111,6 +111,7 @@ FENNEC_JAVA_FILES = \
SurfaceBits.java \
Tab.java \
Tabs.java \
TabsButton.java \
TabsPanel.java \
TabsTray.java \
TabsAccessor.java \
@ -189,10 +190,17 @@ FENNEC_PP_JAVA_FILES = \
FENNEC_PP_XML_FILES = \
res/layout/abouthome_content.xml \
res/layout-xlarge-land-v11/abouthome_content.xml \
res/layout/browser_toolbar.xml \
res/layout/browser_toolbar_menu.xml \
res/layout-land-v14/browser_toolbar.xml \
res/layout-land-v14/browser_toolbar_menu.xml \
res/layout-large-v11/browser_toolbar_menu.xml \
res/layout-xlarge-v11/browser_toolbar_menu.xml \
res/layout/gecko_app.xml \
res/layout-xlarge-v11/gecko_app.xml \
res/layout/text_selection_handles.xml \
res/layout-xlarge-land-v11/abouthome_content.xml \
res/layout-xlarge-v11/awesomebar_search.xml \
res/layout-xlarge-v11/gecko_app.xml \
res/xml/preferences.xml \
res/menu/browser_app_menu.xml \
res/menu-v11/browser_app_menu.xml \
@ -307,8 +315,6 @@ RES_LAYOUT = \
res/layout/awesomebar_tab_indicator.xml \
res/layout/awesomebar_tabs.xml \
res/layout/bookmark_edit.xml \
res/layout/browser_toolbar.xml \
res/layout/browser_toolbar_menu.xml \
res/layout/doorhangerpopup.xml \
res/layout/doorhanger.xml \
res/layout/find_in_page_content.xml \
@ -346,23 +352,18 @@ RES_LAYOUT = \
$(NULL)
RES_LAYOUT_LAND_V14 = \
res/layout-land-v14/browser_toolbar.xml \
res/layout-land-v14/browser_toolbar_menu.xml \
res/layout-land-v14/tabs_panel_toolbar.xml \
res/layout-land-v14/tabs_panel_toolbar_menu.xml \
$(NULL)
RES_LAYOUT_LARGE_V11 = \
res/layout-large-v11/awesomebar_search.xml \
res/layout-large-v11/browser_toolbar_menu.xml \
res/layout-large-v11/doorhangerpopup.xml \
res/layout-large-v11/site_identity_popup.xml \
res/layout-large-v11/tabs_panel_toolbar_menu.xml \
$(NULL)
RES_LAYOUT_XLARGE_V11 = \
res/layout-xlarge-v11/awesomebar_search.xml \
res/layout-xlarge-v11/browser_toolbar_menu.xml \
res/layout-xlarge-v11/font_size_preference.xml \
res/layout-xlarge-v11/remote_tabs_child.xml \
res/layout-xlarge-v11/remote_tabs_group.xml \
@ -459,10 +460,6 @@ RES_DRAWABLE_BASE = \
res/drawable/tab_thumbnail_default.png \
res/drawable/tab_thumbnail_shadow.png \
res/drawable/tabs_carat.png \
res/drawable/tabs_crop_normal.png \
res/drawable/tabs_crop_pressed.png \
res/drawable/tabs_full_normal.png \
res/drawable/tabs_full_pressed.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 \
@ -542,10 +539,6 @@ RES_DRAWABLE_HDPI = \
res/drawable-hdpi/tab_thumbnail_default.png \
res/drawable-hdpi/tab_thumbnail_shadow.png \
res/drawable-hdpi/tabs_carat.png \
res/drawable-hdpi/tabs_crop_normal.png \
res/drawable-hdpi/tabs_crop_pressed.png \
res/drawable-hdpi/tabs_full_normal.png \
res/drawable-hdpi/tabs_full_pressed.png \
res/drawable-hdpi/address_bar_texture_port.png \
res/drawable-hdpi/address_bar_url_default.9.png \
res/drawable-hdpi/address_bar_url_pressed.9.png \
@ -609,10 +602,6 @@ RES_DRAWABLE_XHDPI = \
res/drawable-xhdpi/tab_thumbnail_default.png \
res/drawable-xhdpi/tab_thumbnail_shadow.png \
res/drawable-xhdpi/tabs_carat.png \
res/drawable-xhdpi/tabs_crop_normal.png \
res/drawable-xhdpi/tabs_crop_pressed.png \
res/drawable-xhdpi/tabs_full_normal.png \
res/drawable-xhdpi/tabs_full_pressed.png \
res/drawable-xhdpi/doorhanger_arrow.png \
res/drawable-xhdpi/doorhanger_bg.9.png \
res/drawable-xhdpi/doorhanger_shadow_bg.9.png \
@ -736,10 +725,6 @@ RES_DRAWABLE_LAND_MDPI_V14 = \
res/drawable-land-mdpi-v14/tab_new_normal.png \
res/drawable-land-mdpi-v14/tab_new_pressed.png \
res/drawable-land-mdpi-v14/tabs_carat.png \
res/drawable-land-mdpi-v14/tabs_crop_normal.png \
res/drawable-land-mdpi-v14/tabs_crop_pressed.png \
res/drawable-land-mdpi-v14/tabs_full_normal.png \
res/drawable-land-mdpi-v14/tabs_full_pressed.png \
res/drawable-land-mdpi-v14/urlbar_stop.png \
res/drawable-land-mdpi-v14/menu.png \
res/drawable-land-mdpi-v14/menu_normal.png \
@ -761,10 +746,6 @@ RES_DRAWABLE_LAND_HDPI_V14 = \
res/drawable-land-hdpi-v14/tab_new_normal.png \
res/drawable-land-hdpi-v14/tab_new_pressed.png \
res/drawable-land-hdpi-v14/tabs_carat.png \
res/drawable-land-hdpi-v14/tabs_crop_normal.png \
res/drawable-land-hdpi-v14/tabs_crop_pressed.png \
res/drawable-land-hdpi-v14/tabs_full_normal.png \
res/drawable-land-hdpi-v14/tabs_full_pressed.png \
res/drawable-land-hdpi-v14/urlbar_stop.png \
res/drawable-land-hdpi-v14/menu.png \
res/drawable-land-hdpi-v14/menu_normal.png \
@ -786,10 +767,6 @@ RES_DRAWABLE_LAND_XHDPI_V14 = \
res/drawable-land-xhdpi-v14/tab_new_normal.png \
res/drawable-land-xhdpi-v14/tab_new_pressed.png \
res/drawable-land-xhdpi-v14/tabs_carat.png \
res/drawable-land-xhdpi-v14/tabs_crop_normal.png \
res/drawable-land-xhdpi-v14/tabs_crop_pressed.png \
res/drawable-land-xhdpi-v14/tabs_full_normal.png \
res/drawable-land-xhdpi-v14/tabs_full_pressed.png \
res/drawable-land-xhdpi-v14/urlbar_stop.png \
res/drawable-land-xhdpi-v14/menu.png \
res/drawable-land-xhdpi-v14/menu_normal.png \
@ -825,10 +802,6 @@ RES_DRAWABLE_LARGE_MDPI_V11 = \
res/drawable-large-mdpi-v11/menu_normal.png \
res/drawable-large-mdpi-v11/menu_pressed.png \
res/drawable-large-mdpi-v11/tabs_carat.png \
res/drawable-large-mdpi-v11/tabs_crop_normal.png \
res/drawable-large-mdpi-v11/tabs_crop_pressed.png \
res/drawable-large-mdpi-v11/tabs_full_normal.png \
res/drawable-large-mdpi-v11/tabs_full_pressed.png \
$(NULL)
RES_DRAWABLE_LARGE_HDPI_V11 = \
@ -856,10 +829,6 @@ RES_DRAWABLE_LARGE_HDPI_V11 = \
res/drawable-large-hdpi-v11/menu_normal.png \
res/drawable-large-hdpi-v11/menu_pressed.png \
res/drawable-large-hdpi-v11/tabs_carat.png \
res/drawable-large-hdpi-v11/tabs_crop_normal.png \
res/drawable-large-hdpi-v11/tabs_crop_pressed.png \
res/drawable-large-hdpi-v11/tabs_full_normal.png \
res/drawable-large-hdpi-v11/tabs_full_pressed.png \
$(NULL)
RES_DRAWABLE_LARGE_XHDPI_V11 = \
@ -887,10 +856,6 @@ RES_DRAWABLE_LARGE_XHDPI_V11 = \
res/drawable-large-xhdpi-v11/menu_normal.png \
res/drawable-large-xhdpi-v11/menu_pressed.png \
res/drawable-large-xhdpi-v11/tabs_carat.png \
res/drawable-large-xhdpi-v11/tabs_crop_normal.png \
res/drawable-large-xhdpi-v11/tabs_crop_pressed.png \
res/drawable-large-xhdpi-v11/tabs_full_normal.png \
res/drawable-large-xhdpi-v11/tabs_full_pressed.png \
$(NULL)
RES_DRAWABLE_XLARGE_MDPI_V11 = \
@ -898,14 +863,10 @@ RES_DRAWABLE_XLARGE_MDPI_V11 = \
res/drawable-xlarge-mdpi-v11/awesomebar_tab_left.9.png \
res/drawable-xlarge-mdpi-v11/awesomebar_tab_right.9.png \
res/drawable-xlarge-mdpi-v11/menu.png \
res/drawable-xlarge-mdpi-v11/tabs_crop_button.xml \
res/drawable-xlarge-mdpi-v11/tabs_button.xml \
res/drawable-xlarge-mdpi-v11/tabs_carat_contracted.png \
res/drawable-xlarge-mdpi-v11/tabs_carat_expanded.png \
res/drawable-xlarge-mdpi-v11/tabs_crop_expanded_normal.png \
res/drawable-xlarge-mdpi-v11/tabs_crop_expanded_pressed.png \
res/drawable-xlarge-mdpi-v11/tabs_level.xml \
res/drawable-xlarge-mdpi-v11/tabs_crop_normal.png \
res/drawable-xlarge-mdpi-v11/tabs_crop_pressed.png \
$(NULL)
RES_DRAWABLE_XLARGE_HDPI_V11 = \
@ -915,10 +876,6 @@ RES_DRAWABLE_XLARGE_HDPI_V11 = \
res/drawable-xlarge-hdpi-v11/menu.png \
res/drawable-xlarge-hdpi-v11/tabs_carat_contracted.png \
res/drawable-xlarge-hdpi-v11/tabs_carat_expanded.png \
res/drawable-xlarge-hdpi-v11/tabs_crop_expanded_normal.png \
res/drawable-xlarge-hdpi-v11/tabs_crop_expanded_pressed.png \
res/drawable-xlarge-hdpi-v11/tabs_crop_normal.png \
res/drawable-xlarge-hdpi-v11/tabs_crop_pressed.png \
$(NULL)
RES_DRAWABLE_XLARGE_XHDPI_V11 = \
@ -928,10 +885,6 @@ RES_DRAWABLE_XLARGE_XHDPI_V11 = \
res/drawable-xlarge-xhdpi-v11/menu.png \
res/drawable-xlarge-xhdpi-v11/tabs_carat_contracted.png \
res/drawable-xlarge-xhdpi-v11/tabs_carat_expanded.png \
res/drawable-xlarge-xhdpi-v11/tabs_crop_expanded_normal.png \
res/drawable-xlarge-xhdpi-v11/tabs_crop_expanded_pressed.png \
res/drawable-xlarge-xhdpi-v11/tabs_crop_normal.png \
res/drawable-xlarge-xhdpi-v11/tabs_crop_pressed.png \
$(NULL)
RES_COLOR = \
@ -986,11 +939,7 @@ MOZ_ANDROID_DRAWABLES += \
mobile/android/base/resources/drawable/site_security_level.xml \
mobile/android/base/resources/drawable/suggestion_selector.xml \
mobile/android/base/resources/drawable/tab_new_button.xml \
mobile/android/base/resources/drawable/tabs_crop_button.xml \
mobile/android/base/resources/drawable/tabs_full_button.xml \
mobile/android/base/resources/drawable/tabs_crop_button_contracted.xml \
mobile/android/base/resources/drawable/tabs_full_button_contracted.xml \
mobile/android/base/resources/drawable/tabs_crop_button_expanded.xml \
mobile/android/base/resources/drawable/tabs_button.xml \
mobile/android/base/resources/drawable/tabs_level.xml \
mobile/android/base/resources/drawable/tabs_tray_bg_repeat.xml \
mobile/android/base/resources/drawable/tabs_tray_selected_bg_repeat.xml \

View File

@ -0,0 +1,163 @@
/* 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 android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PorterDuffXfermode;
import android.graphics.PorterDuff.Mode;
import android.util.AttributeSet;
import android.widget.ImageButton;
public class TabsButton extends ImageButton
implements CanvasDelegate.DrawManager {
Paint mPaint;
Path mPath;
Path mBackgroundPath;
Path mLeftCurve;
Path mRightCurve;
boolean mCropped;
int mFullWidth;
CurveTowards mSide;
CanvasDelegate mCanvasDelegate;
private enum CurveTowards { NONE, LEFT, RIGHT };
public TabsButton(Context context, AttributeSet attrs) {
super(context, attrs);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.BrowserToolbarCurve);
int curveTowards = a.getInt(R.styleable.BrowserToolbarCurve_curveTowards, 0x02);
a.recycle();
a = context.obtainStyledAttributes(attrs, R.styleable.TabsButton);
mCropped = a.getBoolean(R.styleable.TabsButton_cropped, false);
a.recycle();
if (curveTowards == 0x00)
mSide = CurveTowards.NONE;
else if (curveTowards == 0x01)
mSide = CurveTowards.LEFT;
else
mSide = CurveTowards.RIGHT;
// Paint to draw the background.
mPaint = new Paint();
mPaint.setAntiAlias(true);
mPaint.setColor(0xFF000000);
// Path is masked.
mPath = new Path();
mBackgroundPath = new Path();
mLeftCurve = new Path();
mRightCurve = new Path();
mCanvasDelegate = new CanvasDelegate(this, Mode.DST_IN);
// Path might extend beyond the screen for smaller tabs button.
mFullWidth = (int) context.getResources().getDimension(R.dimen.tabs_button_full_width);
}
@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int width = getMeasuredWidth();
int height = getMeasuredHeight();
float curve = height * 1.125f;
// The bounds for the rectangle to carve the curves.
float left;
float right;
float top;
float bottom;
if (mSide == CurveTowards.RIGHT) {
left = 0;
right = mFullWidth;
top = 0;
bottom = height;
} else {
left = width - mFullWidth;
right = width;
top = height;
bottom = 0;
}
mLeftCurve.reset();
mLeftCurve.moveTo(left, top);
mLeftCurve.cubicTo(left + (curve * 0.75f), top,
left + (curve * 0.25f), bottom,
left + curve, bottom);
mRightCurve.reset();
mRightCurve.moveTo(right, bottom);
mRightCurve.cubicTo(right - (curve * 0.75f), bottom,
right - (curve * 0.25f), top,
right - curve, top);
mPath.reset();
// Level 2: for phones: transparent.
// for tablets: only one curve.
Drawable background = getBackground();
if (!(background.getCurrent() instanceof ColorDrawable)) {
if (background.getLevel() == 2) {
mPath.moveTo(left, top);
mPath.lineTo(left, bottom);
mPath.lineTo(right, bottom);
mPath.addPath(mRightCurve);
mPath.lineTo(left, top);
} else {
mPath.moveTo(left, top);
mPath.addPath(mLeftCurve);
mPath.lineTo(right, bottom);
mPath.addPath(mRightCurve);
mPath.lineTo(left, top);
}
}
if (mCropped) {
mBackgroundPath.reset();
if (mSide == CurveTowards.RIGHT) {
mBackgroundPath.moveTo(right, bottom);
mBackgroundPath.addPath(mRightCurve);
mBackgroundPath.lineTo(right, top);
mBackgroundPath.lineTo(right, bottom);
} else {
mBackgroundPath.moveTo(left, top);
mBackgroundPath.addPath(mLeftCurve);
mBackgroundPath.lineTo(left, bottom);
mBackgroundPath.lineTo(left, top);
}
}
}
@Override
public void draw(Canvas canvas) {
mCanvasDelegate.draw(canvas, mPath, getWidth(), getHeight());
Drawable background = getBackground();
if (background.getCurrent() instanceof ColorDrawable)
return;
// Additionally draw a black curve for cropped button's default level.
if (mCropped && background.getLevel() != 2)
canvas.drawPath(mBackgroundPath, mPaint);
}
@Override
public void defaultDraw(Canvas canvas) {
super.draw(canvas);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

View File

@ -0,0 +1,22 @@
<?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/. -->
<level-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:maxLevel="1">
<selector>
<item android:state_pressed="true" android:drawable="@drawable/highlight"/>
<item android:drawable="@drawable/tabs_tray_bg_repeat"/>
</selector>
</item>
<item android:maxLevel="2">
<selector>
<item android:state_pressed="true" android:drawable="@drawable/highlight"/>
<item android:drawable="@drawable/tabs_tray_bg_repeat"/>
</selector>
</item>
</level-list>

View File

@ -1,11 +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/. -->
<level-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:maxLevel="1" android:drawable="@drawable/tabs_crop_button_contracted"/>
<item android:maxLevel="2" android:drawable="@drawable/tabs_crop_button_expanded"/>
</level-list>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@ -5,7 +5,13 @@
<level-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:maxLevel="1" android:drawable="@drawable/tabs_crop_button_contracted"/>
<item android:maxLevel="1">
<selector>
<item android:state_pressed="true" android:drawable="@drawable/highlight"/>
<item android:drawable="@drawable/tabs_tray_bg_repeat"/>
</selector>
</item>
<item android:maxLevel="2" android:drawable="@android:color/transparent"/>
</level-list>

View File

@ -1,11 +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/. -->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/tabs_crop_pressed"/>
<item android:drawable="@drawable/tabs_crop_normal"/>
</selector>

View File

@ -1,11 +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/. -->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/tabs_crop_expanded_pressed"/>
<item android:drawable="@drawable/tabs_crop_expanded_normal"/>
</selector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -1,11 +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/. -->
<level-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:maxLevel="1" android:drawable="@drawable/tabs_full_button_contracted"/>
<item android:maxLevel="2" android:drawable="@android:color/transparent"/>
</level-list>

View File

@ -1,11 +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/. -->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/tabs_full_pressed"/>
<item android:drawable="@drawable/tabs_full_normal"/>
</selector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -1,9 +1,11 @@
#filter substitution
<?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"
xmlns:gecko="http://schemas.android.com/apk/res/@ANDROID_PACKAGE_NAME@"
android:id="@+id/browser_toolbar"
style="@style/BrowserToolbar">
@ -33,15 +35,17 @@
<ImageButton android:id="@+id/menu"
style="@style/AddressBar.ImageButton.Unused"/>
<ImageButton android:id="@+id/tabs"
style="@style/AddressBar.ImageButton"
android:layout_width="60dip"
android:layout_alignParentRight="true"
android:background="@drawable/tabs_crop_button"
android:gravity="center_vertical"
android:src="@drawable/tabs_level"
android:paddingLeft="30dip"
android:paddingRight="10dip"/>
<org.mozilla.gecko.TabsButton android:id="@+id/tabs"
style="@style/AddressBar.ImageButton"
android:layout_width="60dip"
android:layout_alignParentRight="true"
gecko:curveTowards="right"
gecko:cropped="true"
android:background="@drawable/tabs_button"
android:gravity="center_vertical"
android:src="@drawable/tabs_level"
android:paddingLeft="30dip"
android:paddingRight="10dip"/>
<TextSwitcher android:id="@+id/tabs_count"
style="@style/AddressBar.ImageButton"

View File

@ -1,9 +1,11 @@
#filter substitution
<?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"
xmlns:gecko="http://schemas.android.com/apk/res/@ANDROID_PACKAGE_NAME@"
android:id="@+id/browser_toolbar"
style="@style/BrowserToolbar">
@ -41,16 +43,17 @@
android:paddingLeft="35dip"
android:paddingRight="10dip"/>
<ImageButton android:id="@+id/tabs"
style="@style/AddressBar.ImageButton"
android:layout_width="80dip"
android:layout_marginRight="15dip"
android:layout_alignParentRight="true"
android:background="@drawable/tabs_full_button"
android:gravity="center_vertical"
android:src="@drawable/tabs_level"
android:paddingLeft="30dip"
android:paddingRight="30dip"/>
<org.mozilla.gecko.TabsButton android:id="@+id/tabs"
style="@style/AddressBar.ImageButton"
android:layout_width="80dip"
android:layout_marginRight="15dip"
android:layout_alignParentRight="true"
gecko:curveTowards="right"
android:background="@drawable/tabs_button"
android:gravity="center_vertical"
android:src="@drawable/tabs_level"
android:paddingLeft="30dip"
android:paddingRight="30dip"/>
<TextSwitcher android:id="@+id/tabs_count"
style="@style/AddressBar.ImageButton"

View File

@ -1,9 +1,11 @@
#filter substitution
<?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"
xmlns:gecko="http://schemas.android.com/apk/res/@ANDROID_PACKAGE_NAME@"
android:id="@+id/browser_toolbar"
style="@style/BrowserToolbar">
@ -29,16 +31,17 @@
android:paddingRight="14dip"
android:visibility="gone"/>
<ImageButton android:id="@+id/tabs"
style="@style/AddressBar.ImageButton"
android:layout_width="112dip"
android:layout_marginRight="28dip"
android:layout_alignParentRight="true"
android:background="@drawable/tabs_full_button"
android:gravity="center_vertical"
android:src="@drawable/tabs_level"
android:paddingLeft="42dip"
android:paddingRight="42dip"/>
<org.mozilla.gecko.TabsButton android:id="@+id/tabs"
style="@style/AddressBar.ImageButton"
android:layout_width="112dip"
android:layout_marginRight="28dip"
android:layout_alignParentRight="true"
gecko:curveTowards="right"
android:background="@drawable/tabs_button"
android:gravity="center_vertical"
android:src="@drawable/tabs_level"
android:paddingLeft="42dip"
android:paddingRight="42dip"/>
<TextSwitcher android:id="@+id/tabs_count"
style="@style/AddressBar.ImageButton"

View File

@ -1,18 +1,22 @@
#filter substitution
<?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/. -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gecko="http://schemas.android.com/apk/res/@ANDROID_PACKAGE_NAME@"
style="@style/AwesomeBar"
android:background="@drawable/address_bar_bg">
<ImageView android:id="@+id/dummy_tab"
style="@style/AddressBar.ImageButton"
android:layout_width="84dip"
android:layout_alignParentLeft="true"
android:background="@drawable/tabs_crop_normal"
android:gravity="center_vertical"/>
<org.mozilla.gecko.TabsButton android:id="@+id/dummy_tab"
style="@style/AddressBar.ImageButton"
android:layout_width="84dip"
android:layout_alignParentLeft="true"
gecko:curveTowards="left"
gecko:cropped="true"
android:background="@drawable/tabs_button"
android:gravity="center_vertical"/>
<view class="org.mozilla.gecko.CustomEditText"
android:id="@+id/awesomebar_text"

View File

@ -1,9 +1,11 @@
#filter substitution
<?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"
xmlns:gecko="http://schemas.android.com/apk/res/@ANDROID_PACKAGE_NAME@"
android:id="@+id/browser_toolbar"
style="@style/BrowserToolbar">
@ -11,15 +13,17 @@
style="@style/AddressBar"
android:background="@drawable/address_bar_bg">
<ImageButton android:id="@+id/tabs"
style="@style/AddressBar.ImageButton"
android:layout_width="84dip"
android:layout_alignParentLeft="true"
android:background="@drawable/tabs_crop_button"
android:gravity="center_vertical"
android:src="@drawable/tabs_level"
android:paddingLeft="6dip"
android:paddingRight="32dip"/>
<org.mozilla.gecko.TabsButton android:id="@+id/tabs"
style="@style/AddressBar.ImageButton"
android:layout_width="84dip"
android:layout_alignParentLeft="true"
gecko:curveTowards="left"
gecko:cropped="true"
android:background="@drawable/tabs_button"
android:gravity="center_vertical"
android:src="@drawable/tabs_level"
android:paddingLeft="6dip"
android:paddingRight="32dip"/>
<TextSwitcher android:id="@+id/tabs_count"
style="@style/AddressBar.ImageButton"

View File

@ -1,9 +1,11 @@
#filter substitution
<?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"
xmlns:gecko="http://schemas.android.com/apk/res/@ANDROID_PACKAGE_NAME@"
android:id="@+id/browser_toolbar"
style="@style/BrowserToolbar">
@ -33,15 +35,17 @@
<ImageButton android:id="@+id/menu"
style="@style/AddressBar.ImageButton.Unused"/>
<ImageButton android:id="@+id/tabs"
style="@style/AddressBar.ImageButton"
android:layout_width="72dip"
android:layout_alignParentRight="true"
android:background="@drawable/tabs_crop_button"
android:gravity="center_vertical"
android:src="@drawable/tabs_level"
android:paddingLeft="38dip"
android:paddingRight="10dip"/>
<org.mozilla.gecko.TabsButton android:id="@+id/tabs"
style="@style/AddressBar.ImageButton"
android:layout_width="72dip"
android:layout_alignParentRight="true"
gecko:curveTowards="right"
gecko:cropped="true"
android:background="@drawable/tabs_button"
android:gravity="center_vertical"
android:src="@drawable/tabs_level"
android:paddingLeft="38dip"
android:paddingRight="10dip"/>
<TextSwitcher android:id="@+id/tabs_count"
style="@style/AddressBar.ImageButton"

View File

@ -1,9 +1,11 @@
#filter substitution
<?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"
xmlns:gecko="http://schemas.android.com/apk/res/@ANDROID_PACKAGE_NAME@"
android:id="@+id/browser_toolbar"
style="@style/BrowserToolbar">
@ -34,6 +36,7 @@
style="@style/AddressBar.ImageButton"
android:layout_width="78dip"
android:layout_alignParentRight="true"
gecko:curveTowards="right"
android:gravity="center_vertical"
android:src="@drawable/menu_level"
android:contentDescription="@string/menu"
@ -42,16 +45,16 @@
android:paddingRight="12dip"
android:visibility="gone"/>
<ImageButton android:id="@+id/tabs"
style="@style/AddressBar.ImageButton"
android:layout_width="98dip"
android:layout_marginRight="22dip"
android:layout_alignParentRight="true"
android:background="@drawable/tabs_full_button"
android:gravity="center_vertical"
android:src="@drawable/tabs_level"
android:paddingLeft="38dip"
android:paddingRight="36dip"/>
<org.mozilla.gecko.TabsButton android:id="@+id/tabs"
style="@style/AddressBar.ImageButton"
android:layout_width="98dip"
android:layout_marginRight="22dip"
android:layout_alignParentRight="true"
android:background="@drawable/tabs_button"
android:gravity="center_vertical"
android:src="@drawable/tabs_level"
android:paddingLeft="38dip"
android:paddingRight="36dip"/>
<TextSwitcher android:id="@+id/tabs_count"
style="@style/AddressBar.ImageButton"

View File

@ -8,5 +8,6 @@
<dimen name="browser_toolbar_height">40dp</dimen>
<dimen name="browser_toolbar_icon_width">46dp</dimen>
<dimen name="tabs_counter_size">18sp</dimen>
<dimen name="tabs_button_full_width">80dp</dimen>
</resources>

View File

@ -8,5 +8,6 @@
<dimen name="browser_toolbar_height">56dp</dimen>
<dimen name="browser_toolbar_icon_width">45dp</dimen>
<dimen name="tabs_counter_size">26sp</dimen>
<dimen name="tabs_button_full_width">112dp</dimen>
</resources>

View File

@ -6,9 +6,9 @@
<resources>
<declare-styleable name="AboutHomeSection">
<attr name="title" format="string"/>
<attr name="subtitle" format="string"/>
<attr name="more_text" format="string"/>
<attr name="title" format="string"/>
<attr name="subtitle" format="string"/>
<attr name="more_text" format="string"/>
</declare-styleable>
<declare-styleable name="MenuItem">
@ -24,21 +24,33 @@
</declare-styleable>
<declare-styleable name="FlowLayout">
<attr name="spacing" format="dimension"/>
<attr name="spacing" format="dimension"/>
</declare-styleable>
<declare-styleable name="MultiChoicePreference">
<attr name="entries" format="string"/>
<attr name="entryKeys" format="string"/>
<attr name="initialValues" format="string"/>
<attr name="entries" format="string"/>
<attr name="entryKeys" format="string"/>
<attr name="initialValues" format="string"/>
</declare-styleable>
<declare-styleable name="BrowserToolbarCurve">
<attr name="curveTowards">
<flag name="none" value="0x00" />
<flag name="left" value="0x01" />
<flag name="right" value ="0x02" />
</attr>
</declare-styleable>
<declare-styleable name="TabsButton">
<attr name="cropped" format="boolean"/>
</declare-styleable>
<declare-styleable name="TabsPanel">
<attr name="sidebar" format="boolean"/>
<attr name="sidebar" format="boolean"/>
</declare-styleable>
<declare-styleable name="TextSelectionHandle">
<attr name="handleType" format="string"/>
<attr name="handleType" format="string"/>
</declare-styleable>
</resources>

View File

@ -32,8 +32,9 @@
<dimen name="popup_width">400dp</dimen>
<dimen name="tab_thumbnail_height">78dp</dimen>
<dimen name="tab_thumbnail_width">136dp</dimen>
<dimen name="tabs_list_divider_height">2dp</dimen>
<dimen name="tabs_button_full_width">98dp</dimen>
<dimen name="tabs_counter_size">22sp</dimen>
<dimen name="tabs_list_divider_height">2dp</dimen>
<dimen name="text_selection_handle_width">30dp</dimen>
<dimen name="text_selection_handle_height">44dp</dimen>
<dimen name="text_selection_handle_shadow">2dp</dimen>