From ba01e50dd4879cd56e555eb871eb441f2087389a Mon Sep 17 00:00:00 2001 From: cioccarellia Date: Thu, 19 Nov 2020 20:22:40 +0100 Subject: [PATCH] Updated version & readme table --- README.md | 58 +++++++++++++++++++++++---------------------- library_info.gradle | 4 ++-- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 56b8709..5c33bbe 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,14 @@

## TLDR -Fed up with typing `ContextCompact`, `recources` and `context` all over your apps to access your resources? Say no more. +Fed up with typing `ContextCompact`, `resources` and `context` all over your apps to access your resources? Say no more. ```gradle -implementation 'com.cioccarellia:kite:1.0.0-beta1' +implementation 'com.cioccarellia:kite:1.0.0-beta2' ``` -- :kite: Access app resources with one contextless unified syntax -- :dna: Null safe layer between Android framework and your app +- :kite: Access all app resources with one unified syntax +- :dna: Null safe layer between the Android framework java code and your app +- :zap: Easy to implement in existing apps - :heart: Kotlin powered, 100%. ```kotlin @@ -53,28 +54,29 @@ fab.text = appContext.getString(R.string.ride) ``` ## Supported Resources -| Resource Type | AAPT class | Namespace | Input | Output | Implementation | API | Variants | -|----------------- |------------ |----------------------- |--------------------------------------------------------- |--------------------- |------------------------------------- |----- |-------------------- | -| Strings | R.string | `Kite.string` | `@StringRes string: Int` | `String` | `Context.getString()` | / | `formatArgs` | -| Plurals | R.plurals | `Kite.plural` | `@PluralRes plural: Int`, `quantity: Int` | `String` | `Resources.getQuantityString()` | / | `formatArgs` | -| Texts | R.string | `Kite.text` | `@StringRes text: Int` | `CharSequence` | `Context.getText()` | / | / | -| Color | R.color | `Kite.color` | `@ColorRes color: Int` | `@ColorInt Color` | `ContextCompat.getColor()` | / | / | -| ColorStateLists | R.color | `Kite.colorStateList` | `@ColorRes colorStateList: Int` | `ColorStateList` | `ContextCompat.getColorStateList()` | / | / | -| Drawables | R.drawable | `Kite.drawable` | `@DrawableRes drawable: Int` | `Drawable` | `ContextCompat.getDrawable()` | / | `Resources.Theme?` | -| Dimensions | R.dimen | `Kite.dimension` | `@DimenRes dimensions: Int` | `Float` | `Resources.getDimensions()` | / | / | -| Animations | R.anim | `Kite.animation` | `@AnimRes animation: Int` | `Animation` | `AnimationUtils.loadAnimation()` | / | / | -| Interpolators | R.anim | `Kite.interpolation` | `@InterpolatorRes interpolator: Int` | `Interpolator` | `AnimationUtils.loadInterpolator()` | / | / | -| Layouts | R.layout | `Kite.layout` | `@LayoutRes layout: Int` | `XmlResourceParser` | `Resources.getlayout()` | / | / | -| Booleans | R.bool | `Kite.booleans` | `@BoolRes bolean: Int` | `Boolean` | `Resources.getBoolean()` | / | / | -| IntArray | R.array | `Kite.intArray` | `@ArrayRes intArray: Int` | `IntArray` | `Resources.getIntArray()` | / | / | -| StringArray | R.array | `Kite.stringArray` | `@ArrayRes stringArray: Int` | `Array` | `Resources.getStringArray()` | / | / | -| TypedArrays | R.array | `Kite.typedArray` | `@ArrayRes typedArray: Int` | `TypedArray` | `Resources.obtainTypedArray()` | / | / | -| Identifiers | R.id | `Kite.identifier` | `name: String`, `defType: String`, `defPackage: String` | `Int` | `Resources.getIdentifier()` | / | / | -| Xmls | R.xml | `Kite.xml` | `@XmlRes xml: Int` | `XmlResourceParser` | `Resources.getXml()` | / | / | -| Raws | R.raw | `Kite.raw` | `@RawRes raw: Int` | `InputStream` | `Resources.openRawResource()` | / | `TypedValue` | -| Fonts | R.font | `Kite.font` | `@FontRes font: Int` | `Typeface` | `Resources.getFont()` | 26 | / | -| Integer | R.integer | `Kite.integer` | `@IntegerRes integer: Int` | `Int` | `Resources.getInteger()` | / | / | -| Fraction | R.fraction | `Kite.fraction` | `@FractionRes fraction: Int`, `base: Int`, `pbase: Int` | `Float` | `Resources.getFraction()` | / | / | +| Resource Type | AAPT class | Namespace | Input | Output | Implementation | API | Variants | +|----------------- |------------------ |----------------------- |--------------------------------------------------------- |--------------------- |------------------------------------- |----- |-------------------- | +| Strings | `R.string` | `Kite.string` | `@StringRes string: Int` | `String` | `Context.getString()` | / | `formatArgs` | +| Plurals | `R.plurals` | `Kite.plural` | `@PluralRes plural: Int`, `quantity: Int` | `String` | `Resources.getQuantityString()` | / | `formatArgs` | +| Texts | `R.string` | `Kite.text` | `@StringRes text: Int` | `CharSequence` | `Context.getText()` | / | / | +| Color | `R.color` | `Kite.color` | `@ColorRes color: Int` | `@ColorInt Color` | `ContextCompat.getColor()` | / | / | +| ColorStateLists | `R.color` | `Kite.colorStateList` | `@ColorRes colorStateList: Int` | `ColorStateList` | `ContextCompat.getColorStateList()` | / | / | +| Drawables | `R.drawable` | `Kite.drawable` | `@DrawableRes drawable: Int` | `Drawable` | `ContextCompat.getDrawable()` | / | `Resources.Theme?` | +| Layouts | `R.layout` | `Kite.layout` | `@LayoutRes layout: Int` | `XmlResourceParser` | `Resources.getlayout()` | / | / | +| Integer | `R.integer` | `Kite.integer` | `@IntegerRes integer: Int` | `Int` | `Resources.getInteger()` | / | / | +| Booleans | `R.bool` | `Kite.booleans` | `@BoolRes bolean: Int` | `Boolean` | `Resources.getBoolean()` | / | / | +| Dimensions | `R.dimen` | `Kite.dimension` | `@DimenRes dimensions: Int` | `Float` | `Resources.getDimensions()` | / | / | +| Fractions | `R.fraction` | `Kite.fraction` | `@FractionRes fraction: Int`, `base: Int`, `pbase: Int` | `Float` | `Resources.getFraction()` | / | / | +| Fonts | `R.font` | `Kite.font` | `@FontRes font: Int` | `Typeface` | `Resources.getFont()` | 26 | / | +| Animations | `R.anim` | `Kite.animation` | `@AnimRes animation: Int` | `Animation` | `AnimationUtils.loadAnimation()` | / | / | +| Interpolators | `R.interpolator` | `Kite.interpolation` | `@InterpolatorRes interpolator: Int` | `Interpolator` | `AnimationUtils.loadInterpolator()` | / | / | +| IntArray | `R.array` | `Kite.intArray` | `@ArrayRes intArray: Int` | `IntArray` | `Resources.getIntArray()` | / | / | +| StringArray | `R.array` | `Kite.stringArray` | `@ArrayRes stringArray: Int` | `Array` | `Resources.getStringArray()` | / | / | +| TypedArray | `R.array` | `Kite.typedArray` | `@ArrayRes typedArray: Int` | `TypedArray` | `Resources.obtainTypedArray()` | / | / | +| Identifiers | `R.id` | `Kite.identifier` | `name: String`, `defType: String`, `defPackage: String` | `Int` | `Resources.getIdentifier()` | / | / | +| Xmls | `R.xml` | `Kite.xml` | `@XmlRes xml: Int` | `XmlResourceParser` | `Resources.getXml()` | / | / | +| Raws | `R.raw` | `Kite.raw` | `@RawRes raw: Int` | `InputStream` | `Resources.openRawResource()` | / | `TypedValue` | -## Known Issues -- Annotation checks over resource parameters (functions which take as argument some annotated value, like `@ColorRes`, `@StringRes`) are not extensively performed by Android Studio, when using kotlin operator functions: I created a bug report to google issuetracker [here](https://issuetracker.google.com/issues/173628041). +## :stop_sign: Known Issues +- Annotation checks over resource parameters (functions which take as argument some annotated value, like `@ColorRes`, `@StringRes`) are not extensively performed by Android Studio, when using kotlin operator functions: I created a bug report at google issue tracker [here](https://issuetracker.google.com/issues/173628041). Hope to see it fixed soon. +- After {@link Build.VERSION_CODES#R}, {@link Resources} must be obtained by {@link android.app.Activity} or {@link android.content.Context} created with {@link android.content.Context#createWindowContext(int, Bundle)}. {@link Application#getResources()} may report wrong values in multi-window or on secondary displays. \ No newline at end of file diff --git a/library_info.gradle b/library_info.gradle index 340622b..5a2e97b 100644 --- a/library_info.gradle +++ b/library_info.gradle @@ -21,8 +21,8 @@ ext.library = [ artifact : "kite", publish_group : "com.cioccarellia", - publish_version : "1.0.0-beta1", - publish_version_code: 92, + publish_version : "1.0.0-beta2", + publish_version_code: 93, description : "(none)", website : "https://github.com/cioccarellia/kite"