Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 2.0.0 #39

Open
wants to merge 37 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
94f4412
Rename library module to ckChangeLog-core
cketti Feb 18, 2016
1c3e60e
Extract dialog code to separate module
cketti Feb 18, 2016
8f6183d
Make ReleaseItem a top-level class
cketti Feb 18, 2016
2af8329
Clean up the code a bit
cketti Feb 18, 2016
507d9d2
Remove white spaces and line breaks from changes text.
johnjohndoe Mar 1, 2016
0169c57
Re-use newInstance constuctor.
johnjohndoe Mar 1, 2016
6cd83f6
Extract method to clean text of change item
cketti Mar 24, 2016
111ee98
Merge pull request #37 into version_2
cketti Mar 24, 2016
f97ba78
Merge pull request #38 from johnjohndoe/new-instance
cketti Mar 24, 2016
cd8d027
Update build tools etc.
cketti Jul 14, 2016
0f42533
Extract core functionality into multiple classes
cketti Oct 23, 2016
33da70d
Add tests
cketti Nov 4, 2016
5ff4e47
Make API to get change log nicer
cketti Nov 4, 2016
faab3ed
Make XmlParser more strict
cketti Nov 9, 2016
726a00a
Extract library version to variable
cketti Feb 11, 2017
26d7801
Move POM metadata to root project's build.gradle
cketti Feb 12, 2017
14e3cfa
Dynamically write string resource with library version
cketti Feb 12, 2017
82a42ba
Update copyright notices
cketti Mar 24, 2017
2637881
Move change log from README to separate file
cketti Mar 24, 2017
94eb31c
Extract code to generate the change log HTML to separate class
cketti Mar 24, 2017
3b4f673
Expose the used ChangeLog instance to users of DialogChangeLog
cketti Mar 24, 2017
5cae803
Clean up and add more JavaDoc
cketti Mar 24, 2017
ee69936
Update Change Log with migration instructions
cketti Mar 24, 2017
1752fac
Update README
cketti Mar 24, 2017
e6d9ee8
Add Maven Central snapshot repository
cketti Mar 24, 2017
5e61cbd
Make XmlParser return an unmodifiable list
cketti Nov 9, 2017
30dcb54
Update build tools
cketti Mar 8, 2018
0b40bcf
Update test dependencies
cketti Mar 8, 2018
2af0af4
Change package name to de.cketti.changelog
cketti May 12, 2018
445a0ae
Update dependencies
cketti May 12, 2018
36c48f8
Clean up code to remove some warnings
cketti May 12, 2018
c0db1c4
Move change log files from res/xml/ to res/raw/
cketti May 12, 2018
89238f7
Add "date" attribute
cketti May 12, 2018
ce3de32
Rename ckChangeLog-dialog to ckChangeLog-legacy-dialog
cketti May 12, 2018
7c9f838
Make writeCurrentVersion() update internal state
cketti May 13, 2018
c4ff306
Update copyright headers
cketti May 13, 2018
d483d5d
Update README and CHANGELOG
cketti May 13, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
language: android
android:
components:
- build-tools-21.1.2
- android-21
components:
- build-tools-27.0.3
- android-27
- extra-android-m2repository
licenses:
- 'android-sdk-license-.+'

jdk: oraclejdk8

jdk: oraclejdk7
before_install:
- yes | sdkmanager "platforms;android-27"

script: ./gradlew build
script: ./gradlew assembleDebug testDebugUnitTest
84 changes: 84 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
## Change Log

### Version 2.0.0 (unreleased)
**Breaking change!** Change log files are now located in `raw` resource directories rather than the `xml` ones
(see issue #48).

The library was split into a core library (`ckchangelog-core`) and a library for the UI part
(`ckchangelog-legacy-dialog`).

The core library provides the base functionality like parsing the XML file and remembering the version code of the last
app version. This allows users of the core library to provide their own visualization of the change log.

The `ckchangelog-legacy-dialog` library provides the simple dialog from ckChangeLog 1.x that renders the change log in a
`WebView` inside an `AlertDialog`. However, users are strongly encouraged to write their own UI to display the change
log. It is the author's belief that `ckchangelog-legacy-dialog` should be avoided because of the following issues:
* Displaying a dialog on app startup is quite obtrusive.
* WebView is a very resource-intensive UI widget.
* Creating a ChangeLog instance triggers a read from `SharedPreferences` and a query to `PackageManager`. Both
operations that should be performed in a background thread, but aren't if you're using `ckchangelog-legacy-dialog`.
Similarly, reading the change log resources are operations that should be performed in the background.

Support for a `date` attribute on the `release` element has been added to `ckchangelog-core`. It's an optional attribute
that accepts arbitrary strings. It's up the user of the library whether to parse the string as a date in a certain
format, output the string as-is, or ignore the value.

Example:
```xml
<release version="1.0" versioncode="1" date="2018-04-01">
<change>First release</change>
</release>
```
**Note:** `ckchangelog-legacy-dialog` does not support this new attribute.

#### Update from ckChangeLog 1.x

1. Replace the old entry in the dependency block with this:

```groovy
dependencies {
compile 'de.cketti.library.changelog:ckchangelog-legacy-dialog:2.0.0'
}
```

2. Move the change log files from `res/xml/` and `res/xml-*` to `res/raw/` and `res/raw-*` respectively.

3. Then replace the old ckChangeLog code in your Activity's `onCreate()` method with this:

```java
DialogChangeLog changeLog = DialogChangeLog.newInstance(this);
if (changeLog.isFirstRun()) {
changeLog.getLogDialog().show();
}
```

Advanced functionality like getting the last version code is available via the `ChangeLog` instance that can be
retrieved by using `DialogChangeLog#getChangeLog()`.
Example: `dialogChangeLog.getChangeLog().isFirstRunEver()`


### Version 1.2.2 (2015-01-09)
* Added Ukrainian translation

### Version 1.2.1
* Added support for [AboutLibraries](https://github.com/mikepenz/AboutLibraries)
* Fixed 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 `ReleaseItem`s
* 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
31 changes: 31 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Copyright (C) 2012-2018 cketti and contributors
https://github.com/cketti/ckChangeLog/graphs/contributors

Portions Copyright (C) 2012 Martin van Zuilekom (http://martin.cubeactive.com)

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.


Based on android-change-log:

Copyright (C) 2011, Karsten Priegnitz

Permission to use, copy, modify, and distribute this piece of software
for any purpose with or without fee is hereby granted, provided that
the above copyright notice and this permission notice appear in the
source code of all copies.

It would be appreciated if you mention the author in your change log,
contributors list or the like.

http://code.google.com/p/android-change-log/
63 changes: 15 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ckChangeLog - An Android Library to display a Change Log

[![Build status](https://api.travis-ci.org/cketti/ckChangeLog.svg)](https://travis-ci.org/cketti/ckChangeLog)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/de.cketti.library.changelog/ckchangelog/badge.svg)](https://maven-badges.herokuapp.com/maven-central/de.cketti.library.changelog/ckchangelog)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/de.cketti.library.changelog/ckchangelog-dialog/badge.svg)](https://maven-badges.herokuapp.com/maven-central/de.cketti.library.changelog/ckchangelog-dialog)

![Screenshot](screenshot_1.png)
![Screenshot](screenshot_2.png)
Expand All @@ -14,14 +14,14 @@ This library provides an easy way to display a change log in your app.
* 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
* Easily extensible 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:
1. Create the master change log in `res/raw/changelog_master.xml`. Formatted like this:

```xml
<?xml version="1.0" encoding="utf-8"?>
Expand All @@ -40,34 +40,29 @@ Repository at <https://github.com/cketti/ckChangeLog>.
```

2. 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`.
language-specific versions of `res/raw/`, e.g. `res/raw-de/changelog.xml`.

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

```java
ChangeLog cl = new ChangeLog(this);
if (cl.isFirstRun()) {
cl.getLogDialog().show();
DialogChangeLog changeLog = DialogChangeLog.newInstance(this);
cketti marked this conversation as resolved.
Show resolved Hide resolved
if (changeLog.isFirstRun()) {
changeLog.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`:
Add the following lines to your `build.gradle` file:

```groovy
dependencies {
compile 'de.cketti.library.changelog:ckchangelog:1.2.2'
compile 'de.cketti.library.changelog:ckchangelog-legacy-dialog:2.0.0'
}
```

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

```groovy
repositories {
mavenCentral()
}
```
The library is uploaded to Maven Central and should be mirrored by JCenter. Make sure your `repositories` block
contains either `mavenCentral()` or `jcenter()`.

## Customize labels

Expand All @@ -78,37 +73,9 @@ In order to change the labels of the dialog add the following items to your `str
<string name="changelog_title">What\'s New</string>
<string name="changelog_ok_button">OK</string>
<string name="changelog_show_full">More…</string>
<string name="changelog_version_format">Version <xliff:g id="version_name">%s</xliff:g></string>
```

## Changelog

### Version 1.2.2 (2015-01-09)
* Added Ukrainian translation

### Version 1.2.1
* Add support for [AboutLibraries](https://github.com/mikepenz/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 `ReleaseItem`s
* 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:
Expand All @@ -117,12 +84,12 @@ This library is based on:

Other contributors:
* [See here](https://github.com/cketti/ckChangeLog/graphs/contributors)
* You? Please create pull requests against the [dev](https://github.com/cketti/ckChangeLog/tree/dev) branch
* You? Create a [pull request](https://github.com/cketti/ckChangeLog/pulls).


## License

Copyright (C) 2012-2015 cketti and contributors
Copyright (C) 2012-2018 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.
Expand Down
5 changes: 4 additions & 1 deletion android-mvn-push.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if (!(hasProperty("nexusUsername") && hasProperty("nexusPassword"))) {
return;
return
}

apply plugin: 'maven'
Expand All @@ -19,6 +19,9 @@ afterEvaluate { project ->
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: nexusUsername, password: nexusPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots") {
authentication(userName: nexusUsername, password: nexusPassword)
}

pom.project {
name project.pom.name
Expand Down
35 changes: 31 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,41 @@
buildscript {
repositories {
mavenCentral()
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
classpath 'com.android.tools.build:gradle:3.0.1'
}
}

allprojects {
repositories {
google()
mavenCentral()
}
}

ext {
propBuildToolsVersion = "21.1.2"
propCompileSdkVersion = 21
propBuildToolsVersion = "27.0.3"
propCompileSdkVersion = 27
libraryVersion = "2.0.0-SNAPSHOT"

pom = [
group: "de.cketti.library.changelog",
name: "ckChangeLog Library",
description: "An Android Library to display a Change Log",
url: "https://github.com/cketti/ckChangeLog",

scmUrl: "https://github.com/cketti/ckChangeLog",
scmConnection: "scm:[email protected]:cketti/ckChangeLog.git",
scmDevConnection: "scm:[email protected]:cketti/ckChangeLog.git",

licenseName: "The Apache Software License, Version 2.0",
licenseUrl: "http://www.apache.org/licenses/LICENSE-2.0.txt",
licenseDist: "repo",

developerId: "cketti",
developerName: "cketti"
]
}
27 changes: 27 additions & 0 deletions ckChangeLog-core/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion propCompileSdkVersion
buildToolsVersion propBuildToolsVersion

defaultConfig {
versionName libraryVersion
minSdkVersion 14

resValue "string", "library_ckChangeLog_libraryVersion", libraryVersion
}
}

dependencies {
implementation 'com.android.support:support-annotations:27.1.1'

testImplementation 'org.robolectric:robolectric:3.7.1'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.18.0'
}

project.ext.pom = rootProject.pom
project.ext.pom['artifactId'] = "ckchangelog-core"

apply from: '../android-mvn-push.gradle'

5 changes: 5 additions & 0 deletions ckChangeLog-core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<manifest package="de.cketti.changelog">

<application/>

</manifest>
Loading