Adding menu to jump to shortcuts page in widgets tab
- Fixing bug in PagedView when setting the current page - Fixing small visual issue with flashing scroll indicator - Fixing slightly offset holographic icons Change-Id: Ic6ce6365daca41cb5a73706c7c4b078f33a4e39c
This commit is contained in:
@@ -35,14 +35,14 @@ import com.android.launcher.R;
|
||||
public class AddAdapter extends BaseAdapter {
|
||||
|
||||
private final LayoutInflater mInflater;
|
||||
|
||||
|
||||
private final ArrayList<ListItem> mItems = new ArrayList<ListItem>();
|
||||
|
||||
|
||||
public static final int ITEM_SHORTCUT = 0;
|
||||
public static final int ITEM_APPWIDGET = 1;
|
||||
public static final int ITEM_APPLICATION = 2;
|
||||
public static final int ITEM_WALLPAPER = 3;
|
||||
|
||||
|
||||
/**
|
||||
* Specific item in our list.
|
||||
*/
|
||||
@@ -50,7 +50,7 @@ public class AddAdapter extends BaseAdapter {
|
||||
public final CharSequence text;
|
||||
public final Drawable image;
|
||||
public final int actionTag;
|
||||
|
||||
|
||||
public ListItem(Resources res, int textResourceId, int imageResourceId, int actionTag) {
|
||||
text = res.getString(textResourceId);
|
||||
if (imageResourceId != -1) {
|
||||
@@ -66,16 +66,17 @@ public class AddAdapter extends BaseAdapter {
|
||||
super();
|
||||
|
||||
mInflater = (LayoutInflater) launcher.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
|
||||
|
||||
// Create default actions
|
||||
Resources res = launcher.getResources();
|
||||
|
||||
|
||||
mItems.add(new ListItem(res, R.string.group_applications,
|
||||
R.drawable.ic_launcher_application, ITEM_APPLICATION));
|
||||
|
||||
mItems.add(new ListItem(res, R.string.group_widgets,
|
||||
R.drawable.ic_launcher_appwidget, ITEM_APPWIDGET));
|
||||
|
||||
mItems.add(new ListItem(res, R.string.group_shortcuts,
|
||||
R.drawable.ic_launcher_application, ITEM_SHORTCUT));
|
||||
mItems.add(new ListItem(res, R.string.group_wallpapers,
|
||||
R.drawable.ic_launcher_wallpaper, ITEM_WALLPAPER));
|
||||
|
||||
@@ -83,16 +84,16 @@ public class AddAdapter extends BaseAdapter {
|
||||
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
ListItem item = (ListItem) getItem(position);
|
||||
|
||||
|
||||
if (convertView == null) {
|
||||
convertView = mInflater.inflate(R.layout.add_list_item, parent, false);
|
||||
}
|
||||
|
||||
|
||||
TextView textView = (TextView) convertView;
|
||||
textView.setTag(item);
|
||||
textView.setText(item.text);
|
||||
textView.setCompoundDrawablesWithIntrinsicBounds(item.image, null, null, null);
|
||||
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
@@ -107,5 +108,4 @@ public class AddAdapter extends BaseAdapter {
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user