Giter Club home page Giter Club logo

Comments (5)

MFlisar avatar MFlisar commented on July 19, 2024 1

If you want to show it on first app start, just do following in your app:

// must be BEFORE the first managed start, as this will change the -1 to current apps version
if (ChangelogPreferenceUtil.getAlreadyShownChangelogVersion() == -1)
{
    // show it without managed start => will only be true ONCE in an apps lifetime
}
// now show it with managed start => from here on it will only show if a version update is detected

from changelog.

MFlisar avatar MFlisar commented on July 19, 2024

If the value has not been set yet, you'll get -1 as lastChangelogVersion, check this:

private static int getAlreadyShownChangelogVersion(Context context) {
SharedPreferences prefs = context.getSharedPreferences(PREF_FILE, Context.MODE_PRIVATE);
return prefs.getInt(PREF_KEY, -1);
}

And on first app start after a new install, a changelog does not make sense imho, so this is the expected behaviour, check out the comment here:

// return last shown version if this is not the first app install AND if last version is less than current
if (lastChangelog != -1 && lastChangelog < currentVersion) {
return lastChangelog + 1;
}

from changelog.

ahctang avatar ahctang commented on July 19, 2024

Ah ok! I understand the intent behind your design now.

Sorry, false alarm!

from changelog.

marbat87 avatar marbat87 commented on July 19, 2024

@MFlisar The method getAlreadyShownChangelogVersion is private so we cannot call it from application

from changelog.

MFlisar avatar MFlisar commented on July 19, 2024

will male it public in the next release

from changelog.

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.