Skip to content

Commit

Permalink
Merge pull request #82 from what3words/staging
Browse files Browse the repository at this point in the history
3.2.5
  • Loading branch information
mani-apps authored Sep 24, 2024
2 parents ebd7b7f + 4b2c60a commit d3325e3
Show file tree
Hide file tree
Showing 25 changed files with 513 additions and 499 deletions.
35 changes: 18 additions & 17 deletions .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@2.1.2
android: circleci/android@2.3.0

jobs:
build-ui-test:
Expand All @@ -12,7 +12,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "lib/build.gradle" }}
key: jars-{{ checksum "build.gradle.kts" }}-{{ checksum "lib/build.gradle.kts" }}
- android/create-avd:
avd-name: testDevice
system-image: system-images;android-30;google_apis;x86
Expand All @@ -23,7 +23,7 @@ jobs:
restore-gradle-cache-prefix: v1a
post-emulator-launch-assemble-command: echo "Emulator Started"
- android/run-tests:
test-command: ./gradlew testing:jacocoTestReport
test-command: ./gradlew testing:connectedDebugAndroidTest
max-tries: 5
- store_test_results:
path: testing/build/outputs/androidTest-results
Expand All @@ -37,7 +37,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "lib/build.gradle" }}
key: jars-{{ checksum "build.gradle.kts" }}-{{ checksum "lib/build.gradle.kts" }}
- run:
name: Set Up
command: |
Expand All @@ -46,26 +46,22 @@ jobs:
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "lib/build.gradle" }}
key: jars-{{ checksum "build.gradle.kts" }}-{{ checksum "lib/build.gradle.kts" }}
- run:
name: Run Tests
command: |
./gradlew lib:testDebugUnitTest
./gradlew lib:jacocoTestReport
- run:
name: Upload Coverage Report to SonarCloud
command: ./gradlew sonarqube
./gradlew lib:testDebugUnitTest
- store_test_results:
path: lib/build/test-results/testDebugUnitTest
deploy-to-sonatype:
docker:
- image: cimg/android:2023.05-browsers
environment:
JVM_OPTS: -Xmx3200m
executor:
name: android/android-machine
tag: 2023.05.1
resource-class: large
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "lib/build.gradle" }}
key: jars-{{ checksum "build.gradle.kts" }}-{{ checksum "lib/build.gradle.kts" }}
- run:
name: Set Up
command: |
Expand All @@ -74,7 +70,11 @@ jobs:
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "lib/build.gradle" }}
key: jars-{{ checksum "build.gradle.kts" }}-{{ checksum "lib/build.gradle.kts" }}
- run:
name: Snapshot Release Check
command: |
echo -e "\nIS_SNAPSHOT_RELEASE=$( [[ "${CIRCLE_BRANCH}" =~ ^epic.* ]] && echo true || echo false )" >> gradle.properties
- run:
name: Inject Maven signing key
command: |
Expand Down Expand Up @@ -104,4 +104,5 @@ workflows:
filters:
branches:
only:
- staging
- staging
- /^epic.*/
45 changes: 11 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# <img src="https://what3words.com/assets/images/w3w_square_red.png" width="64" height="64" alt="what3words">&nbsp;w3w-android-components

[![Maven Central](https://img.shields.io/maven-central/v/com.what3words/w3w-android-components)](https://central.sonatype.com/artifact/com.what3words/w3w-android-components)

### Android minumum SDK support
[![Generic badge](https://img.shields.io/badge/minSdk-23-green.svg)](https://developer.android.com/about/versions/marshmallow/android-6.0/)


An Android library to use the [what3words v3 API autosuggest](https://developer.what3words.com/public-api/docs#autosuggest).

<img src="https://github.com/what3words/w3w-android-components/blob/master/assets/components-1-new.gif" width=40% height=40%>

To obtain an API key, please visit [https://what3words.com/select-plan](https://what3words.com/select-plan) and sign up for an account.

## Installation

The artifact is available through [![Maven Central](https://img.shields.io/maven-central/v/com.what3words/w3w-android-components)](https://central.sonatype.com/artifact/com.what3words/w3w-android-components)

### Android minumum SDK support
[![Generic badge](https://img.shields.io/badge/minSdk-23-green.svg)](https://developer.android.com/about/versions/marshmallow/android-6.0/)

### Gradle

Expand All @@ -23,28 +24,15 @@ implementation 'com.what3words:w3w-android-components:3.2.3'

See the what3words public API [documentation](https://docs.what3words.com/api/v3/)

## Usage with Jetpack Compose
Checkout the W3WAutoSuggestEditText Compose port [readme](https://github.com/what3words/w3w-android-components/tree/master/compose-sample#readme) if you intend to use the W3WAutoSuggestComponent in Jetpack Compose.
## Sample using W3WAutoSuggestComponent in Compose and XML of the w3w-android-components library

## Usage with XML
[autosuggest-sample](https://github.com/what3words/w3w-android-samples/tree/main/autosuggest-sample)

AndroidManifest.xml
```xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yourpackage.yourapp">
## Sample voice only using W3WAutoSuggestVoice of the w3w-android-components library

<uses-permission android:name="android.permission.INTERNET" />
...
```

add this to build.gradle (app level)
```
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
```
[autosuggest-sample-voice](https://github.com/what3words/w3w-android-samples/tree/main/autosuggest-sample-voice)

## Usage

activity_main.xml
```xml
Expand Down Expand Up @@ -191,17 +179,6 @@ or
| toggleVoice | Will trigger the voice programmatically, in cases where the developer wants to start listening without user touching the screen. | ```toggleVoice()``` |
| microphone | Provides a custom Microphone setup for use by the autosuggest component if `voiceEnabled` is set to true. | ```microphone(recordingRate = 16000,encoding = AudioFormat.ENCODING_PCM_16BIT,channel = AudioFormat.CHANNEL_IN_MONO,audioSource = MediaRecorder.AudioSource.MIC)``` |
## Voice only:
If you want to use voice-only (no text input) please look at our **voice-sample** app in this repo for examples of how to use our **W3WAutoSuggestVoice component**.
## Advanced usage:
If you want to check different ways to use our component please look at our **advanced-sample** app in this repo for examples of how to use and customize our **W3WAutoSuggestText component**.
![alt text](https://github.com/what3words/w3w-android-components/blob/master/assets/screen_10.png?raw=true "Screenshot 10")
## Styles:
<img src="https://github.com/what3words/w3w-android-components/blob/master/assets/components-3-new.gif" width=35% height=35%>
Expand Down
Binary file removed assets/screen_1.png
Binary file not shown.
Binary file removed assets/screen_10.png
Binary file not shown.
Binary file removed assets/screen_11.png
Binary file not shown.
Binary file removed assets/screen_2.png
Binary file not shown.
Binary file removed assets/screen_3.png
Binary file not shown.
Binary file removed assets/screen_7.png
Binary file not shown.
Binary file removed assets/screen_8.png
Binary file not shown.
Binary file removed assets/screen_9.png
Binary file not shown.
70 changes: 0 additions & 70 deletions build.gradle

This file was deleted.

20 changes: 20 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
mavenCentral()
google()
maven(url = "https://plugins.gradle.org/m2/")
}
}

plugins {
id("org.jetbrains.kotlin.android") version "1.8.20" apply false
id("com.android.application") version "8.5.0" apply false
id("org.jlleitschuh.gradle.ktlint") version "10.1.0" apply true
id("com.autonomousapps.dependency-analysis") version "1.20.0" apply true
}

tasks.register<Delete>("clean").configure {
delete(rootProject.layout.buildDirectory)
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ android.useAndroidX=true
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
android.nonFinalResIds=false
LIBRARY_VERSION=3.2.5
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Nov 14 14:03:05 ICT 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
47 changes: 0 additions & 47 deletions jacoco.gradle

This file was deleted.

Loading

0 comments on commit d3325e3

Please sign in to comment.