Example #1
0
		public android.view.MenuItem setActionView(android.view.View view)
		{
			mActionView = view;
			mActionProvider = null;
			if (view != null && view.getId() == android.view.View.NO_ID && mId > 0)
			{
				view.setId(mId);
			}
			mMenu.onItemActionRequestChanged(this);
			return this;
		}
Example #2
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]@string.activity_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();
					}
				}
			}
Example #3
0
			public virtual void onChildViewAdded(android.view.View parent, android.view.View 
				child)
			{
				if (parent == this._enclosing && child is android.widget.RadioButton)
				{
					int id = child.getId();
					// generates an id if it's missing
					if (id == android.view.View.NO_ID)
					{
						id = child.GetHashCode();
						child.setId(id);
					}
					((android.widget.RadioButton)child).setOnCheckedChangeWidgetListener(this._enclosing
						.mChildOnCheckedChangeListener);
				}
				if (this.mOnHierarchyChangeListener != null)
				{
					this.mOnHierarchyChangeListener.onChildViewAdded(parent, child);
				}
			}