@Override public ViewGroup.LayoutParams generateLayoutParams(AttributeSet attrs) { return new MarginLayoutParams(getContext(), attrs); }
@Override public ViewGroup.LayoutParams generateLayoutParams(AttributeSet attrs) { return new MarginLayoutParams(getContext(), attrs); }
@Override public void onInitializeAccessibilityEvent(AccessibilityEvent event) { if (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) { // Action mode started //TODO event.setSource(this); event.setClassName(getClass().getName()); event.setPackageName(getContext().getPackageName()); event.setContentDescription(mTitle); } else { //TODO super.onInitializeAccessibilityEvent(event); } } }
@Override public void onInitializeAccessibilityEvent(AccessibilityEvent event) { if (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) { // Action mode started //TODO event.setSource(this); event.setClassName(getClass().getName()); event.setPackageName(getContext().getPackageName()); event.setContentDescription(mTitle); } else { //TODO super.onInitializeAccessibilityEvent(event); } } }
private void initTitle() { if (mTitleLayout == null) { LayoutInflater inflater = LayoutInflater.from(getContext()); inflater.inflate(R.layout.abs__action_bar_title_item, this); mTitleLayout = (LinearLayout) getChildAt(getChildCount() - 1); mTitleView = (TextView) mTitleLayout.findViewById(R.id.abs__action_bar_title); mSubtitleView = (TextView) mTitleLayout.findViewById(R.id.abs__action_bar_subtitle); if (mTitleStyleRes != 0) { mTitleView.setTextAppearance(mContext, mTitleStyleRes); } if (mSubtitleStyleRes != 0) { mSubtitleView.setTextAppearance(mContext, mSubtitleStyleRes); } } mTitleView.setText(mTitle); mSubtitleView.setText(mSubtitle); final boolean hasTitle = !TextUtils.isEmpty(mTitle); final boolean hasSubtitle = !TextUtils.isEmpty(mSubtitle); mSubtitleView.setVisibility(hasSubtitle ? VISIBLE : GONE); mTitleLayout.setVisibility(hasTitle || hasSubtitle ? VISIBLE : GONE); if (mTitleLayout.getParent() == null) { addView(mTitleLayout); } }
private void initTitle() { if (mTitleLayout == null) { LayoutInflater inflater = LayoutInflater.from(getContext()); inflater.inflate(R.layout.abs__action_bar_title_item, this); mTitleLayout = (LinearLayout) getChildAt(getChildCount() - 1); mTitleView = (TextView) mTitleLayout.findViewById(R.id.abs__action_bar_title); mSubtitleView = (TextView) mTitleLayout.findViewById(R.id.abs__action_bar_subtitle); if (mTitleStyleRes != 0) { mTitleView.setTextAppearance(mContext, mTitleStyleRes); } if (mSubtitleStyleRes != 0) { mSubtitleView.setTextAppearance(mContext, mSubtitleStyleRes); } } mTitleView.setText(mTitle); mSubtitleView.setText(mSubtitle); final boolean hasTitle = !TextUtils.isEmpty(mTitle); final boolean hasSubtitle = !TextUtils.isEmpty(mSubtitle); mSubtitleView.setVisibility(hasSubtitle ? VISIBLE : GONE); mTitleLayout.setVisibility(hasTitle || hasSubtitle ? VISIBLE : GONE); if (mTitleLayout.getParent() == null) { addView(mTitleLayout); } }
getContext().getResources().getDisplayMetrics().widthPixels, true);
getContext().getResources().getDisplayMetrics().widthPixels, true);
getContext().getResources().getDisplayMetrics().widthPixels, true);
getContext().getResources().getDisplayMetrics().widthPixels, true);