Giter VIP home page Giter VIP logo

ckchangelog's Introduction

ckChangeLog - An Android Library to display a Change Log

Screenshot Screenshot

This library provides an easy way to display a change log in your app.

Features

  • Displays changes since the last app update
  • Can display the complete change log history
  • Uses a simple XML file as source
  • Supports partial translations
  • Easily extendable to use something other than a dialog

Repository at https://github.com/cketti/ckChangeLog.

Usage

  1. Create the master change log in res/xml/changelog_master.xml. Formatted like this:
<?xml version="1.0" encoding="utf-8"?>
<changelog>
    <release version="1.1" versioncode="11" >
        <change>Totally new and shiny version</change>
    </release>
    <release version="1.0" versioncode="10" >
        <change>Fixed: A bug fix</change>
        <change>Some other changes I can't quite remember</change>
    </release>
    <release version="0.1" versioncode="1">
        <change>First release</change>
    </release>
</changelog>
  1. Create translations of this changelog_master.xml file in files named changelog.xml under language-specific versions of res/xml/, e.g. res/xml-de/changelog.xml.

  2. Display the change log dialog by putting the following code in your activity's onCreate() method:

ChangeLog cl = new ChangeLog(this);
if (cl.isFirstRun()) {
    cl.getLogDialog().show();
}

Include the library

The easiest way to add ckChangeLog to your project is via Gradle. Just add the following lines to your build.gradle:

dependencies {
    compile 'de.cketti.library.changelog:ckchangelog:1.2.2'
}

To tell Gradle where to find the library, make sure build.gradle also contains this:

repositories {
    mavenCentral()
}

Customize labels

In order to change the labels of the dialog add the following items to your strings.xml:

  <string name="changelog_full_title">Change Log</string>
  <string name="changelog_title">What\'s New</string>
  <string name="changelog_ok_button">OK</string>
  <string name="changelog_show_full">More…</string>

Changelog

Version 1.2.2 (2015-01-09)

  • Added Ukrainian translation

Version 1.2.1

  • Add support for AboutLibraries
  • Fix build scripts so Javadoc JAR is properly created

Version 1.2.0

  • Made constant DEFAULT_CSS public
  • Changed internals to make it easier to read the change log from different sources
  • Added public method getChangeLog(boolean) that returns a list of ReleaseItems
  • Changed minSdkVersion to 4
  • Switched to Gradle as build system
  • Added Greek, Spanish, Polish, and Russian translation

Version 1.1.0

  • Added method skipLogDialog()
  • Added Slovak and German translation

Version 1.0.0

  • Breaking change! Moved master translation from res/raw/changelog.xml to res/xml/changelog_master.xml
  • Added German translation of the sample app

Version 0.1

  • Initial release

Acknowledgments

This library is based on:

Other contributors:

  • See here
  • You? Please create pull requests against the dev branch

License

Copyright (C) 2012-2015 cketti and contributors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

ckchangelog's People

Contributors

andrewachen avatar arturdryomov avatar bboa avatar bdonahue avatar cketti avatar denisk20 avatar johnjohndoe avatar micharg avatar pylersm avatar sloy avatar uberspot avatar zjw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ckchangelog's Issues

no versionCode in changelog_master.xml ?

I'm thinking about a auto generated changelog in my app.
I want to auto generate versionCodewith git rev-list HEAD --count but here versionCode in changelog_master.xml is an issue

image

can this lib work without versionCode in changelog_master.xml ?

How about versiondate?

Do you think about implementing optional property versiondate in release? It doesn't matter which kind of style it is (without terrible datehandling) just treat it as String.

Something like that (diffferent kinds of dates):

<changelog>
    <release version="1.1" versioncode="11" versiondate="2015-02-23">
        <change>Totally new and shiny version</change>
    </release>
    <release version="1.0" versioncode="10" versiondate="02/23/2015">
        <change>Fixed: A bug fix</change>
        <change>Some other changes I can't quite remember</change>
    </release>
    <release version="0.1" versioncode="1" versiondate="23.02.2015">
        <change>First release</change>
    </release>
</changelog>

And an additional method:

public ChangeLog setVersionDatesVisible(boolean visible) {
    mVersionDates = visible;
    return this;
}

And some lines of code on other locations, but nothin difficult.

Unable to compile with Android Studio

I have added

repositories {
mavenCentral()
}

and

dependencies {
compile 'de.cketti.library.changelog:ckchangelog:1.2.0'
}

But I'm unable to resolve the ChangeLog class, I have cleaned the project, but it didn't help.

This is the first time I'm working with maven, am I doing something wrong?

mavenCentral not required

It should not be necessary anymore to add mavenCentral() to the repositories in the build scripts as indicated in the Readme. AndroidStudio projects by default include jCenter() which replaces mavenCentral().

Quotations marks in text for a change

In the <change> tags, using quotation marks as " or escaped as \" or even as \u0022 does not show the symbol in the dialog, there is no character instead. In Android resources this works (e.g. in strings.xml). Single quotes ' even cause the whole text following to be removed.

Using the actual characters „ “ ” ‚ ‘ ’ works, however.

Add option for holo dark theme

Currently, the WebView is displayed with white background and passing body { background-color: transparent; } doesn't seem to work.

It would be nice if there would be a switch for light/dark.

AlertDialog from support-v7 library

Are you planning to switch to the android.support.v7.app.AlertDialog which supports defining an accent color, including pre-Lollipop Android versions?

You would need to replace the import for the AlertDialog and reference a style for it:

AlertDialog.Builder builder = new AlertDialog.Builder(mContext, R.style.AppDialog);

The styles.xml cool look like this:

<style name="AppDialog" parent="Theme.AppCompat.Light.Dialog.Alert">
    <item name="colorAccent">@color/accent</item>
</style>

Values in pt br

Hi, may you add these values to values-pt for portuguese language?

Novidades Novidades OK Mais…
<string name="changelog_version_format">Versão <xliff:g id="version_name">%s</xliff:g></string>

.getLogFragment()

Hello.
Do you have plans to support fragments?
I mean, that instead of dialog, you will return fragment.

Callback when dialog is closed

It would be great to being able to register for a callback which is invoked once the dialog is closed. This would enable users to coordinate with other dialogs such as Android permission dialogs.

Resources$NotFoundException: String resource via ChangeLog.getDialog

I noticed a few occurrences of the following error being reported in the Google Developer Console of my app. I am using version 1.2.2 of the library.

I am able to reproduce the crash with an Android emulator API level 21, 5.0.2, Google APIs Intel x86 Atom_64 System Image, Revision 31.

Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x2040002
    at android.content.res.Resources.getText(Resources.java:274)
    at android.content.res.Resources.getString(Resources.java:360)
    at com.android.org.chromium.content.browser.ContentViewCore.setContainerView(ContentViewCore.java:702)
    at com.android.org.chromium.content.browser.ContentViewCore.initialize(ContentViewCore.java:608)
    at com.android.org.chromium.android_webview.AwContents.createAndInitializeContentViewCore(AwContents.java:619)
    at com.android.org.chromium.android_webview.AwContents.setNewAwContents(AwContents.java:758)
    at com.android.org.chromium.android_webview.AwContents.<init>(AwContents.java:608)
    at com.android.org.chromium.android_webview.AwContents.<init>(AwContents.java:546)
    at com.android.webview.chromium.WebViewChromium.initForReal(WebViewChromium.java:312)
    at com.android.webview.chromium.WebViewChromium.access$100(WebViewChromium.java:97)
    at com.android.webview.chromium.WebViewChromium$1.run(WebViewChromium.java:264)
    at com.android.webview.chromium.WebViewChromium$WebViewChromiumRunQueue.drainQueue(WebViewChromium.java:124)
    at com.android.webview.chromium.WebViewChromium$WebViewChromiumRunQueue$1.run(WebViewChromium.java:111)
    at com.android.org.chromium.base.ThreadUtils.runOnUiThread(ThreadUtils.java:144)
    at com.android.webview.chromium.WebViewChromium$WebViewChromiumRunQueue.addTask(WebViewChromium.java:108)
    at com.android.webview.chromium.WebViewChromium.init(WebViewChromium.java:261)
    at android.webkit.WebView.<init>(WebView.java:548)
    at android.webkit.WebView.<init>(WebView.java:483)
    at android.webkit.WebView.<init>(WebView.java:466)
    at android.webkit.WebView.<init>(WebView.java:453)
    at android.webkit.WebView.<init>(WebView.java:443)
    at de.cketti.library.changelog.ChangeLog.getDialog(ChangeLog.java:287)
    at de.cketti.library.changelog.ChangeLog.getLogDialog(ChangeLog.java:265)
    at de.avpptr.umweltzone.base.BaseActivity.showChangeLogDialog(BaseActivity.java:174)
    at de.avpptr.umweltzone.map.MainActivity.onCreate(MainActivity.java:58)
    at android.app.Activity.performCreate(Activity.java:5937)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
    ... 10 more

Missing title padding after update of support:appcompat-v7

Recently, I updated the support:appcompat-v7 library in my app project. I noticed that the title header of the dialog looks odd after the update - as if some bottom padding is missing.

Dialog with support:appcompat-v7 20.0.0

appcompat-v7-20 0 0

Dialog with support:appcompat-v7 22.1.1

appcompat-v7-22 1 1

I was able to isolate the effect to the version increase. At this point in time I did not define any custom styling for the dialog in the application theme - at least to my knowledge :-)


Further, the gray background for the header and footer is not present for dialogs I created myself with v.22.1.1. I am not sure if this intended? I found issue #19 but it did not solve the problem for me to add custom CSS.

getLogDialog is blank

When trying to use getLogDialog() to show an abbreviated changelog, the dialog appears, but is blank. Clicking "More..." displays the full log.

Here is my changelog_master.xml

<changelog>
    <release version="1.1" versioncode="2" >
       <change>Added Ability to view Version History from the "About" screen.</change>
    </release>
    <release version="1.0" versioncode="1" >
        <change>Added Ability to check for and install updates</change>
    </release>
</changelog>

I'm updating from version "1.0" version code 1 to version "1.1" versioncode 2. The update works as expected, and the dialog is showing as it should be. I would expect it to show the release notes for version "1.1" versioncode 2 after an update.

Thanks!

do not show changelog if user first time installing app

No point in showing changelog if user first time installing app. They don't need to know what's changed then and it's just another dialog they have to click through.

I know you don't update this library anymore but that would be very nice thing to have.

Please add Greek translation

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="changelog_full_title">Αλλαγές</string>
<string name="changelog_title">Τι Είναι Καινούργιο</string>
<string name="changelog_ok_button">Εντάξει</string>
<string name="changelog_show_full">Περισσότερα…</string>
<string name="changelog_version_format">Έκδοση <xliff:g id="version_name">%s</xliff:g></string>
</resources>

Library can't be imported into Android Studio

Error:No such property: nexusUsername for class: org.gradle.api.publication.maven.internal.ant.DefaultGroovyMavenDeployer

Looks like android-mvn-push.gradle needs to be modified to provide some dummy default values for maven username and password. I can create a pull request if you don't mind.

UnsatisfiedLinkError

I noticed a few occurrences of the following error being reported in the Google Developer Console of my app. I am using version 1.2.2 of the library.

  • Sony Xperia XZ1 Compact (G8441), Android 8.0
Caused by: java.lang.UnsatisfiedLinkError: 
  at java.lang.Runtime.loadLibrary0 (Runtime.java:1016)
  at java.lang.System.loadLibrary (System.java:1657)
  at org.chromium.base.library_loader.LibraryLoader.c (LibraryLoader.java:66)
  at org.chromium.base.library_loader.LibraryLoader.b (LibraryLoader.java:33)
  at com.android.webview.chromium.WebViewChromiumFactoryProvider.a (WebViewChromiumFactoryProvider.java:87)
  at com.android.webview.chromium.WebViewChromiumFactoryProvider.<init> (WebViewChromiumFactoryProvider.java:24)
  at com.android.webview.chromium.WebViewChromiumFactoryProviderForO.<init> (WebViewChromiumFactoryProviderForO.java:2)
  at com.android.webview.chromium.WebViewChromiumFactoryProviderForO.create (WebViewChromiumFactoryProviderForO.java:1)
  at java.lang.reflect.Method.invoke (Method.java)
  at android.webkit.WebViewFactory.getProvider (WebViewFactory.java:225)
  at android.webkit.WebView.getFactory (WebView.java:2467)
  at android.webkit.WebView.ensureProviderCreated (WebView.java:2462)
  at android.webkit.WebView.setOverScrollMode (WebView.java:2527)
  at android.view.View.<init> (View.java:4536)
  at android.view.View.<init> (View.java:4668)
  at android.view.ViewGroup.<init> (ViewGroup.java:597)
  at android.widget.AbsoluteLayout.<init> (AbsoluteLayout.java:55)
  at android.webkit.WebView.<init> (WebView.java:636)
  at android.webkit.WebView.<init> (WebView.java:581)
  at android.webkit.WebView.<init> (WebView.java:564)
  at android.webkit.WebView.<init> (WebView.java:551)
  at android.webkit.WebView.<init> (WebView.java:541)
  at de.cketti.library.changelog.ChangeLog.isFirstRun (ChangeLog.java:4)
                                           getDialog
                                           readChangeLogFromResource
                                           readChangeLog
                                           parseReleaseTag
  at de.cketti.library.changelog.ChangeLog.getLogDialog (ChangeLog.java:4)
                                           getChangeLog
  at de.avpptr.umweltzone.base.BaseActivity.showChangeLogDialog (BaseActivity.java:17)
  at de.avpptr.umweltzone.map.MainActivity.onCreate (MainActivity.java:36)
  at android.app.Activity.performCreate (Activity.java:6975)
  at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1214)
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2775)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2897)
  at android.app.ActivityThread.-wrap11 (Unknown Source)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1598)
  at android.os.Handler.dispatchMessage (Handler.java:105)
  at android.os.Looper.loop (Looper.java:251)
  at android.app.ActivityThread.main (ActivityThread.java:6572)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:240) 
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:767)

Does this give you any insides for the reason of the crash?

Disable translations?

It is quite inconsistent if the change log is translated to languages the actual app is not. Is there an easy way to disable translations of the change log for certain languages?

The only ways I can think of:

  • Actually create translations for the languages ckChangeLog is translated for by copying strings.xml from the default values
  • Create own keys for the change log strings and set them at the dialog obtained by getLogDialog() (not very elegant)

Lib have wrong path - manual import

Hi, I imported your library (thx for it), but default structure of library should be src->de.cketti.library.changelog not java -> de.cketti.library.changelog
If it is as in first case as normally libs are that way) Eclipse auto import it to our project when we use ChangeLog class.

Issue showing What's New Window

I just followed the default sample, without customizations, and I've got the following results. The first view is empty but, when I click the option 'More...' it looks normal.

It was tested using a Galaxy S4 phone.

Any hints on how to fix it?

Thanks!

2014-11-23 02 56 51

2014-11-23 02 56 59

RuntimeException on start

Tried to use your library, got RuntimeException.

Did everything like in example, but couldn't make it work.

Would be glad to receive any help or advice.

Logcat:

10-23 10:22:52.243 9205-9205/com.trulden.friends E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.trulden.friends, PID: 9205
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.trulden.friends/com.trulden.friends.activity.MainActivity}: android.content.res.Resources$NotFoundException: String resource ID #0x2040002
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
        at android.app.ActivityThread.access$800(ActivityThread.java:144)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5221)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
     Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x2040002
        at android.content.res.Resources.getText(Resources.java:274)
        at android.content.res.Resources.getString(Resources.java:360)
        at com.android.org.chromium.content.browser.ContentViewCore.setContainerView(ContentViewCore.java:702)
        at com.android.org.chromium.content.browser.ContentViewCore.initialize(ContentViewCore.java:608)
        at com.android.org.chromium.android_webview.AwContents.createAndInitializeContentViewCore(AwContents.java:619)
        at com.android.org.chromium.android_webview.AwContents.setNewAwContents(AwContents.java:758)
        at com.android.org.chromium.android_webview.AwContents.<init>(AwContents.java:608)
        at com.android.org.chromium.android_webview.AwContents.<init>(AwContents.java:546)
        at com.android.webview.chromium.WebViewChromium.initForReal(WebViewChromium.java:312)
        at com.android.webview.chromium.WebViewChromium.access$100(WebViewChromium.java:97)
        at com.android.webview.chromium.WebViewChromium$1.run(WebViewChromium.java:264)
        at com.android.webview.chromium.WebViewChromium$WebViewChromiumRunQueue.drainQueue(WebViewChromium.java:124)
        at com.android.webview.chromium.WebViewChromium$WebViewChromiumRunQueue$1.run(WebViewChromium.java:111)
        at com.android.org.chromium.base.ThreadUtils.runOnUiThread(ThreadUtils.java:144)
        at com.android.webview.chromium.WebViewChromium$WebViewChromiumRunQueue.addTask(WebViewChromium.java:108)
        at com.android.webview.chromium.WebViewChromium.init(WebViewChromium.java:261)
        at android.webkit.WebView.<init>(WebView.java:548)
        at android.webkit.WebView.<init>(WebView.java:483)
        at android.webkit.WebView.<init>(WebView.java:466)
        at android.webkit.WebView.<init>(WebView.java:453)
        at android.webkit.WebView.<init>(WebView.java:443)
        at de.cketti.library.changelog.ChangeLog.getDialog(ChangeLog.java:287)
        at de.cketti.library.changelog.ChangeLog.getLogDialog(ChangeLog.java:265)
        at com.trulden.friends.activity.MainActivity.onCreate(MainActivity.java:117)
        at android.app.Activity.performCreate(Activity.java:5937)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360) 
        at android.app.ActivityThread.access$800(ActivityThread.java:144) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:135) 
        at android.app.ActivityThread.main(ActivityThread.java:5221) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:372) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

Provide AndroidX version of the library

Google published its support library artifacts with new package names: androidx. The former com.android.support:support-annotations becomes androidx.annotation:annotation:.

When using your library in an application project which already migrated to androidx it would be convenient when your library is available as an artifact depending on androidx.annotation:annotation:. This would allow to get rid of the android.enableJetifier=true and android.useAndroidX=true flags in the application project.

Dialog won't load content and rapidly resizes

When QAing this library we ran into a case where the change log dialog will not load the contents and constantly changes sizes. This does not happen every time or on every phone but some phones we tested with this is the behavior some of the time.

We know it has something to do with the CSS being applied because when we comment out the CSS we cannot reproduce the issue. Also as you can see in the video it looks like the dialog renders properly for a split second after the dismiss button is clicked.

Please see video of issue at: https://dl.dropboxusercontent.com/u/66318395/VisualGlitching.MOV

New lint check MissingDefaultResource

With the introduction of the MissingDefaultResource ( http://tools.android.com/tips/lint-checks ), an error occurs if this library is used with changelog xml resources in several languages.

bildschirmfoto 2018-11-04 um 17 09 11

As a work around, one can create in res/xml a copy of the changelog_master.xml as a dummy with the name changelog.xml in order to avoid this lint error.
Could we fix this also in the library logic?

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.