public FcRecycleView(Context context, AttributeSet attrs, int defStyle) : base(context, attrs, defStyle) { if (attrs != null) { TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.FcRecycleView, 0, 0); mMaxWidth = array.getLayoutDimension(R.styleable.FcRecycleView_max_width, LayoutParams.MATCH_PARENT); array.recycle(); } }
/// <summary> /// Construct a new spinner with the given context's theme, the supplied attribute set, /// and default style. /// </summary> /// <remarks> /// Construct a new spinner with the given context's theme, the supplied attribute set, /// and default style. <code>mode</code> may be one of /// <see cref="MODE_DIALOG">MODE_DIALOG</see> /// or /// <see cref="MODE_DROPDOWN">MODE_DROPDOWN</see> /// and determines how the user will select choices from the spinner. /// </remarks> /// <param name="context"> /// The Context the view is running in, through which it can /// access the current theme, resources, etc. /// </param> /// <param name="attrs">The attributes of the XML tag that is inflating the view.</param> /// <param name="defStyle"> /// The default style to apply to this view. If 0, no style /// will be applied (beyond what is included in the theme). This may /// either be an attribute resource, whose value will be retrieved /// from the current theme, or an explicit style resource. /// </param> /// <param name="mode">Constant describing how the user will select choices from the spinner. /// </param> /// <seealso cref="MODE_DIALOG">MODE_DIALOG</seealso> /// <seealso cref="MODE_DROPDOWN">MODE_DROPDOWN</seealso> public Spinner(android.content.Context context, android.util.AttributeSet attrs, int defStyle, int mode) : base(context, attrs, defStyle) { // Only measure this many items to get a decent max width. android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected] .styleable.Spinner, defStyle, 0); if (mode == MODE_THEME) { mode = a.getInt([email protected]_spinnerMode, MODE_DIALOG); } switch (mode) { case MODE_DIALOG: { mPopup = new android.widget.Spinner.DialogPopup(this); break; } case MODE_DROPDOWN: { android.widget.Spinner.DropdownPopup popup = new android.widget.Spinner.DropdownPopup (this, context, attrs, defStyle); mDropDownWidth = a.getLayoutDimension([email protected]_dropDownWidth , android.view.ViewGroup.LayoutParams.WRAP_CONTENT); popup.setBackgroundDrawable(a.getDrawable([email protected]_popupBackground )); int verticalOffset = a.getDimensionPixelOffset([email protected]_dropDownVerticalOffset , 0); if (verticalOffset != 0) { popup.setVerticalOffset(verticalOffset); } int horizontalOffset = a.getDimensionPixelOffset([email protected]_dropDownHorizontalOffset , 0); if (horizontalOffset != 0) { popup.setHorizontalOffset(horizontalOffset); } mPopup = popup; break; } } mGravity = a.getInt([email protected]_gravity, android.view.Gravity .CENTER); mPopup.setPromptText(java.lang.CharSequenceProxy.Wrap(a.getString([email protected] .styleable.Spinner_prompt))); a.recycle(); // Base constructor can call setAdapter before we initialize mPopup. // Finish setting things up if this happened. if (mTempAdapter != null) { mPopup.setAdapter(mTempAdapter); mTempAdapter = null; } }
protected internal override void setBaseAttributes(android.content.res.TypedArray a, int widthAttr, int heightAttr) { if (a.hasValue(widthAttr)) { width = a.getLayoutDimension(widthAttr, "layout_width"); } else { width = WRAP_CONTENT; } if (a.hasValue(heightAttr)) { height = a.getLayoutDimension(heightAttr, "layout_height"); } else { height = WRAP_CONTENT; } }
protected internal override void onConfigurationChanged(android.content.res.Configuration newConfig) { base.onConfigurationChanged(newConfig); // Action bar can change size on configuration changes. // Reread the desired height from the theme-specified style. android.content.res.TypedArray a = getContext().obtainStyledAttributes(null, [email protected] .styleable.ActionBar, [email protected], 0); setContentHeight(a.getLayoutDimension([email protected]_height , 0)); a.recycle(); }
protected internal override void setBaseAttributes(android.content.res.TypedArray a, int widthAttr, int heightAttr) { this.width = MATCH_PARENT; if (a.hasValue(heightAttr)) { this.height = a.getLayoutDimension(heightAttr, "layout_height"); } else { this.height = WRAP_CONTENT; } }
protected internal override void setBaseAttributes(android.content.res.TypedArray a, int widthAttr, int heightAttr) { // We don't want to force users to specify a layout_width if (a.hasValue(widthAttr)) { width = a.getLayoutDimension(widthAttr, "layout_width"); } else { width = MATCH_PARENT; } // We don't want to force users to specify a layout_height if (a.hasValue(heightAttr)) { height = a.getLayoutDimension(heightAttr, "layout_height"); } else { height = WRAP_CONTENT; } }
public ScrollingTabContainerView(android.content.Context context) : base(context) { mVisAnimListener = new android.widget.@internal.ScrollingTabContainerView.VisibilityAnimListener (this); setHorizontalScrollBarEnabled(false); android.content.res.TypedArray a = getContext().obtainStyledAttributes(null, [email protected] .styleable.ActionBar, [email protected], 0); setContentHeight(a.getLayoutDimension([email protected]_height , 0)); a.recycle(); mTabLayout = createTabLayout(); addView(mTabLayout, new android.view.ViewGroup.LayoutParams(android.view.ViewGroup .LayoutParams.WRAP_CONTENT, android.view.ViewGroup.LayoutParams.MATCH_PARENT)); }
public ActionBarContextView(android.content.Context context, android.util.AttributeSet attrs, int defStyle) : base(context, attrs, defStyle) { android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected] .styleable.ActionMode, defStyle, 0); setBackgroundDrawable(a.getDrawable([email protected]_background )); mTitleStyleRes = a.getResourceId([email protected]_titleTextStyle , 0); mSubtitleStyleRes = a.getResourceId([email protected]_subtitleTextStyle , 0); mContentHeight = a.getLayoutDimension([email protected]_height , 0); mSplitBackground = a.getDrawable([email protected]_backgroundSplit ); a.recycle(); }
protected internal override void onConfigurationChanged(android.content.res.Configuration newConfig) { base.onConfigurationChanged(newConfig); // Action bar can change size on configuration changes. // Reread the desired height from the theme-specified style. android.content.res.TypedArray a = getContext().obtainStyledAttributes(null, [email protected] .styleable.ActionBar, [email protected], 0); setContentHeight(a.getLayoutDimension([email protected]_height , 0)); a.recycle(); if (mSplitWhenNarrow) { setSplitActionBar(getContext().getResources().getBoolean([email protected].@bool .split_action_bar_is_narrow)); } if (mActionMenuPresenter != null) { mActionMenuPresenter.onConfigurationChanged(newConfig); } }