result = new ArrayList<>();
+ for (ReleaseItem releaseItem : releaseItems) {
+ if (releaseItem.versionCode > lastVersionCode) {
+ result.add(releaseItem);
+ }
+ }
+
+ return result;
+ }
+ };
+ }
+}
diff --git a/ckChangeLog-core/src/test/resources/invalid_change_element_contains_element.xml b/ckChangeLog-core/src/test/resources/invalid_change_element_contains_element.xml
new file mode 100644
index 0000000..263e872
--- /dev/null
+++ b/ckChangeLog-core/src/test/resources/invalid_change_element_contains_element.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/ckChangeLog-core/src/test/resources/invalid_empty_change_element.xml b/ckChangeLog-core/src/test/resources/invalid_empty_change_element.xml
new file mode 100644
index 0000000..c2b1151
--- /dev/null
+++ b/ckChangeLog-core/src/test/resources/invalid_empty_change_element.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/ckChangeLog-core/src/test/resources/invalid_empty_release_element.xml b/ckChangeLog-core/src/test/resources/invalid_empty_release_element.xml
new file mode 100644
index 0000000..a54e33d
--- /dev/null
+++ b/ckChangeLog-core/src/test/resources/invalid_empty_release_element.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/ckChangeLog-core/src/test/resources/invalid_release_element_with_missing_version_attribute.xml b/ckChangeLog-core/src/test/resources/invalid_release_element_with_missing_version_attribute.xml
new file mode 100644
index 0000000..bc62f79
--- /dev/null
+++ b/ckChangeLog-core/src/test/resources/invalid_release_element_with_missing_version_attribute.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/ckChangeLog-core/src/test/resources/invalid_release_element_with_missing_versioncode_attribute.xml b/ckChangeLog-core/src/test/resources/invalid_release_element_with_missing_versioncode_attribute.xml
new file mode 100644
index 0000000..bc62f79
--- /dev/null
+++ b/ckChangeLog-core/src/test/resources/invalid_release_element_with_missing_versioncode_attribute.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/ckChangeLog-core/src/test/resources/invalid_wrong_change_element.xml b/ckChangeLog-core/src/test/resources/invalid_wrong_change_element.xml
new file mode 100644
index 0000000..ffac1ce
--- /dev/null
+++ b/ckChangeLog-core/src/test/resources/invalid_wrong_change_element.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/ckChangeLog-core/src/test/resources/invalid_wrong_release_element.xml b/ckChangeLog-core/src/test/resources/invalid_wrong_release_element.xml
new file mode 100644
index 0000000..01264b1
--- /dev/null
+++ b/ckChangeLog-core/src/test/resources/invalid_wrong_release_element.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/ckChangeLog-core/src/test/resources/invalid_wrong_root_element.xml b/ckChangeLog-core/src/test/resources/invalid_wrong_root_element.xml
new file mode 100644
index 0000000..96976c3
--- /dev/null
+++ b/ckChangeLog-core/src/test/resources/invalid_wrong_root_element.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/ckChangeLog-core/src/test/resources/valid_changelog_with_version_dates.xml b/ckChangeLog-core/src/test/resources/valid_changelog_with_version_dates.xml
new file mode 100644
index 0000000..0e78b48
--- /dev/null
+++ b/ckChangeLog-core/src/test/resources/valid_changelog_with_version_dates.xml
@@ -0,0 +1,16 @@
+
+
+
+
+ Third release
+
+
+
+ Second release
+
+
+
+ First release
+
+
+
diff --git a/ckChangeLog-core/src/test/resources/valid_changelog_without_version_dates.xml b/ckChangeLog-core/src/test/resources/valid_changelog_without_version_dates.xml
new file mode 100644
index 0000000..5cdaac6
--- /dev/null
+++ b/ckChangeLog-core/src/test/resources/valid_changelog_without_version_dates.xml
@@ -0,0 +1,17 @@
+
+
+
+
+ Totally new and shiny version
+
+
+
+ Fixed: A bug fix
+ Some other changes I can't quite remember
+
+
+
+ First release
+
+
+
diff --git a/ckChangeLog-core/src/test/resources/valid_empty_changelog.xml b/ckChangeLog-core/src/test/resources/valid_empty_changelog.xml
new file mode 100644
index 0000000..59d3cf4
--- /dev/null
+++ b/ckChangeLog-core/src/test/resources/valid_empty_changelog.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/ckChangeLog-legacy-dialog/build.gradle b/ckChangeLog-legacy-dialog/build.gradle
new file mode 100644
index 0000000..457c250
--- /dev/null
+++ b/ckChangeLog-legacy-dialog/build.gradle
@@ -0,0 +1,20 @@
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion propCompileSdkVersion
+ buildToolsVersion propBuildToolsVersion
+
+ defaultConfig {
+ versionName libraryVersion
+ minSdkVersion 14
+ }
+}
+
+dependencies {
+ implementation project(':ckChangeLog-core')
+}
+
+project.ext.pom = rootProject.pom
+project.ext.pom['artifactId'] = "ckchangelog-legacy-dialog"
+
+apply from: '../android-mvn-push.gradle'
diff --git a/ckChangeLog-legacy-dialog/src/main/AndroidManifest.xml b/ckChangeLog-legacy-dialog/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7af476b
--- /dev/null
+++ b/ckChangeLog-legacy-dialog/src/main/AndroidManifest.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/ckChangeLog-legacy-dialog/src/main/java/de/cketti/changelog/dialog/DialogChangeLog.java b/ckChangeLog-legacy-dialog/src/main/java/de/cketti/changelog/dialog/DialogChangeLog.java
new file mode 100644
index 0000000..3b05557
--- /dev/null
+++ b/ckChangeLog-legacy-dialog/src/main/java/de/cketti/changelog/dialog/DialogChangeLog.java
@@ -0,0 +1,154 @@
+/*
+ * 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.
+ * 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.
+ */
+package de.cketti.changelog.dialog;
+
+
+import java.util.List;
+
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.webkit.WebView;
+
+import de.cketti.changelog.ChangeLog;
+import de.cketti.changelog.ReleaseItem;
+
+
+/**
+ * Display a dialog showing a full or partial (What's New) Change Log.
+ *
+ *
+ * You can display a Change Log after app updates by putting the following code in your Activity's {@code onCreate()}
+ * method:
+ *
+ * {@code
+ * DialogChangeLog changeLog = DialogChangeLog.newInstance(this);
+ * if (changeLog.isFirstRun()) {
+ * changeLog.getLogDialog().show();
+ * }
+ * }
+ */
+public final class DialogChangeLog {
+ /**
+ * Default CSS styles used to format the Change Log.
+ */
+ public static final String DEFAULT_CSS = "" +
+ "h1 { margin-left: 0px; font-size: 1.2em; }" + "\n" +
+ "li { margin-left: 0px; }" + "\n" +
+ "ul { padding-left: 2em; }";
+
+
+ private final Context context;
+ private final ChangeLog changeLog;
+ private final HtmlFormatter formatter;
+
+
+ /**
+ * Create an instance using the default CSS to format the Change Log.
+ */
+ public static DialogChangeLog newInstance(Context context) {
+ return DialogChangeLog.newInstance(context, DEFAULT_CSS);
+ }
+
+ /**
+ * Create an instance using the supplied CSS to format the Change Log.
+ */
+ public static DialogChangeLog newInstance(Context context, String css) {
+ ChangeLog changeLog = ChangeLog.newInstance(context);
+ String versionFormat = context.getResources().getString(R.string.changelog_version_format);
+ HtmlFormatter formatter = new HtmlFormatter(versionFormat, css);
+ return new DialogChangeLog(context, changeLog, formatter);
+ }
+
+ private DialogChangeLog(Context context, ChangeLog changeLog, HtmlFormatter formatter) {
+ this.context = context;
+ this.changeLog = changeLog;
+ this.formatter = formatter;
+ }
+
+ /**
+ * Get the {@code ChangeLog} instance backing this {@code DialogChangeLog}.
+ */
+ public ChangeLog getChangeLog() {
+ return changeLog;
+ }
+
+ /**
+ * Get the "What's New" dialog.
+ *
+ * @return An AlertDialog displaying the changes since the previous installed version of your
+ * app (What's New). But when this is the first run of your app including
+ * {@code ChangeLog} then the full log dialog is show.
+ */
+ public AlertDialog getLogDialog() {
+ return getDialog(changeLog.isFirstRunEver());
+ }
+
+ /**
+ * Get a dialog with the full Change Log.
+ *
+ * @return An AlertDialog with a full Change Log displayed.
+ */
+ public AlertDialog getFullLogDialog() {
+ return getDialog(true);
+ }
+
+ /**
+ * Check if this is the first execution of this app version.
+ *
+ * @return {@code true} if this version of your app is started the first time.
+ */
+ public boolean isFirstRun() {
+ return changeLog.isFirstRun();
+ }
+
+ private AlertDialog getDialog(boolean full) {
+ WebView webView = new WebView(context);
+ webView.loadDataWithBaseURL(null, getChangeLogHtml(full), "text/html", "UTF-8", null);
+
+ AlertDialog.Builder builder = new AlertDialog.Builder(context);
+ builder.setTitle(full ? R.string.changelog_full_title : R.string.changelog_title)
+ .setView(webView)
+ .setCancelable(false)
+ .setPositiveButton(R.string.changelog_ok_button,
+ new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ changeLog.writeCurrentVersion();
+ }
+ });
+
+ if (!full) {
+ builder.setNegativeButton(R.string.changelog_show_full,
+ new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int id) {
+ getFullLogDialog().show();
+ }
+ });
+ }
+
+ return builder.create();
+ }
+
+ private String getChangeLogHtml(boolean full) {
+ List changelog = full ?
+ changeLog.getChangeLog() :
+ changeLog.getRecentChanges();
+
+ return formatter.createHtmlChangeLog(changelog);
+ }
+}
diff --git a/ckChangeLog-legacy-dialog/src/main/java/de/cketti/changelog/dialog/HtmlFormatter.java b/ckChangeLog-legacy-dialog/src/main/java/de/cketti/changelog/dialog/HtmlFormatter.java
new file mode 100644
index 0000000..7a5addc
--- /dev/null
+++ b/ckChangeLog-legacy-dialog/src/main/java/de/cketti/changelog/dialog/HtmlFormatter.java
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ * 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.
+ */
+package de.cketti.changelog.dialog;
+
+
+import java.util.List;
+
+import de.cketti.changelog.ReleaseItem;
+
+
+class HtmlFormatter {
+ private final String versionFormat;
+ private final String css;
+
+
+ public HtmlFormatter(String versionFormat, String css) {
+ this.versionFormat = versionFormat;
+ this.css = css;
+ }
+
+ public String createHtmlChangeLog(List changelog) {
+ StringBuilder sb = new StringBuilder();
+
+ sb.append("");
+
+ for (ReleaseItem release : changelog) {
+ sb.append("");
+ sb.append(String.format(versionFormat, release.versionName));
+ sb.append("
");
+ for (String change : release.changes) {
+ sb.append("- ");
+ sb.append(change);
+ sb.append("
");
+ }
+ sb.append("
");
+ }
+
+ sb.append("");
+
+ return sb.toString();
+ }
+}
diff --git a/ckChangeLog/src/main/res/values-cs/strings.xml b/ckChangeLog-legacy-dialog/src/main/res/values-cs/strings.xml
similarity index 100%
rename from ckChangeLog/src/main/res/values-cs/strings.xml
rename to ckChangeLog-legacy-dialog/src/main/res/values-cs/strings.xml
diff --git a/ckChangeLog/src/main/res/values-de/strings.xml b/ckChangeLog-legacy-dialog/src/main/res/values-de/strings.xml
similarity index 100%
rename from ckChangeLog/src/main/res/values-de/strings.xml
rename to ckChangeLog-legacy-dialog/src/main/res/values-de/strings.xml
diff --git a/ckChangeLog/src/main/res/values-el/strings.xml b/ckChangeLog-legacy-dialog/src/main/res/values-el/strings.xml
similarity index 100%
rename from ckChangeLog/src/main/res/values-el/strings.xml
rename to ckChangeLog-legacy-dialog/src/main/res/values-el/strings.xml
diff --git a/ckChangeLog/src/main/res/values-es/strings.xml b/ckChangeLog-legacy-dialog/src/main/res/values-es/strings.xml
similarity index 100%
rename from ckChangeLog/src/main/res/values-es/strings.xml
rename to ckChangeLog-legacy-dialog/src/main/res/values-es/strings.xml
diff --git a/ckChangeLog/src/main/res/values-pl/strings.xml b/ckChangeLog-legacy-dialog/src/main/res/values-pl/strings.xml
similarity index 100%
rename from ckChangeLog/src/main/res/values-pl/strings.xml
rename to ckChangeLog-legacy-dialog/src/main/res/values-pl/strings.xml
diff --git a/ckChangeLog/src/main/res/values-ru/strings.xml b/ckChangeLog-legacy-dialog/src/main/res/values-ru/strings.xml
similarity index 100%
rename from ckChangeLog/src/main/res/values-ru/strings.xml
rename to ckChangeLog-legacy-dialog/src/main/res/values-ru/strings.xml
diff --git a/ckChangeLog/src/main/res/values-sk/strings.xml b/ckChangeLog-legacy-dialog/src/main/res/values-sk/strings.xml
similarity index 100%
rename from ckChangeLog/src/main/res/values-sk/strings.xml
rename to ckChangeLog-legacy-dialog/src/main/res/values-sk/strings.xml
diff --git a/ckChangeLog/src/main/res/values-uk/strings.xml b/ckChangeLog-legacy-dialog/src/main/res/values-uk/strings.xml
similarity index 100%
rename from ckChangeLog/src/main/res/values-uk/strings.xml
rename to ckChangeLog-legacy-dialog/src/main/res/values-uk/strings.xml
diff --git a/ckChangeLog/src/main/res/values/strings.xml b/ckChangeLog-legacy-dialog/src/main/res/values/strings.xml
similarity index 100%
rename from ckChangeLog/src/main/res/values/strings.xml
rename to ckChangeLog-legacy-dialog/src/main/res/values/strings.xml
diff --git a/ckChangeLog/build.gradle b/ckChangeLog/build.gradle
deleted file mode 100644
index 1a574b8..0000000
--- a/ckChangeLog/build.gradle
+++ /dev/null
@@ -1,36 +0,0 @@
-apply plugin: 'com.android.library'
-
-android {
- compileSdkVersion propCompileSdkVersion
- buildToolsVersion propBuildToolsVersion
-
- defaultConfig {
- versionName "1.2.2"
-
- minSdkVersion 4
- }
-}
-
-project.ext {
- pom = [
- group: "de.cketti.library.changelog",
- artifactId: "ckchangelog",
- 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:git@github.com:cketti/ckChangeLog.git",
- scmDevConnection: "scm:git@github.com: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"
- ]
-}
-
-apply from: '../android-mvn-push.gradle'
-
diff --git a/ckChangeLog/src/main/AndroidManifest.xml b/ckChangeLog/src/main/AndroidManifest.xml
deleted file mode 100644
index 03a7ba0..0000000
--- a/ckChangeLog/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/ckChangeLog/src/main/java/de/cketti/library/changelog/ChangeLog.java b/ckChangeLog/src/main/java/de/cketti/library/changelog/ChangeLog.java
deleted file mode 100644
index b87b3f0..0000000
--- a/ckChangeLog/src/main/java/de/cketti/library/changelog/ChangeLog.java
+++ /dev/null
@@ -1,600 +0,0 @@
-/*
- * Copyright (C) 2012-2015 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/
- */
-package de.cketti.library.changelog;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import android.app.AlertDialog;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.SharedPreferences;
-import android.content.pm.PackageInfo;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.content.res.XmlResourceParser;
-import android.preference.PreferenceManager;
-import android.util.Log;
-import android.util.SparseArray;
-import android.webkit.WebView;
-
-
-/**
- * Display a dialog showing a full or partial (What's New) change log.
- */
-@SuppressWarnings("UnusedDeclaration")
-public class ChangeLog {
- /**
- * Tag that is used when sending error/debug messages to the log.
- */
- protected static final String LOG_TAG = "ckChangeLog";
-
- /**
- * This is the key used when storing the version code in SharedPreferences.
- */
- protected static final String VERSION_KEY = "ckChangeLog_last_version_code";
-
- /**
- * Constant that used when no version code is available.
- */
- protected static final int NO_VERSION = -1;
-
- /**
- * Default CSS styles used to format the change log.
- */
- public static final String DEFAULT_CSS =
- "h1 { margin-left: 0px; font-size: 1.2em; }" + "\n" +
- "li { margin-left: 0px; }" + "\n" +
- "ul { padding-left: 2em; }";
-
-
- /**
- * Context that is used to access the resources and to create the ChangeLog dialogs.
- */
- protected final Context mContext;
-
- /**
- * Contains the CSS rules used to format the change log.
- */
- protected final String mCss;
-
- /**
- * Last version code read from {@code SharedPreferences} or {@link #NO_VERSION}.
- */
- private int mLastVersionCode;
-
- /**
- * Version code of the current installation.
- */
- private int mCurrentVersionCode;
-
- /**
- * Version name of the current installation.
- */
- private String mCurrentVersionName;
-
-
- /**
- * Contains constants for the root element of {@code changelog.xml}.
- */
- protected interface ChangeLogTag {
- static final String NAME = "changelog";
- }
-
- /**
- * Contains constants for the release element of {@code changelog.xml}.
- */
- protected interface ReleaseTag {
- static final String NAME = "release";
- static final String ATTRIBUTE_VERSION = "version";
- static final String ATTRIBUTE_VERSION_CODE = "versioncode";
- }
-
- /**
- * Contains constants for the change element of {@code changelog.xml}.
- */
- protected interface ChangeTag {
- static final String NAME = "change";
- }
-
- /**
- * Create a {@code ChangeLog} instance using the default {@link SharedPreferences} file.
- *
- * @param context
- * Context that is used to access the resources and to create the ChangeLog dialogs.
- */
- public ChangeLog(Context context) {
- this(context, PreferenceManager.getDefaultSharedPreferences(context), DEFAULT_CSS);
- }
-
- /**
- * Create a {@code ChangeLog} instance using the default {@link SharedPreferences} file.
- *
- * @param context
- * Context that is used to access the resources and to create the ChangeLog dialogs.
- * @param css
- * CSS styles that will be used to format the change log.
- */
- public ChangeLog(Context context, String css) {
- this(context, PreferenceManager.getDefaultSharedPreferences(context), css);
- }
-
- /**
- * Create a {@code ChangeLog} instance using the supplied {@code SharedPreferences} instance.
- *
- * @param context
- * Context that is used to access the resources and to create the ChangeLog dialogs.
- * @param preferences
- * {@code SharedPreferences} instance that is used to persist the last version code.
- * @param css
- * CSS styles used to format the change log (excluding {@code }).
- *
- */
- public ChangeLog(Context context, SharedPreferences preferences, String css) {
- mContext = context;
- mCss = css;
-
- // Get last version code
- mLastVersionCode = preferences.getInt(VERSION_KEY, NO_VERSION);
-
- // Get current version code and version name
- try {
- PackageInfo packageInfo = context.getPackageManager().getPackageInfo(
- context.getPackageName(), 0);
-
- mCurrentVersionCode = packageInfo.versionCode;
- mCurrentVersionName = packageInfo.versionName;
- } catch (NameNotFoundException e) {
- mCurrentVersionCode = NO_VERSION;
- Log.e(LOG_TAG, "Could not get version information from manifest!", e);
- }
- }
-
- /**
- * Get version code of last installation.
- *
- * @return The version code of the last installation of this app (as described in the former
- * manifest). This will be the same as returned by {@link #getCurrentVersionCode()} the
- * second time this version of the app is launched (more precisely: the second time
- * {@code ChangeLog} is instantiated).
- *
- * @see android:versionCode
- */
- public int getLastVersionCode() {
- return mLastVersionCode;
- }
-
- /**
- * Get version code of current installation.
- *
- * @return The version code of this app as described in the manifest.
- *
- * @see android:versionCode
- */
- public int getCurrentVersionCode() {
- return mCurrentVersionCode;
- }
-
- /**
- * Get version name of current installation.
- *
- * @return The version name of this app as described in the manifest.
- *
- * @see android:versionName
- */
- public String getCurrentVersionName() {
- return mCurrentVersionName;
- }
-
- /**
- * Check if this is the first execution of this app version.
- *
- * @return {@code true} if this version of your app is started the first time.
- */
- public boolean isFirstRun() {
- return mLastVersionCode < mCurrentVersionCode;
- }
-
- /**
- * Check if this is a new installation.
- *
- * @return {@code true} if your app including {@code ChangeLog} is started the first time ever.
- * Also {@code true} if your app was uninstalled and installed again.
- */
- public boolean isFirstRunEver() {
- return mLastVersionCode == NO_VERSION;
- }
-
- /**
- * Skip the "What's new" dialog for this app version.
- *
- *
- * Future calls to {@link #isFirstRun()} and {@link #isFirstRunEver()} will return {@code false}
- * for the current app version.
- *
- */
- public void skipLogDialog() {
- updateVersionInPreferences();
- }
-
- /**
- * Get the "What's New" dialog.
- *
- * @return An AlertDialog displaying the changes since the previous installed version of your
- * app (What's New). But when this is the first run of your app including
- * {@code ChangeLog} then the full log dialog is show.
- */
- public AlertDialog getLogDialog() {
- return getDialog(isFirstRunEver());
- }
-
- /**
- * Get a dialog with the full change log.
- *
- * @return An AlertDialog with a full change log displayed.
- */
- public AlertDialog getFullLogDialog() {
- return getDialog(true);
- }
-
- /**
- * Create a dialog containing (parts of the) change log.
- *
- * @param full
- * If this is {@code true} the full change log is displayed. Otherwise only changes for
- * versions newer than the last version are displayed.
- *
- * @return A dialog containing the (partial) change log.
- */
- protected AlertDialog getDialog(boolean full) {
- WebView wv = new WebView(mContext);
- //wv.setBackgroundColor(0); // transparent
- wv.loadDataWithBaseURL(null, getLog(full), "text/html", "UTF-8", null);
-
- AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
- builder.setTitle(
- mContext.getResources().getString(
- full ? R.string.changelog_full_title : R.string.changelog_title))
- .setView(wv)
- .setCancelable(false)
- // OK button
- .setPositiveButton(
- mContext.getResources().getString(R.string.changelog_ok_button),
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- // The user clicked "OK" so save the current version code as
- // "last version code".
- updateVersionInPreferences();
- }
- });
-
- if (!full) {
- // Show "More…" button if we're only displaying a partial change log.
- builder.setNegativeButton(R.string.changelog_show_full,
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int id) {
- getFullLogDialog().show();
- }
- });
- }
-
- return builder.create();
- }
-
- /**
- * Write current version code to the preferences.
- */
- protected void updateVersionInPreferences() {
- SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mContext);
- SharedPreferences.Editor editor = sp.edit();
- editor.putInt(VERSION_KEY, mCurrentVersionCode);
-
- // TODO: Update preferences from a background thread
- editor.commit();
- }
-
- /**
- * Get changes since last version as HTML string.
- *
- * @return HTML string containing the changes since the previous installed version of your app
- * (What's New).
- */
- public String getLog() {
- return getLog(false);
- }
-
- /**
- * Get full change log as HTML string.
- *
- * @return HTML string containing the full change log.
- */
- public String getFullLog() {
- return getLog(true);
- }
-
- /**
- * Get (partial) change log as HTML string.
- *
- * @param full
- * If this is {@code true} the full change log is returned. Otherwise only changes for
- * versions newer than the last version are returned.
- *
- * @return The (partial) change log.
- */
- protected String getLog(boolean full) {
- StringBuilder sb = new StringBuilder();
-
- sb.append("");
-
- String versionFormat = mContext.getResources().getString(R.string.changelog_version_format);
-
- List changelog = getChangeLog(full);
-
- for (ReleaseItem release : changelog) {
- sb.append("");
- sb.append(String.format(versionFormat, release.versionName));
- sb.append("
");
- for (String change : release.changes) {
- sb.append("- ");
- sb.append(change);
- sb.append("
");
- }
- sb.append("
");
- }
-
- sb.append("");
-
- return sb.toString();
- }
-
- /**
- * Returns the merged change log.
- *
- * @param full
- * If this is {@code true} the full change log is returned. Otherwise only changes for
- * versions newer than the last version are returned.
- *
- * @return A sorted {@code List} containing {@link ReleaseItem}s representing the (partial)
- * change log.
- *
- * @see #getChangeLogComparator()
- */
- public List getChangeLog(boolean full) {
- SparseArray masterChangelog = getMasterChangeLog(full);
- SparseArray changelog = getLocalizedChangeLog(full);
-
- List mergedChangeLog =
- new ArrayList(masterChangelog.size());
-
- for (int i = 0, len = masterChangelog.size(); i < len; i++) {
- int key = masterChangelog.keyAt(i);
-
- // Use release information from localized change log and fall back to the master file
- // if necessary.
- ReleaseItem release = changelog.get(key, masterChangelog.get(key));
-
- mergedChangeLog.add(release);
- }
-
- Collections.sort(mergedChangeLog, getChangeLogComparator());
-
- return mergedChangeLog;
- }
-
- /**
- * Read master change log from {@code xml/changelog_master.xml}
- *
- * @see #readChangeLogFromResource(int, boolean)
- */
- protected SparseArray getMasterChangeLog(boolean full) {
- return readChangeLogFromResource(R.xml.changelog_master, full);
- }
-
- /**
- * Read localized change log from {@code xml[-lang]/changelog.xml}
- *
- * @see #readChangeLogFromResource(int, boolean)
- */
- protected SparseArray getLocalizedChangeLog(boolean full) {
- return readChangeLogFromResource(R.xml.changelog, full);
- }
-
- /**
- * Read change log from XML resource file.
- *
- * @param resId
- * Resource ID of the XML file to read the change log from.
- * @param full
- * If this is {@code true} the full change log is returned. Otherwise only changes for
- * versions newer than the last version are returned.
- *
- * @return A {@code SparseArray} containing {@link ReleaseItem}s representing the (partial)
- * change log.
- */
- protected final SparseArray readChangeLogFromResource(int resId, boolean full) {
- XmlResourceParser xml = mContext.getResources().getXml(resId);
- try {
- return readChangeLog(xml, full);
- } finally {
- xml.close();
- }
- }
-
- /**
- * Read the change log from an XML file.
- *
- * @param xml
- * The {@code XmlPullParser} instance used to read the change log.
- * @param full
- * If {@code true} the full change log is read. Otherwise only the changes since the
- * last (saved) version are read.
- *
- * @return A {@code SparseArray} mapping the version codes to release information.
- */
- protected SparseArray readChangeLog(XmlPullParser xml, boolean full) {
- SparseArray result = new SparseArray();
-
- try {
- int eventType = xml.getEventType();
- while (eventType != XmlPullParser.END_DOCUMENT) {
- if (eventType == XmlPullParser.START_TAG && xml.getName().equals(ReleaseTag.NAME)) {
- if (parseReleaseTag(xml, full, result)) {
- // Stop reading more elements if this entry is not newer than the last
- // version.
- break;
- }
- }
- eventType = xml.next();
- }
- } catch (XmlPullParserException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- } catch (IOException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- }
-
- return result;
- }
-
- /**
- * Parse the {@code release} tag of a change log XML file.
- *
- * @param xml
- * The {@code XmlPullParser} instance used to read the change log.
- * @param full
- * If {@code true} the contents of the {@code release} tag are always added to
- * {@code changelog}. Otherwise only if the item's {@code versioncode} attribute is
- * higher than the last version code.
- * @param changelog
- * The {@code SparseArray} to add a new {@link ReleaseItem} instance to.
- *
- * @return {@code true} if the {@code release} element is describing changes of a version older
- * or equal to the last version. In that case {@code changelog} won't be modified and
- * {@link #readChangeLog(XmlPullParser, boolean)} will stop reading more elements from
- * the change log file.
- *
- * @throws XmlPullParserException
- * @throws IOException
- */
- private boolean parseReleaseTag(XmlPullParser xml, boolean full,
- SparseArray changelog) throws XmlPullParserException, IOException {
-
- String version = xml.getAttributeValue(null, ReleaseTag.ATTRIBUTE_VERSION);
-
- int versionCode;
- try {
- String versionCodeStr = xml.getAttributeValue(null, ReleaseTag.ATTRIBUTE_VERSION_CODE);
- versionCode = Integer.parseInt(versionCodeStr);
- } catch (NumberFormatException e) {
- versionCode = NO_VERSION;
- }
-
- if (!full && versionCode <= mLastVersionCode) {
- return true;
- }
-
- int eventType = xml.getEventType();
- List changes = new ArrayList();
- while (eventType != XmlPullParser.END_TAG || xml.getName().equals(ChangeTag.NAME)) {
- if (eventType == XmlPullParser.START_TAG && xml.getName().equals(ChangeTag.NAME)) {
- eventType = xml.next();
-
- changes.add(xml.getText());
- }
- eventType = xml.next();
- }
-
- ReleaseItem release = new ReleaseItem(versionCode, version, changes);
- changelog.put(versionCode, release);
-
- return false;
- }
-
- /**
- * Returns a {@link Comparator} that specifies the sort order of the {@link ReleaseItem}s.
- *
- *
- * The default implementation returns the items in reverse order (latest version first).
- *
- */
- protected Comparator getChangeLogComparator() {
- return new Comparator() {
- @Override
- public int compare(ReleaseItem lhs, ReleaseItem rhs) {
- if (lhs.versionCode < rhs.versionCode) {
- return 1;
- } else if (lhs.versionCode > rhs.versionCode) {
- return -1;
- } else {
- return 0;
- }
- }
- };
- }
-
- /**
- * Container used to store information about a release/version.
- */
- public static class ReleaseItem {
- /**
- * Version code of the release.
- */
- public final int versionCode;
-
- /**
- * Version name of the release.
- */
- public final String versionName;
-
- /**
- * List of changes introduced with that release.
- */
- public final List changes;
-
- ReleaseItem(int versionCode, String versionName, List changes) {
- this.versionCode = versionCode;
- this.versionName = versionName;
- this.changes = changes;
- }
- }
-}
diff --git a/ckChangeLog/src/main/res/xml/changelog_master.xml b/ckChangeLog/src/main/res/xml/changelog_master.xml
deleted file mode 100644
index d83a85b..0000000
--- a/ckChangeLog/src/main/res/xml/changelog_master.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 667288a..3baa851 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 9f62e0c..b3bd290 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Fri Jan 09 08:20:23 CET 2015
+#Thu Mar 08 21:09:01 CET 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
diff --git a/gradlew b/gradlew
index 91a7e26..27309d9 100755
--- a/gradlew
+++ b/gradlew
@@ -6,12 +6,30 @@
##
##############################################################################
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
@@ -30,6 +48,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
+nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
@@ -40,31 +59,11 @@ case "`uname`" in
MINGW* )
msys=true
;;
+ NONSTOP* )
+ nonstop=true
+ ;;
esac
-# For Cygwin, ensure paths are in UNIX format before anything is touched.
-if $cygwin ; then
- [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-fi
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >&-
-APP_HOME="`pwd -P`"
-cd "$SAVED" >&-
-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
@@ -90,7 +89,7 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -114,6 +113,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
diff --git a/gradlew.bat b/gradlew.bat
index 8a0b282..832fdb6 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -8,14 +8,14 @@
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
@@ -46,7 +46,7 @@ echo location of your Java installation.
goto fail
:init
-@rem Get command-line arguments, handling Windowz variants
+@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
diff --git a/sample/build.gradle b/sample-legacy-dialog/build.gradle
similarity index 58%
rename from sample/build.gradle
rename to sample-legacy-dialog/build.gradle
index 67e9cc1..e7fa5e2 100644
--- a/sample/build.gradle
+++ b/sample-legacy-dialog/build.gradle
@@ -8,14 +8,14 @@ android {
versionCode 1
versionName "1.0"
- minSdkVersion 7
- targetSdkVersion 21
+ minSdkVersion 14
+ targetSdkVersion 27
}
}
dependencies {
- compile project(':ckChangeLog')
- compile 'com.android.support:support-v4:21.0.3'
+ implementation project(':ckChangeLog-legacy-dialog')
+ implementation 'com.android.support:support-v4:27.1.1'
}
diff --git a/sample/src/main/AndroidManifest.xml b/sample-legacy-dialog/src/main/AndroidManifest.xml
similarity index 100%
rename from sample/src/main/AndroidManifest.xml
rename to sample-legacy-dialog/src/main/AndroidManifest.xml
diff --git a/sample/src/main/java/de/cketti/sample/changelog/MainActivity.java b/sample-legacy-dialog/src/main/java/de/cketti/sample/changelog/MainActivity.java
similarity index 60%
rename from sample/src/main/java/de/cketti/sample/changelog/MainActivity.java
rename to sample-legacy-dialog/src/main/java/de/cketti/sample/changelog/MainActivity.java
index 01e8652..f13b743 100644
--- a/sample/src/main/java/de/cketti/sample/changelog/MainActivity.java
+++ b/sample-legacy-dialog/src/main/java/de/cketti/sample/changelog/MainActivity.java
@@ -1,6 +1,7 @@
package de.cketti.sample.changelog;
-import de.cketti.library.changelog.ChangeLog;
+import de.cketti.changelog.dialog.DialogChangeLog;
+
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
@@ -10,13 +11,16 @@
public class MainActivity extends FragmentActivity {
+ private static final String DARK_THEME_CSS = "body { color: #ffffff; background-color: #282828; }" + "\n" +
+ DialogChangeLog.DEFAULT_CSS;
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
- ChangeLog cl = new ChangeLog(this);
+ DialogChangeLog cl = DialogChangeLog.newInstance(this);
if (cl.isFirstRun()) {
cl.getLogDialog().show();
}
@@ -32,11 +36,11 @@ public boolean onCreateOptionsMenu(Menu menu) {
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_whats_new: {
- new DarkThemeChangeLog(this).getLogDialog().show();
+ createDarkThemeChangeLog(this).getLogDialog().show();
break;
}
case R.id.menu_full_changelog: {
- new ChangeLog(this).getFullLogDialog().show();
+ DialogChangeLog.newInstance(this).getFullLogDialog().show();
break;
}
}
@@ -44,15 +48,8 @@ public boolean onOptionsItemSelected(MenuItem item) {
return true;
}
- /**
- * Example that shows how to create a themed dialog.
- */
- public static class DarkThemeChangeLog extends ChangeLog {
- public static final String DARK_THEME_CSS =
- "body { color: #ffffff; background-color: #282828; }" + "\n" + DEFAULT_CSS;
-
- public DarkThemeChangeLog(Context context) {
- super(new ContextThemeWrapper(context, R.style.DarkTheme), DARK_THEME_CSS);
- }
+ private static DialogChangeLog createDarkThemeChangeLog(Context context) {
+ ContextThemeWrapper themedContext = new ContextThemeWrapper(context, R.style.DarkTheme);
+ return DialogChangeLog.newInstance(themedContext, DARK_THEME_CSS);
}
}
diff --git a/sample/src/main/res/drawable-hdpi/ic_launcher.png b/sample-legacy-dialog/src/main/res/drawable-hdpi/ic_launcher.png
similarity index 100%
rename from sample/src/main/res/drawable-hdpi/ic_launcher.png
rename to sample-legacy-dialog/src/main/res/drawable-hdpi/ic_launcher.png
diff --git a/sample/src/main/res/drawable-mdpi/ic_launcher.png b/sample-legacy-dialog/src/main/res/drawable-mdpi/ic_launcher.png
similarity index 100%
rename from sample/src/main/res/drawable-mdpi/ic_launcher.png
rename to sample-legacy-dialog/src/main/res/drawable-mdpi/ic_launcher.png
diff --git a/sample/src/main/res/drawable-xhdpi/ic_launcher.png b/sample-legacy-dialog/src/main/res/drawable-xhdpi/ic_launcher.png
similarity index 100%
rename from sample/src/main/res/drawable-xhdpi/ic_launcher.png
rename to sample-legacy-dialog/src/main/res/drawable-xhdpi/ic_launcher.png
diff --git a/sample/src/main/res/drawable-xxhdpi/ic_launcher.png b/sample-legacy-dialog/src/main/res/drawable-xxhdpi/ic_launcher.png
similarity index 100%
rename from sample/src/main/res/drawable-xxhdpi/ic_launcher.png
rename to sample-legacy-dialog/src/main/res/drawable-xxhdpi/ic_launcher.png
diff --git a/sample/src/main/res/drawable-xxxhdpi/ic_launcher.png b/sample-legacy-dialog/src/main/res/drawable-xxxhdpi/ic_launcher.png
similarity index 100%
rename from sample/src/main/res/drawable-xxxhdpi/ic_launcher.png
rename to sample-legacy-dialog/src/main/res/drawable-xxxhdpi/ic_launcher.png
diff --git a/sample/src/main/res/layout/activity_main.xml b/sample-legacy-dialog/src/main/res/layout/activity_main.xml
similarity index 100%
rename from sample/src/main/res/layout/activity_main.xml
rename to sample-legacy-dialog/src/main/res/layout/activity_main.xml
diff --git a/sample/src/main/res/menu/activity_main.xml b/sample-legacy-dialog/src/main/res/menu/activity_main.xml
similarity index 100%
rename from sample/src/main/res/menu/activity_main.xml
rename to sample-legacy-dialog/src/main/res/menu/activity_main.xml
diff --git a/sample/src/main/res/xml-de/changelog.xml b/sample-legacy-dialog/src/main/res/raw-de/changelog.xml
similarity index 100%
rename from sample/src/main/res/xml-de/changelog.xml
rename to sample-legacy-dialog/src/main/res/raw-de/changelog.xml
diff --git a/sample/src/main/res/xml/changelog_master.xml b/sample-legacy-dialog/src/main/res/raw/changelog_master.xml
similarity index 100%
rename from sample/src/main/res/xml/changelog_master.xml
rename to sample-legacy-dialog/src/main/res/raw/changelog_master.xml
diff --git a/sample/src/main/res/values-de/strings.xml b/sample-legacy-dialog/src/main/res/values-de/strings.xml
similarity index 100%
rename from sample/src/main/res/values-de/strings.xml
rename to sample-legacy-dialog/src/main/res/values-de/strings.xml
diff --git a/sample/src/main/res/values-es/strings.xml b/sample-legacy-dialog/src/main/res/values-es/strings.xml
similarity index 100%
rename from sample/src/main/res/values-es/strings.xml
rename to sample-legacy-dialog/src/main/res/values-es/strings.xml
diff --git a/sample/src/main/res/values-v11/styles.xml b/sample-legacy-dialog/src/main/res/values-v11/styles.xml
similarity index 100%
rename from sample/src/main/res/values-v11/styles.xml
rename to sample-legacy-dialog/src/main/res/values-v11/styles.xml
diff --git a/sample/src/main/res/values-v14/styles.xml b/sample-legacy-dialog/src/main/res/values-v14/styles.xml
similarity index 100%
rename from sample/src/main/res/values-v14/styles.xml
rename to sample-legacy-dialog/src/main/res/values-v14/styles.xml
diff --git a/sample/src/main/res/values/strings.xml b/sample-legacy-dialog/src/main/res/values/strings.xml
similarity index 100%
rename from sample/src/main/res/values/strings.xml
rename to sample-legacy-dialog/src/main/res/values/strings.xml
diff --git a/sample/src/main/res/values/styles.xml b/sample-legacy-dialog/src/main/res/values/styles.xml
similarity index 100%
rename from sample/src/main/res/values/styles.xml
rename to sample-legacy-dialog/src/main/res/values/styles.xml
diff --git a/settings.gradle b/settings.gradle
index cc5e2d8..e38665e 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,2 +1,3 @@
-include ':ckChangeLog'
-include ':sample'
+include ':ckChangeLog-core'
+include ':ckChangeLog-legacy-dialog'
+include ':sample-legacy-dialog'