@ CallSuper protected void onVisualizePreference ( @ NonNull final Preference preference , @ NonNull final PreferenceViewHolder viewHolder ) { if ( preference instanceof PreferenceCategory ) { RecyclerView . LayoutParams layoutParams = ( RecyclerView . LayoutParams ) viewHolder . itemView . getLayoutParams ( ) ; layoutParams . height = TextUtils . isEmpty ( preference . getTitle ( ) ) ? 0 : RecyclerView . LayoutParams . WRAP_CONTENT ; } }
The method which is invoked when a specific preference is visualized . This method may be overridden by subclasses in order to modify the appearance of the preference .