Code Monkey home page Code Monkey logo

Comments (7)

gregkorossy avatar gregkorossy commented on June 2, 2024

If I remember correctly, that line is there to show the upper boundary of the list. If you want to remove that, don't set DIVIDER_PREFERENCE_BEFORE_FIRST in setDividerPreferences(...).

So, if you want to remove that while keeping the rest of them, just do this:

setDividerPreferences(DIVIDER_PREFERENCE_BETWEEN | DIVIDER_PREFERENCE_AFTER_LAST)

from android-support-preference-v7-fix.

ben04 avatar ben04 commented on June 2, 2024

Unfortunately that doesn't work...

Code snippet:

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        super.onCreateView(inflater, container, savedInstanceState)
        addPreferencesFromResource(R.xml.information);
        setDividerPreferences(DIVIDER_PREFERENCE_BETWEEN | DIVIDER_PREFERENCE_AFTER_LAST);

        setupUrlMap();
        setupCurrentVersion();

        return super.onCreateView(inflater, container, savedInstanceState);
    }

from android-support-preference-v7-fix.

gregkorossy avatar gregkorossy commented on June 2, 2024

Try putting addPreferencesFromResource(R.xml.information) into onCreatePreferencesFix(...).

from android-support-preference-v7-fix.

xdgimf avatar xdgimf commented on June 2, 2024

Hi, I notice that when using setDividerPreferences(DIVIDER_PREFERENCE_BETWEEN | DIVIDER_PREFERENCE_AFTER_LAST), instead of adding specific dividers it doesn't add anything.

super.setDivider(null);

if (flags == DIVIDER_DEFAULT) {
    divPrefFlags = DIVIDER_PREFERENCE_BETWEEN;
}

if (divItemDecoration == null) {
    divItemDecoration = new DividerItemDecoration(getDividerDrawable()); // getDividerDrawable returns null
    recyclerView.addItemDecoration(divItemDecoration);
}

I checked why it doesn't shows the dividers and found out that getDividerDrawable() returns null
I'm still not sure why it returns null

from android-support-preference-v7-fix.

gregkorossy avatar gregkorossy commented on June 2, 2024

@xdgimf Okay, I know why getDividerDrawable() returned null. Updated library to 23.4.0.4, that should fix your problem.

from android-support-preference-v7-fix.

gregkorossy avatar gregkorossy commented on June 2, 2024

@ben04 Does your problem still exist?

from android-support-preference-v7-fix.

ben04 avatar ben04 commented on June 2, 2024

Nah, it was fixed by updating to the newest library version.
Thanks for your help, Gericop! 👍

from android-support-preference-v7-fix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.