Skip to content

Commit

Permalink
Updated version & readme table
Browse files Browse the repository at this point in the history
  • Loading branch information
cioccarellia committed Nov 19, 2020
1 parent 8ade56b commit ba01e50
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 30 deletions.
58 changes: 30 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
</p>

## 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
Expand Down Expand Up @@ -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<out String>` | `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<out String>` | `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.
4 changes: 2 additions & 2 deletions library_info.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit ba01e50

Please sign in to comment.