Skip to content

Commit

Permalink
Merge pull request #14 from what3words/dev
Browse files Browse the repository at this point in the history
1.0.3
  • Loading branch information
mani-apps authored Jul 25, 2023
2 parents 1217062 + ffdbed1 commit 2a3c1f1
Show file tree
Hide file tree
Showing 12 changed files with 210 additions and 141 deletions.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1
orbs:
gradle: circleci/gradle@2.2.0
android: circleci/android@1.0
android: circleci/android@2.2.0

jobs:
# build-ui-test:
Expand Down Expand Up @@ -29,6 +29,7 @@ jobs:
executor:
name: android/android-machine
resource-class: large
tag: 2023.05.1
steps:
- checkout
- restore_cache:
Expand Down Expand Up @@ -63,6 +64,7 @@ jobs:
executor:
name: android/android-machine
resource-class: large
tag: 2023.05.1
steps:
- checkout
- restore_cache:
Expand Down
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
buildscript {
ext {
compose_version = '1.2.1'
compose_version = '1.4.3'
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.2"
classpath "org.jlleitschuh.gradle:ktlint-gradle:10.1.0"
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.3"
}
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
id 'com.android.application' version '8.0.2' apply false
id 'com.android.library' version '8.0.2' apply false
id 'org.jetbrains.kotlin.android' version '1.8.20' apply false
}

apply from: 'sonarqube.gradle'
Expand Down
14 changes: 7 additions & 7 deletions design-library-usage-sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ android {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion "1.3.1"
kotlinCompilerExtensionVersion '1.4.6'
}
packagingOptions {
resources {
Expand All @@ -63,17 +63,17 @@ android {

dependencies {
implementation project(":design-library")
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.core:core-ktx:1.10.1'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.navigation:navigation-compose:2.4.0-alpha04"
implementation "androidx.navigation:navigation-compose:2.6.0"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
implementation 'androidx.activity:activity-compose:1.3.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
implementation 'androidx.activity:activity-compose:1.7.2'
implementation "androidx.constraintlayout:constraintlayout-compose:1.0.1"
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
Expand Down
127 changes: 66 additions & 61 deletions design-library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,62 +1,67 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.dokka' version '1.5.0'
id 'maven-publish'
id 'signing'
}

apply from: 'maven-push.gradle'
apply from: '../jacoco.gradle'

android {
compileSdk 33

defaultConfig {
minSdk 24
targetSdk 33

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

buildFeatures {
compose true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
composeOptions {
kotlinCompilerExtensionVersion "1.3.1"
}
namespace 'com.what3words.design.library'
}

dependencies {

implementation 'androidx.core:core-ktx:1.7.0'
implementation 'com.google.android.material:material:1.6.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation "androidx.constraintlayout:constraintlayout-compose:1.0.1"
debugImplementation "androidx.customview:customview:1.2.0-alpha02"
debugImplementation "androidx.customview:customview-poolingcontainer:1.0.0"
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.dokka' version '1.5.0'
id 'maven-publish'
id 'signing'
}

apply from: 'maven-push.gradle'
apply from: '../jacoco.gradle'

android {
compileSdk 33

defaultConfig {
minSdk 24
targetSdk 33

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

buildFeatures {
compose true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
composeOptions {
kotlinCompilerExtensionVersion '1.4.6'
}
publishing {
singleVariant('release') {
withSourcesJar()
withJavadocJar()
}
}
namespace 'com.what3words.design.library'
}

dependencies {

implementation 'androidx.core:core-ktx:1.10.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation "androidx.constraintlayout:constraintlayout-compose:1.0.1"
debugImplementation "androidx.customview:customview:1.2.0-alpha02"
debugImplementation "androidx.customview:customview-poolingcontainer:1.0.0"
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
}
17 changes: 1 addition & 16 deletions design-library/maven-push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,7 @@ def ossrhUsername = findProperty('OSSRH_USERNAME')
def ossrhPassword = findProperty('OSSRH_PASSWORD')
def signingKey = findProperty('SIGNING_KEY')
def signingKeyPwd = findProperty('SIGNING_KEY_PWD')
def libVersion = findProperty('LIBRARY_VERSION') ? findProperty('LIBRARY_VERSION') : "3.0.1"

task androidSourcesJar(type: Jar) {
archiveClassifier.convention('sources')
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
}

task androidJavadocsJar(type: Jar, dependsOn: dokkaJavadoc) {
archiveClassifier.convention('javadoc')
archiveClassifier.set('javadoc')
from "$buildDir/dokka"
}
def libVersion = findProperty('LIBRARY_VERSION') ? findProperty('LIBRARY_VERSION') : "1.0.3"

afterEvaluate {
publishing {
Expand All @@ -26,9 +14,6 @@ afterEvaluate {
artifactId = "w3w-android-design-library"
version = libVersion

artifact androidSourcesJar
artifact androidJavadocsJar

pom {
name = "w3w-android-components"
description = 'Android library for what3words REST API.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ fun FilledIconButton(
enabled: Boolean = true,
backgroundColor: Color = W3WTheme.colors.buttonPrimary,
backgroundRipple: Color = W3WTheme.colors.buttonPrimaryVariant,
textColor: Color = W3WTheme.colors.onButtonPrimary
textColor: Color = W3WTheme.colors.onButtonPrimary,
iconContentDescription: String? = null
) =
IconButton(
icon = icon,
Expand All @@ -77,6 +78,7 @@ fun FilledIconButton(
onClick = onClick,
modifier = modifier,
enabled = enabled,
iconContentDescription = iconContentDescription
)

/**
Expand All @@ -87,6 +89,7 @@ fun FilledIconButton(
* @param onClick the [GhostFilledIconButton] click event.
* @param modifier the modifier to be applied to the layout.
* @param enabled set [GhostFilledIconButton] enabled status, if disabled [onClick] won't be triggered.
* @param iconContentDescription String resource.
*/
@Composable
fun GhostFilledIconButton(
Expand All @@ -98,6 +101,7 @@ fun GhostFilledIconButton(
backgroundColor: Color = W3WTheme.colors.buttonOutline,
backgroundRipple: Color = W3WTheme.colors.buttonOutlineVariant,
textColor: Color = W3WTheme.colors.onButtonOutline,
iconContentDescription: String? = null
) =
IconButton(
icon = icon,
Expand All @@ -108,6 +112,7 @@ fun GhostFilledIconButton(
onClick = onClick,
modifier = modifier,
enabled = enabled,
iconContentDescription = iconContentDescription
)

/**
Expand All @@ -129,6 +134,7 @@ fun OutlinedIconButton(
backgroundColor: Color = W3WTheme.colors.buttonText,
backgroundRipple: Color = W3WTheme.colors.buttonTextVariant,
textColor: Color = W3WTheme.colors.onButtonText,
iconContentDescription: String? = null
) =
IconButton(
icon = icon,
Expand All @@ -139,6 +145,7 @@ fun OutlinedIconButton(
onClick = onClick,
modifier = modifier,
enabled = enabled,
iconContentDescription = iconContentDescription
)


Expand All @@ -152,8 +159,9 @@ private fun IconButton(
textColor: Color,
onClick: () -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true
) {
enabled: Boolean = true,
iconContentDescription: String? = null
) {
var backgroundColorState by remember { mutableStateOf(backgroundColor) }

Box(modifier = modifier
Expand Down Expand Up @@ -190,7 +198,7 @@ private fun IconButton(
.fillMaxSize()
.padding(buttonSize.toPadding()),
painter = icon,
contentDescription = null,
contentDescription = iconContentDescription,
tint = textColor
)
}
Expand Down
Loading

0 comments on commit 2a3c1f1

Please sign in to comment.