Giter Club home page Giter Club logo

Comments (8)

ncapdevi avatar ncapdevi commented on May 18, 2024 1

I am pushing out a fix right now for 1.2.5. I am not 100% sure that it will fix the issue, because I am surprised it is happening the way it is now. Give it a shot and if you continue to see it, let me know.

from fragnav.

alashow avatar alashow commented on May 18, 2024 1

Thank you for the response.

I will try it.

from fragnav.

ncapdevi avatar ncapdevi commented on May 18, 2024

Could you update to 1.2.4 and see if you're still experiencing the issue?

from fragnav.

alashow avatar alashow commented on May 18, 2024

Uh, sorry, my bad. I am using 1.2.4. Updated comment.

from fragnav.

ncapdevi avatar ncapdevi commented on May 18, 2024

Got it. Should be a fairly easy fix. I should be able to post a fix in the next couple of days.

from fragnav.

alashow avatar alashow commented on May 18, 2024

Great! Thanks!

Offtopic: Do you suggest using Fragment getRootFragment(int index) over giving a list of fragments on initialization?

from fragnav.

ncapdevi avatar ncapdevi commented on May 18, 2024

There's no inherent performance advantage to using one over the other. Using getRootFragment performs lazy initialization of the object vs creating them all at once when you first initialize
FragNav, so technically those are different, but the difference in minimal. Really it's about three things:

  1. If you don't know what the root fragments for each tab will be on creation, (i.e., until you actually click on it, you may not know what it's going to be) then you need getRootFragment.
  2. Overriding. If you have a base class that's implementing RootFragmentListener, there's some cases where it's nice for the base class to handle a couple of tabs, and then the subclasses handle indexes that are unique to them.
  3. Preference. No real reason behind this one, but to me having a function returning what the fragments are seems a bit clearer/cleaner. I can totally see the opposite argument being made and that having a list being made at construction being a bit clearer. So whichever makes the most sense to you, I wanted to have both.

(Theoretically there's a 4th point, which is that if for some reason that rootFragment is lost, it can still call that function and get a newInstance of the fragment. This was handled in the earlier days as a safety precaution, but in reality, if the library is well built, should never have to happen.)

from fragnav.

rshah avatar rshah commented on May 18, 2024

I experienced this bug too. Now using 1.2.5 hope no crash anymore.
Thank you for the fix

from fragnav.

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.