Skip to content

Commit

Permalink
Prepare for release 3.0.0-alpha05
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisCAD committed Apr 29, 2019
1 parent 6206afe commit e89d00d
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 14 deletions.
81 changes: 81 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,66 @@
# Change log for Splitties

## Version 3.0.0-alpha05 (2019-04-29)
Compiled with Kotlin 1.3.31.

**This release introduces 3 new splits:**

- [Alert Dialog AppCompat Coroutines](modules/alertdialog-appcompat-coroutines)
- [Permissions](modules/permissions)
- [Views Coroutines Material](modules/views-coroutines-material)

**The most important change** though, is how **simpler** integrating Splitties in your Android projects has become starting from this release, thanks to the new grouping artifacts.

See their content and their maven coordinates [in the dedicated part of the README](README.md#gradle-instructions).

There is also new features and changes in existing splits, as detailed below.

#### Alert Dialog & Alert Dialog AppCompat
The `alert` functions have been deprecated in favor of a more accurate naming: `alertDialog`.
These `alertDialog` functions are now usable on `Context` (vs previously only on `Activity`), and they have optional parameters to specify the title, the message and even an icon (using a resource id or a `Drawable`.

Also, the `title` and the `message` properties are now nullable, in respect to their accepted value.

#### Fragments
The `show` and `showAsync` extension functions allow you to show a `DialogFragment` without fearing the infamous `IllegalStateException` if the state has already been saved, because it will wait for the lifecycle to be in the RESUMED state before showing the `DialogFragment`.
These 2 extension functions are defined for `FragmentManager`, `FragmentActivity` and `Fragment`.

`show` is a suspending function that resumes after the lifecycle was resumed and the `DialogFragment` was shown.
`showAsync` is when you are outside of a coroutine but it is marked as experimental because it has "async" in its name while not returning a `Deferred`. Feel free to suggest a better name in the issues or in the `#splitties` channel of Kotlin's Slack.

#### Lifecycle Coroutines
New suspending inline extensions functions for `Lifecycle` have been added for convenience:
`awaitResumed`, `awaitStarted` & `awaitCreated`.

They can replace code like `awaitState(Lifecycle.State.RESUMED)` for improved readability.

#### Material Lists
A new `IconTwoLinesCheckBoxListItem` class has been added. What it does is self-explanatory.

Also, all the list items are now fully xml friendly.

#### Resources
The `colorSL` and `appColorSL` extension functions no longer return the nullable version of `ColorStateList`.

#### Views DSL ConstraintLayout

All the `ConstraintLayout.LayoutParams` extension functions now have overloads that allow specifying the margin.

For example, the following code:
```kotlin
centerHorizontally()
horizontalMargin = dip(16)
```
can now be written on one line: `centerHorizontally(margin = dip(16))`.

That improves readability as the word "horizontal" is no longer repeated, and it is still explicit.

#### Views Material

Two set-only extensions properties have been added for `MaterialButton`:
`iconResource` and `iconTintAndTextColor`.


## Version 3.0.0-alpha04 (2019-03-03)
Compiled with Kotlin 1.3.21.

Expand All @@ -17,6 +78,7 @@ Compiled with Kotlin 1.3.21.

- Remove contract in the `Intents` split that would cause compilation to fail when used.


## Version 3.0.0-alpha03 (2019-02-05)
Compiled with Kotlin 1.3.20.

Expand Down Expand Up @@ -58,6 +120,7 @@ This release has the following new artifact:
"com.louiscad.splitties:splitties-views-coroutines:3.0.0-alpha03"
```


## Version 3.0.0-alpha02 (2019-01-06)

**This release introduces a new split: [Lifecycle Coroutines](modules/lifecycle-coroutines/README.md).**
Expand All @@ -68,6 +131,7 @@ This release has the following new artifact:
"com.louiscad.splitties:splitties-lifecycle-coroutines:3.0.0-alpha02"
```


## Version 3.0.0-alpha01 (2018-12-21)
This release is compiled with Kotlin 1.3.11.

Expand Down Expand Up @@ -154,6 +218,7 @@ This release removes these two artifacts:
~`"com.louiscad.splitties:splitties-views-design-styles:2.1.1"`~
~`"com.louiscad.splitties:splitties-views-dsl-design-styles:2.1.1"`~


## Version 2.1.1 (2018-11-25)
This release is compiled with Kotlin 1.3.10.

Expand All @@ -168,6 +233,7 @@ done in `putExtras` instead. You can see more info in the updated KDoc of these
- Add KDoc to all public symbols from the AlertDialog split.
- Add KDoc to all public symbols from the AlertDialog AppCompat split.


## Version 2.1.0 (2018-11-13)
This release targets Android SDK 28, and splits depending on support libraries use version 28.0.0.

Expand All @@ -177,6 +243,7 @@ This release targets Android SDK 28, and splits depending on support libraries u
design support library version 28.0.0.
- Update for nullability warnings brought by SDK 28.


## Version 2.0.0 (2018-11-13)
This release targets Android SDK 27, and splits depending on support libraries use version 27.1.1.

Expand All @@ -185,6 +252,7 @@ This release targets Android SDK 27, and splits depending on support libraries u
- Lambdas of `onCreate` and `onOpen` functions in Arch Room are now `crossinline`.
- The `LifecycleObserver` class is now marked as experimental.


## Version 2.0.0-beta1 (2018-11-13)
This release **breaks binary and source compatibility**.

Expand All @@ -205,6 +273,7 @@ are replaced, renamed or removed (still with a deprecation cycle whenever possib
`RecyclerView.LayoutManager` are experimental for now, but this could change, especially in alpha,
or beta stage.


## Version 2.0.0-alpha9 (2018-11-13)
This release **breaks binary and source compatibility**.

Expand Down Expand Up @@ -274,6 +343,7 @@ This release removes all these artifacts:
~`debugImplementation("com.louiscad.splitties:splitties-viewdsl-ide-preview:$splitties_version")`~
~`implementation("com.louiscad.splitties:splitties-viewdsl-recyclerview:$splitties_version")`~


## Version 2.0.0-alpha8 (2018-11-12)
This release **breaks binary compatibility**.

Expand All @@ -283,11 +353,13 @@ Make sure you don't rely on any library that uses an old version of a Splitties
on these previously deprecated and now removed symbols, or your app is likely not build, or to
crash at runtime because of not found classes.


## Version 2.0.0-alpha7 (2018-11-12)
Raise all deprecated symbols deprecation level to error.

Use this version to make sure you don't use them in your projects, next version will remove them!


## Version 2.0.0-alpha6 (2018-11-11)
Version 2.0.0-alpha5 broke the API, this version fixes this.

Expand Down Expand Up @@ -372,6 +444,7 @@ encounter gradle sync issues, or runtime issues, and the real cause may not appe
The `wrapInRecyclerView` extension function now accepts an optional lambda to configure the wrapping
`RecyclerView` easily.


## Version 2.0.0-alpha5 (2018-11-02)
_This release is **breaking** if you come from version 2.0.0-alpha4, especially if you were using
View DSL. It's highly recommended to directly migrate from version 2.0.0-alpha4 to 2.0.0-alpha6,
Expand Down Expand Up @@ -497,11 +570,13 @@ This release removes these two artifacts:
~`implementation("com.louiscad.splitties:splitties-uithread:$splitties_version")`~
~`implementation("com.louiscad.splitties:splitties-viewdsl-appcompat-styles:$splitties_version")`~


## Version 2.0.0-alpha4 (2018-07-09)
* Provide `ReplaceWith` migrations for `add` methods deprecated in version 2.0.0-alpha2.
* Add default empty lambda for `startActivity(action: String…)` methods.
* Compiled with Kotlin 1.2.51


## Version 2.0.0-alpha3 (2018-06-09)
### New features
#### Bundle
Expand All @@ -524,6 +599,7 @@ import the versions from the new package for you.
- The delegates previously returned by `arg()` and `argOrNull()` are no longer part of the public
API and have been replaced by the `ReadWriteProperty` interface.


## Version 2.0.0-alpha2 (2018-05-21)
### 9 new library modules (amounting to a total of 42 splits):
- **Activities**: Start activities with minimal boilerplate
Expand Down Expand Up @@ -613,6 +689,7 @@ allProjects {

</details>


## Version 2.0.0-alpha1 (2018-03-11)
### 26 new library modules (amounting to a total of 33 splits):
- **Alert Dialog**: Create simple alert dialogs with simple code
Expand Down Expand Up @@ -732,6 +809,7 @@ allProjects {

</details>


## Version 1.3.0 (2017-04-17)
### 5 new library modules:
- **App Context**: Have a `Context` everywhere
Expand All @@ -750,17 +828,20 @@ https://material.io/guidelines/)
- Typesafe RecyclerView now depends on Kotlin
- Typesafe RecyclerView has a new `ItemViewHolder` helper class for simple but common use cases.


## Version 1.2 (2016-09-19)
This version adds the `setHost(Host host)` method in `ViewWrapper.Binder` interface where `Host` can
be any type you want you can use from the implementing item View to communicate with your Activity,
Fragment, Presenter, or whatever. Note this adds a third type parameter to the `ViewWrapper` class,
and a second one for the `ViewWrapper.Binder` class.


## Version 1.1 (2016-09-11)
This version adds the `setViewHolder(ViewWrapper holder)` method in `ViewWrapper.Binder` interface
so list item `View`s can now get a reference to their `ViewHolder`, and call `getAdapterPosition()`
on it for example.


## Version 1.0 (2016-08-24)
This is the first release of Splitties. It includes two independent modules:
- Typesafe RecyclerView
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -123,6 +123,7 @@ Includes the following modules:
- [fragments](modules/fragments)
- [fragmentargs](modules/fragmentargs)
- [intents](modules/intents)
- [lifecycle-coroutines](modules/lifecycle-coroutines)
- [mainhandler](modules/mainhandler)
- [mainthread](modules/mainthread)
- [material-colors](modules/material-colors)
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/ProjectVersions.kt
Expand Up @@ -5,7 +5,7 @@
object ProjectVersions {
const val androidBuildTools = "28.0.3"
const val androidSdk = 28
const val thisLibrary = "3.0.0-dev-008"
const val thisLibrary = "3.0.0-alpha05"
}

val isDevVersion = ProjectVersions.thisLibrary.contains("-dev-")
1 change: 1 addition & 0 deletions fun-packs/android-base/build.gradle.kts
Expand Up @@ -30,6 +30,7 @@ kotlin {
"fragments",
"fragmentargs",
"intents",
"lifecycle-coroutines",
"mainhandler",
"mainthread",
"material-colors",
Expand Down
3 changes: 2 additions & 1 deletion modules/material-lists/README.md
Expand Up @@ -16,14 +16,15 @@ in this module:
* `IconOneLineListItem`
* `IconTwoLinesListItem`
* `IconTwoLinesSwitchListItem`
* `IconTwoLinesCheckBoxListItem`
* `SwitchTwoLinesIconListItem`

Feel free to open an issue if you need the implementation of a list item that
is not in this library yet, or feel one can be improved. If so, pull
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).
See an example in the [sample module](../../samples/android-app).

## Download

Expand Down
2 changes: 1 addition & 1 deletion modules/typesaferecyclerview/README.md
Expand Up @@ -13,7 +13,7 @@ See the sample to understand how it works.
When using `ViewHolder`, use the one from Splitties to get the typesafe one.

See it in action in the sample: [DemoAdapter](
../../sample/src/androidMain/kotlin/com/louiscad/splittiessample/demo/DemoAdapter.kt
../../samples/android-app/src/androidMain/kotlin/com/example/splitties/demo/DemoAdapter.kt
).

## Download
Expand Down
2 changes: 1 addition & 1 deletion modules/views-dsl-appcompat/README.md
Expand Up @@ -69,7 +69,7 @@ manually setup ViewFactory so it uses AppCompat. Here's how you need to it: Copy
src/androidMain/kotlin/splitties/views/dsl/appcompat/experimental/AppCompatViewInstantiatorInjectProvider.kt
) into a package of an android library/app module of your project, then declare it in the
`AndroidManifest.xml` of the module exactly like it is done [here](
src/main/AndroidManifest.xml
src/androidMain/AndroidManifest.xml
). To do so, copy paste it, then fix the package of the class under the `android:name` xml attribute
of the `provider` tag, then specify the `android:process` value to the one of your non default
process.
Expand Down
2 changes: 1 addition & 1 deletion modules/views-dsl-ide-preview/README.md
Expand Up @@ -27,7 +27,7 @@ subpackage (relative to the app/library package name).
```

Here's a screenshot of how it looks like with [DemoUi from the sample](
../../sample/src/androidMain/kotlin/com/louiscad/splittiessample/demo/DemoUi.kt) after the
../../samples/android-app/src/androidMain/kotlin/com/example/splitties/demo/DemoUi.kt) after the
`compileDebugKotlin` gradle task has been run:

![Example screenshot](Splitties%20View%20DSL%20IDE%20preview%20example.png)
Expand Down
2 changes: 1 addition & 1 deletion modules/views-dsl-material/README.md
Expand Up @@ -48,7 +48,7 @@ manually setup ViewFactory so it uses AppCompat. Here's how you need to it: Copy
src/androidMain/kotlin/splitties/views/dsl/material/experimental/MaterialViewInstantiatorInjectProvider.kt
) into a package of an android library/app module of your project, then declare it in the
`AndroidManifest.xml` of the module exactly like it is done [here](
src/main/AndroidManifest.xml
src/androidMain/AndroidManifest.xml
). To do so, copy paste it, then fix the package of the class under the `android:name` xml attribute
of the `provider` tag, then specify the `android:process` value to the one of your non default
process.
Expand Down
2 changes: 1 addition & 1 deletion modules/views-dsl/Kotlin-UIs-vs-xml-layouts.md
Expand Up @@ -9,7 +9,7 @@ yourself.
## Facts

* If we don't count imports and copyright headers, the xml version of [MainUi](
../../sample/src/androidMain/kotlin/com/louiscad/splittiessample/main/MainUi.kt
../../samples/android-app/src/androidMain/kotlin/com/example/splitties/main/MainUi.kt
) (from the sample) was more than 100% lengthier (50 lines with Kotlin,
102 lines in xml, across the [activity_main.xml](
https://github.com/LouisCAD/Splitties/blob/v1.3.0/sample/src/main/res/layout/activity_main.xml
Expand Down
14 changes: 7 additions & 7 deletions modules/views-dsl/README.md
Expand Up @@ -49,9 +49,9 @@ a `ViewGroup`, or as the content of an `Activity` or a `Fragment`, you need to
do so explicitly.

There are **real examples in the sample**. You can start by taking a look at
[`MainUi`](../../sample/src/androidMain/kotlin/com/louiscad/splittiessample/main/MainUi.kt).
[`MainUi`](../../samples/android-app/src/androidMain/kotlin/com/example/splitties/main/MainUi.kt).
You can also see a simple example that uses `ConstraintLayout` in [`AboutUi`](
../../sample/src/androidMain/kotlin/com/louiscad/splittiessample/about/AboutUi.kt
../../samples/android-app/src/androidMain/kotlin/com/example/splitties/about/AboutUi.kt
).

_Opening the project in your IDE and navigating the sample UI code while reading
Expand Down Expand Up @@ -120,7 +120,7 @@ allocation that would slightly decrease performance otherwise.

Both overloads allow the following 3 **optional** parameters:
* `@IdRes id: Int`, the id of the View. Example argument: `R.id.input_name`, given
you declared it in xml, [as done in the sample](../../sample/src/main/res/values/view_ids.xml)
you declared it in xml, [as done in the sample](../../samples/android-app/src/androidMain/res/values/view_ids.xml)
* `@StyleRes theme: Int`, resource of a theme overlay that will be applied to
the View. Example argument: `R.style.AppTheme_AppBarOverlay`
* `initView: V.() -> Unit`, a lambda that is like `apply` for the created View.
Expand Down Expand Up @@ -469,13 +469,13 @@ your UI to a `ViewModel` and any other components).
### Simple examples

See concrete examples in [`MainUi`](
../../sample/src/androidMain/kotlin/com/louiscad/splittiessample/main/MainUi.kt) and
../../samples/android-app/src/androidMain/kotlin/com/example/splitties/main/MainUi.kt) and
[`DemoUi`](
../../sample/src/androidMain/kotlin/com/louiscad/splittiessample/demo/DemoUi.kt) with
../../samples/android-app/src/androidMain/kotlin/com/example/splitties/demo/DemoUi.kt) with
their respective Activities [`MainActivity`](
../../sample/src/androidMain/kotlin/com/louiscad/splittiessample/main/MainActivity.kt)
../../samples/android-app/src/androidMain/kotlin/com/example/splitties/main/MainActivity.kt)
and [`DemoActivity`](
../../sample/src/androidMain/kotlin/com/louiscad/splittiessample/demo/DemoActivity.kt).
../../samples/android-app/src/androidMain/kotlin/com/example/splitties/demo/DemoActivity.kt).

### Possibilities brought by the `Ui` interface

Expand Down

0 comments on commit e89d00d

Please sign in to comment.