diff options
author | nebkat <nebkat@teamhacksung.org> | 2012-12-28 22:18:49 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.cyanogenmod.com> | 2012-12-29 02:05:44 -0800 |
commit | 3786ed8df9344d365d063406828afee8293acda8 (patch) | |
tree | 36697f8caa98447f65ef9e538f0dcc6d114fadaa /src/com/cyanogenmod/trebuchet/LauncherAction.java | |
parent | ce7dcdd77320ff852f4b8b53ededd4220379fe44 (diff) | |
download | android_packages_apps_Trebuchet-3786ed8df9344d365d063406828afee8293acda8.tar.gz android_packages_apps_Trebuchet-3786ed8df9344d365d063406828afee8293acda8.tar.bz2 android_packages_apps_Trebuchet-3786ed8df9344d365d063406828afee8293acda8.zip |
Launcher: Remove long-press menu
Change-Id: Ie513c0c815fcfa0daa2d5503d3c060ae8e2109c0
Diffstat (limited to 'src/com/cyanogenmod/trebuchet/LauncherAction.java')
-rw-r--r-- | src/com/cyanogenmod/trebuchet/LauncherAction.java | 106 |
1 files changed, 0 insertions, 106 deletions
diff --git a/src/com/cyanogenmod/trebuchet/LauncherAction.java b/src/com/cyanogenmod/trebuchet/LauncherAction.java deleted file mode 100644 index 3ccfc3f0f..000000000 --- a/src/com/cyanogenmod/trebuchet/LauncherAction.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.cyanogenmod.trebuchet; - -import android.content.Context; -import android.content.res.Resources; -import android.graphics.drawable.Drawable; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.BaseAdapter; -import android.widget.TextView; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -public class LauncherAction { - - public enum Action { - AllApps; - int getString() { - return getString(this); - } - int getDrawable() { - return getDrawable(this); - } - static int getString(Action action) { - switch (action) { - case AllApps: - return R.string.all_apps_button_label; - default: - return -1; - } - } - static int getDrawable(Action action) { - switch (action) { - case AllApps: - return R.drawable.ic_allapps; - default: - return -1; - } - } - } - - public static List<Action> getAllActions() { - return Arrays.asList(Action.values()); - } - - public static class AddAdapter extends BaseAdapter { - - public class ItemInfo { - public Action action; - public Drawable drawable; - public String title; - public ItemInfo(Action info, Resources res) { - action = info; - drawable = res.getDrawable(info.getDrawable()); - title = res.getString(info.getString()); - } - } - - private final LayoutInflater mInflater; - - private final List<ItemInfo> mItems = new ArrayList<ItemInfo>(); - - public AddAdapter(Launcher launcher) { - super(); - - mInflater = (LayoutInflater) launcher.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - - // Create default actions - Resources res = launcher.getResources(); - - List<Action> items = LauncherAction.getAllActions(); - for (Action item : items) { - mItems.add(new ItemInfo(item, res)); - } - } - - public View getView(int position, View convertView, ViewGroup parent) { - ItemInfo item = (ItemInfo) 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.title); - textView.setCompoundDrawablesWithIntrinsicBounds(item.drawable, null, null, null); - - return convertView; - } - - public int getCount() { - return mItems.size(); - } - - public Object getItem(int position) { - return mItems.get(position); - } - - public long getItemId(int position) { - return position; - } - } -} |