public FrameLayout(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(context, attrs, defStyleAttr, 0); }
public FrameLayout(Context context) { super(context); init(context, null, 0, 0); }
public FrameLayout(Context context, AttributeSet attrs) { super(context, attrs); init(context, attrs, 0, 0); }
@SuppressWarnings("deprecation") @TargetApi(Build.VERSION_CODES.JELLY_BEAN) @Override protected void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes){ mLabelEnable = false; mLabelVisible = false; mSupportMode = SUPPORT_MODE_NONE; mAutoCompleteMode = AUTOCOMPLETE_MODE_NONE; mDividerCompoundPadding = true; mDividerPadding = -1; mIsRtl = false; super.init(context, attrs, defStyleAttr, defStyleRes); if(isInEditMode()) applyStyle(R.style.Material_Widget_EditText); }
@Override protected void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { mLabelEnable = false; mDropDownWidth = LayoutParams.WRAP_CONTENT; mArrowAnimSwitchMode = false; mGravity = Gravity.CENTER; mDisableChildrenWhenDisabled = false; mSelectedPosition = INVALID_POSITION; mIsRtl = false; setWillNotDraw(false); mPopup = new DropdownPopup(context, attrs, defStyleAttr, defStyleRes); mPopup.setModal(true); if(isInEditMode()) applyStyle(R.style.Material_Widget_Spinner); setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { showPopup(); } }); super.init(context, attrs, defStyleAttr, defStyleRes); }
@Override protected void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes){ mWidth = MATCH_PARENT; mHeight = WRAP_CONTENT; mDuration = -1; mIsRtl = false; mText = new TextView(context); mText.setSingleLine(true); mText.setGravity(Gravity.START | Gravity.CENTER_VERTICAL); addView(mText, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); mAction = new Button(context); mAction.setBackgroundResource(0); mAction.setGravity(Gravity.CENTER); mAction.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (mActionClickListener != null) mActionClickListener.onActionClick(SnackBar.this, mActionId); dismiss(); } }); addView(mAction, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); mBackground = new BackgroundDrawable(); mBackground.setColor(0xFF323232); ViewUtil.setBackground(this, mBackground); setClickable(true); super.init(context, attrs, defStyleAttr, defStyleRes); }