protected internal override ImageButton createDeviceButton() { ImageButton button = (ImageButton)LayoutInflater.from(Context).inflate(R.layout.main_app_view, this, false); Drawable drawable = this.mData.mInstanceIcon; if (drawable.IntrinsicHeight > mDeviceIconMaxSize) { drawable.setBounds(0, 0, mDeviceIconMaxSize, mDeviceIconMaxSize); } button.ImageDrawable = drawable; button.Clickable = false; button.LongClickable = true; Resources res = Resources; perpendicular = res.getDimensionPixelSize(R.dimen.default_controlbar_widget); along = res.getDimensionPixelSize(R.dimen.main_app_btn_length); return(button); }
protected internal override ImageButton createDeviceButton() { ImageButton button = (ImageButton)LayoutInflater.from(Context).inflate(R.layout.app_view, this, false); button.ImageDrawable = this.mData.mInstanceIcon; if (mData.mActionList.size() > 0) { button.OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this); } else { button.OnClickListener = new OnClickListenerAnonymousInnerClassHelper2(this); } Resources res = Resources; perpendicular = res.getDimensionPixelSize(R.dimen.max_app_ic_size); along = res.getDimensionPixelSize(R.dimen.max_app_ic_size); return(button); }
/// <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 )); }
public MenuPopupHelper(android.content.Context context, [email protected] menu, android.view.View anchorView, bool overflowOnly) { mContext = context; mInflater = android.view.LayoutInflater.from(context); mMenu = menu; mOverflowOnly = overflowOnly; android.content.res.Resources res = context.getResources(); mPopupMaxWidth = System.Math.Max(res.getDisplayMetrics().widthPixels / 2, res.getDimensionPixelSize ([email protected]_prefDialogWidth)); mAnchorView = anchorView; menu.addMenuPresenter(this); }