Note: All extensions have moved into the androidx.core.*
package.
- New:
Canvas.withMatrix
extension for manipulating aCanvas
afterconcat
enating a matrix. - New: Add
start
andend
parameters for narrowingSpanned.getSpans
lookup. - New: Extensions to
PreferenceGroup
to treat it more like a collection ofPreference
s. - New:
View.announceForAccessibility
extensions which takes a resource ID instead of a string. - New:
Spannable.set
operator extensions for adding a span with anIntRange
or starting and ending index. - New:
Context.toast
extension for showing simpleToast
s. - New:
Uri.toFile
extension to extract aFile
from theUri
path. - New:
String.parseAsHtml
extension which callsHtml.fromHtml
on the string. - New:
Spanned.toHtml
extension callsHtml.toHtml
on the suppliedSpanned
instance. - Fix: Correct a logic bug in
Path.flatten
which would cause it omit some segments. - Fix: Move
updateLayoutParams
extension fromViewGroup
toView
. - Fix: Move
File.toUri
extension into 'net' package. Handler.post*
overloads accepting aTimeUnit
andDuration
have been removed.SparseBooleanArray.removeAt
has been removed as the function has been added directly on the type.- Extensions to
java.time
types have been removed.
- New:
File.toUri
extension forUri.fromFile
. - New:
TypedArray.getResourceIdOrThrow
extension for ensuring an attribute value is set before callinggetResourceId
. - New:
TypedArray.use
extension for automatically recycling aTypedArray
after the supplied lambda was executed. - New:
ViewGroup.children
extension returns aSequence<View>
for lazily iterating. - New:
View.isVisible
,View.isInvisible
, andView.isGone
mutable properties allow toggling a view's visibility between two corresponding values. - New:
String.toColorInt
extension parses a hexidecimal color into its integer representation. - New:
Locale.layoutDirection
extension exposes the layout direction of the locale instance. - New:
lruCache
function allows easy creation of anLruCache
without subclassing. - New:
CharSequence.toSpanned
andCharSequence.toSpannable
extensions for convenient conversion. - New:
Spanned.getSpans
reified extension simplifies extracting spans of a particular type. - New:
Spannable.plusAssign
andSpannable.minusAssign
extensions allow using+=
or-=
to add or remove spans, respectively, from the entire spannable. - New:
Spannable.clearSpans
convenience extension to remove all spans. - New:
SpannableStringBuilder.strikeThrough
andSpannableStringBuilder.scale
for use insidebuildSpannedString
. - New:
SpannableStringBuilder.inSpans
overload for a single span to reduce overhead for the common case. - New:
SharedPreferences.edit
now has acommit
argument which defaults tofalse
. Set totrue
for usingcommit()
to complete the edit. - New:
String.htmlEncode
extension for escaping HTML entities in the string. - New:
CharSequence.trimmedLength
extension returns the number of characters if whitespace was trimmed. - New:
CharSequence.isDigitsOnly
extension indicates whether only digits comprise the sequence. - New:
ViewGroup.updateLayoutParams
extension allows modification of layout parameters and automatically applies any changes. - New: Extensions to
Menu
to treat it more like a collection ofMenuItem
s. - Fix: Correct
Sparse*
extensions to treat all negative numbers as a missing entry, not just -1. - Fix:
doOnLayout
now checks forisLayoutRequested
and schedules its lambda after layout when true. - Fix: Include
@Px
annotations on pixel-based arguments. - Some existing functions were marked as
inline
where appropriate. - Extensions to
java.time
types are deprecated with no replacement (other than the normal functions that they call). This library is focused on extensions for theandroid.*
packages only.
Initial release.