code: @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;
          }
      }
docs: 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.
  
  @param preference
  The preference, which is visualized, as an instance of the class Preference. The
  preference may not be null
  @param viewHolder
  The view holder, which corresponds to the preference, as an instance of the class
  PreferenceViewHolder. The view holder may not be null