Loading build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '3.0.15' propVersionName = '3.0.16' kotlin_version = '1.2.0' support_libs = '27.0.2' } Loading commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Resources.kt +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ fun Resources.getColoredDrawable(drawableId: Int, colorId: Int, alpha: Int = 255 fun Resources.getColoredDrawableWithColor(drawableId: Int, color: Int, alpha: Int = 255): Drawable { val drawable = getDrawable(drawableId) drawable.mutate().setColorFilter(color, PorterDuff.Mode.SRC_IN) drawable.mutate().applyColorFilter(color) drawable.mutate().alpha = alpha return drawable } Loading commons/src/main/kotlin/com/simplemobiletools/commons/views/FastScroller.kt +2 −2 Original line number Diff line number Diff line package com.simplemobiletools.commons.views import android.content.Context import android.graphics.PorterDuff import android.support.v4.widget.SwipeRefreshLayout import android.support.v7.widget.LinearLayoutManager import android.support.v7.widget.RecyclerView Loading @@ -9,6 +8,7 @@ import android.util.AttributeSet import android.view.MotionEvent import android.view.View import android.widget.FrameLayout import com.simplemobiletools.commons.extensions.applyColorFilter import com.simplemobiletools.commons.extensions.baseConfig // based on https://blog.stylingandroid.com/recyclerview-fastscroll-part-1 Loading Loading @@ -50,7 +50,7 @@ class FastScroller : FrameLayout { } fun updateHandleColor() { handle!!.background.setColorFilter(context.baseConfig.primaryColor, PorterDuff.Mode.SRC_IN) handle!!.background.applyColorFilter(context.baseConfig.primaryColor) } override fun onSizeChanged(width: Int, height: Int, oldWidth: Int, oldHeight: Int) { Loading commons/src/main/kotlin/com/simplemobiletools/commons/views/MyAppCompatSpinner.kt +2 −2 Original line number Diff line number Diff line package com.simplemobiletools.commons.views import android.content.Context import android.graphics.PorterDuff import android.support.v7.widget.AppCompatSpinner import android.util.AttributeSet import android.view.View Loading @@ -9,6 +8,7 @@ import android.widget.AdapterView import android.widget.TextView import com.simplemobiletools.commons.R import com.simplemobiletools.commons.adapters.MyArrayAdapter import com.simplemobiletools.commons.extensions.applyColorFilter class MyAppCompatSpinner : AppCompatSpinner { constructor(context: Context) : super(context) Loading Loading @@ -43,6 +43,6 @@ class MyAppCompatSpinner : AppCompatSpinner { override fun onNothingSelected(parent: AdapterView<*>?) { } } background.setColorFilter(textColor, PorterDuff.Mode.SRC_ATOP) background.applyColorFilter(textColor) } } commons/src/main/kotlin/com/simplemobiletools/commons/views/MyEditText.kt +2 −2 Original line number Diff line number Diff line package com.simplemobiletools.commons.views import android.content.Context import android.graphics.PorterDuff import android.util.AttributeSet import android.widget.EditText import com.simplemobiletools.commons.extensions.adjustAlpha import com.simplemobiletools.commons.extensions.applyColorFilter class MyEditText : EditText { constructor(context: Context) : super(context) Loading @@ -14,7 +14,7 @@ class MyEditText : EditText { constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) fun setColors(textColor: Int, accentColor: Int, backgroundColor: Int) { background?.mutate()?.setColorFilter(accentColor, PorterDuff.Mode.SRC_ATOP) background?.mutate()?.applyColorFilter(accentColor) // requires android:textCursorDrawable="@null" in xml to color the cursor too setTextColor(textColor) Loading Loading
build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '3.0.15' propVersionName = '3.0.16' kotlin_version = '1.2.0' support_libs = '27.0.2' } Loading
commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Resources.kt +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ fun Resources.getColoredDrawable(drawableId: Int, colorId: Int, alpha: Int = 255 fun Resources.getColoredDrawableWithColor(drawableId: Int, color: Int, alpha: Int = 255): Drawable { val drawable = getDrawable(drawableId) drawable.mutate().setColorFilter(color, PorterDuff.Mode.SRC_IN) drawable.mutate().applyColorFilter(color) drawable.mutate().alpha = alpha return drawable } Loading
commons/src/main/kotlin/com/simplemobiletools/commons/views/FastScroller.kt +2 −2 Original line number Diff line number Diff line package com.simplemobiletools.commons.views import android.content.Context import android.graphics.PorterDuff import android.support.v4.widget.SwipeRefreshLayout import android.support.v7.widget.LinearLayoutManager import android.support.v7.widget.RecyclerView Loading @@ -9,6 +8,7 @@ import android.util.AttributeSet import android.view.MotionEvent import android.view.View import android.widget.FrameLayout import com.simplemobiletools.commons.extensions.applyColorFilter import com.simplemobiletools.commons.extensions.baseConfig // based on https://blog.stylingandroid.com/recyclerview-fastscroll-part-1 Loading Loading @@ -50,7 +50,7 @@ class FastScroller : FrameLayout { } fun updateHandleColor() { handle!!.background.setColorFilter(context.baseConfig.primaryColor, PorterDuff.Mode.SRC_IN) handle!!.background.applyColorFilter(context.baseConfig.primaryColor) } override fun onSizeChanged(width: Int, height: Int, oldWidth: Int, oldHeight: Int) { Loading
commons/src/main/kotlin/com/simplemobiletools/commons/views/MyAppCompatSpinner.kt +2 −2 Original line number Diff line number Diff line package com.simplemobiletools.commons.views import android.content.Context import android.graphics.PorterDuff import android.support.v7.widget.AppCompatSpinner import android.util.AttributeSet import android.view.View Loading @@ -9,6 +8,7 @@ import android.widget.AdapterView import android.widget.TextView import com.simplemobiletools.commons.R import com.simplemobiletools.commons.adapters.MyArrayAdapter import com.simplemobiletools.commons.extensions.applyColorFilter class MyAppCompatSpinner : AppCompatSpinner { constructor(context: Context) : super(context) Loading Loading @@ -43,6 +43,6 @@ class MyAppCompatSpinner : AppCompatSpinner { override fun onNothingSelected(parent: AdapterView<*>?) { } } background.setColorFilter(textColor, PorterDuff.Mode.SRC_ATOP) background.applyColorFilter(textColor) } }
commons/src/main/kotlin/com/simplemobiletools/commons/views/MyEditText.kt +2 −2 Original line number Diff line number Diff line package com.simplemobiletools.commons.views import android.content.Context import android.graphics.PorterDuff import android.util.AttributeSet import android.widget.EditText import com.simplemobiletools.commons.extensions.adjustAlpha import com.simplemobiletools.commons.extensions.applyColorFilter class MyEditText : EditText { constructor(context: Context) : super(context) Loading @@ -14,7 +14,7 @@ class MyEditText : EditText { constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) fun setColors(textColor: Int, accentColor: Int, backgroundColor: Int) { background?.mutate()?.setColorFilter(accentColor, PorterDuff.Mode.SRC_ATOP) background?.mutate()?.applyColorFilter(accentColor) // requires android:textCursorDrawable="@null" in xml to color the cursor too setTextColor(textColor) Loading