gregkorossy / Android-Support-Preference-V7-Fix

Android androidx.preference support library has some issues, this lib tries to fix them.
https://discord.gg/87NVsSK
Apache License 2.0
497 stars 46 forks source link

setDivider and setDividerPreferences don't work together #105

Closed KubaB closed 6 years ago

KubaB commented 6 years ago

This:

     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          View view = super.onCreateView(inflater, container, savedInstanceState);
          setDividerPreferences(DIVIDER_DEFAULT);
          Drawable drawable = getContext().getResources().getDrawable(R.drawable.line_divider);
          setDivider(drawable);
          return view;
      }

results in this: screenshot_2017-10-31-16-21-38-604_com example mpccontroller

and this:

     public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
          super.onViewCreated(view, savedInstanceState);
          setDividerPreferences(DIVIDER_DEFAULT);
          Drawable drawable = getContext().getResources().getDrawable(R.drawable.line_divider);
          setDivider(drawable);
     }

results in this: screenshot_2017-10-31-16-21-54-287_com example mpccontroller

So clearly, setting divider itself works and setting dividerPreferences too, but it seems one cannot use them together.

gregkorossy commented 6 years ago

I'll check it out.

KubaB commented 6 years ago

Any progress on this subject?

gregkorossy commented 6 years ago

Yes, I have identified the problem, it will be fixed soon.

gregkorossy commented 6 years ago

Sorry, this will have to be pushed to v27.0.2.1. I've had no time to fix it yet.

gregkorossy commented 6 years ago

This is no longer relevant. The 28.0.0 version deprecates the PreferenceFragmentCompatDividers, and the AndroidX version removes it completely.

KubaB commented 6 years ago

thanks for fast fix