aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buildSrc/src/main/kotlin/kau/Versions.kt2
-rw-r--r--core/src/main/kotlin/ca/allanwang/kau/utils/IIconUtils.kt6
-rw-r--r--mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt13
-rw-r--r--sample/build.gradle2
-rw-r--r--sample/proguard-rules.pro7
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt1
-rw-r--r--searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt8
7 files changed, 26 insertions, 13 deletions
diff --git a/buildSrc/src/main/kotlin/kau/Versions.kt b/buildSrc/src/main/kotlin/kau/Versions.kt
index e953929..a9c6674 100644
--- a/buildSrc/src/main/kotlin/kau/Versions.kt
+++ b/buildSrc/src/main/kotlin/kau/Versions.kt
@@ -42,7 +42,7 @@ object Versions {
const val glide = "4.9.0"
// https://github.com/mikepenz/Android-Iconics#1-provide-the-gradle-dependency
- const val iconics = "3.2.5"
+ const val iconics = "4.0.0"
const val iconicsGoogle = "3.0.1.4"
const val iconicsMaterial = "2.2.0.6"
const val iconicsCommunity = "3.5.95.1"
diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/IIconUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/IIconUtils.kt
index 8b40352..52ea57d 100644
--- a/core/src/main/kotlin/ca/allanwang/kau/utils/IIconUtils.kt
+++ b/core/src/main/kotlin/ca/allanwang/kau/utils/IIconUtils.kt
@@ -16,11 +16,12 @@
package ca.allanwang.kau.utils
import android.content.Context
-import android.content.res.ColorStateList
import android.graphics.Color
import android.graphics.drawable.Drawable
import androidx.annotation.ColorInt
import com.mikepenz.iconics.IconicsDrawable
+import com.mikepenz.iconics.colorInt
+import com.mikepenz.iconics.sizeDp
import com.mikepenz.iconics.typeface.IIcon
/**
@@ -33,8 +34,7 @@ fun IIcon.toDrawable(
@ColorInt color: Int = Color.WHITE,
builder: IconicsDrawable.() -> Unit = {}
): Drawable {
- val state = ColorStateList.valueOf(color)
- val icon = IconicsDrawable(c).icon(this).color(state)
+ val icon = IconicsDrawable(c).icon(this).colorInt(color)
if (sizeDp > 0) icon.sizeDp(sizeDp)
icon.builder()
return icon
diff --git a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt
index fe7a3b1..ae1d9d6 100644
--- a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt
+++ b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt
@@ -46,9 +46,16 @@ import com.bumptech.glide.Glide
import com.bumptech.glide.RequestManager
import com.mikepenz.fastadapter.IItem
import com.mikepenz.fastadapter.adapters.ItemAdapter
-import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
+import com.mikepenz.iconics.IconicsColor
import com.mikepenz.iconics.IconicsDrawable
+import com.mikepenz.iconics.IconicsSize
+import com.mikepenz.iconics.colorInt
+import com.mikepenz.iconics.paddingPx
+import com.mikepenz.iconics.sizePx
import com.mikepenz.iconics.typeface.IIcon
+import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
+import com.mikepenz.iconics.utils.toIconicsColor
+import com.mikepenz.iconics.utils.toIconicsSizePx
import kotlinx.coroutines.CancellationException
import java.io.File
@@ -93,9 +100,9 @@ abstract class MediaPickerCore<T : IItem<*, *>>(
val sizePx = MediaPickerCore.computeViewSize(context)
return IconicsDrawable(context, iicon)
.sizePx(sizePx)
- .backgroundColor(color)
+ .backgroundColor(color.toIconicsColor())
.paddingPx(sizePx / 3)
- .color(Color.WHITE)
+ .colorInt(Color.WHITE)
}
var accentColor: Int = 0xff666666.toInt()
diff --git a/sample/build.gradle b/sample/build.gradle
index aa4bd14..9880735 100644
--- a/sample/build.gradle
+++ b/sample/build.gradle
@@ -54,8 +54,6 @@ android {
buildTypes {
debug {
- minifyEnabled false
- shrinkResources false
applicationIdSuffix ".debug"
versionNameSuffix "-debug"
signingConfig signingConfigs.debug
diff --git a/sample/proguard-rules.pro b/sample/proguard-rules.pro
index f3a65f0..3189ebb 100644
--- a/sample/proguard-rules.pro
+++ b/sample/proguard-rules.pro
@@ -1,2 +1,7 @@
-ignorewarnings
--dontwarn kotlin.** \ No newline at end of file
+-dontwarn kotlin.**
+# Iconics
+-keep class .R
+-keep class **.R$* {
+ <fields>;
+} \ No newline at end of file
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 73d6eab..b848812 100644
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
@@ -40,6 +40,7 @@ import ca.allanwang.kau.utils.withSceneTransitionAnimation
import ca.allanwang.kau.xml.showChangelog
import com.afollestad.materialdialogs.input.input
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
+import java.lang.RuntimeException
class MainActivity : KPrefActivity() {
diff --git a/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt b/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt
index e4c6dbd..709dbad 100644
--- a/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt
+++ b/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt
@@ -390,7 +390,9 @@ class SearchView @JvmOverloads constructor(
config(config)
val menuItem = menu.findItem(id)
?: throw IllegalArgumentException("Menu item with given id doesn't exist")
- if (menuItem.icon == null) menuItem.icon = GoogleMaterial.Icon.gmd_search.toDrawable(context, 18, menuIconColor)
+ if (menuItem.icon == null) {
+ menuItem.icon = GoogleMaterial.Icon.gmd_search.toDrawable(context, 18, menuIconColor)
+ }
kau_search_cardview.gone()
menuItem.setOnMenuItemClickListener { revealOpen(); true }
kau_search_shadow.setOnClickListener { revealClose() }
@@ -509,7 +511,7 @@ fun Activity.bindSearchView(
menu: Menu,
@IdRes id: Int,
@ColorInt menuIconColor: Int = Color.WHITE,
- config: SearchView.Configs.() -> Unit = {}
+ config: Configs.() -> Unit = {}
): SearchView = findViewById<ViewGroup>(android.R.id.content).bindSearchView(menu, id, menuIconColor, config)
/**
@@ -522,7 +524,7 @@ fun ViewGroup.bindSearchView(
menu: Menu,
@IdRes id: Int,
@ColorInt menuIconColor: Int = Color.WHITE,
- config: SearchView.Configs.() -> Unit = {}
+ config: Configs.() -> Unit = {}
): SearchView {
val searchView = SearchView(context)
searchView.layoutParams =