@Override protected void onBindView(View view) { super.onBindView(view); mImageView = (ImageView) view.findViewById(R.id.expando); if (mDrawable != null) mImageView.setImageDrawable(mDrawable); // For accessibility, read out the whole title and whether the group is collapsed/expanded. String description = getTitle() + getContext().getResources().getString(mExpanded ? R.string.accessibility_expanded_group : R.string.accessibility_collapsed_group); view.setContentDescription(description); } }
@Override protected void onBindView(final View view) { super.onBindView(view); // On pre-L devices, PreferenceCategoryWithButtonStyle is reused for PreferenceCategory, // which needs a top padding of 16dp; we don't want this top padding for // PreferenceCategoryWithButton views. view.setPadding(view.getPaddingLeft(), 0, view.getPaddingRight(), view.getPaddingBottom()); View button = view.findViewById(android.R.id.icon); button.setOnClickListener(this); if (!TextUtils.isEmpty(mContentDescription)) { button.setContentDescription(mContentDescription); } }
@Override protected void onBindView(View view) { super.onBindView(view); TextView titleView = (TextView) view.findViewById(android.R.id.title); TextView summary = (TextView) view.findViewById(android.R.id.summary); if (titleView != null && summary != null && getContext() != null) { FontUtils.setPreferenceTypeface(getContext(), fontStyle, titleView, summary); } }