aboutsummaryrefslogtreecommitdiff
path: root/about/src/main/kotlin/ca/allanwang
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-04-07 20:23:17 -0400
committerGitHub <noreply@github.com>2018-04-07 20:23:17 -0400
commita0377be622f21b4c6a7d8828505c1e95efab1254 (patch)
tree825760fab6f0bb1baa4e709443becefba5a8d06a /about/src/main/kotlin/ca/allanwang
parente97db5c6529b1e12effc7141f277bd41d3fb580a (diff)
downloadkau-a0377be622f21b4c6a7d8828505c1e95efab1254.tar.gz
kau-a0377be622f21b4c6a7d8828505c1e95efab1254.tar.bz2
kau-a0377be622f21b4c6a7d8828505c1e95efab1254.zip
Update/android studio 3.1 (#146)
* Update dependencies * Add default invalid id value * Extend appcompat views only * Update migration * Remove setTextIfValid * Remove nosibling warning * Add deprecation warnings to fragment view binding * Bring back glide 4.6.1 * Use proper distribution type setter
Diffstat (limited to 'about/src/main/kotlin/ca/allanwang')
-rw-r--r--about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt13
-rw-r--r--about/src/main/kotlin/ca/allanwang/kau/about/CollapsibleTextView.kt3
2 files changed, 9 insertions, 7 deletions
diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt b/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt
index 7a14d95..dddb0b9 100644
--- a/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt
+++ b/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt
@@ -15,6 +15,7 @@ import ca.allanwang.kau.internal.KauBaseActivity
import ca.allanwang.kau.ui.widgets.ElasticDragDismissFrameLayout
import ca.allanwang.kau.ui.widgets.InkPageIndicator
import ca.allanwang.kau.utils.AnimHolder
+import ca.allanwang.kau.utils.INVALID_ID
import ca.allanwang.kau.utils.bindView
import ca.allanwang.kau.utils.dimenPixelSize
import com.mikepenz.aboutlibraries.Libs
@@ -57,7 +58,7 @@ abstract class AboutActivityBase(val rClass: Class<*>?, private val configBuilde
val panels: List<AboutPanelContract> by lazy {
val defaultPanels = mutableListOf(AboutPanelMain(), AboutPanelLibs())
- if (configs.faqXmlRes != -1) defaultPanels.add(AboutPanelFaqs())
+ if (configs.faqXmlRes != INVALID_ID) defaultPanels.add(AboutPanelFaqs())
defaultPanels
}
@@ -86,23 +87,23 @@ abstract class AboutActivityBase(val rClass: Class<*>?, private val configBuilde
}
class Configs : ThemableIItemColors by ThemableIItemColorsDelegate() {
- var cutoutTextRes: Int = -1
+ var cutoutTextRes: Int = INVALID_ID
var cutoutText: String? = null
- var cutoutDrawableRes: Int = -1
+ var cutoutDrawableRes: Int = INVALID_ID
var cutoutDrawable: Drawable? = null
var cutoutForeground: Int? = null
var libPageTitleRes: Int = R.string.kau_about_libraries_intro
var libPageTitle: String? = null
set(value) {
field = value
- libPageTitleRes = -1 //reset res so we don't use our default
+ libPageTitleRes = INVALID_ID //reset res so we don't use our default
}
- var faqXmlRes: Int = -1
+ var faqXmlRes: Int = INVALID_ID
var faqPageTitleRes: Int = R.string.kau_about_faq_intro
var faqPageTitle: String? = null
set(value) {
field = value
- faqPageTitleRes = -1 //reset res so we don't use our default
+ faqPageTitleRes = INVALID_ID //reset res so we don't use our default
}
/**
* Whether new lines should be included
diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/CollapsibleTextView.kt b/about/src/main/kotlin/ca/allanwang/kau/about/CollapsibleTextView.kt
index 036f16c..59ab39a 100644
--- a/about/src/main/kotlin/ca/allanwang/kau/about/CollapsibleTextView.kt
+++ b/about/src/main/kotlin/ca/allanwang/kau/about/CollapsibleTextView.kt
@@ -2,6 +2,7 @@ package ca.allanwang.kau.about
import android.content.Context
import android.content.res.Configuration
+import android.support.v7.widget.AppCompatTextView
import android.util.AttributeSet
import android.widget.TextView
import ca.allanwang.kau.ui.views.CollapsibleView
@@ -13,7 +14,7 @@ import ca.allanwang.kau.ui.views.CollapsibleViewDelegate
*/
class CollapsibleTextView @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
-) : TextView(context, attrs, defStyleAttr), CollapsibleView by CollapsibleViewDelegate() {
+) : AppCompatTextView(context, attrs, defStyleAttr), CollapsibleView by CollapsibleViewDelegate() {
init {
initCollapsible(this)