aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt2
-rw-r--r--adapter/build.gradle2
-rw-r--r--adapter/src/main/kotlin/ca/allanwang/kau/adapters/AdapterUtils.kt5
-rw-r--r--adapter/src/main/kotlin/ca/allanwang/kau/adapters/RepeatedClickListener.kt2
-rw-r--r--buildSrc/src/main/groovy/ca/allanwang/kau/Versions.groovy2
-rw-r--r--core/src/main/kotlin/ca/allanwang/kau/utils/ActivityUtils.kt11
-rw-r--r--docs/Changelog.md1
-rw-r--r--files/debug.keystorebin0 -> 2611 bytes
-rw-r--r--kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt2
-rw-r--r--sample/build.gradle21
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt11
-rw-r--r--sample/src/main/res/values/strings_sample.xml1
12 files changed, 38 insertions, 22 deletions
diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt b/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt
index d71f786..e7ddcd3 100644
--- a/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt
+++ b/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt
@@ -32,7 +32,7 @@ class LibraryIItem(val lib: Library) : KauIItem<LibraryIItem, LibraryIItem.ViewH
false
else
with(item.lib) {
- v.context.startLink(libraryWebsite, repositoryLink, authorWebsite)
+ v!!.context.startLink(libraryWebsite, repositoryLink, authorWebsite)
true
}
}
diff --git a/adapter/build.gradle b/adapter/build.gradle
index b58c912..a4f2583 100644
--- a/adapter/build.gradle
+++ b/adapter/build.gradle
@@ -5,9 +5,7 @@ apply from: '../android-lib.gradle'
dependencies {
implementation project(':core')
- //noinspection GradleDependency
api "com.mikepenz:fastadapter-commons:${kau.fastAdapterCommons}@aar"
- //noinspection GradleDependency
api "com.mikepenz:fastadapter:${kau.fastAdapter}@aar"
}
diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/AdapterUtils.kt b/adapter/src/main/kotlin/ca/allanwang/kau/adapters/AdapterUtils.kt
index 14be76b..2f25d8c 100644
--- a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/AdapterUtils.kt
+++ b/adapter/src/main/kotlin/ca/allanwang/kau/adapters/AdapterUtils.kt
@@ -1,5 +1,6 @@
package ca.allanwang.kau.adapters
+import android.view.View
import com.mikepenz.fastadapter.FastAdapter
import com.mikepenz.fastadapter.IAdapter
import com.mikepenz.fastadapter.IItem
@@ -11,5 +12,5 @@ import com.mikepenz.fastadapter.IItem
/**
* Add kotlin's generic syntax to better support out types
*/
-fun <T : IItem<*, *>> fastAdapter(vararg adapter: IAdapter<out T>) =
- FastAdapter.with<T, IAdapter<out T>>(adapter.toList())!! \ No newline at end of file
+fun <Item : IItem<*, *>> fastAdapter(vararg adapter: IAdapter<out Item>) =
+ FastAdapter.with<Item, IAdapter<out Item>>(adapter.toList())!! \ No newline at end of file
diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/RepeatedClickListener.kt b/adapter/src/main/kotlin/ca/allanwang/kau/adapters/RepeatedClickListener.kt
index 5925454..aeee94c 100644
--- a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/RepeatedClickListener.kt
+++ b/adapter/src/main/kotlin/ca/allanwang/kau/adapters/RepeatedClickListener.kt
@@ -35,7 +35,7 @@ private class RepeatedClickListener<Item : IItem<*, *>>(
private var chain = 0
private var time = -1L
- override fun onClick(v: View, adapter: IAdapter<Item>, item: Item, position: Int): Boolean {
+ override fun onClick(v: View?, adapter: IAdapter<Item>, item: Item, position: Int): Boolean {
val now = System.currentTimeMillis()
if (time - now < duration)
chain++
diff --git a/buildSrc/src/main/groovy/ca/allanwang/kau/Versions.groovy b/buildSrc/src/main/groovy/ca/allanwang/kau/Versions.groovy
index ac38509..e06aa5b 100644
--- a/buildSrc/src/main/groovy/ca/allanwang/kau/Versions.groovy
+++ b/buildSrc/src/main/groovy/ca/allanwang/kau/Versions.groovy
@@ -14,7 +14,7 @@ class Versions {
static def anko = '0.10.4'
static def blurry = '2.1.1'
static def constraintLayout = '1.1.0-beta5'
- static def fastAdapter = '3.1.2'
+ static def fastAdapter = '3.2.4'
static def fastAdapterCommons = fastAdapter
static def glide = '4.6.1'
diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/ActivityUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/ActivityUtils.kt
index 833ec3a..ab0e59f 100644
--- a/core/src/main/kotlin/ca/allanwang/kau/utils/ActivityUtils.kt
+++ b/core/src/main/kotlin/ca/allanwang/kau/utils/ActivityUtils.kt
@@ -1,3 +1,5 @@
+@file:Suppress("NOTHING_TO_INLINE")
+
package ca.allanwang.kau.utils
import android.annotation.SuppressLint
@@ -74,7 +76,6 @@ inline fun Activity.restart(intentBuilder: Intent.() -> Unit = {}) {
/**
* Force restart an entire application
*/
-@Suppress("NOTHING_TO_INLINE")
@RequiresApi(Build.VERSION_CODES.M)
inline fun Activity.restartApplication() {
val intent = packageManager.getLaunchIntentForPackage(packageName)
@@ -134,10 +135,10 @@ fun Context.setMenuIcons(menu: Menu, @ColorInt color: Int = Color.WHITE, vararg
}
}
-fun Activity.hideKeyboard() = currentFocus.hideKeyboard()
+inline fun Activity.hideKeyboard() = currentFocus.hideKeyboard()
-fun Activity.showKeyboard() = currentFocus.showKeyboard()
+inline fun Activity.showKeyboard() = currentFocus.showKeyboard()
-fun Activity.snackbar(text: String, duration: Int = Snackbar.LENGTH_LONG, builder: Snackbar.() -> Unit = {}) = contentView!!.snackbar(text, duration, builder)
+inline fun Activity.snackbar(text: String, duration: Int = Snackbar.LENGTH_LONG, noinline builder: Snackbar.() -> Unit = {}) = contentView!!.snackbar(text, duration, builder)
-fun Activity.snackbar(@StringRes textId: Int, duration: Int = Snackbar.LENGTH_LONG, builder: Snackbar.() -> Unit = {}) = contentView!!.snackbar(textId, duration, builder) \ No newline at end of file
+inline fun Activity.snackbar(@StringRes textId: Int, duration: Int = Snackbar.LENGTH_LONG, noinline builder: Snackbar.() -> Unit = {}) = contentView!!.snackbar(textId, duration, builder) \ No newline at end of file
diff --git a/docs/Changelog.md b/docs/Changelog.md
index d5b8d5b..b4f21fd 100644
--- a/docs/Changelog.md
+++ b/docs/Changelog.md
@@ -5,7 +5,6 @@
* :core: Create restartApplication()
* :colorpicker: Rewrote implementation to be null and parse safe
* :colorpicker: Added more encapsulation to CircleView (selected -> colorSelected; all others are private)
-* :colorpicker:
* Update documentation
## v3.6.3
diff --git a/files/debug.keystore b/files/debug.keystore
new file mode 100644
index 0000000..2f9e154
--- /dev/null
+++ b/files/debug.keystore
Binary files differ
diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt
index 75e9c36..6de57c2 100644
--- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt
+++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt
@@ -70,7 +70,7 @@ abstract class KPrefActivity : KauBaseActivity(), KPrefActivityContract {
globalOptions = GlobalOptions(core, this)
recycler.withLinearAdapter(adapter)
adapter.withSelectable(false)
- .withOnClickListener { v, _, item, _ -> item.onClick(v); true }
+ .withOnClickListener { v, _, item, _ -> item.onClick(v!!); true }
showNextPrefs(R.string.kau_settings, onCreateKPrefs(savedInstanceState), true)
}
diff --git a/sample/build.gradle b/sample/build.gradle
index fb55b94..d2572c3 100644
--- a/sample/build.gradle
+++ b/sample/build.gradle
@@ -32,9 +32,9 @@ android {
def releaseSigning = file("../files/kau.properties")
def hasSigning = releaseSigning.exists()
- if (hasSigning) {
- signingConfigs {
+ signingConfigs {
+ if (hasSigning) {
def releaseProps = new Properties()
releaseSigning.withInputStream { releaseProps.load(it) }
@@ -45,12 +45,29 @@ android {
keyPassword releaseProps.getProperty('keyPassword')
}
}
+
+ debug {
+ storeFile file("../files/debug.keystore")
+ storePassword "debugKey"
+ keyAlias "debugKey"
+ keyPassword "debugKey"
+ }
}
buildTypes {
+ debug {
+ minifyEnabled false
+ shrinkResources false
+ applicationIdSuffix ".debug"
+ versionNameSuffix "-debug"
+ signingConfig signingConfigs.debug
+ resValue "string", "app_name", "KAU Debug"
+ }
+
release {
minifyEnabled true
if (hasSigning) signingConfig signingConfigs.release
+ resValue "string", "app_name", "KAU"
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
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 0d2e5a3..b424e91 100644
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
@@ -233,11 +233,12 @@ class MainActivity : KPrefActivity() {
this.navigationBarColor = KPrefSample.accentColor
if (KPrefSample.version < BuildConfig.VERSION_CODE) {
KPrefSample.version = BuildConfig.VERSION_CODE
- showChangelog(R.xml.kau_changelog, KPrefSample.textColor) {
- titleColor(KPrefSample.textColor)
- backgroundColor(KPrefSample.bgColor)
- positiveColor(KPrefSample.accentColor)
- }
+ if (!BuildConfig.DEBUG)
+ showChangelog(R.xml.kau_changelog, KPrefSample.textColor) {
+ titleColor(KPrefSample.textColor)
+ backgroundColor(KPrefSample.bgColor)
+ positiveColor(KPrefSample.accentColor)
+ }
}
supportActionBar?.apply {
setDisplayHomeAsUpEnabled(false)
diff --git a/sample/src/main/res/values/strings_sample.xml b/sample/src/main/res/values/strings_sample.xml
index 1e3361e..46a8140 100644
--- a/sample/src/main/res/values/strings_sample.xml
+++ b/sample/src/main/res/values/strings_sample.xml
@@ -1,5 +1,4 @@
<resources>
- <string name="app_name">KAU</string>
<string name="header">This is a header</string>
<string name="desc">This is a description</string>
<string name="checkbox_1">Checkbox 1</string>