예제 #1
0
 /// <summary>Create a new instance.</summary>
 /// <remarks>Create a new instance.</remarks>
 /// <param name="context">The application environment.</param>
 /// <param name="attrs">A collection of attributes.</param>
 /// <param name="defStyle">The default style to apply to this view.</param>
 public ActivityChooserView(android.content.Context context, android.util.AttributeSet
                            attrs, int defStyle) : base(context, attrs, defStyle)
 {
     mModelDataSetOberver    = new _DataSetObserver_118(this);
     mOnGlobalLayoutListener = new _OnGlobalLayoutListener_132(this);
     android.content.res.TypedArray attributesArray = context.obtainStyledAttributes(attrs
                                                                                     , [email protected], defStyle, 0);
     mInitialActivityCount = attributesArray.getInt([email protected]_initialActivityCount
                                                    , android.widget.ActivityChooserView.ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT
                                                    );
     android.graphics.drawable.Drawable expandActivityOverflowButtonDrawable = attributesArray
                                                                               .getDrawable([email protected]_expandActivityOverflowButtonDrawable
                                                                                            );
     attributesArray.recycle();
     android.view.LayoutInflater inflater = android.view.LayoutInflater.from(mContext);
     inflater.inflate([email protected]_chooser_view, this, true);
     mCallbacks = new android.widget.ActivityChooserView.Callbacks(this);
     mActivityChooserContent = (android.widget.LinearLayout)findViewById([email protected]
                                                                         .id.activity_chooser_view_content);
     mActivityChooserContentBackground = mActivityChooserContent.getBackground();
     mDefaultActivityButton            = (android.widget.FrameLayout)findViewById([email protected]
                                                                                  .id.default_activity_button);
     mDefaultActivityButton.setOnClickListener(mCallbacks);
     mDefaultActivityButton.setOnLongClickListener(mCallbacks);
     mDefaultActivityButtonImage = (android.widget.ImageView)mDefaultActivityButton.findViewById
                                       ([email protected]);
     mExpandActivityOverflowButton = (android.widget.FrameLayout)findViewById([email protected]
                                                                              .id.expand_activities_button);
     mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
     mExpandActivityOverflowButtonImage = (android.widget.ImageView)mExpandActivityOverflowButton
                                          .findViewById([email protected]);
     mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable
                                                         );
     mAdapter = new android.widget.ActivityChooserView.ActivityChooserViewAdapter(this
                                                                                  );
     mAdapter.registerDataSetObserver(new _DataSetObserver_239(this));
     android.content.res.Resources resources = context.getResources();
     mListPopupMaxWidth = System.Math.Max(resources.getDisplayMetrics().widthPixels /
                                          2, resources.getDimensionPixelSize([email protected]_prefDialogWidth
                                                                             ));
 }
예제 #2
0
		/// <summary>Create a new instance.</summary>
		/// <remarks>Create a new instance.</remarks>
		/// <param name="context">The application environment.</param>
		/// <param name="attrs">A collection of attributes.</param>
		/// <param name="defStyle">The default style to apply to this view.</param>
		public ActivityChooserView(android.content.Context context, android.util.AttributeSet
			 attrs, int defStyle) : base(context, attrs, defStyle)
		{
			mModelDataSetOberver = new _DataSetObserver_118(this);
			mOnGlobalLayoutListener = new _OnGlobalLayoutListener_132(this);
			android.content.res.TypedArray attributesArray = context.obtainStyledAttributes(attrs
				, [email protected], defStyle, 0);
			mInitialActivityCount = attributesArray.getInt([email protected]_initialActivityCount
				, android.widget.ActivityChooserView.ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT
				);
			android.graphics.drawable.Drawable expandActivityOverflowButtonDrawable = attributesArray
				.getDrawable([email protected]_expandActivityOverflowButtonDrawable
				);
			attributesArray.recycle();
			android.view.LayoutInflater inflater = android.view.LayoutInflater.from(mContext);
			inflater.inflate([email protected]_chooser_view, this, true);
			mCallbacks = new android.widget.ActivityChooserView.Callbacks(this);
			mActivityChooserContent = (android.widget.LinearLayout)findViewById([email protected]
				.id.activity_chooser_view_content);
			mActivityChooserContentBackground = mActivityChooserContent.getBackground();
			mDefaultActivityButton = (android.widget.FrameLayout)findViewById([email protected]
				.id.default_activity_button);
			mDefaultActivityButton.setOnClickListener(mCallbacks);
			mDefaultActivityButton.setOnLongClickListener(mCallbacks);
			mDefaultActivityButtonImage = (android.widget.ImageView)mDefaultActivityButton.findViewById
				([email protected]);
			mExpandActivityOverflowButton = (android.widget.FrameLayout)findViewById([email protected]
				.id.expand_activities_button);
			mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
			mExpandActivityOverflowButtonImage = (android.widget.ImageView)mExpandActivityOverflowButton
				.findViewById([email protected]);
			mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable
				);
			mAdapter = new android.widget.ActivityChooserView.ActivityChooserViewAdapter(this
				);
			mAdapter.registerDataSetObserver(new _DataSetObserver_239(this));
			android.content.res.Resources resources = context.getResources();
			mListPopupMaxWidth = System.Math.Max(resources.getDisplayMetrics().widthPixels / 
				2, resources.getDimensionPixelSize([email protected]_prefDialogWidth
				));
		}