diff options
author | Winson Chung <winsonc@google.com> | 2011-06-27 19:08:49 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2011-07-25 13:48:59 -0700 |
commit | 5a808358f1a773dab8babae44899ffd4ed1810c1 (patch) | |
tree | 51da799b228afea0af7fad593b6f6899fb3c0ab4 /src/com/android/launcher2/AddAdapter.java | |
parent | a22194bd9ff845775f91bff719322aba2522d32c (diff) | |
download | packages_apps_trebuchet-5a808358f1a773dab8babae44899ffd4ed1810c1.zip packages_apps_trebuchet-5a808358f1a773dab8babae44899ffd4ed1810c1.tar.gz packages_apps_trebuchet-5a808358f1a773dab8babae44899ffd4ed1810c1.tar.bz2 |
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
Diffstat (limited to 'src/com/android/launcher2/AddAdapter.java')
-rw-r--r-- | src/com/android/launcher2/AddAdapter.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/com/android/launcher2/AddAdapter.java b/src/com/android/launcher2/AddAdapter.java index d1076b1..5b7e92c 100644 --- a/src/com/android/launcher2/AddAdapter.java +++ b/src/com/android/launcher2/AddAdapter.java @@ -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; } - } |