Skip to content

Commit

Permalink
Merge branch 'release/0.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Brabenetz committed Aug 3, 2021
2 parents 91599fa + 1925803 commit 4c70f27
Show file tree
Hide file tree
Showing 30 changed files with 153 additions and 83 deletions.
25 changes: 17 additions & 8 deletions ChoiceSDK/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,30 @@ buildscript {
}
project.ext.buildNumber = buildNumber

project.ext.sdkVersionName = "0.2.0"
project.ext.sdkVersionName = "0.3.0"
project.ext.appVersionName = "${project.sdkVersionName}.${project.buildNumber}"
project.ext.versionCode = 8
project.ext.versionCode = 9
project.ext.groupId = "at.bluesource.choicesdk"

ext.kotlin_version = "1.5.20"
ext.kotlin_version = "1.5.21"
ext.coroutines_version = "1.5.1"
ext.ktlint_version = "0.42.0"
ext.core_ktx_version = "1.6.0"
ext.rxjava_version = "3.0.13"
ext.rxandroid_version = "3.0.0"
ext.rxrelay_version = "3.0.1"

ext.firebase_bom_version = "28.3.0"

repositories {
google()
jcenter()
maven { url 'http://developer.huawei.com/repo/' }
gradlePluginPortal()

maven { url 'https://developer.huawei.com/repo/' }
}

dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.android.tools.build:gradle:7.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

classpath 'com.jaredsburrows:gradle-license-plugin:0.8.80'
Expand All @@ -45,9 +54,9 @@ plugins {
allprojects {
repositories {
google()
jcenter()
gradlePluginPortal()

maven { url 'http://developer.huawei.com/repo/' }
maven { url 'https://developer.huawei.com/repo/' }

maven {
name "Gitlab"
Expand Down
15 changes: 7 additions & 8 deletions ChoiceSDK/choicesdk-analytics/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ android {
minSdkVersion 19
targetSdkVersion 29

versionName project.sdkVersionName
versionCode project.versionCode

consumerProguardFiles "consumer-rules.pro"
}

resourcePrefix 'choicesdk'

buildTypes {
release {
minifyEnabled false
Expand All @@ -47,20 +46,20 @@ android {
dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.6.0'
implementation "androidx.core:core-ktx:$core_ktx_version"

// RX
api 'io.reactivex.rxjava3:rxjava:3.0.13'
api 'io.reactivex.rxjava3:rxandroid:3.0.0'
api "io.reactivex.rxjava3:rxjava:$rxjava_version"
api "io.reactivex.rxjava3:rxandroid:$rxandroid_version"

// RxRelay
implementation 'com.jakewharton.rxrelay3:rxrelay:3.0.0'
implementation "com.jakewharton.rxrelay3:rxrelay:$rxrelay_version"

// ChoiceSDK Core
api project(":choicesdk-core")

// GMS
implementation platform('com.google.firebase:firebase-bom:28.2.0')
implementation platform("com.google.firebase:firebase-bom:$firebase_bom_version")
implementation 'com.google.firebase:firebase-analytics-ktx'

// HMS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import at.bluesource.choicesdk.core.MobileServicesDetector

/**
* Analytics factory, uses [MobileServicesDetector] to get instance of [Analytics]
* Automatically decides if GMS or HMS should be used. GMS is always preferred first.
* Automatically decides if GMS or HMS should be used.
*
* Throws [UnsupportedOperationException] if no underlying api has been found.
*
Expand Down
6 changes: 3 additions & 3 deletions ChoiceSDK/choicesdk-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ android {
dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation "androidx.core:core-ktx:$core_ktx_version"
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.android.support:multidex:1.0.3'

Expand All @@ -105,7 +105,7 @@ dependencies {
implementation 'com.huawei.hms:maps:5.3.0.300'

// Coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"

// HTTP Lib
implementation "com.squareup.retrofit2:retrofit:2.9.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,22 @@ class BiometricsActivity : AppCompatActivity() {
setContentView(R.layout.activity_biometrics)

val biometricManager = BiometricManager.from(this)
when (biometricManager.canAuthenticate()) {
when (biometricManager.canAuthenticate(BiometricManager.Authenticators.BIOMETRIC_WEAK)) {
BiometricManager.BIOMETRIC_SUCCESS ->
Log.d("ChoiceSdkApp", "App can authenticate using biometrics.")
BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE ->
Log.e("ChoiceSdkApp", "No biometric features available on this device.")
BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE ->
Log.e("ChoiceSdkApp", "Biometric features are currently unavailable.")
BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED ->
Log.e(
"ChoiceSdkApp", "The user hasn't associated " +
"any biometric credentials with their account."
)
Log.e("ChoiceSdkApp", "The user hasn't associated any biometric credentials with their account.")
BiometricManager.BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED ->
Log.e("ChoiceSdkApp", "Biometric security update required.")
BiometricManager.BIOMETRIC_ERROR_UNSUPPORTED ->
Log.e("ChoiceSdkApp", "Biometric error unsupported.")
BiometricManager.BIOMETRIC_STATUS_UNKNOWN ->
Log.e("ChoiceSdkApp", "Biometric status unknown.")

}


Expand Down
7 changes: 3 additions & 4 deletions ChoiceSDK/choicesdk-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ android {
minSdkVersion 19
targetSdkVersion 29

versionName project.sdkVersionName
versionCode project.versionCode

consumerProguardFiles "consumer-rules.pro"
}

resourcePrefix 'choicesdk'

buildTypes {
release {
minifyEnabled false
Expand All @@ -47,7 +46,7 @@ android {
dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.6.0'
implementation "androidx.core:core-ktx:$core_ktx_version"

// GMS
implementation 'com.google.android.gms:play-services-base:17.6.0'
Expand Down
13 changes: 6 additions & 7 deletions ChoiceSDK/choicesdk-location/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ android {
minSdkVersion 19
targetSdkVersion 29

versionName project.sdkVersionName
versionCode project.versionCode

consumerProguardFiles "consumer-rules.pro"
}

resourcePrefix 'choicesdk'

buildTypes {
release {
minifyEnabled false
Expand All @@ -47,14 +46,14 @@ android {
dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.6.0'
implementation "androidx.core:core-ktx:$core_ktx_version"

// RX
api 'io.reactivex.rxjava3:rxjava:3.0.13'
api 'io.reactivex.rxjava3:rxandroid:3.0.0'
api "io.reactivex.rxjava3:rxjava:$rxjava_version"
api "io.reactivex.rxjava3:rxandroid:$rxandroid_version"

// RxRelay3
implementation 'com.jakewharton.rxrelay3:rxrelay:3.0.0'
implementation "com.jakewharton.rxrelay3:rxrelay:$rxrelay_version"

// ChoiceSDK Core
api project(":choicesdk-core")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import at.bluesource.choicesdk.location.hms.HmsFusedLocationProviderClient

/**
* FusedLocationProvider factory, uses [MobileServicesDetector] to get instance of [FusedLocationProviderClient]
* Automatically decides if GMS or HMS should be used. GMS is always preferred first.
* Automatically decides if GMS or HMS should be used.
*
* Throws [UnsupportedOperationException] if no underlying api has been found.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.google.android.gms.location.LocationServices

/**
* SettingsClient factory, uses [MobileServicesDetector] to get instance of [SettingsClient]
* Automatically decides if GMS or HMS should be used. GMS is always preferred first.
* Automatically decides if GMS or HMS should be used.
*
* Throws [UnsupportedOperationException] if no underlying api has been found.
*
Expand Down
14 changes: 7 additions & 7 deletions ChoiceSDK/choicesdk-maps/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'kotlin-parcelize'
id 'org.jetbrains.dokka'
}

Expand All @@ -15,12 +16,11 @@ android {
minSdkVersion 19
targetSdkVersion 29

versionName project.sdkVersionName
versionCode project.versionCode

consumerProguardFiles "consumer-rules.pro"
}

resourcePrefix 'choicesdk'

buildTypes {
release {
minifyEnabled false
Expand All @@ -47,14 +47,14 @@ android {
dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.6.0'
implementation "androidx.core:core-ktx:$core_ktx_version"

// RX
api 'io.reactivex.rxjava3:rxjava:3.0.13'
api 'io.reactivex.rxjava3:rxandroid:3.0.0'
api "io.reactivex.rxjava3:rxjava:$rxjava_version"
api "io.reactivex.rxjava3:rxandroid:$rxandroid_version"

// RxRelay
implementation 'com.jakewharton.rxrelay3:rxrelay:3.0.0'
implementation "com.jakewharton.rxrelay3:rxrelay:$rxrelay_version"

// ChoiceSDK Core
api project(":choicesdk-core")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ import io.reactivex.rxjava3.disposables.CompositeDisposable
* @see com.google.android.gms.maps.SupportMapFragment
* @see com.huawei.hms.maps.SupportMapFragment
*/
open class MapFragment(
private val options: MapOptions?
) : Fragment() {
open class MapFragment : Fragment() {

private val disposables = CompositeDisposable()

Expand All @@ -46,6 +44,8 @@ open class MapFragment(
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

val options: MapOptions? = arguments?.getParcelable(ARG_MAP_OPTIONS)

val mapFragment: Fragment = when (MobileServicesDetector.getAvailableMobileService()) {
MobileService.GMS -> {
val instance = if (options == null) {
Expand Down Expand Up @@ -92,7 +92,7 @@ open class MapFragment(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
return inflater.inflate(R.layout.fragment_map, container, false)
return inflater.inflate(R.layout.choicesdk_fragment_map, container, false)
}

override fun onDestroy() {
Expand All @@ -102,14 +102,20 @@ open class MapFragment(

companion object {

private const val ARG_MAP_OPTIONS = "ARG_MAP_OPTIONS"

@JvmStatic
fun newInstance(): MapFragment {
return newInstance(null)
}

@JvmStatic
fun newInstance(options: MapOptions? = null): MapFragment {
return MapFragment(options)
return MapFragment().apply {
arguments = Bundle().apply {
putParcelable(ARG_MAP_OPTIONS, options)
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package at.bluesource.choicesdk.maps.common

import android.os.Parcelable
import at.bluesource.choicesdk.core.MobileService
import at.bluesource.choicesdk.core.MobileServicesDetector
import at.bluesource.choicesdk.maps.gms.GmsMapOptionsFactory
import at.bluesource.choicesdk.maps.hms.HmsMapOptionsFactory
import com.google.android.gms.maps.GoogleMapOptions
import com.huawei.hms.maps.HuaweiMapOptions

interface MapOptions {
interface MapOptions : Parcelable {

val liteMode: Boolean?
val mapToolbarEnabled: Boolean?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package at.bluesource.choicesdk.maps.common

import at.bluesource.choicesdk.maps.factory.TileProviderFactory
import at.bluesource.choicesdk.maps.gms.GmsTileProvider
import at.bluesource.choicesdk.maps.hms.HmsTileProvider

Expand All @@ -20,6 +21,10 @@ fun interface TileProvider {
@JvmStatic
fun noTile(): Tile = Tile.getFactory().create(-1, -1, null)

fun create(getTile: (x: Int, y: Int, zoom: Int) -> Tile?): TileProvider {
return TileProviderFactory.getTileProvider(getTile)
}

@JvmStatic
fun com.google.android.gms.maps.model.TileProvider.toChoiceTileProvider(): TileProvider {
return GmsTileProvider(this@toChoiceTileProvider)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import at.bluesource.choicesdk.maps.hms.HmsBitmapDescriptorFactory

/**
* BitmapDescriptorFactory factory, uses [MobileServicesDetector] to get instance of [BitmapDescriptorFactory]
* Automatically decides if GMS or HMS should be used. GMS is always preferred first.
* Automatically decides if GMS or HMS should be used.
*
* Throws [UnsupportedOperationException] if no underlying api has been found.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import at.bluesource.choicesdk.maps.hms.HmsGroundOverlayOptions

/**
* GroundOverlayOptions factory, uses [MobileServicesDetector] to get instance of [GroundOverlayOptions]
* Automatically decides if GMS or HMS should be used. GMS is always preferred first.
* Automatically decides if GMS or HMS should be used.
*
* Throws [UnsupportedOperationException] if no underlying api has been found.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import at.bluesource.choicesdk.maps.hms.HmsMarkerOptions

/**
* MarkerOptions factory, uses [MobileServicesDetector] to get instance of [MarkerOptions]
* Automatically decides if GMS or HMS should be used. GMS is always preferred first.
* Automatically decides if GMS or HMS should be used.
*
* Throws [UnsupportedOperationException] if no underlying api has been found.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import at.bluesource.choicesdk.maps.hms.HmsTileOverlayOptions

/**
* TileOverlayOptions factory, uses [MobileServicesDetector] to get instance of [TileOverlayOptions]
* Automatically decides if GMS or HMS should be used. GMS is always preferred first.
* Automatically decides if GMS or HMS should be used.
*
* Throws [UnsupportedOperationException] if no underlying api has been found.
*
Expand Down
Loading

0 comments on commit 4c70f27

Please sign in to comment.