зеркало из https://github.com/mozilla/gecko-dev.git
Bug 785994: Use ListView for custom menu. [r=mfinkle]
--HG-- extra : rebase_source : 64fa013dca7844e77b41c1a87a163665d91bdf47
This commit is contained in:
Родитель
4444ef8203
Коммит
87922539e0
|
@ -83,7 +83,6 @@ import android.widget.FrameLayout;
|
|||
import android.widget.LinearLayout;
|
||||
import android.widget.ListView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
|
@ -472,10 +471,10 @@ abstract public class GeckoApp
|
|||
}
|
||||
|
||||
// MenuPanel holds the scrollable Menu
|
||||
public static class MenuPanel extends ScrollView {
|
||||
public static class MenuPanel extends LinearLayout {
|
||||
public MenuPanel(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
setLayoutParams(new ViewGroup.LayoutParams((int) context.getResources().getDimension(R.dimen.menu_item_row_width),
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT));
|
||||
}
|
||||
|
||||
|
|
|
@ -4,23 +4,33 @@
|
|||
|
||||
package org.mozilla.gecko;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.SubMenu;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ListView;
|
||||
import android.widget.LinearLayout.LayoutParams;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GeckoMenu extends LinearLayout
|
||||
implements Menu, GeckoMenuItem.OnShowAsActionChangedListener {
|
||||
public class GeckoMenu extends ListView
|
||||
implements Menu,
|
||||
MenuItem.OnMenuItemClickListener,
|
||||
AdapterView.OnItemClickListener,
|
||||
GeckoMenuItem.OnVisibilityChangedListener,
|
||||
GeckoMenuItem.OnShowAsActionChangedListener {
|
||||
private static final String LOGTAG = "GeckoMenu";
|
||||
|
||||
private Context mContext;
|
||||
|
@ -33,7 +43,7 @@ public class GeckoMenu extends LinearLayout
|
|||
|
||||
private static final int NO_ID = 0;
|
||||
|
||||
// Default list of items.
|
||||
// List of all menu items.
|
||||
private List<GeckoMenuItem> mItems;
|
||||
|
||||
// List of items in action-bar.
|
||||
|
@ -42,17 +52,32 @@ public class GeckoMenu extends LinearLayout
|
|||
// Reference to action-items bar in action-bar.
|
||||
private ActionItemBarPresenter mActionItemBarPresenter;
|
||||
|
||||
// Adapter to hold the list of menu items.
|
||||
private MenuItemsAdapter mAdapter;
|
||||
|
||||
// ActionBar to show the menu items as icons.
|
||||
private LinearLayout mActionBar;
|
||||
|
||||
public GeckoMenu(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
mContext = context;
|
||||
|
||||
setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
|
||||
LayoutParams.WRAP_CONTENT));
|
||||
setOrientation(VERTICAL);
|
||||
LayoutParams.FILL_PARENT));
|
||||
|
||||
// Add a header view that acts as an action-bar.
|
||||
mActionBar = (LinearLayout) LayoutInflater.from(mContext).inflate(R.layout.menu_action_bar, null);
|
||||
|
||||
// Attach an adapter.
|
||||
mAdapter = new MenuItemsAdapter(context);
|
||||
setAdapter(mAdapter);
|
||||
setOnItemClickListener(this);
|
||||
|
||||
mItems = new ArrayList<GeckoMenuItem>();
|
||||
mActionItems = new ArrayList<GeckoMenuItem>();
|
||||
|
||||
mActionItemBarPresenter = new DefaultActionItemBarPresenter(mContext, mActionBar);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -89,44 +114,28 @@ public class GeckoMenu extends LinearLayout
|
|||
|
||||
private void addItem(GeckoMenuItem menuItem) {
|
||||
menuItem.setOnShowAsActionChangedListener(this);
|
||||
|
||||
// Insert it in proper order.
|
||||
int index = 0;
|
||||
for (GeckoMenuItem item : mItems) {
|
||||
if (item.getOrder() > menuItem.getOrder()) {
|
||||
mItems.add(index, menuItem);
|
||||
|
||||
// Account for the items in the action-bar.
|
||||
if (mActionItemBarPresenter != null)
|
||||
addView(menuItem.getLayout(), index - mActionItemBarPresenter.getActionItemsCount());
|
||||
else
|
||||
addView(menuItem.getLayout(), index);
|
||||
|
||||
return;
|
||||
} else {
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
// Add the menuItem at the end.
|
||||
menuItem.setOnVisibilityChangedListener(this);
|
||||
menuItem.setOnMenuItemClickListener(this);
|
||||
mAdapter.addMenuItem(menuItem);
|
||||
mItems.add(menuItem);
|
||||
addView(menuItem.getLayout());
|
||||
}
|
||||
|
||||
private void addActionItem(GeckoMenuItem menuItem) {
|
||||
menuItem.setOnShowAsActionChangedListener(this);
|
||||
menuItem.setOnVisibilityChangedListener(null);
|
||||
menuItem.setOnMenuItemClickListener(this);
|
||||
|
||||
int index = 0;
|
||||
for (GeckoMenuItem item : mItems) {
|
||||
if (item.getOrder() <= menuItem.getOrder())
|
||||
index++;
|
||||
else
|
||||
break;
|
||||
if (mActionItems.size() == 0 &&
|
||||
mActionItemBarPresenter instanceof DefaultActionItemBarPresenter) {
|
||||
// Reset the adapter before adding the header view to a list.
|
||||
setAdapter(null);
|
||||
addHeaderView(mActionBar);
|
||||
setAdapter(mAdapter);
|
||||
}
|
||||
|
||||
mActionItems.add(menuItem);
|
||||
mItems.add(index, menuItem);
|
||||
mActionItemBarPresenter.addActionItem(menuItem.getLayout());
|
||||
mItems.add(menuItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -210,20 +219,28 @@ public class GeckoMenu extends LinearLayout
|
|||
|
||||
@Override
|
||||
public void removeItem(int id) {
|
||||
for (GeckoMenuItem menuItem : mItems) {
|
||||
if (menuItem.getItemId() == id) {
|
||||
if (mActionItems.contains(menuItem)) {
|
||||
if (mActionItemBarPresenter != null)
|
||||
mActionItemBarPresenter.removeActionItem(mActionItems.indexOf(menuItem));
|
||||
GeckoMenuItem item = (GeckoMenuItem) findItem(id);
|
||||
if (item != null) {
|
||||
if (mActionItems.contains(item)) {
|
||||
if (mActionItemBarPresenter != null)
|
||||
mActionItemBarPresenter.removeActionItem(mActionItems.indexOf(item));
|
||||
|
||||
mActionItems.remove(menuItem);
|
||||
} else {
|
||||
removeView(findViewById(id));
|
||||
mActionItems.remove(item);
|
||||
mItems.remove(item);
|
||||
|
||||
if (mActionItems.size() == 0 &&
|
||||
mActionItemBarPresenter instanceof DefaultActionItemBarPresenter) {
|
||||
// Reset the adapter before removing the header view from a list.
|
||||
setAdapter(null);
|
||||
removeHeaderView(mActionBar);
|
||||
setAdapter(mAdapter);
|
||||
}
|
||||
|
||||
mItems.remove(menuItem);
|
||||
return;
|
||||
}
|
||||
|
||||
mAdapter.removeMenuItem(item);
|
||||
mItems.remove(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -263,7 +280,171 @@ public class GeckoMenu extends LinearLayout
|
|||
addItem(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVisibilityChanged(GeckoMenuItem item, boolean isVisible) {
|
||||
if (isVisible)
|
||||
mAdapter.addMenuItem(item);
|
||||
else
|
||||
mAdapter.removeMenuItem(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
position -= getHeaderViewsCount();
|
||||
GeckoMenuItem item = mAdapter.getItem(position);
|
||||
if (item.isEnabled())
|
||||
item.onClick(item.getLayout());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
Activity activity = (Activity) mContext;
|
||||
boolean result = activity.onOptionsItemSelected(item);
|
||||
activity.closeOptionsMenu();
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setActionItemBarPresenter(ActionItemBarPresenter presenter) {
|
||||
mActionItemBarPresenter = presenter;
|
||||
}
|
||||
|
||||
// Action Items are added to the header view by default.
|
||||
// URL bar can register itself as a presenter, in case it has a different place to show them.
|
||||
private class DefaultActionItemBarPresenter implements ActionItemBarPresenter {
|
||||
private Context mContext;
|
||||
private LinearLayout mContainer;
|
||||
private List<View> mItems;
|
||||
|
||||
private class Divider extends LinearLayout {
|
||||
public Divider(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
setLayoutParams(new LinearLayout.LayoutParams((int) context.getResources().getDisplayMetrics().density,
|
||||
LinearLayout.LayoutParams.FILL_PARENT));
|
||||
setBackgroundColor(0xFFD1D5DA);
|
||||
}
|
||||
}
|
||||
|
||||
public DefaultActionItemBarPresenter(Context context, LinearLayout container) {
|
||||
mContext = context;
|
||||
mContainer = container;
|
||||
mItems = new ArrayList<View>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addActionItem(View actionItem) {
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(actionItem.getLayoutParams());
|
||||
params.weight = 1.0f;
|
||||
actionItem.setLayoutParams(params);
|
||||
|
||||
if (mItems.size() > 0) {
|
||||
Divider divider = new Divider(mContext, null);
|
||||
mContainer.addView(divider);
|
||||
}
|
||||
|
||||
mContainer.addView(actionItem);
|
||||
mItems.add(actionItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeActionItem(int index) {
|
||||
// Remove the icon and the vertical divider.
|
||||
mContainer.removeViewAt(index * 2);
|
||||
|
||||
if (index != 0)
|
||||
mContainer.removeViewAt(index * 2 - 1);
|
||||
|
||||
mItems.remove(index);
|
||||
|
||||
if (mItems.size() == 0)
|
||||
mContainer.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getActionItemsCount() {
|
||||
return mItems.size();
|
||||
}
|
||||
}
|
||||
|
||||
// Adapter to bind menu items to the list.
|
||||
private class MenuItemsAdapter extends BaseAdapter {
|
||||
private Context mContext;
|
||||
private List<GeckoMenuItem> mItems;
|
||||
|
||||
public MenuItemsAdapter(Context context) {
|
||||
mContext = context;
|
||||
mItems = new ArrayList<GeckoMenuItem>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return (mItems == null ? 0 : mItems.size());
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeckoMenuItem getItem(int position) {
|
||||
return mItems.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
return mItems.get(position).getLayout();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean areAllItemsEnabled() {
|
||||
for (GeckoMenuItem item : mItems) {
|
||||
if (!item.isEnabled())
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled(int position) {
|
||||
return getItem(position).isEnabled();
|
||||
}
|
||||
|
||||
public void addMenuItem(GeckoMenuItem menuItem) {
|
||||
if (mItems.contains(menuItem))
|
||||
return;
|
||||
|
||||
// Insert it in proper order.
|
||||
int index = 0;
|
||||
for (GeckoMenuItem item : mItems) {
|
||||
if (item.getOrder() > menuItem.getOrder()) {
|
||||
mItems.add(index, menuItem);
|
||||
notifyDataSetChanged();
|
||||
return;
|
||||
} else {
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
// Add the menuItem at the end.
|
||||
mItems.add(menuItem);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void removeMenuItem(GeckoMenuItem menuItem) {
|
||||
// Remove it from the list.
|
||||
mItems.remove(menuItem);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public GeckoMenuItem getMenuItem(int id) {
|
||||
for (GeckoMenuItem item : mItems) {
|
||||
if (item.getItemId() == id)
|
||||
return item;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ package org.mozilla.gecko;
|
|||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.content.res.XmlResourceParser;
|
||||
|
@ -20,8 +19,7 @@ import android.view.MenuItem;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
public class GeckoMenuInflater extends MenuInflater
|
||||
implements MenuItem.OnMenuItemClickListener {
|
||||
public class GeckoMenuInflater extends MenuInflater {
|
||||
private static final String LOGTAG = "GeckoMenuInflater";
|
||||
|
||||
private static final String TAG_ITEM = "item";
|
||||
|
@ -80,7 +78,6 @@ public class GeckoMenuInflater extends MenuInflater
|
|||
// Add the item.
|
||||
MenuItem menuItem = menu.add(NO_ID, item.id, item.order, item.title);
|
||||
setValues(item, menuItem);
|
||||
menuItem.setOnMenuItemClickListener(this);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -99,14 +96,6 @@ public class GeckoMenuInflater extends MenuInflater
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
Activity activity = (Activity) mContext;
|
||||
boolean result = activity.onOptionsItemSelected(item);
|
||||
activity.closeOptionsMenu();
|
||||
return result;
|
||||
}
|
||||
|
||||
public void parseItem(ParsedItem item, AttributeSet attrs) {
|
||||
TypedArray a = mContext.obtainStyledAttributes(attrs, R.styleable.MenuItem);
|
||||
|
||||
|
@ -128,6 +117,7 @@ public class GeckoMenuInflater extends MenuInflater
|
|||
.setVisible(item.visible)
|
||||
.setEnabled(item.enabled)
|
||||
.setCheckable(item.checkable)
|
||||
.setCheckable(item.checked)
|
||||
.setIcon(item.iconRes)
|
||||
.setShowAsAction(item.showAsAction ? 1 : 0);
|
||||
}
|
||||
|
|
|
@ -34,6 +34,10 @@ public class GeckoMenuItem implements MenuItem, View.OnClickListener {
|
|||
public void onShowAsActionChanged(GeckoMenuItem item, boolean isActionItem);
|
||||
}
|
||||
|
||||
public static interface OnVisibilityChangedListener {
|
||||
public void onVisibilityChanged(GeckoMenuItem item, boolean isVisible);
|
||||
}
|
||||
|
||||
private Context mContext;
|
||||
private int mId;
|
||||
private int mOrder;
|
||||
|
@ -48,6 +52,7 @@ public class GeckoMenuItem implements MenuItem, View.OnClickListener {
|
|||
private Drawable mIcon;
|
||||
private int mIconRes;
|
||||
private MenuItem.OnMenuItemClickListener mMenuItemClickListener;
|
||||
private OnVisibilityChangedListener mVisibilityChangedListener;
|
||||
private OnShowAsActionChangedListener mShowAsActionChangedListener;
|
||||
|
||||
public GeckoMenuItem(Context context, int id) {
|
||||
|
@ -63,8 +68,6 @@ public class GeckoMenuItem implements MenuItem, View.OnClickListener {
|
|||
mCheckable = true;
|
||||
mChecked = false;
|
||||
mMenuItemClickListener = null;
|
||||
|
||||
mLayout.setOnClickListener(this);
|
||||
}
|
||||
|
||||
public GeckoMenuItem(Context context, int id, int order) {
|
||||
|
@ -329,6 +332,10 @@ public class GeckoMenuItem implements MenuItem, View.OnClickListener {
|
|||
public MenuItem setVisible(boolean visible) {
|
||||
mVisible = visible;
|
||||
mLayout.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
|
||||
if (mVisibilityChangedListener != null)
|
||||
mVisibilityChangedListener.onVisibilityChanged(this, visible);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -340,5 +347,9 @@ public class GeckoMenuItem implements MenuItem, View.OnClickListener {
|
|||
|
||||
public void setOnShowAsActionChangedListener(OnShowAsActionChangedListener listener) {
|
||||
mShowAsActionChangedListener = listener;
|
||||
}
|
||||
}
|
||||
|
||||
public void setOnVisibilityChangedListener(OnVisibilityChangedListener listener) {
|
||||
mVisibilityChangedListener = listener;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -338,6 +338,7 @@ RES_LAYOUT = \
|
|||
res/layout/web_app.xml \
|
||||
res/layout/launch_app_list.xml \
|
||||
res/layout/launch_app_listitem.xml \
|
||||
res/layout/menu_action_bar.xml \
|
||||
res/layout/menu_item.xml \
|
||||
res/layout/menu_popup.xml \
|
||||
res/layout/notification_icon_text.xml \
|
||||
|
@ -495,9 +496,6 @@ RES_DRAWABLE_BASE = \
|
|||
res/drawable/larry_blue.png \
|
||||
res/drawable/larry_green.png \
|
||||
res/drawable/menu.xml \
|
||||
res/drawable/menu_item_bg.xml \
|
||||
res/drawable/menu_item_default.xml \
|
||||
res/drawable/menu_item_pressed.xml \
|
||||
res/drawable/site_security_identified.png \
|
||||
res/drawable/site_security_verified.png \
|
||||
res/drawable/urlbar_stop.png \
|
||||
|
@ -661,8 +659,6 @@ RES_DRAWABLE_MDPI_V11 = \
|
|||
res/drawable-mdpi-v11/menu_panel_bg.9.png \
|
||||
res/drawable-mdpi-v11/menu_popup_bg.9.png \
|
||||
res/drawable-mdpi-v11/menu_popup_arrow.png \
|
||||
res/drawable-mdpi-v11/menu_item_texture.png \
|
||||
res/drawable-mdpi-v11/menu_item_pressed_texture.png \
|
||||
res/drawable-mdpi-v11/menu_item_check.png \
|
||||
$(NULL)
|
||||
|
||||
|
@ -685,8 +681,6 @@ RES_DRAWABLE_HDPI_V11 = \
|
|||
res/drawable-hdpi-v11/menu_panel_bg.9.png \
|
||||
res/drawable-hdpi-v11/menu_popup_bg.9.png \
|
||||
res/drawable-hdpi-v11/menu_popup_arrow.png \
|
||||
res/drawable-hdpi-v11/menu_item_texture.png \
|
||||
res/drawable-hdpi-v11/menu_item_pressed_texture.png \
|
||||
res/drawable-hdpi-v11/menu_item_check.png \
|
||||
$(NULL)
|
||||
|
||||
|
@ -709,8 +703,6 @@ RES_DRAWABLE_XHDPI_V11 = \
|
|||
res/drawable-xhdpi-v11/menu_panel_bg.9.png \
|
||||
res/drawable-xhdpi-v11/menu_popup_bg.9.png \
|
||||
res/drawable-xhdpi-v11/menu_popup_arrow.png \
|
||||
res/drawable-xhdpi-v11/menu_item_texture.png \
|
||||
res/drawable-xhdpi-v11/menu_item_pressed_texture.png \
|
||||
res/drawable-xhdpi-v11/menu_item_check.png \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ public class MenuItemActionBar extends ImageButton
|
|||
int padding = size / 4;
|
||||
setPadding(padding, padding, padding, padding);
|
||||
setBackgroundResource(R.drawable.action_bar_button);
|
||||
setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
setScaleType(ImageView.ScaleType.FIT_CENTER);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,7 +11,7 @@ import android.util.AttributeSet;
|
|||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.LinearLayout.LayoutParams;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class MenuItemDefault extends LinearLayout
|
||||
|
@ -26,9 +26,8 @@ public class MenuItemDefault extends LinearLayout
|
|||
super(context, attrs);
|
||||
|
||||
Resources res = context.getResources();
|
||||
setLayoutParams(new LayoutParams((int) (res.getDimension(R.dimen.menu_item_row_width)),
|
||||
(int) (res.getDimension(R.dimen.menu_item_row_height))));
|
||||
setBackgroundResource(R.drawable.menu_item_bg);
|
||||
setLayoutParams(new AbsListView.LayoutParams((int) (res.getDimension(R.dimen.menu_item_row_width)),
|
||||
(int) (res.getDimension(R.dimen.menu_item_row_height))));
|
||||
|
||||
inflate(context, R.layout.menu_item, this);
|
||||
mIcon = (ImageView) findViewById(R.id.icon);
|
||||
|
|
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 1.1 KiB |
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 4.3 KiB |
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 1.0 KiB |
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 2.5 KiB |
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 1.1 KiB |
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 6.5 KiB |
|
@ -1,10 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_enabled="true"
|
||||
android:state_pressed="true"
|
||||
android:drawable="@drawable/menu_item_pressed"/>
|
||||
|
||||
<item android:drawable="@drawable/menu_item_default"/>
|
||||
|
||||
</selector>
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:src="@drawable/menu_item_texture"
|
||||
android:tileMode="repeat"
|
||||
android:dither="false"/>
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:src="@drawable/menu_item_pressed_texture"
|
||||
android:tileMode="repeat"
|
||||
android:dither="false"/>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="@dimen/menu_item_row_width"
|
||||
android:layout_height="@dimen/browser_toolbar_height"
|
||||
android:orientation="horizontal"/>
|
|
@ -6,17 +6,20 @@
|
|||
|
||||
<menu xmlns:gecko="http://schemas.android.com/apk/res/@ANDROID_PACKAGE_NAME@">
|
||||
|
||||
<item gecko:id="@+id/reload"
|
||||
gecko:icon="@drawable/ic_menu_reload"
|
||||
gecko:title="@string/reload"/>
|
||||
|
||||
<item gecko:id="@+id/forward"
|
||||
gecko:icon="@drawable/ic_menu_forward"
|
||||
gecko:title="@string/forward"/>
|
||||
gecko:title="@string/forward"
|
||||
gecko:showAsAction="true"/>
|
||||
|
||||
<item gecko:id="@+id/reload"
|
||||
gecko:icon="@drawable/ic_menu_reload"
|
||||
gecko:title="@string/reload"
|
||||
gecko:showAsAction="true"/>
|
||||
|
||||
<item gecko:id="@+id/bookmark"
|
||||
gecko:icon="@drawable/ic_menu_bookmark_add"
|
||||
gecko:title="@string/bookmark"/>
|
||||
gecko:title="@string/bookmark"
|
||||
gecko:showAsAction="true"/>
|
||||
|
||||
<item gecko:id="@+id/share"
|
||||
gecko:icon="@drawable/ic_menu_share"
|
||||
|
|
|
@ -10,15 +10,8 @@
|
|||
Please refer to values/styles.xml for default styles.
|
||||
-->
|
||||
|
||||
<!-- AwesomeBar -->
|
||||
<style name="AwesomeBar">
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:layout_height">@dimen/browser_toolbar_height</item>
|
||||
<item name="android:orientation">horizontal</item>
|
||||
</style>
|
||||
|
||||
<!-- Lists in AwesomeBar -->
|
||||
<style name="AwesomeBarList" parent="android:style/Widget.Holo.ListView">
|
||||
<style name="GeckoList" parent="android:style/Widget.Holo.ListView">
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:layout_height">fill_parent</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
|
@ -28,6 +21,16 @@
|
|||
<item name="android:cacheColorHint">#EEF1F5</item>
|
||||
<item name="android:listSelector">@drawable/action_bar_button</item>
|
||||
</style>
|
||||
|
||||
<!-- AwesomeBar -->
|
||||
<style name="AwesomeBar">
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:layout_height">@dimen/browser_toolbar_height</item>
|
||||
<item name="android:orientation">horizontal</item>
|
||||
</style>
|
||||
|
||||
<!-- Lists in AwesomeBar -->
|
||||
<style name="AwesomeBarList" parent="@style/GeckoList"/>
|
||||
|
||||
<!-- ActionBar -->
|
||||
<style name="ActionBar" parent="android:style/Widget.Holo.ActionBar" />
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
<style name="Gecko.App">
|
||||
<item name="android:windowBackground">@drawable/abouthome_bg_repeat</item>
|
||||
<item name="android:panelBackground">@drawable/menu_panel_bg</item>
|
||||
<item name="android:listViewStyle">@style/GeckoList</item>
|
||||
</style>
|
||||
|
||||
<style name="Gecko.Light.AwesomeBar">
|
||||
|
|
|
@ -11,17 +11,9 @@
|
|||
-->
|
||||
|
||||
<!-- Lists in AwesomeBar -->
|
||||
<style name="AwesomeBarList" parent="android:style/Widget.Holo.ListView">
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:layout_height">fill_parent</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
<style name="AwesomeBarList" parent="@style/GeckoList">
|
||||
<item name="android:paddingLeft">52dp</item>
|
||||
<item name="android:paddingRight">52dp</item>
|
||||
<item name="android:background">#EEF1F5</item>
|
||||
<item name="android:divider">#D1D5DA</item>
|
||||
<item name="android:dividerHeight">1dp</item>
|
||||
<item name="android:cacheColorHint">#EEF1F5</item>
|
||||
<item name="android:listSelector">@drawable/action_bar_button</item>
|
||||
</style>
|
||||
|
||||
<!-- AwesomeBar Tab Indicator Curve Left -->
|
||||
|
|
Загрузка…
Ссылка в новой задаче