Skip to content

Commit

Permalink
Prepare for release 2.0.0-alpha2
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisCAD committed May 21, 2018
1 parent 7cfe95d commit 72a7fae
Show file tree
Hide file tree
Showing 44 changed files with 285 additions and 12 deletions.
29 changes: 25 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ as possible.

## All the [splits](#what-is-a-split "What is a split in Splitties?")

- **[Activities:](activities)** Start activities with minimal boilerplate.
- **[Alert Dialog:](alertdialog)** Create simple alert dialogs with simple code.
- **[Alert Dialog AppCompat:](alertdialog-appcompat)** AppCompat version of
[Alert Dialog](alertdialog).
Expand All @@ -26,20 +27,26 @@ as possible.
Kotlin.
- **[Bit Flags:](bitflags)** `hasFlag`, `withFlag` and `minusFlag` extensions on `Long`, `Int`,
`Short` and `Byte`.
- **[Bundle:](bundle)** `BundleHelper` to use `Bundle` with property syntax for `Intent` extras
- **[Bundle:](bundle)** `BundleSpec` to use `Bundle` with property syntax for `Intent` extras
and more.
- **[Collections:](collections)** `forEach` for `List`s without `Iterator` allocation.
- **[Checked Lazy:](checkedlazy)** `uiLazy` that checks property access on UI thread, and
`checkedLazy` to make your own variant.
- **[Dimensions:](dimensions)** Android `dp` extensions for `View` and `Context`. Particularly
handy when using [View DSL](viewdsl).
- **[Exceptions:](exceptions)** `illegal(…)` and similar functions that return `Nothing`, handy for
impossible or illegal `when` branches.
- **[Fragments:](fragments)** Start activities from fragments and do transactions with minimal
boilerplate.
- **[Fragment Args:](fragmentargs)** Fragment arguments without ceremony thanks to delegated
properties.
- **[Init Provider:](initprovider)** Base class for `ContentProvider`s used for automatic
initialization purposes.
- **[Intents:](intents)** Transform `companion object`s into powerful typesafe intent specs.
- **[Main Handler:](mainhandler)** Top-level `mainHandler` property to stop allocating multiple
`Handler`s for main `Looper`.
- **[Material Colors:](material-colors)** [2014 Material Design color palettes](
https://material.io/design/color/#tools-for-picking-colors) as color resources.
- **[Material Lists:](material-lists)** List item Views implementing [Material Design guidelines](
https://material.io/guidelines) (perfect for usage in a `RecyclerView`).
- **[Preferences:](preferences)** Property syntax for Android's SharedPreferences.
Expand Down Expand Up @@ -70,9 +77,14 @@ precondition checker.
[View DSL](viewdsl).
- **[View DSL Design:](viewdsl-design)** Design Support Library extension of [View DSL](viewdsl).
- **[View DSL IDE preview:](viewdsl-ide-preview)** Preview [View DSL](viewdsl) UIs in the IDE.
- **[View DSL RecyclerView:](viewdsl-recyclerview)** RecyclerView extension of [View DSL](viewdsl).
- **[Views:](views)** Extensions function and properties on `View`s.
- **[Views AppCompat:](views-appcompat)** AppCompat extension of [Views](views). Includes helpers
for `ImageView` tinting, `ActionBar` and tooltip.
- **[Views CardView:](views-cardview)** CardView extension of [Views](views). Provides a
`contentPadding` property.
- **[Views Design:](views-design)** Design Support library extension of [Views](views).
- **[Views RecyclerView:](views-recyclerview)** RecyclerView extension of [Views](views).

## Download

Expand All @@ -86,7 +98,7 @@ into your root project `build.gradle` file:
```groovy
allProjects {
ext {
splitties_version = '2.0.0-alpha1'
splitties_version = '2.0.0-alpha2'
}
}
```
Expand All @@ -97,6 +109,7 @@ allProjects {
</summary>

```groovy
implementation "com.louiscad.splitties:splitties-activities:$splitties_version"
implementation "com.louiscad.splitties:splitties-alertdialog:$splitties_version"
implementation "com.louiscad.splitties:splitties-alertdialog-appcompat:$splitties_version"
implementation "com.louiscad.splitties:splitties-appctx:$splitties_version"
Expand All @@ -105,31 +118,39 @@ implementation "com.louiscad.splitties:splitties-arch-room:$splitties_version"
implementation "com.louiscad.splitties:splitties-bitflags:$splitties_version"
implementation "com.louiscad.splitties:splitties-bundle:$splitties_version"
implementation "com.louiscad.splitties:splitties-checkedlazy:$splitties_version"
implementation "com.louiscad.splitties:splitties-collections:$splitties_version"
implementation "com.louiscad.splitties:splitties-dimensions:$splitties_version"
implementation "com.louiscad.splitties:splitties-exceptions:$splitties_version"
implementation "com.louiscad.splitties:splitties-fragments:$splitties_version"
implementation "com.louiscad.splitties:splitties-fragmentargs:$splitties_version"
implementation "com.louiscad.splitties:splitties-initprovider:$splitties_version"
implementation "com.louiscad.splitties:splitties-intents:$splitties_version"
implementation "com.louiscad.splitties:splitties-mainhandler:$splitties_version"
implementation "com.louiscad.splitties:splitties-material-colors:$splitties_version"
implementation "com.louiscad.splitties:splitties-material-lists:$splitties_version"
implementation "com.louiscad.splitties:splitties-preferences:$splitties_version"
implementation "com.louiscad.splitties:splitties-resources:$splitties_version"
implementation "com.louiscad.splitties:splitties-fragmentargs:$splitties_version"
implementation "com.louiscad.splitties:splitties-selectableviews:$splitties_version"
implementation "com.louiscad.splitties:splitties-selectableviews-appcompat:$splitties_version"
implementation "com.louiscad.splitties:splitties-selectableviews-constraintlayout:$splitties_version"
implementation "com.louiscad.splitties:splitties-snackbar:$splitties_version"
debugImplementation "com.louiscad.splitties:splitties-stetho-init:$splitties_version"
implementation "com.louiscad.splitties:splitties-systemservices:$splitties_version"
implementation "com.louiscad.splitties:splitties-toast:$splitties_version"
implementation "com.louiscad.splitties:splitties-typesaferecyclerview:$splitties_version"
implementation "com.louiscad.splitties:splitties-uithread:$splitties_version"
implementation "com.louiscad.splitties:splitties-snackbar:$splitties_version"
implementation "com.louiscad.splitties:splitties-viewdsl:$splitties_version"
implementation "com.louiscad.splitties:splitties-viewdsl-appcompat:$splitties_version"
implementation "com.louiscad.splitties:splitties-viewdsl-appcompat-styles:$splitties_version"
implementation "com.louiscad.splitties:splitties-viewdsl-constraintlayout:$splitties_version"
implementation "com.louiscad.splitties:splitties-viewdsl-design:$splitties_version"
debugImplementation "com.louiscad.splitties:splitties-viewdsl-ide-preview:$splitties_version"
implementation "com.louiscad.splitties:splitties-viewdsl-recyclerview:$splitties_version"
implementation "com.louiscad.splitties:splitties-views:$splitties_version"
implementation "com.louiscad.splitties:splitties-views-appcompat:$splitties_version"
implementation "com.louiscad.splitties:splitties-views-cardview:$splitties_version"
implementation "com.louiscad.splitties:splitties-views-design:$splitties_version"
implementation "com.louiscad.splitties:splitties-views-recyclerview:$splitties_version"
```

</details>
Expand Down
6 changes: 6 additions & 0 deletions activities/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ edit it (e.g. adding flags) before the activity is started with it.
The `startActivity` extension function for `Context` is designed for implicit
intents. It expects the `Intent` action as first parameter, and takes a
lambda to edit the intent further, like `start`.

## Download

```groovy
implementation "com.louiscad.splitties:splitties-activities:$splitties_version"
```
6 changes: 6 additions & 0 deletions alertdialog-appcompat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ class YourActivity : AppCompatActivity {
}
}
```

## Download

```groovy
implementation "com.louiscad.splitties:splitties-alertdialog-appcompat:$splitties_version"
```
6 changes: 6 additions & 0 deletions alertdialog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@ class YourActivity : AppCompatActivity {
}
}
```

## Download

```groovy
implementation "com.louiscad.splitties:splitties-alertdialog:$splitties_version"
```
6 changes: 6 additions & 0 deletions appctx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,9 @@ import splitties.init.AppCtxInitProvider

class SecondProcessInitProvider : AppCtxInitProvider()
```

## Download

```groovy
implementation "com.louiscad.splitties:splitties-appctx:$splitties_version"
```
6 changes: 6 additions & 0 deletions arch-lifecycle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,9 @@ class YourViewModel : ViewModel() {
Note that the `map` lambda runs on UI thread, so very light operations like
getting a property is right, but long/blocking operations are not (would
result in lags or ANRs).

## Download

```groovy
implementation "com.louiscad.splitties:splitties-arch-lifecycle:$splitties_version"
```
6 changes: 6 additions & 0 deletions arch-room/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ the value of the last expression of the lambda.

Inlining brings a slight performance improvement at runtime and reduces the
number of classes, making the apk smaller.

## Download

```groovy
implementation "com.louiscad.splitties:splitties-arch-room:$splitties_version"
```
6 changes: 6 additions & 0 deletions bitflags/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ These extensions make dealing with bit flags easier.
These small inline extensions can be proven handy since bit flags are found in
multiple places over the Android API, in low level stuff when you
have to deal with raw bytes, and maybe in your own codebase too.

## Download

```groovy
implementation "com.louiscad.splitties:splitties-bitflags:$splitties_version"
```
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ allprojects {

// Libraries
groupId = "com.louiscad.splitties"
library_version = "2.0.0-SNAPSHOT"
library_version = "2.0.0-alpha2"
isSnapshot = library_version.endsWith("-SNAPSHOT")
isRelease = !isSnapshot

Expand Down
18 changes: 12 additions & 6 deletions bundle/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Bundle

*`BundleHelper` to use `Bundle` with property syntax for `Intent` extras
*`BundleSpec` to use `Bundle` with property syntax for `Intent` extras
and more.*

## Non-exhaustive list of use cases
Expand All @@ -17,7 +17,7 @@ Can be used for `Activity` extras, but also in `Service` extras,

1. Let's say you have an `Activity` subclass named `YourActivity`.
1. In `YourActivity`, add a nested `object` named `ExtrasSpec`.
2. Make it extend `BundleHelper`.
2. Make it extend `BundleSpec`.
3. For each required `Intent` extra you need, in `ExtrasSpec`, add a
`var` property with explicit type, delegated `by bundle()`.
3. For each optional `Intent` extra you need, still in `ExtrasSpec`, add a
Expand All @@ -43,7 +43,7 @@ See the examples below.
See the implementation of the `put(…)` extension on `Bundle` to check all
the supported types (it is likely to suit your needs).

You may only access the delegated properties of a `BundleHelper` subclass
You may only access the delegated properties of a `BundleSpec` subclass
from the UI thread, inside the `withExtras(…) { … }` lambda or inside the
`someBundle.with(…) { … }` lambda. If you violate this rule, an
`IllegalStateException` will be thrown.
Expand All @@ -63,7 +63,7 @@ cost of data serialization in Bundles).
```kotlin
class DemoActivity : AppCompatActivity() {

object ExtrasSpec : BundleHelper() {
object ExtrasSpec : BundleSpec() {
var showGreetingToast: Boolean by bundle() // Required extra
var optionalExtra: String? by bundleOrNull() // Optional extra
}
Expand Down Expand Up @@ -97,7 +97,7 @@ class StartDemoActivity : AppCompatActivity() {
```kotlin
class AirplaneModeReceiver : BroadcastReceiver() {

object ExtrasSpec : BundleHelper() {
object ExtrasSpec : BundleSpec() {
var isAirplaneModeOn: Boolean by bundle("state")
}

Expand All @@ -114,7 +114,7 @@ class AirplaneModeReceiver : BroadcastReceiver() {
```kotlin
class DemoActivity : AppCompatActivity() {

private object InstanceStateSpec : BundleHelper() {
private object InstanceStateSpec : BundleSpec() {
var startTime: Long by bundle()
}

Expand All @@ -136,3 +136,9 @@ class DemoActivity : AppCompatActivity() {
}
}
```

## Download

```groovy
implementation "com.louiscad.splitties:splitties-bundle:$splitties_version"
```
6 changes: 6 additions & 0 deletions checkedlazy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ class YourClass {
val expensiveObject by checkedLazy(noUiThreadChecker) { doHeavyInstantiation() }
}
```

## Download

```groovy
implementation "com.louiscad.splitties:splitties-checkedlazy:$splitties_version"
```
6 changes: 6 additions & 0 deletions collections/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ allows you to iterate on a `List` without allocating an `Iterator`.
This is useful when you need to iterate on a `List` in performance critical
conditions (e.g. code executed/called from an `onDraw` method, or code run
on the UI thread more generally).

## Download

```groovy
implementation "com.louiscad.splitties:splitties-collections:$splitties_version"
```
6 changes: 6 additions & 0 deletions dimensions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ val minTapTargetSize = dip(48)
```kotlin
val circleDiameter = dp(48)
```

## Download

```groovy
implementation "com.louiscad.splitties:splitties-dimensions:$splitties_version"
```
6 changes: 6 additions & 0 deletions exceptions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ Here's the list of these functions:
* `illegalArg(…)` (shortcut to `throw IllegalArgumentException(…)`)
* `unsupported(…)` (shortcut to `throw UnsupportedOperationException(…)`)
* `unsupportedAction(…)` (designed for unsupported `Intent` actions)

## Download

```groovy
implementation "com.louiscad.splitties:splitties-exceptions:$splitties_version"
```
6 changes: 6 additions & 0 deletions fragmentargs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ fun createYourFragment(someId: Int): Fragment = YourFragment().apply {
someRequiredId = someId
}
```

## Download

```groovy
implementation "com.louiscad.splitties:splitties-fragments:$splitties_version"
```
6 changes: 6 additions & 0 deletions fragments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ your Fragments (e.g. adding, replacing…).

The `addToBackStack()` extension function for `FragmentTransaction` calls
`addToBackStack(null)`. It effectively makes the name parameter optional.

## Download

```groovy
implementation "com.louiscad.splitties:splitties-fragmentargs:$splitties_version"
```
6 changes: 6 additions & 0 deletions initprovider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ purposes.*

See the [Stetho Init](../stetho-init) and [App Context](../appctx)
implementations to see how it's meant to be used.

## Download

```groovy
implementation "com.louiscad.splitties:splitties-initprovider:$splitties_version"
```
8 changes: 7 additions & 1 deletion intents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class DemoActivity : AppCompatActivity() {
const val someText = "Splitties is great!"
}

object ExtrasSpec : BundleHelper() {
object ExtrasSpec : BundleSpec() {
var showGreetingToast: Boolean by bundle() // Required extra
var optionalExtra: String? by bundleOrNull() // Optional extra
}
Expand All @@ -104,3 +104,9 @@ class StartDemoActivity : AppCompatActivity() {
}
}
```

## Download

```groovy
implementation "com.louiscad.splitties:splitties-intents:$splitties_version"
```
6 changes: 6 additions & 0 deletions mainhandler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ main `Looper`.*

If the sentence above is not clear enough or if you need more explanations,
please open an issue.

## Download

```groovy
implementation "com.louiscad.splitties:splitties-mainhandler:$splitties_version"
```
6 changes: 6 additions & 0 deletions material-colors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ generator).

* Red 500: `R.color.red_500` / `@color/red_500`
* Cyan accent 400: `R.color.cyan_a400` / `@color/cyan_a400`

## Download

```groovy
implementation "com.louiscad.splitties:splitties-material-colors:$splitties_version"
```
6 changes: 6 additions & 0 deletions material-lists/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ requests are welcome as long as the code style is kept intact (you can
debate about it in an issue if you feel there's room for improvement).

See an example in the [sample module](../sample).

## Download

```groovy
implementation "com.louiscad.splitties:splitties-material-lists:$splitties_version"
```
6 changes: 6 additions & 0 deletions preferences/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,9 @@ However, you may make an abstract subclass of `Preferences` for specific
use cases where adding logic to base `Preferences` or sharing some
properties may be desirable. (If you do, please open an issue to tell us
about this use case. It may become an example shown here.)

## Download

```groovy
implementation "com.louiscad.splitties:splitties-preferences:$splitties_version"
```
6 changes: 6 additions & 0 deletions resources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,9 @@ arguments.
There's also optional format arguments.
* `styledTxtArray(…)` takes an array theme attribute and returns an
`Array<out CharSequence>?`

## Download

```groovy
implementation "com.louiscad.splitties:splitties-resources:$splitties_version"
```
Loading

0 comments on commit 72a7fae

Please sign in to comment.