Example #1
0
            public override android.view.View getView(int position, android.view.View convertView
                                                      , android.view.ViewGroup parent)
            {
                int itemViewType = this.getItemViewType(position);

                switch (itemViewType)
                {
                case ITEM_VIEW_TYPE_FOOTER:
                {
                    if (convertView == null || convertView.getId() != ITEM_VIEW_TYPE_FOOTER)
                    {
                        convertView = android.view.LayoutInflater.from(this._enclosing.getContext()).inflate
                                          ([email protected]_chooser_view_list_item, parent, false);
                        convertView.setId(ITEM_VIEW_TYPE_FOOTER);
                        android.widget.TextView titleView = (android.widget.TextView)convertView.findViewById
                                                                ([email protected]);
                        titleView.setText(java.lang.CharSequenceProxy.Wrap(this._enclosing.mContext.getString
                                                                               ([email protected][email protected]_chooser_view_see_all)));
                    }
                    return(convertView);
                }

                case ITEM_VIEW_TYPE_ACTIVITY:
                {
                    if (convertView == null || convertView.getId() != [email protected]_item)
                    {
                        convertView = android.view.LayoutInflater.from(this._enclosing.getContext()).inflate
                                          ([email protected]_chooser_view_list_item, parent, false);
                    }
                    android.content.pm.PackageManager packageManager = this._enclosing.mContext.getPackageManager
                                                                           ();
                    // Set the icon
                    android.widget.ImageView iconView = (android.widget.ImageView)convertView.findViewById
                                                            ([email protected]);
                    android.content.pm.ResolveInfo activity = (android.content.pm.ResolveInfo) this.getItem
                                                                  (position);
                    iconView.setImageDrawable(activity.loadIcon(packageManager));
                    // Set the title.
                    android.widget.TextView titleView_1 = (android.widget.TextView)convertView.findViewById
                                                              ([email protected]);
                    titleView_1.setText(activity.loadLabel(packageManager));
                    // Highlight the default.
                    if (this.mShowDefaultActivity && position == 0 && this.mHighlightDefaultActivity)
                    {
                        convertView.setActivated(true);
                    }
                    else
                    {
                        convertView.setActivated(false);
                    }
                    return(convertView);
                }

                default:
                {
                    throw new System.ArgumentException();
                }
                }
            }