mIconSize = am.getLauncherLargeIconSize(); mAdapter = new ResolveListAdapter(this, intent, initialIntents, rList, mLaunchedFromUid); int count = mAdapter.getCount(); if (Build.VERSION.SDK_INT >= 17) { if (mLaunchedFromUid < 0) {
public View getView(int position, View convertView, ViewGroup parent) { View view; if (convertView == null) { view = mInflater.inflate(R.layout.resolve_list_item, parent, false); final ViewHolder holder = new ViewHolder(view); view.setTag(holder); // Fix the icon size even if we have different sized resources ViewGroup.LayoutParams lp = holder.icon.getLayoutParams(); lp.width = lp.height = mIconSize; } else { view = convertView; } bindView(view, mList.get(position)); return view; }
continue; processGroup(currentResolveList, start, (i - 1), r0, r0Label); r0 = ri; r0Label = riLabel; processGroup(currentResolveList, start, (N - 1), r0, r0Label);
continue; processGroup(currentResolveList, start, (i - 1), r0, r0Label); r0 = ri; r0Label = riLabel; processGroup(currentResolveList, start, (N - 1), r0, r0Label);
continue; processGroup(currentResolveList, start, (i - 1), r0, r0Label); r0 = ri; r0Label = riLabel; processGroup(currentResolveList, start, (N - 1), r0, r0Label);
mIconSize = am.getLauncherLargeIconSize(); mAdapter = new ResolveListAdapter(this, intent, initialIntents, rList, mLaunchedFromUid); int count = mAdapter.getCount(); if (Build.VERSION.SDK_INT >= 17) { if (mLaunchedFromUid < 0) {
mIconSize = am.getLauncherLargeIconSize(); mAdapter = new ResolveListAdapter(this, intent, initialIntents, rList, mLaunchedFromUid); int count = mAdapter.getCount(); if (Build.VERSION.SDK_INT >= 17) { if (mLaunchedFromUid < 0) {
public View getView(int position, View convertView, ViewGroup parent) { View view; if (convertView == null) { view = mInflater.inflate(R.layout.resolve_list_item, parent, false); final ViewHolder holder = new ViewHolder(view); view.setTag(holder); // Fix the icon size even if we have different sized resources ViewGroup.LayoutParams lp = holder.icon.getLayoutParams(); lp.width = lp.height = mIconSize; } else { view = convertView; } bindView(view, mList.get(position)); return view; }
public View getView(int position, View convertView, ViewGroup parent) { View view; if (convertView == null) { view = mInflater.inflate(R.layout.resolve_list_item, parent, false); final ViewHolder holder = new ViewHolder(view); view.setTag(holder); // Fix the icon size even if we have different sized resources ViewGroup.LayoutParams lp = holder.icon.getLayoutParams(); lp.width = lp.height = mIconSize; } else { view = convertView; } bindView(view, mList.get(position)); return view; }
@Override protected void onPostExecute(DisplayResolveInfo info) { mAdapter.notifyDataSetChanged(); } }
public ResolveListAdapter(Context context, Intent intent, Intent[] initialIntents, List<ResolveInfo> rList, int launchedFromUid) { mIntent = new Intent(intent); mInitialIntents = initialIntents; mBaseResolveList = rList; mLaunchedFromUid = launchedFromUid; mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); mList = new ArrayList<DisplayResolveInfo>(); rebuildList(); }
@Override protected void onRestart() { super.onRestart(); if (!mRegistered) { mRegistered = true; } mAdapter.handlePackagesChanged(); }
@Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { ResolveInfo ri = mAdapter.resolveInfoForPosition(position); showAppDetails(ri); return true; }
public ResolveListAdapter(Context context, Intent intent, Intent[] initialIntents, List<ResolveInfo> rList, int launchedFromUid) { mIntent = new Intent(intent); mInitialIntents = initialIntents; mBaseResolveList = rList; mLaunchedFromUid = launchedFromUid; mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); mList = new ArrayList<DisplayResolveInfo>(); rebuildList(); }
@Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { ResolveInfo ri = mAdapter.resolveInfoForPosition(position); showAppDetails(ri); return true; }
public void handlePackagesChanged() { final int oldItemCount = getCount(); rebuildList(); notifyDataSetChanged(); final int newItemCount = getCount(); if (newItemCount == 0) { // We no longer have any items... just finish the activity. finish(); } }
public void handlePackagesChanged() { final int oldItemCount = getCount(); rebuildList(); notifyDataSetChanged(); final int newItemCount = getCount(); if (newItemCount == 0) { // We no longer have any items... just finish the activity. finish(); } }
void startSelected(int which, boolean always) { if (isFinishing()) { return; } ResolveInfo ri = mAdapter.resolveInfoForPosition(which); Intent intent = mAdapter.intentForPosition(which); onIntentSelected(ri, intent, always); finish(); }
void startSelected(int which, boolean always) { if (isFinishing()) { return; } ResolveInfo ri = mAdapter.resolveInfoForPosition(which); Intent intent = mAdapter.intentForPosition(which); onIntentSelected(ri, intent, always); finish(); }
@Override protected void onPostExecute(DisplayResolveInfo info) { mAdapter.notifyDataSetChanged(); } }