Code Monkey home page Code Monkey logo

Comments (3)

gregkorossy avatar gregkorossy commented on June 2, 2024

Yeah, I received the other notification too, but I had no time to respond, sorry.
I tested it and looks good to me on API 17. What's your onPreferenceStartScreen(...) implementation? Also, which Android version is this?

Thanks, but I don't do this project for the money, I use this fix in my apps too. The bugs are really frustrating but also challenging, which I like. So it's a love-hate relationship 😄

from android-support-preference-v7-fix.

yccheok avatar yccheok commented on June 2, 2024

The screenshot I posted is for API 16.

Just now, I re-test again using API 17, the inner screen is still having same padding problem shown in screenshots.

@Gericop

You get the right catch! When I look back at the code

// Code for public class JStockPreferenceActivity extends AppCompatActivity implements PreferenceFragmentCompat.OnPreferenceStartScreenCallback

// http://stackoverflow.com/questions/32487206/inner-preferencescreen-not-opens-with-preferencefragmentcompat/32540395#32540395
@Override
public boolean onPreferenceStartScreen(PreferenceFragmentCompat preferenceFragmentCompat, PreferenceScreen preferenceScreen) {
    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    JStockInnerPreferenceFragmentCompat fragment = new JStockInnerPreferenceFragmentCompat();
    Bundle args = new Bundle();
    args.putString(PreferenceFragmentCompat.ARG_PREFERENCE_ROOT, preferenceScreen.getKey());
    fragment.setArguments(args);
    ft.add(R.id.content, fragment, preferenceScreen.getKey());
    ft.addToBackStack(preferenceScreen.getKey());
    ft.commit();
    return true;
}

Then, I realize my JStockInnerPreferenceFragmentCompat is as follow

public class JStockInnerPreferenceFragmentCompat extends PreferenceFragmentCompat

When I change to

public class JStockInnerPreferenceFragmentCompat extends PreferenceFragmentCompatFix

It works perfectly fine now. Sorry. I will close this ticket. It is no longer valid.

p/s I did not use your new gradle dependency. Your old code works just fine for me. Since nothing broken, I will avoid from changing the code :)

from android-support-preference-v7-fix.

gregkorossy avatar gregkorossy commented on June 2, 2024

I think you should give it a try though. The "Fix" suffix is no longer required (indeed, it's deprecated) as in my package there are same-name replicas of the broken classes and I "hacked" the PreferenceManager in a way that it loads those classes instead of the broken ones.

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.