From d377eca31a9c9623c525f181a32c588a31dc5737 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Fri, 7 Jun 2019 12:45:59 -0400 Subject: Update migration docs --- docs/Migration.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs') diff --git a/docs/Migration.md b/docs/Migration.md index 593056e..b8d5715 100644 --- a/docs/Migration.md +++ b/docs/Migration.md @@ -12,6 +12,9 @@ Please refer to [MD's documents](https://github.com/afollestad/material-dialogs/ Alongside such changes, `:colorpicker` is no longer as necessary. It exists mainly to provide an internal interface for other submodules. +After Material Dialog 2.x, a decision was made to enforce theming through xml styles only to avoid reflection. +As a result, options to supply custom dialog colors are now removed. + ## Update ProgressAnimator `ProgressAnimator` has been completely rewritten to be an extension of `ValueAnimator`. -- cgit v1.2.3 From 3293b5f4e2060f3ae22bdd941b8654bde70c9939 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Fri, 7 Jun 2019 12:56:33 -0400 Subject: Update public xml script to ignore modules without res items --- artifacts.gradle | 27 +++++++++++++++++---------- core-ui/src/main/res-public/values/public.xml | 2 +- core/src/main/res-public/values/public.xml | 2 +- docs/Changelog.md | 4 ++++ 4 files changed, 23 insertions(+), 12 deletions(-) (limited to 'docs') diff --git a/artifacts.gradle b/artifacts.gradle index ab291f7..4471d37 100644 --- a/artifacts.gradle +++ b/artifacts.gradle @@ -31,16 +31,23 @@ artifacts { // We assume resources within res-public are public task generatepublicxml { - def resDir = project.projectDir.absolutePath + "/src/main/res-public" - - def publicFolder = file(resDir + "/values") - if (!publicFolder.exists()) publicFolder.mkdirs() + def resDir = project.projectDir.absolutePath + "/src/main/res" + def publicDir = resDir + "-public" + def resFolder = file(resDir + "/values") + def publicFolder = file(publicDir + "/values") + if (!publicFolder.exists()) { + // No res; no need for contents + if (!resFolder.exists()) { + return + } + publicFolder.mkdirs() + } // Include the desired res types // Note: we don't need the qualified resource directories, // since those resources will already be defined in the unqualified directories // however, there are special cases like transition-v21 that is only available on lollipop and up - def tree = fileTree(dir: resDir, + def tree = fileTree(dir: publicDir, includes: ['**/anim/*.xml', '**/color/*.xml', '**/drawable/*.xml', @@ -54,12 +61,12 @@ task generatepublicxml { println "Generating public XML: ${project.name}" // Create new public.xml with writer - file(resDir + "/values/public.xml").withWriter { writer -> + file(publicDir + "/values/public.xml").withWriter { writer -> // Create MarkupBuilder with 4 space indent - def destXml = new MarkupBuilder(new IndentPrinter(writer, " ", true)); - def destXmlMkp = destXml.getMkp(); + def destXml = new MarkupBuilder(new IndentPrinter(writer, " ", true)) + def destXmlMkp = destXml.getMkp() - // GIST NOTE: our project needed the ResourceName suppression, but its not needed in general + // GIST NOTE: our project needed the ResourceName suppression, but it's not needed in general destXml.resources( 'xmlns:tools': 'http://schemas.android.com/tools', 'tools:ignore': 'ResourceName' @@ -74,7 +81,7 @@ task generatepublicxml { tree.each { resFile -> // use the directory name to get the type - def type = resFile.getParentFile().getName() + String type = resFile.getParentFile().getName() if (type == "values") { // Resource files under values. Parse the file, and pull out the resource definitions diff --git a/core-ui/src/main/res-public/values/public.xml b/core-ui/src/main/res-public/values/public.xml index f46b3eb..af7ce44 100644 --- a/core-ui/src/main/res-public/values/public.xml +++ b/core-ui/src/main/res-public/values/public.xml @@ -1,5 +1,5 @@ - + diff --git a/core/src/main/res-public/values/public.xml b/core/src/main/res-public/values/public.xml index ea8ed73..9761199 100644 --- a/core/src/main/res-public/values/public.xml +++ b/core/src/main/res-public/values/public.xml @@ -1,5 +1,5 @@ - + diff --git a/docs/Changelog.md b/docs/Changelog.md index a2c38e1..61e5fb7 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -1,5 +1,9 @@ # Changelog +## v5.0.0 +* :core: Update Material Dialogs to 3.x +* :colorpicker: Strip down to just the interface; unless you require the accent palette, it may be fine to just use MD's color extension + ## v4.1.0 * :core: Deprecate NetworkUtils, as the underlying functions are deprecated * :core: Permission manager no longer synchronized, as all actions should occur in the main thread -- cgit v1.2.3 From 77be91c57b36ae85b6be34d3db864fcd63661018 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Fri, 7 Jun 2019 13:11:45 -0400 Subject: Add deprecation annotations for network utils --- core/src/main/kotlin/ca/allanwang/kau/utils/NetworkUtils.kt | 3 +++ docs/Migration.md | 2 +- sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/NetworkUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/NetworkUtils.kt index 32cf084..39d689b 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/NetworkUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/NetworkUtils.kt @@ -22,6 +22,7 @@ import android.net.ConnectivityManager /** * Created by Allan Wang on 2017-07-07. */ +@Suppress("DEPRECATION") @Deprecated("Applications should make use of network callbacks instead of individual queries") inline val Context.isNetworkAvailable: Boolean @SuppressLint("MissingPermission") @@ -31,6 +32,7 @@ inline val Context.isNetworkAvailable: Boolean return activeNetworkInfo?.isConnectedOrConnecting ?: false } +@Suppress("DEPRECATION") @Deprecated("Applications should make use of network callbacks instead of individual queries") inline val Context.isWifiConnected: Boolean @SuppressLint("MissingPermission") @@ -40,6 +42,7 @@ inline val Context.isWifiConnected: Boolean return (activeNetworkInfo?.type ?: -1) == ConnectivityManager.TYPE_WIFI } +@Suppress("DEPRECATION") @Deprecated("Applications should make use of network callbacks instead of individual queries") inline val Context.isMobileDataConnected: Boolean @SuppressLint("MissingPermission") diff --git a/docs/Migration.md b/docs/Migration.md index b8d5715..203dc1d 100644 --- a/docs/Migration.md +++ b/docs/Migration.md @@ -13,7 +13,7 @@ Please refer to [MD's documents](https://github.com/afollestad/material-dialogs/ Alongside such changes, `:colorpicker` is no longer as necessary. It exists mainly to provide an internal interface for other submodules. After Material Dialog 2.x, a decision was made to enforce theming through xml styles only to avoid reflection. -As a result, options to supply custom dialog colors are now removed. +As a result, options to supply custom dialog colors are now removed (ie in the changelog dialog and color picker kprefs). ## Update ProgressAnimator diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt index 2c3bf23..9ce3f42 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt @@ -260,7 +260,7 @@ class MainActivity : KPrefActivity() { if (KPrefSample.version < BuildConfig.VERSION_CODE) { KPrefSample.version = BuildConfig.VERSION_CODE if (!BuildConfig.DEBUG) - showChangelog(R.xml.kau_changelog, KPrefSample.textColor) + showChangelog(R.xml.kau_changelog) } supportActionBar?.apply { setDisplayHomeAsUpEnabled(false) @@ -293,7 +293,7 @@ class MainActivity : KPrefActivity() { override fun onOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { - R.id.action_changelog -> showChangelog(R.xml.kau_changelog, KPrefSample.textColor) + R.id.action_changelog -> showChangelog(R.xml.kau_changelog) R.id.action_settings -> startActivity() R.id.action_email -> sendEmail(R.string.your_email, R.string.your_subject) else -> return super.onOptionsItemSelected(item) -- cgit v1.2.3