Skip to content

Commit

Permalink
Update documentation and add new release
Browse files Browse the repository at this point in the history
  • Loading branch information
PranavMaganti committed Apr 8, 2021
1 parent bbb5d96 commit ffe2c8b
Show file tree
Hide file tree
Showing 15 changed files with 119 additions and 131 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

### 0.3.3 - 2021-04-08

- Update compose version to 1.0.0-beta04
- Modify dialog styling (elevation, shape, etc) to better match material spec (thanks **[ivaniskandar](https://github.com/ivaniskandar)**)
- Fix issues when selection the hour 12 in the time picker
- New time picker features (thanks **[Jahor](https://github.com/Jahor)** )
- Add min and max time range/limit
- Add optional 24 hour time selector
- Switch to publishing to maven central due to sun-setting of bintray

### 0.3.2 - 2021-03-24

- Update compose version to 1.0.0-beta03
Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

### [See Releases and Changelog](https://github.com/vanpra/compose-material-dialogs/blob/main/CHANGELOG.md)

**Current Compose Version: 1.0.0-beta03**
### NOTE: The dependency name of the package has changed due to moving to maven central

**Current Compose Version: 1.0.0-beta04**

## Credits

Expand All @@ -16,12 +18,12 @@ This library's design is heavily inspired by https://github.com/afollestad/mater

![](https://raw.githubusercontent.com/vanpra/compose-material-dialogs/main/imgs/full_core.png)

[ ![Download](https://api.bintray.com/packages/vanpra/maven/compose-material-dialogs%3Acore/images/download.svg) ](https://bintray.com/vanpra/maven/compose-material-dialogs%3Acore/_latestVersion)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.vanpra.compose-material-dialogs/core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.vanpra.compose-material-dialogs/core)

```gradle
dependencies {
...
implementation "com.vanpra.compose-material-dialogs:core:0.3.2"
implementation "io.github.vanpra.compose-material-dialogs:core:0.3.3"
...
}
```
Expand All @@ -32,12 +34,12 @@ dependencies {

![](https://raw.githubusercontent.com/vanpra/compose-material-dialogs/main/imgs/date_and_time.png)

[ ![Download](https://api.bintray.com/packages/vanpra/maven/compose-material-dialogs%3Adatetime/images/download.svg) ](https://bintray.com/vanpra/maven/compose-material-dialogs%3Adatetime/_latestVersion)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.vanpra.compose-material-dialogs/datetime/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.vanpra.compose-material-dialogs/datetime)

```gradle
dependencies {
...
implementation "com.vanpra.compose-material-dialogs:datetime:0.3.2"
implementation "io.github.vanpra.compose-material-dialogs:datetime:0.3.3"
...
}
```
Expand All @@ -48,12 +50,12 @@ dependencies {

![](https://raw.githubusercontent.com/vanpra/compose-material-dialogs/main/imgs/color_picker.png)

[ ![Download](https://api.bintray.com/packages/vanpra/maven/compose-material-dialogs%3Acolor/images/download.svg) ](https://bintray.com/vanpra/maven/compose-material-dialogs%3Acolor/_latestVersion)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.vanpra.compose-material-dialogs/color/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.vanpra.compose-material-dialogs/color)

```gradle
dependencies {
...
implementation "com.vanpra.compose-material-dialogs:color:0.3.2"
implementation "io.github.vanpra.compose-material-dialogs:color:0.3.3"
...
}
```
12 changes: 6 additions & 6 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ android {
}

dependencies {
implementation(project(":core"))
implementation(project(":datetime"))
implementation(project(":color"))
// implementation(project(":core"))
// implementation(project(":datetime"))
// implementation(project(":color"))

// implementation(Dependencies.ComposeMaterialDialogs.core)
// implementation(Dependencies.ComposeMaterialDialogs.datetime)
// implementation(Dependencies.ComposeMaterialDialogs.color)
implementation(Dependencies.ComposeMaterialDialogs.core)
implementation(Dependencies.ComposeMaterialDialogs.datetime)
implementation(Dependencies.ComposeMaterialDialogs.color)

implementation(Dependencies.Kotlin.stdlib)

Expand Down
5 changes: 4 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ buildscript {
dependencies {
classpath(Dependencies.Kotlin.gradlePlugin)
classpath("com.android.tools.build:gradle:7.0.0-alpha13")
classpath("com.vanniktech:gradle-maven-publish-plugin:0.14.2")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.4.30")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down Expand Up @@ -47,4 +49,5 @@ subprojects {
ktlint(Dependencies.Ktlint.version)
}
}
}
}

4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/CommonModulePlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.JavaVersion
import org.gradle.api.plugins.ExtensionAware
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.configure

class CommonModulePlugin: Plugin<Project> {
Expand All @@ -21,8 +22,7 @@ class CommonModulePlugin: Plugin<Project> {
plugins.run {
apply("com.android.library")
apply("kotlin-android")
apply("maven-publish")
apply("com.jfrog.bintray")
apply("com.vanniktech.maven.publish")
}
}

Expand Down
6 changes: 3 additions & 3 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ object Dependencies {
object ComposeMaterialDialogs {
const val version = "0.3.3"

const val core = "com.vanpra.compose-material-dialogs:core:$version"
const val datetime = "com.vanpra.compose-material-dialogs:datetime:$version"
const val color = "com.vanpra.compose-material-dialogs:color:$version"
const val core = "io.github.vanpra.compose-material-dialogs:core:$version"
const val datetime = "io.github.vanpra.compose-material-dialogs:datetime:$version"
const val color = "io.github.vanpra.compose-material-dialogs:color:$version"
}

object Ktlint {
Expand Down
54 changes: 18 additions & 36 deletions color/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import java.util.Date

plugins {
id("common-library")
}
Expand Down Expand Up @@ -40,45 +38,29 @@ dependencies {
api(project(":core"))
}

val artifactName = "color"
val artifactGroup = "com.vanpra.compose-material-dialogs"
val artifactVersion = Dependencies.ComposeMaterialDialogs.version

val sourcesJar by tasks.creating(Jar::class) {
from(android.sourceSets.getByName("main").java.srcDirs)
archiveClassifier.set("sources")
}

afterEvaluate {
publishing {
publications {
create<MavenPublication>("release") {
from(components.getByName("release"))
artifact(sourcesJar)
val VERSION_NAME: String by project
val mavenCentralRepositoryUsername: String by project
val mavenCentralRepositoryPassword: String by project

groupId = artifactGroup
artifactId = artifactName
version = artifactVersion
publishing {
repositories {
withType<MavenArtifactRepository> {
if (name == "local") {
return@withType
}
}
}

bintray {
user = project.findProperty("bintrayUser").toString()
key = project.findProperty("bintrayKey").toString()
publish = true
override = true
val releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"

setPublications("release")

pkg.apply {
repo = "maven"
name = "compose-material-dialogs:$artifactName"
url = if (VERSION_NAME.endsWith("SNAPSHOT")) {
uri(snapshotsRepoUrl)
} else {
uri(releasesRepoUrl)
}

version.apply {
name = artifactVersion
released = Date().toString()
vcsTag = artifactVersion
credentials {
username = mavenCentralRepositoryUsername
password = mavenCentralRepositoryPassword
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions color/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
POM_ARTIFACT_ID=color
POM_NAME=Compose Material Dialog Color Picker
58 changes: 20 additions & 38 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import java.util.Date

plugins {
id("common-library")
}
Expand Down Expand Up @@ -41,46 +39,30 @@ dependencies {
implementation(kotlin("stdlib-jdk8"))
}

val artifactName = "core"
val artifactGroup = "com.vanpra.compose-material-dialogs"
val artifactVersion = Dependencies.ComposeMaterialDialogs.version

val sourcesJar by tasks.creating(Jar::class) {
from(android.sourceSets.getByName("main").java.srcDirs)
archiveClassifier.set("sources")
}

afterEvaluate {
publishing {
publications {
create<MavenPublication>("release") {
from(components.getByName("release"))
artifact(sourcesJar)
val VERSION_NAME: String by project
val mavenCentralRepositoryUsername: String by project
val mavenCentralRepositoryPassword: String by project

groupId = artifactGroup
artifactId = artifactName
version = artifactVersion
publishing {
repositories {
withType<MavenArtifactRepository> {
if (name == "local") {
return@withType
}
}
}
}

bintray {
user = project.findProperty("bintrayUser").toString()
key = project.findProperty("bintrayKey").toString()
publish = true
override = true

setPublications("release")
val releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"

pkg.apply {
repo = "maven"
name = "compose-material-dialogs:$artifactName"
url = if (VERSION_NAME.endsWith("SNAPSHOT")) {
uri(snapshotsRepoUrl)
} else {
uri(releasesRepoUrl)
}

version.apply {
name = artifactVersion
released = Date().toString()
vcsTag = artifactVersion
credentials {
username = mavenCentralRepositoryUsername
password = mavenCentralRepositoryPassword
}
}
}
}
}
2 changes: 2 additions & 0 deletions core/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
POM_ARTIFACT_ID=core
POM_NAME=Compose Material Dialog Core
54 changes: 18 additions & 36 deletions datetime/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import java.util.*

plugins {
id("common-library")
}
Expand Down Expand Up @@ -45,45 +43,29 @@ dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5")
}

val artifactName = "datetime"
val artifactGroup = "com.vanpra.compose-material-dialogs"
val artifactVersion = Dependencies.ComposeMaterialDialogs.version

val sourcesJar by tasks.creating(Jar::class) {
from(android.sourceSets.getByName("main").java.srcDirs)
archiveClassifier.set("sources")
}

afterEvaluate {
publishing {
publications {
create<MavenPublication>("release") {
from(components.getByName("release"))
artifact(sourcesJar)
val VERSION_NAME: String by project
val mavenCentralRepositoryUsername: String by project
val mavenCentralRepositoryPassword: String by project

groupId = artifactGroup
artifactId = artifactName
version = artifactVersion
publishing {
repositories {
withType<MavenArtifactRepository> {
if (name == "local") {
return@withType
}
}
}

bintray {
user = project.findProperty("bintrayUser").toString()
key = project.findProperty("bintrayKey").toString()
publish = true
override = true
val releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"

setPublications("release")

pkg.apply {
repo = "maven"
name = "compose-material-dialogs:$artifactName"
url = if (VERSION_NAME.endsWith("SNAPSHOT")) {
uri(snapshotsRepoUrl)
} else {
uri(releasesRepoUrl)
}

version.apply {
name = artifactVersion
released = Date().toString()
vcsTag = artifactVersion
credentials {
username = mavenCentralRepositoryUsername
password = mavenCentralRepositoryPassword
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions datetime/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
POM_ARTIFACT_ID=datetime
POM_NAME=Compose Material Dialog Date and Time Pickers
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ private data class SelectedOffset(
* @param colors see [TimePickerColors]
* @param waitForPositiveButton if true the [onComplete] callback will only be called when the
* positive button is pressed, otherwise it will be called on every input change
* @param minimumTime any time between 00:00 and this time will be disabled
* @param maximumTime any time between 23:59 and this time will be disabled
* @param is24HourClock uses the 24 hour clock face when true
* @param onComplete callback with a LocalTime object when the user completes their input
*/
@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import com.vanpra.composematerialdialogs.datetime.util.isAM
import com.vanpra.composematerialdialogs.datetime.util.simpleHour
import java.time.LocalTime

internal enum class ClockScreen {
Expand Down
Loading

0 comments on commit ffe2c8b

Please sign in to comment.