diff --git a/.gitignore b/.gitignore index 3853974..a324d16 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,19 @@ +# +# Copyright 2020 Supasin Tatiyanupanwong +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + # Mac OS .DS_Store diff --git a/LICENSE b/LICENSE index 261eeb9..d645695 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,4 @@ + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ diff --git a/README.md b/README.md index f5f23ba..2055f3a 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,28 @@ # Map Kit -Abstraction wrapper that encapsulates Maps APIs of supported platforms for Android, allowing access to multiple Maps APIs while maintaining your application single codebase. +[![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.supasintatiyanupanwong.libraries.android.kits.maps/maps-core/badge.svg)](https://search.maven.org/search?q=g:dev.supasintatiyanupanwong.libraries.android.kits.maps) +[![javadoc](https://javadoc.io/badge2/dev.supasintatiyanupanwong.libraries.android.kits.maps/maps-core/javadoc.svg)](https://javadoc.io/doc/dev.supasintatiyanupanwong.libraries.android.kits.maps/maps-core) +[![license](https://img.shields.io/github/license/SupasinTatiyanupanwong/map-kit-android.svg)](https://www.apache.org/licenses/LICENSE-2.0) -Map Kit is currently providing support for Google Maps and Huawei Maps. +Map Kit is an abstraction wrapper that encapsulates Android's Maps APIs of Google Maps SDK for Android and HUAWEI Map Kit. -## Usage +## Architecture + +The library consists of 3 artifacts; `maps-core`, `maps-google`, and `maps-huawei`. -This project contains 3 artifacts; `maps-core`, `maps-google`, and `maps-huawei`. +`maps-core` artifact provides an abstraction interface to interact with Maps APIs. -`maps-core` artifact provides abstraction interface to interact with Maps APIs. +`maps-google` artifact provides the Google Maps SDK for Android integration to Map Kit. -`maps-google` artifact provides Google Maps integration. +`maps-huawei` artifact provides the HUAWEI Map Kit integration to Map Kit. -`maps-huawei` artifact provides Huawei Maps integration. +## Usage -### Migration from existing Maps APIs +### Migrating from the existing APIs -| Google Name | Huawei Name | Map Kit Name | +| Google Maps SDK for Android | HUAWEI Map Kit | Map Kit | |:--------------------------------- |:------------------------- |:------------------------------------------------------------ | -| ``com.google.android.gms.maps.*`` | ``com.huawei.hms.maps.*`` | ``me.tatiyanupanwong.supasin.android.libraries.kits.maps.*`` | +| ``com.google.android.gms.maps.*`` | ``com.huawei.hms.maps.*`` | ``dev.supasintatiyanupanwong.libraries.android.kits.maps.*`` | | ``GoogleMap`` | ``HuaweiMap`` | ``MapClient`` | | ``new LatLng()`` | ``new LatLng()`` | ``MapKit.newLatLng()`` | | ``new *Options()`` | ``new *Options()`` | ``MapKit.new*Options()`` | @@ -26,25 +30,23 @@ This project contains 3 artifacts; `maps-core`, `maps-google`, and `maps-huawei` | ``*Factory.*()`` | ``*Factory.*()`` | ``MapKit.get*Factory().*()`` | | ``Tile.NO_TILE`` | ``Tile.NO_TILE`` | ``MapKit.noTile()`` | -### Limitations - -1. Models are currently not `Parcelable`. -2. `*MapOptions` is currently not supported. -3. Google's `StreetView` is currently not supported. +### Limitation -### Additional documentation +* Models are not `Parcelable`. +* `MapOptions` is currently not supported. +* `StreetView` is currently not supported. -* [Maps SDK for Android - Google Developer](https://developers.google.com/maps/documentation/android-sdk/intro) -* [Map Kit - HMS Core - HUAWEI Developer](https://developer.huawei.com/consumer/en/hms/huawei-MapKit) +## Declaring dependencies -## Download - -Add the following to your Gradle build file: +Add the dependencies for the artifacts you need in the `build.gradle` file for your app or module: ```groovy dependencies { - implementation 'me.tatiyanupanwong.supasin.android.libraries.kits.maps:maps-google:1.2.2' - implementation 'me.tatiyanupanwong.supasin.android.libraries.kits.maps:maps-huawei:1.2.2' + // To use the Google Maps SDK for Android via Map Kit + implementation 'dev.supasintatiyanupanwong.libraries.android.kits.maps:maps-google:2.0.0' + + // To use the HUAWEI Map Kit via Map Kit + implementation 'dev.supasintatiyanupanwong.libraries.android.kits.maps:maps-huawei:2.0.0' } ``` @@ -54,7 +56,7 @@ However, it is recommended to separate builds between them as next: ```groovy android { - ... + // ... flavorDimensions 'vendor' productFlavors { google @@ -74,31 +76,35 @@ configurations { } dependencies { - google 'me.tatiyanupanwong.supasin.android.libraries.kits.maps:maps-google:1.2.2' - huawei 'me.tatiyanupanwong.supasin.android.libraries.kits.maps:maps-huawei:1.2.2' + google 'dev.supasintatiyanupanwong.libraries.android.kits.maps:maps-google:2.0.0' + huawei 'dev.supasintatiyanupanwong.libraries.android.kits.maps:maps-huawei:2.0.0' } ``` -`maps-core` may be used to provides Maps APIs interaction if needed, e.g. to pass `LatLng` object to different module. +But, make sure to have one of the integration artifacts included in your final build, otherwise an exception will be thrown at runtime. -```groovy -dependencies { - implementation 'me.tatiyanupanwong.supasin.android.libraries.kits.maps:maps-core:1.2.1' -} -``` +For more information about dependencies, see [Add build dependencies](https://developer.android.com/studio/build/dependencies). + +## Additional documentation + +* [Maps SDK for Android - Google Developer](https://developers.google.com/maps/documentation/android-sdk/intro) +* [Map Kit - HMS Core - HUAWEI Developer](https://developer.huawei.com/consumer/en/hms/huawei-MapKit) + +## Feedback -However, make sure to have one of integration artifacts included in your final build, otherwise an exception will be thrown. +Your feedback helps make Map Kit better. Let us know if you discover new issues or have ideas for improving this library. +Please take a look at the [existing issues](https://github.com/SupasinTatiyanupanwong/map-kit-android/issues) in this library before you create a new one. ## License ``` -Copyright (C) 2020 Supasin Tatiyanupanwong +Copyright 2020 Supasin Tatiyanupanwong Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/build.gradle b/build.gradle index c899baa..1bd0945 100644 --- a/build.gradle +++ b/build.gradle @@ -1,14 +1,30 @@ +/* + * Copyright 2020 Supasin Tatiyanupanwong + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + buildscript { repositories { google() jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:4.0.1' + classpath 'com.android.tools.build:gradle:4.1.3' - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' - classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.vanniktech:gradle-maven-publish-plugin:0.13.0' } } @@ -19,24 +35,6 @@ allprojects { } } -ext { - BINTRAY_REPOSITORY = 'android.libraries.kits.maps' - BINTRAY_LICENSES = ["Apache-2.0"] - - POM_GROUP_ID = 'me.tatiyanupanwong.supasin.android.libraries.kits.maps' - - POM_URL = 'https://github.com/SupasinTatiyanupanwong/map-kit-android' - POM_SCM_URL = 'https://github.com/SupasinTatiyanupanwong/map-kit-android' - POM_SCM_CONNECTION = 'https://github.com/SupasinTatiyanupanwong/map-kit-android.git' - - POM_DEVELOPER_ID = 'supasintatiyanupanwong' - POM_DEVELOPER_NAME = 'Supasin Tatiyanupanwong' - POM_DEVELOPER_EMAIL = 'supasin@tatiyanupanwong.me' - - POM_LICENCE_NAME = 'Apache License 2.0' - POM_LICENCE_URL = 'http://www.apache.org/licenses/LICENSE-2.0' -} - task clean(type: Delete) { delete rootProject.buildDir } diff --git a/gradle.properties b/gradle.properties index 015c76e..5ba123c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,39 @@ +# +# Copyright 2020 Supasin Tatiyanupanwong +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + org.gradle.jvmargs=-Xmx1536m +# Declare we support AndroidX android.useAndroidX=true +# Automatically convert third-party libraries to use AndroidX android.enableJetifier=true + +GROUP=dev.supasintatiyanupanwong.libraries.android.kits.maps + +POM_INCEPTION_YEAR=2020 + +POM_URL=https://github.com/SupasinTatiyanupanwong/map-kit-android/ +POM_SCM_URL=https://github.com/SupasinTatiyanupanwong/map-kit-android/ +POM_SCM_CONNECTION=scm:git:git://github.com/SupasinTatiyanupanwong/map-kit-android.git +POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/SupasinTatiyanupanwong/map-kit-android.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo + +POM_DEVELOPER_ID=supasintatiyanupanwong +POM_DEVELOPER_NAME=Supasin Tatiyanupanwong +POM_DEVELOPER_URL=https://github.com/SupasinTatiyanupanwong/ diff --git a/gradle/bintray.gradle b/gradle/bintray.gradle deleted file mode 100644 index 5b43c25..0000000 --- a/gradle/bintray.gradle +++ /dev/null @@ -1,50 +0,0 @@ -apply plugin: 'com.jfrog.bintray' - -version = POM_VERSION - -if (project.hasProperty("android")) { - // Android libraries - task sourcesJar(type: Jar) { - archiveClassifier.set('sources') - from android.sourceSets.main.java.srcDirs - } - - task javadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) - } -} else { - // Java libraries - task sourcesJar(type: Jar, dependsOn: classes) { - archiveClassifier.set('sources') - from sourceSets.main.allSource - } -} - -task javadocJar(type: Jar, dependsOn: javadoc) { - archiveClassifier.set('javadoc') - from javadoc.destinationDir -} - -artifacts { - archives javadocJar - archives sourcesJar -} - -// Bintray -bintray { - user = System.getenv('BINTRAY_USER') - key = System.getenv('BINTRAY_KEY') - - configurations = ['archives'] - pkg { - repo = BINTRAY_REPOSITORY - name = POM_ARTIFACT_ID - desc = POM_DESCRIPTION - websiteUrl = POM_SCM_URL - vcsUrl = POM_SCM_CONNECTION - licenses = BINTRAY_LICENSES - publish = true - publicDownloadNumbers = true - } -} diff --git a/gradle/install.gradle b/gradle/install.gradle deleted file mode 100644 index 5927177..0000000 --- a/gradle/install.gradle +++ /dev/null @@ -1,38 +0,0 @@ -apply plugin: 'com.github.dcendents.android-maven' - -group = POM_GROUP_ID // Maven Group ID for the artifact - -install { - repositories.mavenInstaller { - pom { - project { - packaging 'aar' - groupId POM_GROUP_ID - artifactId POM_ARTIFACT_ID - - name POM_NAME - description POM_DESCRIPTION - url POM_URL - - licenses { - license { - name POM_LICENCE_NAME - url POM_LICENCE_URL - } - } - developers { - developer { - id POM_DEVELOPER_ID - name POM_DEVELOPER_NAME - email POM_DEVELOPER_EMAIL - } - } - scm { - connection POM_SCM_CONNECTION - developerConnection POM_SCM_CONNECTION - url POM_SCM_URL - } - } - } - } -} diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2f3e879..3012fc6 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,3 +1,19 @@ +# +# Copyright 2020 Supasin Tatiyanupanwong +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + #Wed Jun 10 20:05:43 ICT 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists diff --git a/maps-core/build.gradle b/maps-core/build.gradle index 1c9ea11..dd25949 100644 --- a/maps-core/build.gradle +++ b/maps-core/build.gradle @@ -1,29 +1,35 @@ +/* + * Copyright 2020 Supasin Tatiyanupanwong + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + apply plugin: 'com.android.library' +apply plugin: 'com.vanniktech.maven.publish' android { - compileSdkVersion 29 + compileSdkVersion 30 defaultConfig { minSdkVersion 19 - targetSdkVersion 29 + targetSdkVersion 30 } } dependencies { - api 'androidx.annotation:annotation:1.1.0' + api 'androidx.annotation:annotation:1.2.0' // Assuming that Fragment APIs is very stable and clients will use compatible version // Keeping version 1.0.0 to avoid Java 8 requirement and version conflicts api 'androidx.fragment:fragment:1.0.0' } - -ext { - POM_ARTIFACT_ID = 'maps-core' - - POM_NAME = 'Map Kit (Core)' - POM_DESCRIPTION = 'Encapsulates Maps APIs for Android.' - POM_VERSION = '1.2.1' -} - -apply from: rootProject.file("gradle/install.gradle") -apply from: rootProject.file("gradle/bintray.gradle") diff --git a/maps-core/gradle.properties b/maps-core/gradle.properties new file mode 100644 index 0000000..3165371 --- /dev/null +++ b/maps-core/gradle.properties @@ -0,0 +1,21 @@ +# +# Copyright 2021 Supasin Tatiyanupanwong +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +POM_ARTIFACT_ID=maps-core +POM_NAME=Map Kit (Core) +POM_DESCRIPTION=Library encapsulating Map APIs for Android. + +VERSION_NAME=2.0.0 diff --git a/maps-core/src/main/AndroidManifest.xml b/maps-core/src/main/AndroidManifest.xml index 2b22cf7..de763d7 100644 --- a/maps-core/src/main/AndroidManifest.xml +++ b/maps-core/src/main/AndroidManifest.xml @@ -1,22 +1,23 @@ + + package="dev.supasintatiyanupanwong.libraries.android.kits.maps"> * <fragment - * class="me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment" + * class="dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment" * android:layout_width="match_parent" * android:layout_height="match_parent" /> * @@ -59,9 +59,8 @@ public static MapFragment newInstance() { return new MapFragment(); } - @Nullable @Override - public final View onCreateView( + public final @NonNull View onCreateView( @NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { @@ -69,17 +68,14 @@ public final View onCreateView( } /** - * Sets a callback object which will be triggered when the {@link Map} instance is ready + * Sets a callback object which will be triggered when the {@link MapClient} instance is ready * to be used. * * @param callback The callback object that will be triggered when the map is ready to be used. - * @see #getMapAsync(MapKit.OnMapReadyCallback) - * @deprecated As of 1.2.0, use {@link #getMapAsync(MapKit.OnMapReadyCallback)} instead. + * @since 1.2.0 */ - @SuppressWarnings("deprecation") - @Deprecated @UiThread - public final void getMapAsync(final Map.Factory.OnMapReadyCallback callback) { + public final void getMapAsync(final MapKit.OnMapReadyCallback callback) { if (getView() != null) { getMapAsyncInternal(callback); } else { @@ -99,39 +95,20 @@ public void onFragmentViewCreated( } /** - * Sets a callback object which will be triggered when the {@link MapClient} instance is ready - * to be used. + * Sets a callback object which will be triggered when the map has undergone layout and the + * {@link MapClient} instance is ready to be used. * - * @param callback The callback object that will be triggered when the map is ready to be used. - * @since 1.2.0 + * @param callback The callback object that will be triggered when the map has undergone layout + * and ready to be used. */ - @UiThread - public final void getMapAsync(final MapKit.OnMapReadyCallback callback) { - if (getView() != null) { - getMapAsyncInternal(callback); - } else { - requireFragmentManager().registerFragmentLifecycleCallbacks( - new FragmentManager.FragmentLifecycleCallbacks() { - @Override - public void onFragmentViewCreated( - @NonNull FragmentManager fragmentManager, - @NonNull Fragment fragment, - @NonNull View view, - @Nullable Bundle savedInstanceState) { - fragmentManager.unregisterFragmentLifecycleCallbacks(this); - getMapAsyncInternal(callback); - } - }, false); - } + public final void getMapAsync(final MapKit.OnMapAndViewReadyCallback callback) { + getMapAsync(new OnMapAndViewReadyCallbackImpl(this, callback)); } /** - * @see #getMapAsyncInternal(MapKit.OnMapReadyCallback) - * @deprecated As of 1.2.0, use {@link #getMapAsyncInternal(MapKit.OnMapReadyCallback)} instead. + * @since 1.2.0 */ - @SuppressWarnings("deprecation") - @Deprecated - private void getMapAsyncInternal(Map.Factory.OnMapReadyCallback callback) { + private void getMapAsyncInternal(MapKit.OnMapReadyCallback callback) { Fragment fragment = getChildFragmentManager() .findFragmentById(MapsPlatform.get().getFragmentDelegateId()); @@ -142,18 +119,66 @@ private void getMapAsyncInternal(Map.Factory.OnMapReadyCallback callback) { MapsPlatform.get().getFactory().getMapAsync(fragment, callback); } - /** - * @since 1.2.0 - */ - private void getMapAsyncInternal(MapKit.OnMapReadyCallback callback) { - Fragment fragment = getChildFragmentManager() - .findFragmentById(MapsPlatform.get().getFragmentDelegateId()); - if (fragment == null) { - throw new NullPointerException(); + private static class OnMapAndViewReadyCallbackImpl implements + ViewTreeObserver.OnGlobalLayoutListener, + MapKit.OnMapReadyCallback { + private final MapFragment mMapFragment; + private final View mMapView; + private final MapKit.OnMapAndViewReadyCallback mDelegate; + + private boolean mIsViewReady; + private boolean mIsMapReady; + private MapClient mMap; + + public OnMapAndViewReadyCallbackImpl( + @NonNull MapFragment mapFragment, + @NonNull MapKit.OnMapAndViewReadyCallback delegate) { + mMapFragment = mapFragment; + mMapView = mapFragment.getView(); + mDelegate = delegate; + mIsViewReady = false; + mIsMapReady = false; + mMap = null; + + registerListeners(); } - MapsPlatform.get().getFactory().getMapAsync(fragment, callback); + + private void registerListeners() { + // View layout. + if ((mMapView.getWidth() != 0) && (mMapView.getHeight() != 0)) { + // View has already completed layout. + mIsViewReady = true; + } else { + // Map has not undergone layout, register a View observer. + mMapView.getViewTreeObserver().addOnGlobalLayoutListener(this); + } + + // Note if the MapClient is already ready it will still fire the callback later. + mMapFragment.getMapAsync(this); + } + + @Override + public final void onMapReady(@NonNull MapClient map) { + mMap = map; + mIsMapReady = true; + fireCallbackIfReady(); + } + + @Override + public final void onGlobalLayout() { + // Remove our listener. + mMapView.getViewTreeObserver().removeOnGlobalLayoutListener(this); + mIsViewReady = true; + fireCallbackIfReady(); + } + + private void fireCallbackIfReady() { + if (mIsViewReady && mIsMapReady) { + mDelegate.onMapAndViewReady(mMap); + } + } } } diff --git a/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/MapKit.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/MapKit.java new file mode 100644 index 0000000..20bcb62 --- /dev/null +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/MapKit.java @@ -0,0 +1,326 @@ +/* + * Copyright 2020 Supasin Tatiyanupanwong + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dev.supasintatiyanupanwong.libraries.android.kits.maps; + +import android.content.Context; + +import androidx.annotation.NonNull; +import androidx.annotation.RawRes; +import androidx.annotation.UiThread; + +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.BitmapDescriptor; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.ButtCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CameraPosition; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CameraUpdate; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Circle; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CustomCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Dash; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Dot; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Gap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.GroundOverlay; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLngBounds; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapFactory; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Marker; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Polygon; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Polyline; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.RoundCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.SquareCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Tile; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.TileOverlay; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.TileProvider; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.UrlTileProvider; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.VisibleRegion; + +/** + * The main entry point for Maps APIs. + * + * @since 1.0.0 + */ +public final class MapKit { + + private static final @NonNull MapFactory FACTORY = MapsPlatform.get().getFactory(); + + private MapKit() {} // No instances! + + + /** + * @since 1.2.0 + */ + public static @NonNull BitmapDescriptor.Factory getBitmapDescriptorFactory() { + return FACTORY.getBitmapDescriptorFactory(); + } + + /** + * @since 1.2.0 + */ + public static @NonNull ButtCap newButtCap() { + return FACTORY.newButtCap(); + } + + /** + * @since 1.2.0 + */ + public static @NonNull CameraUpdate.Factory getCameraUpdateFactory() { + return FACTORY.getCameraUpdateFactory(); + } + + /** + * @since 1.2.0 + */ + public static @NonNull CameraPosition newCameraPositionFromLatLngZoom( + @NonNull LatLng target, + float zoom) { + return FACTORY.newCameraPositionFromLatLngZoom(target, zoom); + } + + /** + * @since 1.2.0 + */ + public static @NonNull CameraPosition.Builder newCameraPositionBuilder() { + return FACTORY.newCameraPositionBuilder(); + } + + /** + * @since 1.2.0 + */ + public static @NonNull CameraPosition.Builder newCameraPositionBuilder( + @NonNull CameraPosition camera) { + return FACTORY.newCameraPositionBuilder(camera); + } + + /** + * @since 1.2.0 + */ + public static @NonNull Circle.Options newCircleOptions() { + return FACTORY.newCircleOptions(); + } + + /** + * @since 1.2.0 + */ + public static @NonNull CustomCap newCustomCap( + @NonNull BitmapDescriptor bitmapDescriptor, float refWidth) { + return FACTORY.newCustomCap(bitmapDescriptor, refWidth); + } + + /** + * @since 1.2.0 + */ + public static @NonNull CustomCap newCustomCap(@NonNull BitmapDescriptor bitmapDescriptor) { + return FACTORY.newCustomCap(bitmapDescriptor); + } + + /** + * @since 1.2.0 + */ + public static @NonNull Dot newDot() { + return FACTORY.newDot(); + } + + /** + * @since 1.2.0 + */ + public static @NonNull Dash newDash(float length) { + return FACTORY.newDash(length); + } + + /** + * @since 1.2.0 + */ + public static @NonNull Gap newGap(float length) { + return FACTORY.newGap(length); + } + + /** + * @since 1.2.0 + */ + public static @NonNull GroundOverlay.Options newGroundOverlayOptions() { + return FACTORY.newGroundOverlayOptions(); + } + + /** + * @since 1.2.0 + */ + public static @NonNull LatLng newLatLng(double latitude, double longitude) { + return FACTORY.newLatLng(latitude, longitude); + } + + /** + * @since 1.2.0 + */ + public static @NonNull LatLngBounds newLatLngBounds( + @NonNull LatLng southwest, @NonNull LatLng northeast) { + return FACTORY.newLatLngBounds(southwest, northeast); + } + + /** + * @since 1.2.0 + */ + public static @NonNull LatLngBounds.Builder newLatLngBoundsBuilder() { + return FACTORY.newLatLngBoundsBuilder(); + } + + /** + * @since 1.2.0 + */ + public static @NonNull MapClient.Style.Options newMapStyleOptions(String json) { + return FACTORY.newMapStyleOptions(json); + } + + /** + * @since 1.2.0 + */ + public static @NonNull MapClient.Style.Options newMapStyleOptions( + @NonNull Context context, @RawRes int resourceId) { + return FACTORY.newMapStyleOptions(context, resourceId); + } + + /** + * @since 1.2.0 + */ + public static @NonNull Marker.Options newMarkerOptions() { + return FACTORY.newMarkerOptions(); + } + + /** + * @since 1.2.0 + */ + public static @NonNull Polygon.Options newPolygonOptions() { + return FACTORY.newPolygonOptions(); + } + + /** + * @since 1.2.0 + */ + public static @NonNull Polyline.Options newPolylineOptions() { + return FACTORY.newPolylineOptions(); + } + + /** + * @since 1.2.0 + */ + public static @NonNull RoundCap newRoundCap() { + return FACTORY.newRoundCap(); + } + + /** + * @since 1.2.0 + */ + public static @NonNull SquareCap newSquareCap() { + return FACTORY.newSquareCap(); + } + + /** + * @since 1.2.0 + */ + public static @NonNull TileOverlay.Options newTileOverlayOptions() { + return FACTORY.newTileOverlayOptions(); + } + + /** + * @since 1.2.0 + */ + public static @NonNull Tile newTile(int width, int height, byte[] data) { + return FACTORY.newTile(width, height, data); + } + + /** + * @since 1.2.0 + */ + public static @NonNull Tile noTile() { + return FACTORY.noTile(); + } + + /** + * @since 1.2.0 + */ + public static @NonNull TileProvider newUrlTileProvider( + int width, + int height, + @NonNull UrlTileProvider tileProvider) { + return FACTORY.newUrlTileProvider(width, height, tileProvider); + } + + /** + * @since 1.2.0 + */ + public static @NonNull VisibleRegion newVisibleRegion( + LatLng nearLeft, + LatLng nearRight, + LatLng farLeft, + LatLng farRight, + LatLngBounds latLngBounds) { + return FACTORY.newVisibleRegion(nearLeft, nearRight, farLeft, farRight, latLngBounds); + } + + + /** + * Interface definition for a callback to be invoked when the map is ready to be used. + * + *

Once an instance of this interface is set on a {@link MapFragment} object, the {@link + * #onMapReady(MapClient)} method is triggered when the map is ready to be used and provides + * a non-null instance of {@link MapClient}. + * + * @since 1.2.0 + */ + public interface OnMapReadyCallback { + /** + * Called when the map is ready to be used. + * + *

Note that this does not guarantee that the map has undergone layout. Therefore, the + * map's size may not have been determined by the time the callback method is called. If + * you need to know the dimensions or call a method in the API that needs to know the + * dimensions, use {@link OnMapAndViewReadyCallback} instead which encapsulate the logic + * of {@code OnMapReadyCallback} and {@code View.OnGlobalLayoutListener}. + * + *

As an example, if you want to update the map's camera using a {@link LatLngBounds} + * without dimensions, there is a race condition that could trigger an {@link + * IllegalStateException} if the map has not undergone layout. + * + * @param map A non-null instance of a {@link MapClient} associated with the {@link + * MapFragment} that defines the callback. + */ + @UiThread + void onMapReady(@NonNull MapClient map); + } + + /** + * Interface definition for a callback to be invoked when the map has undergone layout and + * ready to be used. + * + *

Note that this is only necessary if a developer wishes to immediately invoke any method + * on the {@link MapClient} that also requires the View to have finished layout (ie. anything + * that needs to know the View's true size like snapshotting). + * + *

Once an instance of this interface is set on a {@link MapFragment} object, the {@link + * #onMapAndViewReady(MapClient)} method is triggered when the map has undergone layout and is + * ready to be used and provides a non-null instance of {@link MapClient}. + */ + public interface OnMapAndViewReadyCallback { + /** + * Called when the map has undergone layout and ready to be used. + * + * @param map A non-null instance of a {@link MapClient} associated with the {@link + * MapFragment} that defines the callback. + */ + @UiThread + void onMapAndViewReady(@NonNull MapClient map); + } + +} diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/MapKitInitProvider.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/MapKitInitProvider.java similarity index 80% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/MapKitInitProvider.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/MapKitInitProvider.java index 15b59da..a5c9a39 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/MapKitInitProvider.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/MapKitInitProvider.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps; +package dev.supasintatiyanupanwong.libraries.android.kits.maps; import android.content.ContentProvider; import android.content.ContentValues; @@ -40,9 +40,8 @@ public boolean onCreate() { return false; } - @Nullable @Override - public Cursor query( + public @Nullable Cursor query( @NonNull Uri uri, @Nullable String[] projection, @Nullable String selection, @@ -51,21 +50,21 @@ public Cursor query( return null; } - @Nullable @Override - public String getType(@NonNull Uri uri) { + public @Nullable String getType(@NonNull Uri uri) { return null; } - @Nullable @Override - public Uri insert(@NonNull Uri uri, @Nullable ContentValues values) { + public @Nullable Uri insert(@NonNull Uri uri, @Nullable ContentValues values) { return null; } @Override public int delete( - @NonNull Uri uri, @Nullable String selection, @Nullable String[] selectionArgs) { + @NonNull Uri uri, + @Nullable String selection, + @Nullable String[] selectionArgs) { return 0; } diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/MapsPlatform.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/MapsPlatform.java similarity index 76% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/MapsPlatform.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/MapsPlatform.java index 523d7b2..3147ed3 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/MapsPlatform.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/MapsPlatform.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps; +package dev.supasintatiyanupanwong.libraries.android.kits.maps; import android.content.Context; @@ -23,13 +23,15 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapFactory; +import java.util.Objects; + +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapFactory; abstract class MapsPlatform { private static MapsPlatform sPlatform; - static synchronized MapsPlatform get() { + static synchronized @NonNull MapsPlatform get() { return sPlatform; } @@ -38,8 +40,7 @@ static synchronized void init(@NonNull Context context) { } - @NonNull - abstract MapFactory getFactory(); + abstract @NonNull MapFactory getFactory(); @LayoutRes abstract int getFragmentLayoutId(); @@ -72,7 +73,7 @@ private static MapsPlatform findPlatform(@NonNull Context context) { private static final class AmazonMapsPlatform extends MapsPlatform { private static final String LIBRARY_PACKAGE_NAME = - "me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.amazon"; + "dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.amazon"; private static final String CLASS_NAME_LAYOUT_RES = LIBRARY_PACKAGE_NAME + ".R$layout"; @@ -88,9 +89,8 @@ private static final class AmazonMapsPlatform extends MapsPlatform { private AmazonMapsPlatform() {} - @NonNull @Override - MapFactory getFactory() { + @NonNull MapFactory getFactory() { return sFactory; } @@ -107,13 +107,13 @@ int getFragmentDelegateId() { } - @Nullable - static AmazonMapsPlatform buildIfSupported(@NonNull Context context) { + static @Nullable AmazonMapsPlatform buildIfSupported(@NonNull Context context) { try { - sFactory = (MapFactory) Class - .forName(LIBRARY_PACKAGE_NAME + ".model.AmazonMapFactory") - .getMethod("buildIfSupported", Context.class) - .invoke(null, context); + sFactory = Objects.requireNonNull( + (MapFactory) Class + .forName(LIBRARY_PACKAGE_NAME + ".model.AmazonMapFactory") + .getMethod("buildIfSupported", Context.class) + .invoke(null, context)); sFragmentLayoutId = Class.forName(CLASS_NAME_LAYOUT_RES) .getField(FIELD_NAME_LAYOUT_ID).getInt(null); @@ -130,7 +130,7 @@ static AmazonMapsPlatform buildIfSupported(@NonNull Context context) { private static final class GoogleMapsPlatform extends MapsPlatform { private static final String LIBRARY_PACKAGE_NAME = - "me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google"; + "dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google"; private static final String CLASS_NAME_LAYOUT_RES = LIBRARY_PACKAGE_NAME + ".R$layout"; @@ -146,9 +146,8 @@ private static final class GoogleMapsPlatform extends MapsPlatform { private GoogleMapsPlatform() {} - @NonNull @Override - MapFactory getFactory() { + @NonNull MapFactory getFactory() { return sFactory; } @@ -165,13 +164,13 @@ int getFragmentDelegateId() { } - @Nullable - static GoogleMapsPlatform buildIfSupported(@NonNull Context context) { + static @Nullable GoogleMapsPlatform buildIfSupported(@NonNull Context context) { try { - sFactory = (MapFactory) Class - .forName(LIBRARY_PACKAGE_NAME + ".model.GoogleMapFactory") - .getMethod("buildIfSupported", Context.class) - .invoke(null, context); + sFactory = Objects.requireNonNull( + (MapFactory) Class + .forName(LIBRARY_PACKAGE_NAME + ".model.GoogleMapFactory") + .getMethod("buildIfSupported", Context.class) + .invoke(null, context)); sFragmentLayoutId = Class.forName(CLASS_NAME_LAYOUT_RES) .getField(FIELD_NAME_LAYOUT_ID).getInt(null); @@ -188,7 +187,7 @@ static GoogleMapsPlatform buildIfSupported(@NonNull Context context) { private static final class HuaweiMapsPlatform extends MapsPlatform { private static final String LIBRARY_PACKAGE_NAME = - "me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei"; + "dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei"; private static final String CLASS_NAME_LAYOUT_RES = LIBRARY_PACKAGE_NAME + ".R$layout"; @@ -204,9 +203,8 @@ private static final class HuaweiMapsPlatform extends MapsPlatform { private HuaweiMapsPlatform() {} - @NonNull @Override - MapFactory getFactory() { + @NonNull MapFactory getFactory() { return sFactory; } @@ -223,13 +221,13 @@ int getFragmentDelegateId() { } - @Nullable - static HuaweiMapsPlatform buildIfSupported(@NonNull Context context) { + static @Nullable HuaweiMapsPlatform buildIfSupported(@NonNull Context context) { try { - sFactory = (MapFactory) Class - .forName(LIBRARY_PACKAGE_NAME + ".model.HuaweiMapFactory") - .getMethod("buildIfSupported", Context.class) - .invoke(null, context); + sFactory = Objects.requireNonNull( + (MapFactory) Class + .forName(LIBRARY_PACKAGE_NAME + ".model.HuaweiMapFactory") + .getMethod("buildIfSupported", Context.class) + .invoke(null, context)); sFragmentLayoutId = Class.forName(CLASS_NAME_LAYOUT_RES) .getField(FIELD_NAME_LAYOUT_ID).getInt(null); diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/BitmapDescriptor.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/BitmapDescriptor.java similarity index 85% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/BitmapDescriptor.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/BitmapDescriptor.java index 48c0330..0dc1ceb 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/BitmapDescriptor.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/BitmapDescriptor.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; import android.content.Context; import android.graphics.Bitmap; @@ -55,8 +55,7 @@ interface Factory { * @return The {@link BitmapDescriptor} that was loaded from the asset or null if failed * to load. */ - @NonNull - BitmapDescriptor fromResource(int resourceId); + @NonNull BitmapDescriptor fromResource(int resourceId); /** * Creates a {@link BitmapDescriptor} using the name of a Bitmap image in the assets @@ -66,8 +65,7 @@ interface Factory { * @return The {@link BitmapDescriptor} that was loaded from the asset or null if failed * to load. */ - @NonNull - BitmapDescriptor fromAsset(String assetName); + @NonNull BitmapDescriptor fromAsset(String assetName); /** * Creates a {@link BitmapDescriptor} using the name of a Bitmap image file located in the @@ -78,8 +76,7 @@ interface Factory { * @return The {@link BitmapDescriptor} that was loaded from the asset or null if failed * to load. */ - @NonNull - BitmapDescriptor fromFile(String fileName); + @NonNull BitmapDescriptor fromFile(String fileName); /** * Creates a {@link BitmapDescriptor} from the absolute file path of a Bitmap image. @@ -88,16 +85,14 @@ interface Factory { * @return The {@link BitmapDescriptor} that was loaded from the asset or null if failed * to load. */ - @NonNull - BitmapDescriptor fromPath(String absolutePath); + @NonNull BitmapDescriptor fromPath(String absolutePath); /** * Creates a {@link BitmapDescriptor} that refers to the default marker image. * * @return The {@link BitmapDescriptor} that refers to the default marker image. */ - @NonNull - BitmapDescriptor defaultMarker(); + @NonNull BitmapDescriptor defaultMarker(); /** * Creates a {@link BitmapDescriptor} that refers to the default marker image. @@ -105,8 +100,7 @@ interface Factory { * @param hue The hue of the marker. Value must be greater or equal to 0 and less than 360. * @return The {@link BitmapDescriptor} that refers to the default marker image. */ - @NonNull - BitmapDescriptor defaultMarker( + @NonNull BitmapDescriptor defaultMarker( @FloatRange(from = 0, to = 360, toInclusive = false) float hue); /** @@ -115,8 +109,7 @@ BitmapDescriptor defaultMarker( * @param image The bitmap image. * @return The {@link BitmapDescriptor} from a given Bitmap image. */ - @NonNull - BitmapDescriptor fromBitmap(Bitmap image); + @NonNull BitmapDescriptor fromBitmap(Bitmap image); } } diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/ButtCap.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/ButtCap.java similarity index 84% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/ButtCap.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/ButtCap.java index b0dce7f..78c0004 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/ButtCap.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/ButtCap.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; /** * Cap that is squared off exactly at the start or end vertex of a {@link Polyline} with solid diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/CameraPosition.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/CameraPosition.java similarity index 90% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/CameraPosition.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/CameraPosition.java index 88bd21e..487b2a5 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/CameraPosition.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/CameraPosition.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; import androidx.annotation.FloatRange; import androidx.annotation.NonNull; @@ -35,8 +35,7 @@ public interface CameraPosition { * * @return The location that the camera is pointing at. */ - @NonNull - LatLng getTarget(); + @NonNull LatLng getTarget(); /** * Gets zoom level near the center of the screen. See {@link Builder#zoom(float) zoom(float)} @@ -74,8 +73,7 @@ interface Builder { * @param location The location that the camera is pointing at. * @return This {@link Builder} object for method chaining. */ - @NonNull - Builder target(@NonNull LatLng location); + @NonNull Builder target(@NonNull LatLng location); /** * Sets the zoom level of the camera. Zoom level is defined such that at zoom level 0, @@ -92,8 +90,7 @@ interface Builder { * @param zoom The zoom level of the camera. * @return This {@link Builder} object for method chaining. */ - @NonNull - Builder zoom(float zoom); + @NonNull Builder zoom(float zoom); /** * Sets the angle, in degrees, of the camera from the nadir (directly facing the Earth). @@ -115,8 +112,7 @@ interface Builder { * Earth). * @return This {@link Builder} object for method chaining. */ - @NonNull - Builder tilt(@FloatRange(from = 0.0, to = 90.0) float tilt); + @NonNull Builder tilt(@FloatRange(from = 0.0, to = 90.0) float tilt); /** * Sets the direction that the camera is pointing in, in degrees clockwise from north. @@ -125,16 +121,14 @@ interface Builder { * north. * @return This {@link Builder} object for method chaining. */ - @NonNull - Builder bearing(float bearing); + @NonNull Builder bearing(float bearing); /** * Builds a {@link CameraPosition}. * * @return The constructed {@link CameraPosition} object. */ - @NonNull - CameraPosition build(); + @NonNull CameraPosition build(); } } diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/CameraUpdate.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/CameraUpdate.java similarity index 90% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/CameraUpdate.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/CameraUpdate.java index 9beb903..4451b6a 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/CameraUpdate.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/CameraUpdate.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; import android.graphics.Point; @@ -48,8 +48,7 @@ interface Factory { * * @return A {@link CameraUpdate} containing the transformation. */ - @NonNull - CameraUpdate zoomIn(); + @NonNull CameraUpdate zoomIn(); /** * Returns a {@link CameraUpdate} that zooms out on the map by moving the viewpoint's @@ -57,8 +56,7 @@ interface Factory { * * @return A {@link CameraUpdate} containing the transformation. */ - @NonNull - CameraUpdate zoomOut(); + @NonNull CameraUpdate zoomOut(); /** * Returns a {@link CameraUpdate} that scrolls the camera over the map, shifting the @@ -76,8 +74,7 @@ interface Factory { * camera upwards, with respect to its current orientation. * @return A {@link CameraUpdate} containing the transformation. */ - @NonNull - CameraUpdate scrollBy(float xPixel, float yPixel); + @NonNull CameraUpdate scrollBy(float xPixel, float yPixel); /** * Returns a {@link CameraUpdate} that moves the camera viewpoint to a particular zoom @@ -88,8 +85,7 @@ interface Factory { * zoom in. Not all areas have tiles at the largest zoom levels. * @return A {@link CameraUpdate} containing the transformation. */ - @NonNull - CameraUpdate zoomTo(float zoom); + @NonNull CameraUpdate zoomTo(float zoom); /** * Returns a {@link CameraUpdate} that shifts the zoom level of the current camera @@ -103,8 +99,7 @@ interface Factory { * surface of the Earth. * @return A {@link CameraUpdate} containing the transformation. */ - @NonNull - CameraUpdate zoomBy(float amount); + @NonNull CameraUpdate zoomBy(float amount); /** * Returns a {@link CameraUpdate} that shifts the zoom level of the current camera @@ -128,8 +123,7 @@ interface Factory { * remain the same after the camera has moved. * @return A {@link CameraUpdate} containing the transformation. */ - @NonNull - CameraUpdate zoomBy(float amount, Point focus); + @NonNull CameraUpdate zoomBy(float amount, Point focus); /** * Returns a {@link CameraUpdate} that moves the camera to a specified @@ -138,8 +132,7 @@ interface Factory { * * @return A {@link CameraUpdate} containing the transformation. */ - @NonNull - CameraUpdate newCameraPosition(CameraPosition cameraPosition); + @NonNull CameraUpdate newCameraPosition(CameraPosition cameraPosition); /** * Returns a {@link CameraUpdate} that moves the camera to a specified @@ -149,8 +142,7 @@ interface Factory { * @param latLng A {@link LatLng} object containing the desired latitude and longitude. * @return A {@link CameraUpdate} containing the transformation. */ - @NonNull - CameraUpdate newLatLng(@NonNull LatLng latLng); + @NonNull CameraUpdate newLatLng(@NonNull LatLng latLng); /** * Returns a {@link CameraUpdate} that moves the center of the screen to a latitude and @@ -162,8 +154,7 @@ interface Factory { * in. Not all areas have tiles at the largest zoom levels. * @return A {@link CameraUpdate} containing the transformation. */ - @NonNull - CameraUpdate newLatLngZoom(@NonNull LatLng latLng, float zoom); + @NonNull CameraUpdate newLatLngZoom(@NonNull LatLng latLng, float zoom); /** * Returns a {@link CameraUpdate} that transforms the camera such that the specified @@ -184,8 +175,7 @@ interface Factory { * edges. This value is applied to all four sides of the bounding box. * @return A {@link CameraUpdate} containing the transformation. */ - @NonNull - CameraUpdate newLatLngBounds(@NonNull LatLngBounds bounds, int padding); + @NonNull CameraUpdate newLatLngBounds(@NonNull LatLngBounds bounds, int padding); /** * Returns a {@link CameraUpdate} that transforms the camera such that the specified @@ -204,9 +194,11 @@ interface Factory { * @param padding Additional size restriction (in px) of the bounding box. * @return A {@link CameraUpdate} containing the transformation. */ - @NonNull - CameraUpdate newLatLngBounds( - @NonNull LatLngBounds bounds, int width, int height, int padding); + @NonNull CameraUpdate newLatLngBounds( + @NonNull LatLngBounds bounds, + int width, + int height, + int padding); } } diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Cap.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Cap.java similarity index 81% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Cap.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Cap.java index c2c8563..b861e1d 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Cap.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Cap.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; /** * Immutable cap that can be applied at the start or end vertex of a {@link Polyline}. diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Circle.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Circle.java similarity index 92% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Circle.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Circle.java index 9296e55..27b6229 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Circle.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Circle.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; import android.graphics.Color; @@ -123,8 +123,7 @@ public interface Circle { * * @return The stroke pattern. */ - @Nullable - List getStrokePattern(); + @Nullable List getStrokePattern(); /** * Sets the fill color. @@ -217,8 +216,7 @@ public interface Circle { * * @return The tag if a tag was set with {@code setTag}; {@code null} if no tag has been set. */ - @Nullable - Object getTag(); + @Nullable Object getTag(); /** @@ -235,8 +233,7 @@ interface Options { * @param center The geographic center as a {@link LatLng}. * @return This {@link Options} object for method chaining. */ - @NonNull - Options center(LatLng center); + @NonNull Options center(LatLng center); /** * Sets the radius in meters. @@ -246,8 +243,7 @@ interface Options { * @param radius Radius in meters. * @return This {@link Options} object for method chaining. */ - @NonNull - Options radius(double radius); + @NonNull Options radius(double radius); /** * Sets the stroke width. @@ -260,8 +256,7 @@ interface Options { * @param width Width in pixels. * @return This {@link Options} object for method chaining. */ - @NonNull - Options strokeWidth(float width); + @NonNull Options strokeWidth(float width); /** * Sets the stroke color. @@ -274,8 +269,7 @@ interface Options { * @param color Color in the {@link Color} format. * @return This {@link Options} object for method chaining. */ - @NonNull - Options strokeColor(int color); + @NonNull Options strokeColor(int color); /** * Sets a stroke pattern for the circle's outline. The default stroke pattern is solid, @@ -284,8 +278,7 @@ interface Options { * @param pattern A stroke pattern for the circle's outline. * @return This {@link Options} object for method chaining. */ - @NonNull - Options strokePattern(@Nullable List pattern); + @NonNull Options strokePattern(@Nullable List pattern); /** * Sets the fill color. @@ -298,8 +291,7 @@ interface Options { * @param color Color in the {@link Color} format. * @return This {@link Options} object for method chaining. */ - @NonNull - Options fillColor(int color); + @NonNull Options fillColor(int color); /** * Sets the zIndex. @@ -312,8 +304,7 @@ interface Options { * @param zIndex The zIndex value. * @return This {@link Options} object for method chaining. */ - @NonNull - Options zIndex(float zIndex); + @NonNull Options zIndex(float zIndex); /** * Sets the visibility. @@ -323,8 +314,7 @@ interface Options { * @param visible {@code false} to make this circle invisible. * @return This {@link Options} object for method chaining. */ - @NonNull - Options visible(boolean visible); + @NonNull Options visible(boolean visible); /** * Specifies whether this circle is clickable. The default setting is {@code false}. @@ -332,8 +322,7 @@ interface Options { * @param clickable {@code false} to make this circle not clickable. * @return This {@link Options} object for method chaining. */ - @NonNull - Options clickable(boolean clickable); + @NonNull Options clickable(boolean clickable); /** * Returns the center as a {@link LatLng}. @@ -368,8 +357,7 @@ interface Options { * * @return The stroke pattern of the circle's outline. */ - @Nullable - List getStrokePattern(); + @Nullable List getStrokePattern(); /** * Returns the fill color. diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/CustomCap.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/CustomCap.java similarity index 84% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/CustomCap.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/CustomCap.java index 1cc6b8a..4800c51 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/CustomCap.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/CustomCap.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; import androidx.annotation.NonNull; @@ -30,8 +30,7 @@ public interface CustomCap extends Cap { /** * Descriptor of the bitmap to be overlaid at the start or end vertex. */ - @NonNull - BitmapDescriptor getBitmapDescriptor(); + @NonNull BitmapDescriptor getBitmapDescriptor(); /** * Reference stroke width (in pixels) - the stroke width for which the cap bitmap at its native diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Dash.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Dash.java similarity index 83% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Dash.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Dash.java index c7e9da8..1b52917 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Dash.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Dash.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; /** * An immutable class representing a dash used in the stroke pattern for a {@link Polyline} or diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Dot.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Dot.java similarity index 82% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Dot.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Dot.java index e93fb36..b7b4a6d 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Dot.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Dot.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; /** * An immutable class representing a dot used in the stroke pattern for a {@link Polyline} or diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Gap.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Gap.java similarity index 83% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Gap.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Gap.java index fd6f1ac..16bc3b1 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Gap.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Gap.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; /** * An immutable class representing a gap used in the stroke pattern for a {@link Polyline} or diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/GroundOverlay.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/GroundOverlay.java similarity index 94% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/GroundOverlay.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/GroundOverlay.java index b0034c7..e101bfb 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/GroundOverlay.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/GroundOverlay.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; import androidx.annotation.FloatRange; import androidx.annotation.NonNull; @@ -236,8 +236,7 @@ interface Options { * * @see Mipmap (Wikipedia) */ - @NonNull - Options image(@NonNull BitmapDescriptor imageDescriptor); + @NonNull Options image(@NonNull BitmapDescriptor imageDescriptor); /** * Specifies the anchor. @@ -261,8 +260,7 @@ interface Options { * @param anchorV v-coordinate of the anchor * @return This {@link Options} object for method chaining. */ - @NonNull - Options anchor( + @NonNull Options anchor( @FloatRange(from = 0.0, to = 1.0) float anchorU, @FloatRange(from = 0.0, to = 1.0) float anchorV); @@ -278,8 +276,7 @@ Options anchor( * automatically based on the image aspect ratio. * @return This {@link Options} object for method chaining. */ - @NonNull - Options position(@NonNull LatLng location, float width); + @NonNull Options position(@NonNull LatLng location, float width); /** * Specifies the position for this ground overlay using an anchor point (a {@link LatLng}), @@ -293,8 +290,7 @@ Options anchor( * @param height The height of the overlay (in meters). * @return This {@link Options} object for method chaining. */ - @NonNull - Options position(@NonNull LatLng location, float width, float height); + @NonNull Options position(@NonNull LatLng location, float width, float height); /** * Specifies the position for this ground overlay. @@ -302,8 +298,7 @@ Options anchor( * @param bounds A {@link LatLngBounds} in which to place the ground overlay. * @return This {@link Options} object for method chaining. */ - @NonNull - Options positionFromBounds(LatLngBounds bounds); + @NonNull Options positionFromBounds(LatLngBounds bounds); /** * Specifies the bearing of the ground overlay in degrees clockwise from north. @@ -316,8 +311,7 @@ Options anchor( * [0, 360) will be normalized. * @return This {@link Options} object for method chaining. */ - @NonNull - Options bearing(float bearing); + @NonNull Options bearing(float bearing); /** * Specifies the ground overlay's zIndex, i.e., the order in which it will be drawn. @@ -325,8 +319,7 @@ Options anchor( * @param zIndex The zIndex for this ground overlay. * @return This {@link Options} object for method chaining. */ - @NonNull - Options zIndex(float zIndex); + @NonNull Options zIndex(float zIndex); /** * Specifies the visibility for the ground overlay. The default visibility is {@code true}. @@ -334,8 +327,7 @@ Options anchor( * @param visible The visibility for this ground overlay. * @return This {@link Options} object for method chaining. */ - @NonNull - Options visible(boolean visible); + @NonNull Options visible(boolean visible); /** * Specifies the transparency of the ground overlay. The default transparency is {@code 0} @@ -345,8 +337,7 @@ Options anchor( * ground overlay is opaque and {@code 1} means that the ground overlay is transparent. * @return This {@link Options} object for method chaining. */ - @NonNull - Options transparency(@FloatRange(from = 0.0, to = 1.0) float transparency); + @NonNull Options transparency(@FloatRange(from = 0.0, to = 1.0) float transparency); /** * Specifies whether the ground overlay is clickable. The default clickability is {@code @@ -355,8 +346,7 @@ Options anchor( * @param clickable The new clickability setting. * @return This {@link Options} object for method chaining. */ - @NonNull - Options clickable(boolean clickable); + @NonNull Options clickable(boolean clickable); /** * Gets the image descriptor set for this {@link Options} object. diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/IndoorBuilding.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/IndoorBuilding.java similarity index 91% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/IndoorBuilding.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/IndoorBuilding.java index 3f29e77..aa55ec3 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/IndoorBuilding.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/IndoorBuilding.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; import java.util.List; diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/IndoorLevel.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/IndoorLevel.java similarity index 89% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/IndoorLevel.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/IndoorLevel.java index 31d12de..a2b5712 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/IndoorLevel.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/IndoorLevel.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; /** * Represents a level in a building. diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/JointType.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/JointType.java similarity index 87% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/JointType.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/JointType.java index 1de3f60..f3d7b7a 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/JointType.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/JointType.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; /** * Joint types for {@link Polyline} and outline of {@link Polygon}. diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/LatLng.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/LatLng.java similarity index 84% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/LatLng.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/LatLng.java index 20a91cf..c04d24f 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/LatLng.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/LatLng.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; /** * An immutable class representing a pair of latitude and longitude coordinates, stored as degrees. diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/LatLngBounds.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/LatLngBounds.java similarity index 89% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/LatLngBounds.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/LatLngBounds.java index ec48639..a94177f 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/LatLngBounds.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/LatLngBounds.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; import androidx.annotation.NonNull; @@ -30,16 +30,14 @@ public interface LatLngBounds { * * @return Southwest corner of the bound. */ - @NonNull - LatLng getSouthwest(); + @NonNull LatLng getSouthwest(); /** * Returns northeast corner of the bound. * * @return Northeast corner of the bound. */ - @NonNull - LatLng getNortheast(); + @NonNull LatLng getNortheast(); /** * Returns whether this contains the given {@link LatLng}. @@ -62,8 +60,7 @@ public interface LatLngBounds { * @param point A {@link LatLng} to be included in the new bounds * @return A new {@link LatLngBounds} that contains this and the extra point. */ - @NonNull - LatLngBounds including(@NonNull LatLng point); + @NonNull LatLngBounds including(@NonNull LatLng point); /** * Returns the center of this LatLngBounds. The center is simply the average of the coordinates @@ -73,8 +70,7 @@ public interface LatLngBounds { * * @return A {@link LatLng} that is the center of the LatLngBounds. */ - @NonNull - LatLng getCenter(); + @NonNull LatLng getCenter(); /** @@ -94,8 +90,7 @@ interface Builder { * @param point A {@link LatLng} to be included in the bounds. * @return This {@link Builder} object for method chaining. */ - @NonNull - Builder include(@NonNull LatLng point); + @NonNull Builder include(@NonNull LatLng point); /** * Creates the LatLng bounds. @@ -103,8 +98,7 @@ interface Builder { * @return The created {@link LatLngBounds} object. * @throws IllegalStateException If no points have been included. */ - @NonNull - LatLngBounds build(); + @NonNull LatLngBounds build(); } } diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/LocationSource.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/LocationSource.java similarity index 93% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/LocationSource.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/LocationSource.java index 51cefdd..f7333b1 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/LocationSource.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/LocationSource.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; import android.location.Location; diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Map.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/MapClient.java similarity index 91% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Map.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/MapClient.java index 174e1c2..a789fd5 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Map.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/MapClient.java @@ -1,6 +1,21 @@ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +/* + * Copyright 2020 Supasin Tatiyanupanwong + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; -import android.content.Context; import android.graphics.Bitmap; import android.location.Location; import android.view.View; @@ -8,37 +23,31 @@ import androidx.annotation.IntRange; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.annotation.RawRes; import androidx.annotation.RequiresPermission; import androidx.annotation.UiThread; -import androidx.fragment.app.Fragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; import static android.Manifest.permission.ACCESS_COARSE_LOCATION; import static android.Manifest.permission.ACCESS_FINE_LOCATION; /** * This is the main class of the Map Kit and is the entry point for all methods related to the map. - * You cannot instantiate a {@link Map} object directly, rather, you must obtain one from {@link - * MapFragment#getMapAsync} that you have added to your application. + * You cannot instantiate a {@link MapClient} object directly, rather, you must obtain one from + * {@link MapFragment#getMapAsync} that you have added to your application. * - *

Note: Similar to a {@link View} object, a {@link Map} can only be read and modified from the - * Android UI thread. Calling {@link Map} methods from another thread will result in an exception. + *

Note: Similar to a {@link View} object, a {@link MapClient} can only be read and modified from + * the Android UI thread. Calling {@link MapClient} methods from another thread will result in an + * exception. * *

You can adjust the viewpoint of a map by changing the position of the camera (as opposed to * moving the map). You can use the map's camera to set parameters such as location, zoom level, * tilt angle, and bearing. * - * @see MapClient - * @since 1.0.0 - * @deprecated As of 1.2.0, renamed to {@link MapClient} to avoid naming conflicts with {@link - * java.util.Map}. + * @since 1.2.0 */ -@SuppressWarnings("deprecation") -@Deprecated -public interface Map { +@UiThread +public interface MapClient { /** * No base map tiles. @@ -74,8 +83,7 @@ public interface Map { * * @return The current position of the Camera. */ - @NonNull - CameraPosition getCameraPosition(); + @NonNull CameraPosition getCameraPosition(); /** * Returns the maximum zoom level for the current camera position. This takes into account what @@ -169,8 +177,7 @@ void animateCamera( * @param options A polyline options object that defines how to render the Polyline. * @return The {@link Polyline} object that is added to the map. */ - @NonNull - Polyline addPolyline(Polyline.Options options); + @NonNull Polyline addPolyline(Polyline.Options options); /** * Adds a polygon to this map. @@ -178,8 +185,7 @@ void animateCamera( * @param options A polygon options object that defines how to render the Polygon. * @return The {@link Polygon} object that is added to the map. */ - @NonNull - Polygon addPolygon(Polygon.Options options); + @NonNull Polygon addPolygon(Polygon.Options options); /** * Add a circle to this map. @@ -187,8 +193,7 @@ void animateCamera( * @param options A circle options object that defines how to render the Circle. * @return The {@link Circle} object that is added to the map. */ - @NonNull - Circle addCircle(Circle.Options options); + @NonNull Circle addCircle(Circle.Options options); /** * Adds a marker to this map. @@ -201,8 +206,7 @@ void animateCamera( * @param options A marker options object that defines how to render the marker. * @return The {@link Marker} that was added to the map. */ - @NonNull - Marker addMarker(Marker.Options options); + @NonNull Marker addMarker(Marker.Options options); /** * Adds an image to this map. @@ -211,8 +215,7 @@ void animateCamera( * Options must have an image (AnchoredBitmap) and position specified. * @return The {@link GroundOverlay} that was added to the map. */ - @NonNull - GroundOverlay addGroundOverlay(GroundOverlay.Options options); + @NonNull GroundOverlay addGroundOverlay(GroundOverlay.Options options); /** * Adds a tile overlay to this map. See {@link TileOverlay} for more information. @@ -225,8 +228,7 @@ void animateCamera( * IllegalArgumentException} will be thrown. * @return The {@link TileOverlay} that was added to the map. */ - @NonNull - TileOverlay addTileOverlay(TileOverlay.Options options); + @NonNull TileOverlay addTileOverlay(TileOverlay.Options options); /** * Removes all markers, polylines, polygons, overlays, etc from the map. @@ -238,8 +240,7 @@ void animateCamera( * * @return The current focused building or {@code null} if no building is focused. */ - @Nullable - IndoorBuilding getFocusedBuilding(); + @Nullable IndoorBuilding getFocusedBuilding(); /** * Sets or clears the listener for indoor events. Only one listener can ever be set. Setting a @@ -347,8 +348,7 @@ void animateCamera( * * @return The {@link UiSettings} for this map. */ - @NonNull - UiSettings getUiSettings(); + @NonNull UiSettings getUiSettings(); /** * Returns a {@link Projection} object that you can use to convert between screen coordinates @@ -361,8 +361,7 @@ void animateCamera( * * @return The {@link Projection} of the map in its current state. */ - @NonNull - Projection getProjection(); + @NonNull Projection getProjection(); /** * Sets a callback that's invoked when the camera starts moving or the reason for camera motion @@ -770,8 +769,7 @@ interface InfoWindowAdapter { * @return A custom info window for {@code marker}, or {@code null} to use the default * info window frame with {@linkplain #getInfoContents(Marker) custom contents}. */ - @Nullable - View getInfoWindow(@NonNull Marker marker); + @Nullable View getInfoWindow(@NonNull Marker marker); /** * Provides custom contents for the default info window frame of a marker. This method is @@ -785,8 +783,7 @@ interface InfoWindowAdapter { * @return A custom view to display as contents in the info window for {@code marker}, or * {@code null} to use the default content rendering instead. */ - @Nullable - View getInfoContents(@NonNull Marker marker); + @Nullable View getInfoContents(@NonNull Marker marker); } /** @@ -1369,121 +1366,4 @@ interface UiSettings { boolean isMapToolbarEnabled(); } - - /** - * @see MapKit - * @deprecated As of 1.2.0, the usage of {@link Factory} is now restricted to library group. - * Its public APIs are now lifted and can be accessed directly through {@link MapKit}. - */ - interface Factory { - @NonNull - BitmapDescriptor.Factory getBitmapDescriptorFactory(); - - @NonNull - ButtCap newButtCap(); - - @NonNull - CameraUpdate.Factory getCameraUpdateFactory(); - - @NonNull - CameraPosition newCameraPositionFromLatLngZoom(@NonNull LatLng target, float zoom); - - @NonNull - CameraPosition.Builder newCameraPositionBuilder(); - - @NonNull - CameraPosition.Builder newCameraPositionBuilder(@NonNull CameraPosition camera); - - @NonNull - Circle.Options newCircleOptions(); - - @NonNull - CustomCap newCustomCap(@NonNull BitmapDescriptor bitmapDescriptor, float refWidth); - - @NonNull - CustomCap newCustomCap(@NonNull BitmapDescriptor bitmapDescriptor); - - @NonNull - Dot newDot(); - - @NonNull - Dash newDash(float length); - - @NonNull - Gap newGap(float length); - - @NonNull - GroundOverlay.Options newGroundOverlayOptions(); - - @NonNull - LatLng newLatLng(double latitude, double longitude); - - @NonNull - LatLngBounds newLatLngBounds(@NonNull LatLng southwest, @NonNull LatLng northeast); - - @NonNull - LatLngBounds.Builder newLatLngBoundsBuilder(); - - @NonNull - MapClient.Style.Options newMapStyleOptions(String json); - - @NonNull - MapClient.Style.Options newMapStyleOptions( - @NonNull Context context, @RawRes int resourceId); - - @NonNull - Marker.Options newMarkerOptions(); - - @NonNull - Polygon.Options newPolygonOptions(); - - @NonNull - Polyline.Options newPolylineOptions(); - - @NonNull - RoundCap newRoundCap(); - - @NonNull - SquareCap newSquareCap(); - - @NonNull - TileOverlay.Options newTileOverlayOptions(); - - @NonNull - Tile newTile(int width, int height, byte[] data); - - @NonNull - Tile noTile(); - - @NonNull - TileProvider newUrlTileProvider( - int width, int height, @NonNull UrlTileProvider tileProvider); - - @NonNull - VisibleRegion newVisibleRegion( - LatLng nearLeft, - LatLng nearRight, - LatLng farLeft, - LatLng farRight, - LatLngBounds latLngBounds); - - /** - * @deprecated It is not intended to be used outside the library group. As of 1.2.0, its - * usage scope is now restricted. - */ - @UiThread - void getMapAsync( - @NonNull Fragment fragment, - @SuppressWarnings("deprecation") @NonNull OnMapReadyCallback callback); - - /** - * @see MapKit.OnMapReadyCallback - * @deprecated As of 1.2.0, use {@link MapKit.OnMapReadyCallback} instead. - */ - interface OnMapReadyCallback { - @UiThread - void onMapReady(@SuppressWarnings("deprecation") @NonNull Map map); - } - } - } diff --git a/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/MapFactory.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/MapFactory.java new file mode 100644 index 0000000..d434faf --- /dev/null +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/MapFactory.java @@ -0,0 +1,106 @@ +/* + * Copyright 2020 Supasin Tatiyanupanwong + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; + +import android.content.Context; + +import androidx.annotation.NonNull; +import androidx.annotation.RawRes; +import androidx.annotation.RestrictTo; +import androidx.annotation.UiThread; +import androidx.fragment.app.Fragment; + +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; + +import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP; + +/** + * @since 1.2.0 + */ +@RestrictTo(LIBRARY_GROUP) +public interface MapFactory { + + @NonNull BitmapDescriptor.Factory getBitmapDescriptorFactory(); + + @NonNull ButtCap newButtCap(); + + @NonNull CameraUpdate.Factory getCameraUpdateFactory(); + + @NonNull CameraPosition newCameraPositionFromLatLngZoom(@NonNull LatLng target, float zoom); + + @NonNull CameraPosition.Builder newCameraPositionBuilder(); + + @NonNull CameraPosition.Builder newCameraPositionBuilder(@NonNull CameraPosition camera); + + @NonNull Circle.Options newCircleOptions(); + + @NonNull CustomCap newCustomCap(@NonNull BitmapDescriptor bitmapDescriptor, float refWidth); + + @NonNull CustomCap newCustomCap(@NonNull BitmapDescriptor bitmapDescriptor); + + @NonNull Dot newDot(); + + @NonNull Dash newDash(float length); + + @NonNull Gap newGap(float length); + + @NonNull GroundOverlay.Options newGroundOverlayOptions(); + + @NonNull LatLng newLatLng(double latitude, double longitude); + + @NonNull LatLngBounds newLatLngBounds(@NonNull LatLng southwest, @NonNull LatLng northeast); + + @NonNull LatLngBounds.Builder newLatLngBoundsBuilder(); + + @NonNull MapClient.Style.Options newMapStyleOptions(String json); + + @NonNull MapClient.Style.Options newMapStyleOptions( + @NonNull Context context, + @RawRes int resourceId); + + @NonNull Marker.Options newMarkerOptions(); + + @NonNull Polygon.Options newPolygonOptions(); + + @NonNull Polyline.Options newPolylineOptions(); + + @NonNull RoundCap newRoundCap(); + + @NonNull SquareCap newSquareCap(); + + @NonNull TileOverlay.Options newTileOverlayOptions(); + + @NonNull Tile newTile(int width, int height, byte[] data); + + @NonNull Tile noTile(); + + @NonNull TileProvider newUrlTileProvider( + int width, + int height, + @NonNull UrlTileProvider tileProvider); + + @NonNull VisibleRegion newVisibleRegion( + LatLng nearLeft, + LatLng nearRight, + LatLng farLeft, + LatLng farRight, + LatLngBounds latLngBounds); + + @UiThread + void getMapAsync(@NonNull Fragment fragment, @NonNull MapKit.OnMapReadyCallback callback); + +} diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Marker.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Marker.java similarity index 93% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Marker.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Marker.java index 146832f..b5f112c 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Marker.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Marker.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; import androidx.annotation.FloatRange; import androidx.annotation.NonNull; @@ -40,8 +40,7 @@ public interface Marker { * * @return This marker's id. */ - @NonNull - String getId(); + @NonNull String getId(); /** * Sets the position of the marker. @@ -53,8 +52,7 @@ public interface Marker { * * @return A {@link LatLng} object specifying the marker's current position. */ - @NonNull - LatLng getPosition(); + @NonNull LatLng getPosition(); /** * Sets the zIndex of the marker. @@ -265,8 +263,7 @@ void setInfoWindowAnchor( * * @return The tag if a tag was set with {@code setTag}; {@code null} if no tag has been set. */ - @Nullable - Object getTag(); + @Nullable Object getTag(); /** @@ -276,22 +273,19 @@ interface Options { /** * Sets the location for the marker. */ - @NonNull - Options position(@NonNull LatLng latLng); + @NonNull Options position(@NonNull LatLng latLng); /** * Sets the zIndex for the marker. */ - @NonNull - Options zIndex(float zIndex); + @NonNull Options zIndex(float zIndex); /** * Sets the icon for the marker. * * @param iconDescriptor If {@code null} , the default marker is used. */ - @NonNull - Options icon(@Nullable BitmapDescriptor iconDescriptor); + @NonNull Options icon(@Nullable BitmapDescriptor iconDescriptor); /** * Sets the anchor point for the marker. @@ -326,8 +320,7 @@ interface Options { * @param anchorU u-coordinate of the anchor, as a ratio of the image width. * @param anchorV v-coordinate of the anchor, as a ratio of the image height. */ - @NonNull - Options anchor( + @NonNull Options anchor( @FloatRange(from = 0.0, to = 1.0) float anchorU, @FloatRange(from = 0.0, to = 1.0) float anchorV); @@ -340,34 +333,29 @@ Options anchor( * @param anchorU u-coordinate of the anchor, as a ratio of the image width. * @param anchorV v-coordinate of the anchor, as a ratio of the image height. */ - @NonNull - Options infoWindowAnchor( + @NonNull Options infoWindowAnchor( @FloatRange(from = 0.0, to = 1.0) float anchorU, @FloatRange(from = 0.0, to = 1.0) float anchorV); /** * Sets the title for the marker. */ - @NonNull - Options title(@Nullable String title); + @NonNull Options title(@Nullable String title); /** * Sets the snippet for the marker. */ - @NonNull - Options snippet(@Nullable String snippet); + @NonNull Options snippet(@Nullable String snippet); /** * Sets the draggability for the marker. */ - @NonNull - Options draggable(boolean draggable); + @NonNull Options draggable(boolean draggable); /** * Sets the visibility for the marker. */ - @NonNull - Options visible(boolean visible); + @NonNull Options visible(boolean visible); /** * Sets whether this marker should be flat against the map {@code true} or a billboard @@ -377,8 +365,7 @@ Options infoWindowAnchor( * always be drawn facing the camera and will rotate and tilt with the camera. The default * value is {@code false}. */ - @NonNull - Options flat(boolean flat); + @NonNull Options flat(boolean flat); /** * Sets the rotation of the marker in degrees clockwise about the marker's anchor point. @@ -388,15 +375,13 @@ Options infoWindowAnchor( * When the marker is a billboard, the default position is pointing up and the rotation is * such that the marker is always facing the camera. The default value is 0. */ - @NonNull - Options rotation(float rotation); + @NonNull Options rotation(float rotation); /** * Sets the alpha (opacity) of the marker. This is a value from 0 to 1, where 0 means the * marker is completely transparent and 1 means the marker is completely opaque. */ - @NonNull - Options alpha(@FloatRange(from = 0.0, to = 1.0) float alpha); + @NonNull Options alpha(@FloatRange(from = 0.0, to = 1.0) float alpha); /** * Gets the title set for this {@link Marker.Options object}. @@ -425,8 +410,7 @@ Options infoWindowAnchor( * @return A {@link BitmapDescriptor} representing the custom icon, or {@code null} if no * custom icon is set. */ - @Nullable - BitmapDescriptor getIcon(); + @Nullable BitmapDescriptor getIcon(); /** * Horizontal distance, normalized to [0, 1], of the anchor from the left edge. diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/PatternItem.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/PatternItem.java similarity index 82% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/PatternItem.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/PatternItem.java index e985353..f9de7b9 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/PatternItem.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/PatternItem.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; /** * Immutable item used in the stroke pattern for a {@link Polyline} or the outline of a {@link diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/PointOfInterest.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/PointOfInterest.java similarity index 81% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/PointOfInterest.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/PointOfInterest.java index 7a69cb7..b9ab18c 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/PointOfInterest.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/PointOfInterest.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; import androidx.annotation.NonNull; @@ -28,8 +28,7 @@ public interface PointOfInterest { /** *The {@link LatLng} of the POI. */ - @NonNull - LatLng getLatLng(); + @NonNull LatLng getLatLng(); /** * The placeId of the POI. diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Polygon.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Polygon.java similarity index 92% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Polygon.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Polygon.java index c57b44b..d4f35e4 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Polygon.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Polygon.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -141,8 +141,7 @@ public interface Polygon { * * @return The stroke pattern. */ - @Nullable - List getStrokePattern(); + @Nullable List getStrokePattern(); /** * Sets the fill color of this polygon. @@ -245,8 +244,7 @@ public interface Polygon { * * @return The tag if a tag was set with {@code setTag}; {@code null} if no tag has been set. */ - @Nullable - Object getTag(); + @Nullable Object getTag(); /** @@ -258,40 +256,35 @@ interface Options { * * @return This {@link Options} object for method chaining. */ - @NonNull - Options add(LatLng point); + @NonNull Options add(LatLng point); /** * Adds vertices to the outline of the polygon being built. * * @return This {@link Options} object for method chaining. */ - @NonNull - Options add(LatLng... points); + @NonNull Options add(LatLng... points); /** * Adds vertices to the outline of the polygon being built. * * @return This {@link Options} object for method chaining. */ - @NonNull - Options addAll(Iterable points); + @NonNull Options addAll(Iterable points); /** * Adds a hole to the polygon being built. * * @return This {@link Options} object for method chaining. */ - @NonNull - Options addHole(Iterable points); + @NonNull Options addHole(Iterable points); /** * Specifies the polygon's stroke width, in display pixels. The default width is 10. * * @return This {@link Options} object for method chaining. */ - @NonNull - Options strokeWidth(float width); + @NonNull Options strokeWidth(float width); /** * Specifies the polygon's stroke color, as a 32-bit ARGB color. The default color is @@ -299,16 +292,14 @@ interface Options { * * @return This {@link Options} object for method chaining. */ - @NonNull - Options strokeColor(int color); + @NonNull Options strokeColor(int color); /** * Specifies the joint type for all vertices of the polygon's outline. * * @return This {@link Options} object for method chaining. */ - @NonNull - Options strokeJointType(int jointType); + @NonNull Options strokeJointType(int jointType); /** * Specifies a stroke pattern for the polygon's outline. The default stroke pattern is @@ -316,8 +307,7 @@ interface Options { * * @return This {@link Options} object for method chaining. */ - @NonNull - Options strokePattern(@Nullable List pattern); + @NonNull Options strokePattern(@Nullable List pattern); /** * Sets the color of the polygon as a 32-bit ARGB color. The default color is black @@ -325,24 +315,21 @@ interface Options { * * @return This {@link Options} object for method chaining. */ - @NonNull - Options fillColor(int color); + @NonNull Options fillColor(int color); /** * Specifies the polygon's zIndex, i.e., the order in which it will be drawn. * * @return This {@link Options} object for method chaining. */ - @NonNull - Options zIndex(float zIndex); + @NonNull Options zIndex(float zIndex); /** * Specifies the visibility for the polygon. The default visibility is {@code true}. * * @return This {@link Options} object for method chaining. */ - @NonNull - Options visible(boolean visible); + @NonNull Options visible(boolean visible); /** * Specifies whether to draw each segment of this polygon as a geodesic. The default @@ -350,16 +337,14 @@ interface Options { * * @return This {@link Options} object for method chaining. */ - @NonNull - Options geodesic(boolean geodesic); + @NonNull Options geodesic(boolean geodesic); /** * Specifies whether this polygon is clickable. The default setting is {@code false}. * * @return This {@link Options} object for method chaining. */ - @NonNull - Options clickable(boolean clickable); + @NonNull Options clickable(boolean clickable); /** * Gets the outline set for this {@link Options} object. @@ -403,8 +388,7 @@ interface Options { * * @return The stroke pattern of the polygon's outline. */ - @Nullable - List getStrokePattern(); + @Nullable List getStrokePattern(); /** * Gets the fill color set for this {@link Options} object. diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Polyline.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Polyline.java similarity index 91% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Polyline.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Polyline.java index 3003bd6..3b1abfc 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Polyline.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Polyline.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -104,8 +104,7 @@ public interface Polyline { * * @return The start cap. */ - @NonNull - Cap getStartCap(); + @NonNull Cap getStartCap(); /** * Sets the cap at the end vertex of this polyline. The default end cap is {@link ButtCap}. @@ -119,8 +118,7 @@ public interface Polyline { * * @return The endCap cap. */ - @NonNull - Cap getEndCap(); + @NonNull Cap getEndCap(); /** * Sets the joint type for all vertices of the polyline except the start and end vertices. @@ -153,8 +151,7 @@ public interface Polyline { * * @return The stroke pattern. */ - @Nullable - List getPattern(); + @Nullable List getPattern(); /** * Sets the zIndex of this polyline. Polylines with higher zIndices are drawn above those with @@ -243,8 +240,7 @@ public interface Polyline { * * @return The tag if a tag was set with {@code setTag}; {@code null} if no tag has been set. */ - @Nullable - Object getTag(); + @Nullable Object getTag(); /** @@ -256,32 +252,28 @@ interface Options { * * @return This {@link Options} object for method chaining. */ - @NonNull - Options add(LatLng point); + @NonNull Options add(LatLng point); /** * Adds vertices to the end of the polyline being built. * * @return This {@link Options} object for method chaining. */ - @NonNull - Options add(LatLng... points); + @NonNull Options add(LatLng... points); /** * Adds vertices to the end of the polyline being built. * * @return This {@link Options} object for method chaining. */ - @NonNull - Options addAll(Iterable points); + @NonNull Options addAll(Iterable points); /** * Sets the width of the polyline in screen pixels. The default is 10. * * @return This {@link Options} object for method chaining. */ - @NonNull - Options width(float width); + @NonNull Options width(float width); /** * Sets the color of the polyline as a 32-bit ARGB color. The default color is black @@ -289,8 +281,7 @@ interface Options { * * @return This {@link Options} object for method chaining. */ - @NonNull - Options color(int color); + @NonNull Options color(int color); /** * Sets the cap at the start vertex of the polyline. The default start cap is {@link @@ -298,16 +289,14 @@ interface Options { * * @return This {@link Options} object for method chaining. */ - @NonNull - Options startCap(@NonNull Cap startCap); + @NonNull Options startCap(@NonNull Cap startCap); /** * Sets the cap at the end vertex of the polyline. The default end cap is {@link ButtCap}. * * @return This {@link Options} object for method chaining. */ - @NonNull - Options endCap(@NonNull Cap endCap); + @NonNull Options endCap(@NonNull Cap endCap); /** * Sets the joint type for all vertices of the polyline except the start and end vertices. @@ -317,8 +306,7 @@ interface Options { * * @return This {@link Options} object for method chaining. */ - @NonNull - Options jointType(int jointType); + @NonNull Options jointType(int jointType); /** * Sets the stroke pattern for the polyline. The default stroke pattern is solid, @@ -326,24 +314,21 @@ interface Options { * * @return This {@link Options} object for method chaining. */ - @NonNull - Options pattern(@Nullable List pattern); + @NonNull Options pattern(@Nullable List pattern); /** * Specifies the polyline's zIndex, i.e., the order in which it will be drawn. * * @return This {@link Options} object for method chaining. */ - @NonNull - Options zIndex(float zIndex); + @NonNull Options zIndex(float zIndex); /** * Specifies the visibility for the polyline. The default visibility is {@code true}. * * @return This {@link Options} object for method chaining. */ - @NonNull - Options visible(boolean visible); + @NonNull Options visible(boolean visible); /** * Specifies whether to draw each segment of this polyline as a geodesic. The default @@ -351,16 +336,14 @@ interface Options { * * @return This {@link Options} object for method chaining. */ - @NonNull - Options geodesic(boolean geodesic); + @NonNull Options geodesic(boolean geodesic); /** * Specifies whether this polyline is clickable. The default setting is {@code false}. * * @return This {@link Options} object for method chaining. */ - @NonNull - Options clickable(boolean clickable); + @NonNull Options clickable(boolean clickable); /** * Gets the points set for this {@link Options} object. @@ -388,16 +371,14 @@ interface Options { * * @return The start cap of the polyline. */ - @NonNull - Cap getStartCap(); + @NonNull Cap getStartCap(); /** * Gets the cap set for the end vertex in this {@link Options} object. * * @return The end cap of the polyline. */ - @NonNull - Cap getEndCap(); + @NonNull Cap getEndCap(); /** * Gets the joint type set in this {@link Options} object for all vertices except the @@ -412,8 +393,7 @@ interface Options { * * @return The stroke pattern of the polyline. */ - @Nullable - List getPattern(); + @Nullable List getPattern(); /** * Gets the zIndex set for this {@link Options} object. diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Projection.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Projection.java similarity index 87% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Projection.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Projection.java index 0040318..d07c8e9 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Projection.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Projection.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; import android.graphics.Point; @@ -40,8 +40,7 @@ public interface Projection { * ray through the given screen point does not intersect the ground plane (this might be the * case if the map is heavily tilted). */ - @Nullable - LatLng fromScreenLocation(Point point); + @Nullable LatLng fromScreenLocation(Point point); /** * Returns a screen location that corresponds to a geographical coordinate ({@link LatLng}). @@ -51,8 +50,7 @@ public interface Projection { * @param location A {@link LatLng} on the map to convert to a screen location. * @return A {@link Point} representing the screen location in screen pixels. */ - @NonNull - Point toScreenLocation(LatLng location); + @NonNull Point toScreenLocation(LatLng location); /** * Gets a projection of the viewing frustum for converting between screen coordinates and @@ -60,7 +58,6 @@ public interface Projection { * * @return The projection of the viewing frustum in its current state. */ - @NonNull - VisibleRegion getVisibleRegion(); + @NonNull VisibleRegion getVisibleRegion(); } diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/RoundCap.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/RoundCap.java similarity index 82% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/RoundCap.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/RoundCap.java index e0181b8..b3b1d35 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/RoundCap.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/RoundCap.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; /** * Cap that is a semicircle with radius equal to half the stroke width, centered at the start or diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/SquareCap.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/SquareCap.java similarity index 82% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/SquareCap.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/SquareCap.java index 0d692eb..1dd6ec0 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/SquareCap.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/SquareCap.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; /** * Cap that is squared off after extending half the stroke width beyond the start or end vertex of diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Tile.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Tile.java similarity index 85% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Tile.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Tile.java index 7fef5b7..0b37ffb 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/Tile.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/Tile.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; import android.graphics.BitmapFactory; @@ -41,7 +41,6 @@ public interface Tile { * A byte array containing the image data. The image will be created from this data by calling * {@link BitmapFactory#decodeByteArray(byte[], int, int) decodeByteArray(byte[], int, int)}. */ - @Nullable - byte[] getData(); + @Nullable byte[] getData(); } diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/TileOverlay.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/TileOverlay.java similarity index 92% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/TileOverlay.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/TileOverlay.java index 198ed39..5b792b1 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/TileOverlay.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/TileOverlay.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; import androidx.annotation.FloatRange; import androidx.annotation.NonNull; @@ -123,8 +123,7 @@ interface Options { * @param tileProvider The {@link TileProvider} to use for this tile overlay. * @return This {@link Options} object for method chaining. */ - @NonNull - Options tileProvider(TileProvider tileProvider); + @NonNull Options tileProvider(TileProvider tileProvider); /** * Specifies the tile overlay's zIndex, i.e., the order in which it will be drawn where @@ -133,8 +132,7 @@ interface Options { * @param zIndex The zIndex to use for this tile overlay. * @return This {@link Options} object for method chaining. */ - @NonNull - Options zIndex(float zIndex); + @NonNull Options zIndex(float zIndex); /** * Specifies the visibility for the tile overlay. The default visibility is {@code true}. @@ -142,8 +140,7 @@ interface Options { * @param visible The visibility setting to use for this tile overlay. * @return This {@link Options} object for method chaining. */ - @NonNull - Options visible(boolean visible); + @NonNull Options visible(boolean visible); /** * Specifies whether the tiles should fade in. The default is {@code true}. @@ -151,8 +148,7 @@ interface Options { * @param fadeIn The visibility setting to use for this tile overlay. * @return This {@link Options} object for method chaining. */ - @NonNull - Options fadeIn(boolean fadeIn); + @NonNull Options fadeIn(boolean fadeIn); /** * Specifies the transparency of the tile overlay. The default transparency is 0 (opaque). @@ -162,8 +158,7 @@ interface Options { * @return This {@link Options} object for method chaining. * @throws IllegalArgumentException If the transparency is outside the range {@code 0..1}. */ - @NonNull - Options transparency(@FloatRange(from = 0.0, to = 1.0) float transparency); + @NonNull Options transparency(@FloatRange(from = 0.0, to = 1.0) float transparency); /** * Gets the tile provider set for this {@link Options} object. diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/TileProvider.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/TileProvider.java similarity index 90% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/TileProvider.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/TileProvider.java index 9cf15dd..4ef9ef0 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/TileProvider.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/TileProvider.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; /** * An interface for a class that provides the tile images for a {@link TileOverlay}. diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/UrlTileProvider.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/UrlTileProvider.java similarity index 91% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/UrlTileProvider.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/UrlTileProvider.java index 5cf0ccc..6b8dd67 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/UrlTileProvider.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/UrlTileProvider.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; import java.net.URL; diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/VisibleRegion.java b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/VisibleRegion.java similarity index 86% rename from maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/VisibleRegion.java rename to maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/VisibleRegion.java index ae07d5a..9e2db9f 100644 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/VisibleRegion.java +++ b/maps-core/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/model/VisibleRegion.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.model; import androidx.annotation.NonNull; @@ -33,32 +33,28 @@ public interface VisibleRegion { * * @return {@link LatLng} object that defines the bottom left corner of the camera. */ - @NonNull - LatLng getNearLeft(); + @NonNull LatLng getNearLeft(); /** * {@link LatLng} object that defines the bottom right corner of the camera. * * @return {@link LatLng} object that defines the bottom right corner of the camera. */ - @NonNull - LatLng getNearRight(); + @NonNull LatLng getNearRight(); /** * {@link LatLng} object that defines the far left corner of the camera. * * @return {@link LatLng} object that defines the far left corner of the camera. */ - @NonNull - LatLng getFarLeft(); + @NonNull LatLng getFarLeft(); /** * {@link LatLng} object that defines the far right corner of the camera. * * @return {@link LatLng} object that defines the far right corner of the camera. */ - @NonNull - LatLng getFarRight(); + @NonNull LatLng getFarRight(); /** * The smallest bounding box that includes the visible region defined in this class. @@ -70,7 +66,6 @@ public interface VisibleRegion { * * @return The smallest bounding box that includes the visible region defined in this class. */ - @NonNull - LatLngBounds getLatLngBounds(); + @NonNull LatLngBounds getLatLngBounds(); } diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/MapKit.java b/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/MapKit.java deleted file mode 100644 index 002e131..0000000 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/MapKit.java +++ /dev/null @@ -1,321 +0,0 @@ -/* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package me.tatiyanupanwong.supasin.android.libraries.kits.maps; - -import android.content.Context; - -import androidx.annotation.NonNull; -import androidx.annotation.RawRes; -import androidx.annotation.UiThread; - -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.BitmapDescriptor; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.ButtCap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CameraPosition; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CameraUpdate; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Circle; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CustomCap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Dash; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Dot; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Gap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.GroundOverlay; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLngBounds; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Map; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapFactory; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Marker; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Polygon; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Polyline; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.RoundCap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.SquareCap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Tile; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.TileOverlay; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.TileProvider; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.UrlTileProvider; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.VisibleRegion; - -/** - * Main entry point for Maps API. - * - * @since 1.0.0 - */ -public final class MapKit { - - private static final MapFactory FACTORY = MapsPlatform.get().getFactory(); - - private MapKit() {} // No instances! - - - /** - * Obtains a factory object to interact with Maps APIs for the current platform. - * - * @return The {@link Map.Factory} for the current platform. - * @deprecated As of 1.2.0, the usage of {@link Map.Factory} is now restricted to library group. - * Its public APIs are now lifted and can be accessed directly through {@link MapKit}. - */ - @SuppressWarnings("deprecation") - @Deprecated - @NonNull - public static Map.Factory getFactory() { - return FACTORY; - } - - - /** - * @since 1.2.0 - */ - @NonNull - public static BitmapDescriptor.Factory getBitmapDescriptorFactory() { - return FACTORY.getBitmapDescriptorFactory(); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static ButtCap newButtCap() { - return FACTORY.newButtCap(); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static CameraUpdate.Factory getCameraUpdateFactory() { - return FACTORY.getCameraUpdateFactory(); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static CameraPosition newCameraPositionFromLatLngZoom( - @NonNull LatLng target, float zoom) { - return FACTORY.newCameraPositionFromLatLngZoom(target, zoom); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static CameraPosition.Builder newCameraPositionBuilder() { - return FACTORY.newCameraPositionBuilder(); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static CameraPosition.Builder newCameraPositionBuilder(@NonNull CameraPosition camera) { - return FACTORY.newCameraPositionBuilder(camera); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static Circle.Options newCircleOptions() { - return FACTORY.newCircleOptions(); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static CustomCap newCustomCap( - @NonNull BitmapDescriptor bitmapDescriptor, float refWidth) { - return FACTORY.newCustomCap(bitmapDescriptor, refWidth); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static CustomCap newCustomCap(@NonNull BitmapDescriptor bitmapDescriptor) { - return FACTORY.newCustomCap(bitmapDescriptor); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static Dot newDot() { - return FACTORY.newDot(); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static Dash newDash(float length) { - return FACTORY.newDash(length); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static Gap newGap(float length) { - return FACTORY.newGap(length); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static GroundOverlay.Options newGroundOverlayOptions() { - return FACTORY.newGroundOverlayOptions(); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static LatLng newLatLng(double latitude, double longitude) { - return FACTORY.newLatLng(latitude, longitude); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static LatLngBounds newLatLngBounds( - @NonNull LatLng southwest, @NonNull LatLng northeast) { - return FACTORY.newLatLngBounds(southwest, northeast); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static LatLngBounds.Builder newLatLngBoundsBuilder() { - return FACTORY.newLatLngBoundsBuilder(); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static MapClient.Style.Options newMapStyleOptions(String json) { - return FACTORY.newMapStyleOptions(json); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static MapClient.Style.Options newMapStyleOptions( - @NonNull Context context, @RawRes int resourceId) { - return FACTORY.newMapStyleOptions(context, resourceId); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static Marker.Options newMarkerOptions() { - return FACTORY.newMarkerOptions(); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static Polygon.Options newPolygonOptions() { - return FACTORY.newPolygonOptions(); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static Polyline.Options newPolylineOptions() { - return FACTORY.newPolylineOptions(); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static RoundCap newRoundCap() { - return FACTORY.newRoundCap(); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static SquareCap newSquareCap() { - return FACTORY.newSquareCap(); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static TileOverlay.Options newTileOverlayOptions() { - return FACTORY.newTileOverlayOptions(); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static Tile newTile(int width, int height, byte[] data) { - return FACTORY.newTile(width, height, data); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static Tile noTile() { - return FACTORY.noTile(); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static TileProvider newUrlTileProvider( - int width, int height, @NonNull UrlTileProvider tileProvider) { - return FACTORY.newUrlTileProvider(width, height, tileProvider); - } - - /** - * @since 1.2.0 - */ - @NonNull - public static VisibleRegion newVisibleRegion( - LatLng nearLeft, - LatLng nearRight, - LatLng farLeft, - LatLng farRight, - LatLngBounds latLngBounds) { - return FACTORY.newVisibleRegion(nearLeft, nearRight, farLeft, farRight, latLngBounds); - } - - - /** - * @since 1.2.0 - */ - public interface OnMapReadyCallback { - @UiThread - void onMapReady(@NonNull MapClient map); - } - -} diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/MapClient.java b/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/MapClient.java deleted file mode 100644 index 6c7cb5e..0000000 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/MapClient.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; - -import android.view.View; - -import androidx.annotation.UiThread; - -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; - -/** - * This is the main class of the Map Kit and is the entry point for all methods related to the map. - * You cannot instantiate a {@link MapClient} object directly, rather, you must obtain one from - * {@link MapFragment#getMapAsync} that you have added to your application. - * - *

Note: Similar to a {@link View} object, a {@link MapClient} can only be read and modified from - * the Android UI thread. Calling {@link MapClient} methods from another thread will result in an - * exception. - * - *

You can adjust the viewpoint of a map by changing the position of the camera (as opposed to - * moving the map). You can use the map's camera to set parameters such as location, zoom level, - * tilt angle, and bearing. - * - * @since 1.2.0 - */ -@SuppressWarnings("deprecation") -@UiThread -public interface MapClient extends Map {} diff --git a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/MapFactory.java b/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/MapFactory.java deleted file mode 100644 index 59cd313..0000000 --- a/maps-core/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/model/MapFactory.java +++ /dev/null @@ -1,22 +0,0 @@ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.model; - -import androidx.annotation.NonNull; -import androidx.annotation.RestrictTo; -import androidx.annotation.UiThread; -import androidx.fragment.app.Fragment; - -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; - -import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP; - -/** - * @since 1.2.0 - */ -@SuppressWarnings("deprecation") -@RestrictTo(LIBRARY_GROUP) -public interface MapFactory extends Map.Factory { - - @UiThread - void getMapAsync(@NonNull Fragment fragment, @NonNull MapKit.OnMapReadyCallback callback); - -} diff --git a/maps-google/build.gradle b/maps-google/build.gradle index b0237f4..3bef602 100644 --- a/maps-google/build.gradle +++ b/maps-google/build.gradle @@ -1,3 +1,19 @@ +/* + * Copyright 2020 Supasin Tatiyanupanwong + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + rootProject.allprojects { repositories { google() @@ -5,13 +21,14 @@ rootProject.allprojects { } apply plugin: 'com.android.library' +apply plugin: 'com.vanniktech.maven.publish' android { - compileSdkVersion 29 + compileSdkVersion 30 defaultConfig { minSdkVersion 19 - targetSdkVersion 29 + targetSdkVersion 30 consumerProguardFiles 'consumer-rules.pro' } @@ -24,14 +41,3 @@ dependencies { } tasks.withType(Javadoc).all { enabled = false } - -ext { - POM_ARTIFACT_ID = 'maps-google' - - POM_NAME = 'Map Kit (Google)' - POM_DESCRIPTION = 'Provides Google Maps integration to Map Kit.' - POM_VERSION = '1.2.2' -} - -apply from: rootProject.file("gradle/install.gradle") -apply from: rootProject.file("gradle/bintray.gradle") diff --git a/maps-google/consumer-rules.pro b/maps-google/consumer-rules.pro index 21c872d..068cbab 100644 --- a/maps-google/consumer-rules.pro +++ b/maps-google/consumer-rules.pro @@ -1,3 +1,19 @@ --keep class me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model.GoogleMapFactory { +# +# Copyright 2020 Supasin Tatiyanupanwong +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +-keep class dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model.GoogleMapFactory { public static *** buildIfSupported(android.content.Context); } diff --git a/maps-google/gradle.properties b/maps-google/gradle.properties new file mode 100644 index 0000000..2a13090 --- /dev/null +++ b/maps-google/gradle.properties @@ -0,0 +1,21 @@ +# +# Copyright 2021 Supasin Tatiyanupanwong +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +POM_ARTIFACT_ID=maps-google +POM_NAME=Map Kit (Google) +POM_DESCRIPTION=Library providing Google Maps integration to Map Kit. + +VERSION_NAME=2.0.0 diff --git a/maps-google/src/main/AndroidManifest.xml b/maps-google/src/main/AndroidManifest.xml index cfc732f..e3fd4f9 100644 --- a/maps-google/src/main/AndroidManifest.xml +++ b/maps-google/src/main/AndroidManifest.xml @@ -1,17 +1,18 @@ - + + diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleBitmapDescriptor.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleBitmapDescriptor.java similarity index 77% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleBitmapDescriptor.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleBitmapDescriptor.java index c4f39e4..3b85a3c 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleBitmapDescriptor.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleBitmapDescriptor.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import android.graphics.Bitmap; @@ -23,50 +23,43 @@ import com.google.android.gms.maps.model.BitmapDescriptorFactory; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.BitmapDescriptor; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.BitmapDescriptor; class GoogleBitmapDescriptor implements BitmapDescriptor { static final BitmapDescriptor.Factory FACTORY = new BitmapDescriptor.Factory() { - @NonNull @Override - public BitmapDescriptor defaultMarker() { + public @NonNull BitmapDescriptor defaultMarker() { return new GoogleBitmapDescriptor(BitmapDescriptorFactory.defaultMarker()); } - @NonNull @Override - public BitmapDescriptor defaultMarker(float hue) { + public @NonNull BitmapDescriptor defaultMarker(float hue) { return new GoogleBitmapDescriptor(BitmapDescriptorFactory.defaultMarker(hue)); } - @NonNull @Override - public BitmapDescriptor fromAsset(String assetName) { + public @NonNull BitmapDescriptor fromAsset(String assetName) { return new GoogleBitmapDescriptor(BitmapDescriptorFactory.fromAsset(assetName)); } - @NonNull @Override - public BitmapDescriptor fromBitmap(Bitmap image) { + public @NonNull BitmapDescriptor fromBitmap(Bitmap image) { return new GoogleBitmapDescriptor(BitmapDescriptorFactory.fromBitmap(image)); } - @NonNull @Override - public BitmapDescriptor fromFile(String fileName) { + public @NonNull BitmapDescriptor fromFile(String fileName) { return new GoogleBitmapDescriptor(BitmapDescriptorFactory.fromFile(fileName)); } - @NonNull @Override - public BitmapDescriptor fromPath(String absolutePath) { + public @NonNull BitmapDescriptor fromPath(String absolutePath) { return new GoogleBitmapDescriptor(BitmapDescriptorFactory.fromPath(absolutePath)); } - @NonNull @Override - public BitmapDescriptor fromResource(int resourceId) { + public @NonNull BitmapDescriptor fromResource(int resourceId) { return new GoogleBitmapDescriptor(BitmapDescriptorFactory.fromResource(resourceId)); } }; @@ -97,9 +90,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleButtCap.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleButtCap.java similarity index 86% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleButtCap.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleButtCap.java index a4e35c9..f2f76c7 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleButtCap.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleButtCap.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,12 +14,12 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.ButtCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.ButtCap; class GoogleButtCap extends GoogleCap implements ButtCap { @@ -52,9 +52,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleCameraPosition.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleCameraPosition.java similarity index 79% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleCameraPosition.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleCameraPosition.java index 1661e1c..36ae929 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleCameraPosition.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleCameraPosition.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,14 +14,14 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.FloatRange; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CameraPosition; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CameraPosition; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; class GoogleCameraPosition implements CameraPosition { @@ -33,9 +33,8 @@ private GoogleCameraPosition(com.google.android.gms.maps.model.CameraPosition de mDelegate = delegate; } - @NonNull @Override - public LatLng getTarget() { + public @NonNull LatLng getTarget() { if (mTarget == null) { mTarget = GoogleLatLng.wrap(mDelegate.target); } @@ -76,9 +75,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } @@ -104,37 +102,32 @@ static class Builder implements CameraPosition.Builder { GoogleCameraPosition.unwrap(camera)); } - @NonNull @Override - public CameraPosition.Builder target(@NonNull LatLng location) { + public @NonNull CameraPosition.Builder target(@NonNull LatLng location) { mDelegate.target(GoogleLatLng.unwrap(location)); return this; } - @NonNull @Override - public CameraPosition.Builder zoom(float zoom) { + public @NonNull CameraPosition.Builder zoom(float zoom) { mDelegate.zoom(zoom); return this; } - @NonNull @Override - public CameraPosition.Builder tilt(@FloatRange(from = 0.0, to = 90.0) float tilt) { + public @NonNull CameraPosition.Builder tilt(@FloatRange(from = 0.0, to = 90.0) float tilt) { mDelegate.tilt(tilt); return this; } - @NonNull @Override - public CameraPosition.Builder bearing(float bearing) { + public @NonNull CameraPosition.Builder bearing(float bearing) { mDelegate.bearing(bearing); return this; } - @NonNull @Override - public CameraPosition build() { + public @NonNull CameraPosition build() { return GoogleCameraPosition.wrap(mDelegate.build()); } } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleCameraUpdate.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleCameraUpdate.java similarity index 70% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleCameraUpdate.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleCameraUpdate.java index 0c7109b..e0ab440 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleCameraUpdate.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleCameraUpdate.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import android.graphics.Point; @@ -23,86 +23,78 @@ import com.google.android.gms.maps.CameraUpdateFactory; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CameraPosition; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CameraUpdate; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLngBounds; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CameraPosition; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CameraUpdate; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLngBounds; class GoogleCameraUpdate implements CameraUpdate { static final CameraUpdate.Factory FACTORY = new CameraUpdate.Factory() { - @NonNull @Override - public CameraUpdate zoomIn() { + public @NonNull CameraUpdate zoomIn() { return new GoogleCameraUpdate(CameraUpdateFactory.zoomIn()); } - @NonNull @Override - public CameraUpdate zoomOut() { + public @NonNull CameraUpdate zoomOut() { return new GoogleCameraUpdate(CameraUpdateFactory.zoomOut()); } - @NonNull @Override - public CameraUpdate scrollBy(float xPixel, float yPixel) { + public @NonNull CameraUpdate scrollBy(float xPixel, float yPixel) { return new GoogleCameraUpdate(CameraUpdateFactory.scrollBy(xPixel, yPixel)); } - @NonNull @Override - public CameraUpdate zoomTo(float zoom) { + public @NonNull CameraUpdate zoomTo(float zoom) { return new GoogleCameraUpdate(CameraUpdateFactory.zoomTo(zoom)); } - @NonNull @Override - public CameraUpdate zoomBy(float amount) { + public @NonNull CameraUpdate zoomBy(float amount) { return new GoogleCameraUpdate(CameraUpdateFactory.zoomBy(amount)); } - @NonNull @Override - public CameraUpdate zoomBy(float amount, Point focus) { + public @NonNull CameraUpdate zoomBy(float amount, Point focus) { return new GoogleCameraUpdate(CameraUpdateFactory.zoomBy(amount, focus)); } - @NonNull @Override - public CameraUpdate newCameraPosition(CameraPosition cameraPosition) { + public @NonNull CameraUpdate newCameraPosition(CameraPosition cameraPosition) { return new GoogleCameraUpdate(CameraUpdateFactory.newCameraPosition( GoogleCameraPosition.unwrap(cameraPosition) )); } - @NonNull @Override - public CameraUpdate newLatLng(@NonNull LatLng latLng) { + public @NonNull CameraUpdate newLatLng(@NonNull LatLng latLng) { return new GoogleCameraUpdate(CameraUpdateFactory.newLatLng( GoogleLatLng.unwrap(latLng) )); } - @NonNull @Override - public CameraUpdate newLatLngZoom(@NonNull LatLng latLng, float zoom) { + public @NonNull CameraUpdate newLatLngZoom(@NonNull LatLng latLng, float zoom) { return new GoogleCameraUpdate(CameraUpdateFactory.newLatLngZoom( GoogleLatLng.unwrap(latLng), zoom )); } - @NonNull @Override - public CameraUpdate newLatLngBounds(@NonNull LatLngBounds bounds, int padding) { + public @NonNull CameraUpdate newLatLngBounds(@NonNull LatLngBounds bounds, int padding) { return new GoogleCameraUpdate(CameraUpdateFactory.newLatLngBounds( GoogleLatLngBounds.unwrap(bounds), padding )); } - @NonNull @Override - public CameraUpdate newLatLngBounds( - @NonNull LatLngBounds bounds, int width, int height, int padding) { + public @NonNull CameraUpdate newLatLngBounds( + @NonNull LatLngBounds bounds, + int width, + int height, + int padding) { return new GoogleCameraUpdate(CameraUpdateFactory.newLatLngBounds( GoogleLatLngBounds.unwrap(bounds), width, height, padding )); @@ -135,9 +127,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleCap.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleCap.java similarity index 81% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleCap.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleCap.java index 6cbeecd..982262c 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleCap.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleCap.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,13 +14,13 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.ButtCap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Cap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CustomCap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.RoundCap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.SquareCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.ButtCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Cap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CustomCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.RoundCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.SquareCap; abstract class GoogleCap implements Cap { diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleCircle.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleCircle.java similarity index 82% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleCircle.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleCircle.java index 05524f3..faa63f1 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleCircle.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleCircle.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,16 +14,16 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import java.util.List; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Circle; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.PatternItem; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Circle; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.PatternItem; class GoogleCircle implements Circle { @@ -88,9 +88,8 @@ public void setStrokePattern(@Nullable List pattern) { mDelegate.setStrokePattern(GooglePatternItem.unwrap(pattern)); } - @Nullable @Override - public List getStrokePattern() { + public @Nullable List getStrokePattern() { return GooglePatternItem.wrap(mDelegate.getStrokePattern()); } @@ -139,9 +138,8 @@ public void setTag(@Nullable Object tag) { mDelegate.setTag(tag); } - @Nullable @Override - public Object getTag() { + public @Nullable Object getTag() { return mDelegate.getTag(); } @@ -164,9 +162,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } @@ -183,65 +180,56 @@ static class Options implements Circle.Options { mDelegate = new com.google.android.gms.maps.model.CircleOptions(); } - @NonNull @Override - public Circle.Options center(LatLng center) { + public @NonNull Circle.Options center(LatLng center) { mDelegate.center(GoogleLatLng.unwrap(center)); return this; } - @NonNull @Override - public Circle.Options radius(double radius) { + public @NonNull Circle.Options radius(double radius) { mDelegate.radius(radius); return this; } - @NonNull @Override - public Circle.Options strokeWidth(float width) { + public @NonNull Circle.Options strokeWidth(float width) { mDelegate.strokeWidth(width); return this; } - @NonNull @Override - public Circle.Options strokeColor(int color) { + public @NonNull Circle.Options strokeColor(int color) { mDelegate.strokeColor(color); return this; } - @NonNull @Override - public Circle.Options strokePattern(@Nullable List pattern) { + public @NonNull Circle.Options strokePattern(@Nullable List pattern) { mDelegate.strokePattern(GooglePatternItem.unwrap(pattern)); return this; } - @NonNull @Override - public Circle.Options fillColor(int color) { + public @NonNull Circle.Options fillColor(int color) { mDelegate.fillColor(color); return this; } - @NonNull @Override - public Circle.Options zIndex(float zIndex) { + public @NonNull Circle.Options zIndex(float zIndex) { mDelegate.zIndex(zIndex); return this; } - @NonNull @Override - public Circle.Options visible(boolean visible) { + public @NonNull Circle.Options visible(boolean visible) { mDelegate.visible(visible); return this; } - @NonNull @Override - public Circle.Options clickable(boolean clickable) { + public @NonNull Circle.Options clickable(boolean clickable) { mDelegate.clickable(clickable); return this; } @@ -266,9 +254,8 @@ public int getStrokeColor() { return mDelegate.getStrokeColor(); } - @Nullable @Override - public List getStrokePattern() { + public @Nullable List getStrokePattern() { return GooglePatternItem.wrap(mDelegate.getStrokePattern()); } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleCustomCap.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleCustomCap.java similarity index 85% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleCustomCap.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleCustomCap.java index 72b33d9..edb1a22 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleCustomCap.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleCustomCap.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,13 +14,13 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.BitmapDescriptor; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CustomCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.BitmapDescriptor; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CustomCap; class GoogleCustomCap extends GoogleCap implements CustomCap { @@ -42,9 +42,8 @@ private GoogleCustomCap(com.google.android.gms.maps.model.CustomCap delegate) { GoogleBitmapDescriptor.unwrap(bitmapDescriptor))); } - @NonNull @Override - public BitmapDescriptor getBitmapDescriptor() { + public @NonNull BitmapDescriptor getBitmapDescriptor() { if (mBitmapDescriptor == null) { mBitmapDescriptor = GoogleBitmapDescriptor.wrap(mDelegate.bitmapDescriptor); } @@ -75,9 +74,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleDash.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleDash.java similarity index 86% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleDash.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleDash.java index ecb656a..ccb2da4 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleDash.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleDash.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,12 +14,12 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Dash; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Dash; class GoogleDash extends GooglePatternItem implements Dash { @@ -57,9 +57,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleDot.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleDot.java similarity index 86% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleDot.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleDot.java index 085e0ed..db4a450 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleDot.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleDot.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,12 +14,12 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Dot; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Dot; class GoogleDot extends GooglePatternItem implements Dot { @@ -52,9 +52,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleGap.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleGap.java similarity index 86% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleGap.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleGap.java index e7e468c..c0991e7 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleGap.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleGap.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,12 +14,12 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Gap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Gap; class GoogleGap extends GooglePatternItem implements Gap { @@ -57,9 +57,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleGroundOverlay.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleGroundOverlay.java similarity index 83% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleGroundOverlay.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleGroundOverlay.java index f651cc8..91a8697 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleGroundOverlay.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleGroundOverlay.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,15 +14,15 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.BitmapDescriptor; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.GroundOverlay; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLngBounds; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.BitmapDescriptor; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.GroundOverlay; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLngBounds; class GoogleGroundOverlay implements GroundOverlay { @@ -166,9 +166,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } @@ -185,72 +184,65 @@ static class Options implements GroundOverlay.Options { mDelegate = new com.google.android.gms.maps.model.GroundOverlayOptions(); } - @NonNull @Override - public GroundOverlay.Options image(@NonNull BitmapDescriptor imageDescriptor) { + public @NonNull GroundOverlay.Options image(@NonNull BitmapDescriptor imageDescriptor) { mDelegate.image(GoogleBitmapDescriptor.unwrap(imageDescriptor)); return this; } - @NonNull @Override - public GroundOverlay.Options anchor(float anchorU, float anchorV) { + public @NonNull GroundOverlay.Options anchor(float anchorU, float anchorV) { mDelegate.anchor(anchorU, anchorV); return this; } - @NonNull @Override - public GroundOverlay.Options position(@NonNull LatLng location, float width) { + public @NonNull GroundOverlay.Options position(@NonNull LatLng location, float width) { mDelegate.position(GoogleLatLng.unwrap(location), width); return this; } - @NonNull @Override - public GroundOverlay.Options position(@NonNull LatLng location, float width, float height) { + public @NonNull GroundOverlay.Options position( + @NonNull LatLng location, + float width, + float height) { mDelegate.position(GoogleLatLng.unwrap(location), width, height); return this; } - @NonNull @Override - public GroundOverlay.Options positionFromBounds(LatLngBounds bounds) { + public @NonNull GroundOverlay.Options positionFromBounds(LatLngBounds bounds) { mDelegate.positionFromBounds(GoogleLatLngBounds.unwrap(bounds)); return this; } - @NonNull @Override - public GroundOverlay.Options bearing(float bearing) { + public @NonNull GroundOverlay.Options bearing(float bearing) { mDelegate.bearing(bearing); return this; } - @NonNull @Override - public GroundOverlay.Options zIndex(float zIndex) { + public @NonNull GroundOverlay.Options zIndex(float zIndex) { mDelegate.zIndex(zIndex); return this; } - @NonNull @Override - public GroundOverlay.Options visible(boolean visible) { + public @NonNull GroundOverlay.Options visible(boolean visible) { mDelegate.visible(visible); return this; } - @NonNull @Override - public GroundOverlay.Options transparency(float transparency) { + public @NonNull GroundOverlay.Options transparency(float transparency) { mDelegate.transparency(transparency); return this; } - @NonNull @Override - public GroundOverlay.Options clickable(boolean clickable) { + public @NonNull GroundOverlay.Options clickable(boolean clickable) { mDelegate.clickable(clickable); return this; } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleIndoorBuilding.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleIndoorBuilding.java similarity index 84% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleIndoorBuilding.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleIndoorBuilding.java index 30edcdc..abcfa63 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleIndoorBuilding.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleIndoorBuilding.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,15 +14,15 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import java.util.List; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.IndoorBuilding; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.IndoorLevel; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.IndoorBuilding; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.IndoorLevel; class GoogleIndoorBuilding implements IndoorBuilding { @@ -72,15 +72,13 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } - @Nullable - static IndoorBuilding wrap( + static @Nullable IndoorBuilding wrap( @Nullable com.google.android.gms.maps.model.IndoorBuilding delegate) { return delegate == null ? null : new GoogleIndoorBuilding(delegate); } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleIndoorLevel.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleIndoorLevel.java similarity index 88% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleIndoorLevel.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleIndoorLevel.java index 21f93c3..d6b2dfc 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleIndoorLevel.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleIndoorLevel.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -22,7 +22,7 @@ import java.util.ArrayList; import java.util.List; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.IndoorLevel; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.IndoorLevel; class GoogleIndoorLevel implements IndoorLevel { @@ -66,9 +66,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleLatLng.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleLatLng.java similarity index 91% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleLatLng.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleLatLng.java index ef6ffa9..0ef9c97 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleLatLng.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleLatLng.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -23,7 +23,7 @@ import java.util.Iterator; import java.util.List; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; class GoogleLatLng implements LatLng { @@ -66,9 +66,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleLatLngBounds.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleLatLngBounds.java similarity index 79% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleLatLngBounds.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleLatLngBounds.java index 39a7476..8e3dc78 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleLatLngBounds.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleLatLngBounds.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,13 +14,13 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLngBounds; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLngBounds; class GoogleLatLngBounds implements LatLngBounds { @@ -39,18 +39,16 @@ private GoogleLatLngBounds(@NonNull com.google.android.gms.maps.model.LatLngBoun GoogleLatLng.unwrap(southwest), GoogleLatLng.unwrap(northeast))); } - @NonNull @Override - public LatLng getSouthwest() { + public @NonNull LatLng getSouthwest() { if (mSouthwest == null) { mSouthwest = GoogleLatLng.wrap(mDelegate.southwest); } return mSouthwest; } - @NonNull @Override - public LatLng getNortheast() { + public @NonNull LatLng getNortheast() { if (mNortheast == null) { mNortheast = GoogleLatLng.wrap(mDelegate.northeast); } @@ -62,15 +60,13 @@ public boolean contains(@NonNull LatLng point) { return mDelegate.contains(GoogleLatLng.unwrap(point)); } - @NonNull @Override - public LatLngBounds including(@NonNull LatLng point) { + public @NonNull LatLngBounds including(@NonNull LatLng point) { return GoogleLatLngBounds.wrap(mDelegate.including(GoogleLatLng.unwrap(point))); } - @NonNull @Override - public LatLng getCenter() { + public @NonNull LatLng getCenter() { if (mCenter == null) { mCenter = GoogleLatLng.wrap(mDelegate.getCenter()); } @@ -96,9 +92,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } @@ -107,8 +102,8 @@ static LatLngBounds wrap(com.google.android.gms.maps.model.LatLngBounds delegate return new GoogleLatLngBounds(delegate); } - @Nullable - static com.google.android.gms.maps.model.LatLngBounds unwrap(@Nullable LatLngBounds wrapped) { + static @Nullable com.google.android.gms.maps.model.LatLngBounds unwrap( + @Nullable LatLngBounds wrapped) { return wrapped == null ? null : ((GoogleLatLngBounds) wrapped).mDelegate; } @@ -120,16 +115,14 @@ static class Builder implements LatLngBounds.Builder { mDelegate = com.google.android.gms.maps.model.LatLngBounds.builder(); } - @NonNull @Override - public LatLngBounds.Builder include(@NonNull LatLng point) { + public @NonNull LatLngBounds.Builder include(@NonNull LatLng point) { mDelegate.include(GoogleLatLng.unwrap(point)); return this; } - @NonNull @Override - public LatLngBounds build() { + public @NonNull LatLngBounds build() { return GoogleLatLngBounds.wrap(mDelegate.build()); } } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleMapClient.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleMapClient.java similarity index 93% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleMapClient.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleMapClient.java index 778fc2b..e03bcd5 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleMapClient.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleMapClient.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import android.content.Context; import android.graphics.Bitmap; @@ -27,19 +27,19 @@ import androidx.annotation.RawRes; import androidx.annotation.RequiresPermission; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CameraPosition; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CameraUpdate; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Circle; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.GroundOverlay; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.IndoorBuilding; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLngBounds; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LocationSource; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Marker; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Polygon; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Polyline; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Projection; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.TileOverlay; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CameraPosition; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CameraUpdate; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Circle; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.GroundOverlay; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.IndoorBuilding; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLngBounds; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LocationSource; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Marker; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Polygon; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Polyline; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Projection; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.TileOverlay; import static android.Manifest.permission.ACCESS_COARSE_LOCATION; import static android.Manifest.permission.ACCESS_FINE_LOCATION; @@ -55,9 +55,8 @@ class GoogleMapClient implements MapClient { mSettings = new UiSettings(map.getUiSettings()); } - @NonNull @Override - public CameraPosition getCameraPosition() { + public @NonNull CameraPosition getCameraPosition() { return GoogleCameraPosition.wrap(mDelegate.getCameraPosition()); } @@ -131,40 +130,34 @@ public void stopAnimation() { mDelegate.stopAnimation(); } - @NonNull @Override - public Polyline addPolyline(Polyline.Options options) { + public @NonNull Polyline addPolyline(Polyline.Options options) { return GooglePolyline.wrap(mDelegate.addPolyline(GooglePolyline.Options.unwrap(options))); } - @NonNull @Override - public Polygon addPolygon(Polygon.Options options) { + public @NonNull Polygon addPolygon(Polygon.Options options) { return GooglePolygon.wrap(mDelegate.addPolygon(GooglePolygon.Options.unwrap(options))); } - @NonNull @Override - public Circle addCircle(Circle.Options options) { + public @NonNull Circle addCircle(Circle.Options options) { return GoogleCircle.wrap(mDelegate.addCircle(GoogleCircle.Options.unwrap(options))); } - @NonNull @Override - public Marker addMarker(Marker.Options options) { + public @NonNull Marker addMarker(Marker.Options options) { return GoogleMarker.wrap(mDelegate.addMarker(GoogleMarker.Options.unwrap(options))); } - @NonNull @Override - public GroundOverlay addGroundOverlay(GroundOverlay.Options options) { + public @NonNull GroundOverlay addGroundOverlay(GroundOverlay.Options options) { return GoogleGroundOverlay.wrap( mDelegate.addGroundOverlay(GoogleGroundOverlay.Options.unwrap(options))); } - @NonNull @Override - public TileOverlay addTileOverlay(TileOverlay.Options options) { + public @NonNull TileOverlay addTileOverlay(TileOverlay.Options options) { return GoogleTileOverlay.wrap( mDelegate.addTileOverlay(GoogleTileOverlay.Options.unwrap(options))); } @@ -174,9 +167,8 @@ public void clear() { mDelegate.clear(); } - @Nullable @Override - public IndoorBuilding getFocusedBuilding() { + public @Nullable IndoorBuilding getFocusedBuilding() { return GoogleIndoorBuilding.wrap(mDelegate.getFocusedBuilding()); } @@ -274,15 +266,13 @@ public void deactivate() { }); } - @NonNull @Override - public MapClient.UiSettings getUiSettings() { + public @NonNull MapClient.UiSettings getUiSettings() { return mSettings; } - @NonNull @Override - public Projection getProjection() { + public @NonNull Projection getProjection() { return GoogleProjection.wrap(mDelegate.getProjection()); } @@ -658,15 +648,13 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } - @Nullable - static com.google.android.gms.maps.model.MapStyleOptions unwrap( + static @Nullable com.google.android.gms.maps.model.MapStyleOptions unwrap( @Nullable MapClient.Style.Options wrapped) { return wrapped == null ? null : ((Style.Options) wrapped).mDelegate; } diff --git a/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleMapFactory.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleMapFactory.java new file mode 100644 index 0000000..2d78f09 --- /dev/null +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleMapFactory.java @@ -0,0 +1,251 @@ +/* + * Copyright 2020 Supasin Tatiyanupanwong + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; + +import android.content.Context; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.RawRes; +import androidx.fragment.app.Fragment; + +import com.google.android.gms.common.ConnectionResult; +import com.google.android.gms.common.GoogleApiAvailability; + +import java.util.Arrays; +import java.util.List; + +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.BitmapDescriptor; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.ButtCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CameraPosition; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CameraUpdate; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Circle; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CustomCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Dash; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Dot; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Gap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.GroundOverlay; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLngBounds; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapFactory; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Marker; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Polygon; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Polyline; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.RoundCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.SquareCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Tile; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.TileOverlay; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.TileProvider; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.UrlTileProvider; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.VisibleRegion; + +@SuppressWarnings("unused") +class GoogleMapFactory implements MapFactory { + + private static final List UNAVAILABLE_RESULTS = Arrays.asList( + ConnectionResult.SERVICE_DISABLED, + ConnectionResult.SERVICE_MISSING, + ConnectionResult.SERVICE_INVALID); + + private GoogleMapFactory() {} + + @Override + public @NonNull BitmapDescriptor.Factory getBitmapDescriptorFactory() { + return GoogleBitmapDescriptor.FACTORY; + } + + @Override + public @NonNull ButtCap newButtCap() { + return new GoogleButtCap(); + } + + @Override + public @NonNull CameraUpdate.Factory getCameraUpdateFactory() { + return GoogleCameraUpdate.FACTORY; + } + + @Override + public @NonNull CameraPosition newCameraPositionFromLatLngZoom( + @NonNull LatLng target, + float zoom) { + return newCameraPositionBuilder() + .target(target) + .zoom(zoom) + .build(); + } + + @Override + public @NonNull CameraPosition.Builder newCameraPositionBuilder() { + return new GoogleCameraPosition.Builder(); + } + + @Override + public @NonNull CameraPosition.Builder newCameraPositionBuilder( + @NonNull CameraPosition camera) { + return new GoogleCameraPosition.Builder(camera); + } + + @Override + public @NonNull Circle.Options newCircleOptions() { + return new GoogleCircle.Options(); + } + + @Override + public @NonNull CustomCap newCustomCap( + @NonNull BitmapDescriptor bitmapDescriptor, + float refWidth) { + return new GoogleCustomCap(bitmapDescriptor, refWidth); + } + + @Override + public @NonNull CustomCap newCustomCap(@NonNull BitmapDescriptor bitmapDescriptor) { + return new GoogleCustomCap(bitmapDescriptor); + } + + @Override + public @NonNull Dot newDot() { + return new GoogleDot(); + } + + @Override + public @NonNull Dash newDash(float length) { + return new GoogleDash(length); + } + + @Override + public @NonNull Gap newGap(float length) { + return new GoogleGap(length); + } + + @Override + public @NonNull GroundOverlay.Options newGroundOverlayOptions() { + return new GoogleGroundOverlay.Options(); + } + + @Override + public @NonNull LatLng newLatLng(double latitude, double longitude) { + return new GoogleLatLng(latitude, longitude); + } + + @Override + public @NonNull LatLngBounds newLatLngBounds( + @NonNull LatLng southwest, + @NonNull LatLng northeast) { + return new GoogleLatLngBounds(southwest, northeast); + } + + @Override + public @NonNull LatLngBounds.Builder newLatLngBoundsBuilder() { + return new GoogleLatLngBounds.Builder(); + } + + @Override + public @NonNull MapClient.Style.Options newMapStyleOptions(String json) { + return new GoogleMapClient.Style.Options(json); + } + + @Override + public @NonNull MapClient.Style.Options newMapStyleOptions( + @NonNull Context context, @RawRes int resourceId) { + return new GoogleMapClient.Style.Options(context, resourceId); + } + + @Override + public @NonNull Marker.Options newMarkerOptions() { + return new GoogleMarker.Options(); + } + + @Override + public @NonNull Polygon.Options newPolygonOptions() { + return new GooglePolygon.Options(); + } + + @Override + public @NonNull Polyline.Options newPolylineOptions() { + return new GooglePolyline.Options(); + } + + @Override + public @NonNull RoundCap newRoundCap() { + return new GoogleRoundCap(); + } + + @Override + public @NonNull SquareCap newSquareCap() { + return new GoogleSquareCap(); + } + + @Override + public @NonNull TileOverlay.Options newTileOverlayOptions() { + return new GoogleTileOverlay.Options(); + } + + @Override + public @NonNull Tile newTile(int width, int height, byte[] data) { + return new GoogleTile(width, height, data); + } + + @Override + public @NonNull Tile noTile() { + return GoogleTileProvider.NO_TILE; + } + + @Override + public @NonNull TileProvider newUrlTileProvider( + int width, + int height, + @NonNull UrlTileProvider tileProvider) { + return new GoogleUrlTileProvider(width, height, tileProvider); + } + + @Override + public @NonNull VisibleRegion newVisibleRegion( + LatLng nearLeft, + LatLng nearRight, + LatLng farLeft, + LatLng farRight, + LatLngBounds latLngBounds) { + return new GoogleVisibleRegion(nearLeft, nearRight, farLeft, farRight, latLngBounds); + } + + @Override + public void getMapAsync( + @NonNull Fragment fragment, + @NonNull final MapKit.OnMapReadyCallback callback) { + ((com.google.android.gms.maps.SupportMapFragment) fragment) + .getMapAsync(new com.google.android.gms.maps.OnMapReadyCallback() { + @Override + public void onMapReady(com.google.android.gms.maps.GoogleMap googleMap) { + callback.onMapReady(new GoogleMapClient(googleMap)); + } + }); + } + + + public static @Nullable MapFactory buildIfSupported(@NonNull Context context) { + final int result = + GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context); + if (UNAVAILABLE_RESULTS.contains(result)) { + return null; + } + + return new GoogleMapFactory(); + } + +} diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleMarker.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleMarker.java similarity index 82% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleMarker.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleMarker.java index 3e78312..92cf7a2 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleMarker.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleMarker.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,14 +14,14 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.BitmapDescriptor; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Marker; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.BitmapDescriptor; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Marker; class GoogleMarker implements Marker { @@ -36,9 +36,8 @@ public void remove() { mDelegate.remove(); } - @NonNull @Override - public String getId() { + public @NonNull String getId() { return mDelegate.getId(); } @@ -47,9 +46,8 @@ public void setPosition(@NonNull LatLng latLng) { mDelegate.setPosition(GoogleLatLng.unwrap(latLng)); } - @NonNull @Override - public LatLng getPosition() { + public @NonNull LatLng getPosition() { return GoogleLatLng.wrap(mDelegate.getPosition()); } @@ -168,9 +166,8 @@ public void setTag(@Nullable Object tag) { mDelegate.setTag(tag); } - @Nullable @Override - public Object getTag() { + public @Nullable Object getTag() { return mDelegate.getTag(); } @@ -193,9 +190,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } @@ -212,86 +208,74 @@ static class Options implements Marker.Options { mDelegate = new com.google.android.gms.maps.model.MarkerOptions(); } - @NonNull @Override - public Marker.Options position(@NonNull LatLng latLng) { + public @NonNull Marker.Options position(@NonNull LatLng latLng) { mDelegate.position(GoogleLatLng.unwrap(latLng)); return this; } - @NonNull @Override - public Marker.Options zIndex(float zIndex) { + public @NonNull Marker.Options zIndex(float zIndex) { mDelegate.zIndex(zIndex); return this; } - @NonNull @Override - public Marker.Options icon(@Nullable BitmapDescriptor iconDescriptor) { + public @NonNull Marker.Options icon(@Nullable BitmapDescriptor iconDescriptor) { mDelegate.icon(GoogleBitmapDescriptor.unwrap(iconDescriptor)); return this; } - @NonNull @Override - public Marker.Options anchor(float anchorU, float anchorV) { + public @NonNull Marker.Options anchor(float anchorU, float anchorV) { mDelegate.anchor(anchorU, anchorV); return this; } - @NonNull @Override - public Marker.Options infoWindowAnchor(float anchorU, float anchorV) { + public @NonNull Marker.Options infoWindowAnchor(float anchorU, float anchorV) { mDelegate.infoWindowAnchor(anchorU, anchorV); return this; } - @NonNull @Override - public Marker.Options title(@Nullable String title) { + public @NonNull Marker.Options title(@Nullable String title) { mDelegate.title(title); return this; } - @NonNull @Override - public Marker.Options snippet(@Nullable String snippet) { + public @NonNull Marker.Options snippet(@Nullable String snippet) { mDelegate.snippet(snippet); return this; } - @NonNull @Override - public Marker.Options draggable(boolean draggable) { + public @NonNull Marker.Options draggable(boolean draggable) { mDelegate.draggable(draggable); return this; } - @NonNull @Override - public Marker.Options visible(boolean visible) { + public @NonNull Marker.Options visible(boolean visible) { mDelegate.visible(visible); return this; } - @NonNull @Override - public Marker.Options flat(boolean flat) { + public @NonNull Marker.Options flat(boolean flat) { mDelegate.flat(flat); return this; } - @NonNull @Override - public Marker.Options rotation(float rotation) { + public @NonNull Marker.Options rotation(float rotation) { mDelegate.rotation(rotation); return this; } - @NonNull @Override - public Marker.Options alpha(float alpha) { + public @NonNull Marker.Options alpha(float alpha) { mDelegate.alpha(alpha); return this; } @@ -311,9 +295,8 @@ public String getSnippet() { return mDelegate.getSnippet(); } - @Nullable @Override - public BitmapDescriptor getIcon() { + public @Nullable BitmapDescriptor getIcon() { return GoogleBitmapDescriptor.wrap(mDelegate.getIcon()); } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GooglePatternItem.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GooglePatternItem.java similarity index 86% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GooglePatternItem.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GooglePatternItem.java index e86decb..618b3ca 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GooglePatternItem.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GooglePatternItem.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,15 +14,15 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import java.util.ArrayList; import java.util.List; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Dash; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Dot; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Gap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.PatternItem; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Dash; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Dot; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Gap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.PatternItem; abstract class GooglePatternItem implements PatternItem { diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GooglePointOfInterest.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GooglePointOfInterest.java similarity index 83% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GooglePointOfInterest.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GooglePointOfInterest.java index 0b67be9..ceecadd 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GooglePointOfInterest.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GooglePointOfInterest.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,13 +14,13 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.PointOfInterest; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.PointOfInterest; class GooglePointOfInterest implements PointOfInterest { @@ -32,9 +32,8 @@ private GooglePointOfInterest(com.google.android.gms.maps.model.PointOfInterest mDelegate = delegate; } - @NonNull @Override - public LatLng getLatLng() { + public @NonNull LatLng getLatLng() { if (mLatLng == null) { mLatLng = GoogleLatLng.wrap(mDelegate.latLng); } @@ -70,9 +69,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GooglePolygon.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GooglePolygon.java similarity index 83% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GooglePolygon.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GooglePolygon.java index dc348be..a6624b6 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GooglePolygon.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GooglePolygon.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -23,9 +23,9 @@ import java.util.Arrays; import java.util.List; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.PatternItem; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Polygon; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.PatternItem; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Polygon; class GooglePolygon implements Polygon { @@ -108,9 +108,8 @@ public void setStrokePattern(@Nullable List pattern) { mDelegate.setStrokePattern(GooglePatternItem.unwrap(pattern)); } - @Nullable @Override - public List getStrokePattern() { + public @Nullable List getStrokePattern() { return GooglePatternItem.wrap(mDelegate.getStrokePattern()); } @@ -169,9 +168,8 @@ public void setTag(@Nullable Object tag) { mDelegate.setTag(tag); } - @Nullable @Override - public Object getTag() { + public @Nullable Object getTag() { return mDelegate.getTag(); } @@ -194,9 +192,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } @@ -213,93 +210,80 @@ static class Options implements Polygon.Options { mDelegate = new com.google.android.gms.maps.model.PolygonOptions(); } - @NonNull @Override - public Polygon.Options add(LatLng point) { + public @NonNull Polygon.Options add(LatLng point) { mDelegate.add(GoogleLatLng.unwrap(point)); return this; } - @NonNull @Override - public Polygon.Options add(LatLng... points) { + public @NonNull Polygon.Options add(LatLng... points) { mDelegate.addAll(GoogleLatLng.unwrap(Arrays.asList(points))); return this; } - @NonNull @Override - public Polygon.Options addAll(Iterable points) { + public @NonNull Polygon.Options addAll(Iterable points) { mDelegate.addAll(GoogleLatLng.unwrap(points)); return this; } - @NonNull @Override - public Polygon.Options addHole(Iterable points) { + public @NonNull Polygon.Options addHole(Iterable points) { mDelegate.addHole(GoogleLatLng.unwrap(points)); return this; } - @NonNull @Override - public Polygon.Options strokeWidth(float width) { + public @NonNull Polygon.Options strokeWidth(float width) { mDelegate.strokeWidth(width); return this; } - @NonNull @Override - public Polygon.Options strokeColor(int color) { + public @NonNull Polygon.Options strokeColor(int color) { mDelegate.strokeColor(color); return this; } - @NonNull @Override - public Polygon.Options strokeJointType(int jointType) { + public @NonNull Polygon.Options strokeJointType(int jointType) { mDelegate.strokeJointType(jointType); return this; } - @NonNull @Override - public Polygon.Options strokePattern(@Nullable List pattern) { + public @NonNull Polygon.Options strokePattern(@Nullable List pattern) { mDelegate.strokePattern(GooglePatternItem.unwrap(pattern)); return this; } - @NonNull @Override - public Polygon.Options fillColor(int color) { + public @NonNull Polygon.Options fillColor(int color) { mDelegate.fillColor(color); return this; } - @NonNull @Override - public Polygon.Options zIndex(float zIndex) { + public @NonNull Polygon.Options zIndex(float zIndex) { mDelegate.zIndex(zIndex); return this; } - @NonNull @Override - public Polygon.Options visible(boolean visible) { + public @NonNull Polygon.Options visible(boolean visible) { mDelegate.visible(visible); return this; } - @NonNull @Override - public Polygon.Options geodesic(boolean geodesic) { + public @NonNull Polygon.Options geodesic(boolean geodesic) { mDelegate.geodesic(geodesic); return this; } - @NonNull @Override - public Polygon.Options clickable(boolean clickable) { + public @NonNull Polygon.Options clickable(boolean clickable) { mDelegate.clickable(clickable); return this; } @@ -333,9 +317,8 @@ public int getStrokeJointType() { return mDelegate.getStrokeJointType(); } - @Nullable @Override - public List getStrokePattern() { + public @Nullable List getStrokePattern() { return GooglePatternItem.wrap(mDelegate.getStrokePattern()); } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GooglePolyline.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GooglePolyline.java similarity index 79% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GooglePolyline.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GooglePolyline.java index 455f50c..ce28149 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GooglePolyline.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GooglePolyline.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -22,10 +22,10 @@ import java.util.Arrays; import java.util.List; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Cap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.PatternItem; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Polyline; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Cap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.PatternItem; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Polyline; class GooglePolyline implements Polyline { @@ -80,9 +80,8 @@ public void setStartCap(@NonNull Cap startCap) { mDelegate.setStartCap(GoogleCap.unwrap(startCap)); } - @NonNull @Override - public Cap getStartCap() { + public @NonNull Cap getStartCap() { return GoogleCap.wrap(mDelegate.getStartCap()); } @@ -91,9 +90,8 @@ public void setEndCap(@NonNull Cap endCap) { mDelegate.setEndCap(GoogleCap.unwrap(endCap)); } - @NonNull @Override - public Cap getEndCap() { + public @NonNull Cap getEndCap() { return GoogleCap.wrap(mDelegate.getEndCap()); } @@ -112,9 +110,8 @@ public void setPattern(@Nullable List pattern) { mDelegate.setPattern(GooglePatternItem.unwrap(pattern)); } - @Nullable @Override - public List getPattern() { + public @Nullable List getPattern() { return GooglePatternItem.wrap(mDelegate.getPattern()); } @@ -163,9 +160,8 @@ public void setTag(@Nullable Object tag) { mDelegate.setTag(tag); } - @Nullable @Override - public Object getTag() { + public @Nullable Object getTag() { return mDelegate.getTag(); } @@ -188,9 +184,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } @@ -207,93 +202,80 @@ static class Options implements Polyline.Options { mDelegate = new com.google.android.gms.maps.model.PolylineOptions(); } - @NonNull @Override - public Polyline.Options add(LatLng point) { + public @NonNull Polyline.Options add(LatLng point) { mDelegate.add(GoogleLatLng.unwrap(point)); return this; } - @NonNull @Override - public Polyline.Options add(LatLng... points) { + public @NonNull Polyline.Options add(LatLng... points) { mDelegate.addAll(GoogleLatLng.unwrap(Arrays.asList(points))); return this; } - @NonNull @Override - public Polyline.Options addAll(Iterable points) { + public @NonNull Polyline.Options addAll(Iterable points) { mDelegate.addAll(GoogleLatLng.unwrap(points)); return this; } - @NonNull @Override - public Polyline.Options width(float width) { + public @NonNull Polyline.Options width(float width) { mDelegate.width(width); return this; } - @NonNull @Override - public Polyline.Options color(int color) { + public @NonNull Polyline.Options color(int color) { mDelegate.color(color); return this; } - @NonNull @Override - public Polyline.Options startCap(@NonNull Cap startCap) { + public @NonNull Polyline.Options startCap(@NonNull Cap startCap) { mDelegate.startCap(GoogleCap.unwrap(startCap)); return this; } - @NonNull @Override - public Polyline.Options endCap(@NonNull Cap endCap) { + public @NonNull Polyline.Options endCap(@NonNull Cap endCap) { mDelegate.endCap(GoogleCap.unwrap(endCap)); return this; } - @NonNull @Override - public Polyline.Options jointType(int jointType) { + public @NonNull Polyline.Options jointType(int jointType) { mDelegate.jointType(jointType); return this; } - @NonNull @Override - public Polyline.Options pattern(@Nullable List pattern) { + public @NonNull Polyline.Options pattern(@Nullable List pattern) { mDelegate.pattern(GooglePatternItem.unwrap(pattern)); return this; } - @NonNull @Override - public Polyline.Options zIndex(float zIndex) { + public @NonNull Polyline.Options zIndex(float zIndex) { mDelegate.zIndex(zIndex); return this; } - @NonNull @Override - public Polyline.Options visible(boolean visible) { + public @NonNull Polyline.Options visible(boolean visible) { mDelegate.visible(visible); return this; } - @NonNull @Override - public Polyline.Options geodesic(boolean geodesic) { + public @NonNull Polyline.Options geodesic(boolean geodesic) { mDelegate.geodesic(geodesic); return this; } - @NonNull @Override - public Polyline.Options clickable(boolean clickable) { + public @NonNull Polyline.Options clickable(boolean clickable) { mDelegate.clickable(clickable); return this; } @@ -313,15 +295,13 @@ public int getColor() { return mDelegate.getColor(); } - @NonNull @Override - public Cap getStartCap() { + public @NonNull Cap getStartCap() { return GoogleCap.wrap(mDelegate.getStartCap()); } - @NonNull @Override - public Cap getEndCap() { + public @NonNull Cap getEndCap() { return GoogleCap.wrap(mDelegate.getEndCap()); } @@ -330,9 +310,8 @@ public int getJointType() { return mDelegate.getJointType(); } - @Nullable @Override - public List getPattern() { + public @Nullable List getPattern() { return GooglePatternItem.wrap(mDelegate.getPattern()); } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleProjection.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleProjection.java similarity index 75% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleProjection.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleProjection.java index 756e945..33e9bf3 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleProjection.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleProjection.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,16 +14,16 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import android.graphics.Point; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Projection; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.VisibleRegion; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Projection; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.VisibleRegion; class GoogleProjection implements Projection { @@ -33,21 +33,18 @@ private GoogleProjection(com.google.android.gms.maps.Projection delegate) { mDelegate = delegate; } - @Nullable @Override - public LatLng fromScreenLocation(Point point) { + public @Nullable LatLng fromScreenLocation(Point point) { return GoogleLatLng.wrap(mDelegate.fromScreenLocation(point)); } - @NonNull @Override - public Point toScreenLocation(LatLng location) { + public @NonNull Point toScreenLocation(LatLng location) { return mDelegate.toScreenLocation(GoogleLatLng.unwrap(location)); } - @NonNull @Override - public VisibleRegion getVisibleRegion() { + public @NonNull VisibleRegion getVisibleRegion() { return GoogleVisibleRegion.wrap(mDelegate.getVisibleRegion()); } @@ -70,9 +67,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleRoundCap.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleRoundCap.java similarity index 86% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleRoundCap.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleRoundCap.java index 8e422e4..be411c7 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleRoundCap.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleRoundCap.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,12 +14,12 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.RoundCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.RoundCap; class GoogleRoundCap extends GoogleCap implements RoundCap { @@ -52,9 +52,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleSquareCap.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleSquareCap.java similarity index 86% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleSquareCap.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleSquareCap.java index 73c9e08..497635e 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleSquareCap.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleSquareCap.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,12 +14,12 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.SquareCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.SquareCap; class GoogleSquareCap extends GoogleCap implements SquareCap { @@ -52,9 +52,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleTile.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleTile.java similarity index 85% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleTile.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleTile.java index 1f3ebad..6d33c74 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleTile.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleTile.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,12 +14,12 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Tile; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Tile; class GoogleTile implements Tile { @@ -43,9 +43,8 @@ public int getHeight() { return mDelegate.height; } - @Nullable @Override - public byte[] getData() { + public @Nullable byte[] getData() { return mDelegate.data; } @@ -68,9 +67,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleTileOverlay.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleTileOverlay.java similarity index 84% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleTileOverlay.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleTileOverlay.java index 4675b7a..28b6120 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleTileOverlay.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleTileOverlay.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,13 +14,13 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.TileOverlay; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.TileProvider; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.TileOverlay; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.TileProvider; class GoogleTileOverlay implements TileOverlay { @@ -104,9 +104,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } @@ -123,37 +122,32 @@ static class Options implements TileOverlay.Options { mDelegate = new com.google.android.gms.maps.model.TileOverlayOptions(); } - @NonNull @Override - public TileOverlay.Options tileProvider(TileProvider tileProvider) { + public @NonNull TileOverlay.Options tileProvider(TileProvider tileProvider) { mDelegate.tileProvider(GoogleTileProvider.unwrap(tileProvider)); return this; } - @NonNull @Override - public TileOverlay.Options zIndex(float zIndex) { + public @NonNull TileOverlay.Options zIndex(float zIndex) { mDelegate.zIndex(zIndex); return this; } - @NonNull @Override - public TileOverlay.Options visible(boolean visible) { + public @NonNull TileOverlay.Options visible(boolean visible) { mDelegate.visible(visible); return this; } - @NonNull @Override - public TileOverlay.Options fadeIn(boolean fadeIn) { + public @NonNull TileOverlay.Options fadeIn(boolean fadeIn) { mDelegate.fadeIn(fadeIn); return this; } - @NonNull @Override - public TileOverlay.Options transparency(float transparency) { + public @NonNull TileOverlay.Options transparency(float transparency) { mDelegate.transparency(transparency); return this; } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleTileProvider.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleTileProvider.java similarity index 87% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleTileProvider.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleTileProvider.java index e822239..9bd4320 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleTileProvider.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleTileProvider.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,13 +14,13 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Tile; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.TileProvider; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Tile; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.TileProvider; class GoogleTileProvider implements TileProvider { static final Tile NO_TILE = @@ -65,9 +65,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleUrlTileProvider.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleUrlTileProvider.java similarity index 87% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleUrlTileProvider.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleUrlTileProvider.java index e9b751d..6c533a0 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleUrlTileProvider.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleUrlTileProvider.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,14 +14,14 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import java.net.URL; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.UrlTileProvider; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.UrlTileProvider; class GoogleUrlTileProvider extends GoogleTileProvider implements UrlTileProvider { @@ -65,9 +65,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleVisibleRegion.java b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleVisibleRegion.java similarity index 82% rename from maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleVisibleRegion.java rename to maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleVisibleRegion.java index 289e11d..8adcddd 100644 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleVisibleRegion.java +++ b/maps-google/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/google/model/GoogleVisibleRegion.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,14 +14,14 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.google.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLngBounds; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.VisibleRegion; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLngBounds; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.VisibleRegion; class GoogleVisibleRegion implements VisibleRegion { @@ -51,45 +51,40 @@ private GoogleVisibleRegion(com.google.android.gms.maps.model.VisibleRegion dele GoogleLatLngBounds.unwrap(latLngBounds))); } - @NonNull @Override - public LatLng getNearLeft() { + public @NonNull LatLng getNearLeft() { if (mNearLeft == null) { mNearLeft = GoogleLatLng.wrap(mDelegate.nearLeft); } return mNearLeft; } - @NonNull @Override - public LatLng getNearRight() { + public @NonNull LatLng getNearRight() { if (mNearRight == null) { mNearRight = GoogleLatLng.wrap(mDelegate.nearRight); } return mNearRight; } - @NonNull @Override - public LatLng getFarLeft() { + public @NonNull LatLng getFarLeft() { if (mFarLeft == null) { mFarLeft = GoogleLatLng.wrap(mDelegate.farLeft); } return mFarLeft; } - @NonNull @Override - public LatLng getFarRight() { + public @NonNull LatLng getFarRight() { if (mFarRight == null) { mFarRight = GoogleLatLng.wrap(mDelegate.farRight); } return mFarRight; } - @NonNull @Override - public LatLngBounds getLatLngBounds() { + public @NonNull LatLngBounds getLatLngBounds() { if (mLatLngBounds == null) { mLatLngBounds = GoogleLatLngBounds.wrap(mDelegate.latLngBounds); } @@ -115,9 +110,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } @@ -126,4 +120,4 @@ static VisibleRegion wrap(com.google.android.gms.maps.model.VisibleRegion delega return new GoogleVisibleRegion(delegate); } -} \ No newline at end of file +} diff --git a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleMapFactory.java b/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleMapFactory.java deleted file mode 100644 index 554934a..0000000 --- a/maps-google/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/google/model/GoogleMapFactory.java +++ /dev/null @@ -1,275 +0,0 @@ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.google.model; - -import android.content.Context; - -import androidx.annotation.NonNull; -import androidx.annotation.RawRes; -import androidx.fragment.app.Fragment; - -import com.google.android.gms.common.ConnectionResult; -import com.google.android.gms.common.GoogleApiAvailability; - -import java.util.Arrays; -import java.util.List; - -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.BitmapDescriptor; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.ButtCap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CameraPosition; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CameraUpdate; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Circle; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CustomCap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Dash; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Dot; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Gap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.GroundOverlay; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLngBounds; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapFactory; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Marker; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Polygon; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Polyline; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.RoundCap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.SquareCap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Tile; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.TileOverlay; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.TileProvider; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.UrlTileProvider; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.VisibleRegion; - -@SuppressWarnings("unused") -class GoogleMapFactory implements MapFactory { - - private static final List UNAVAILABLE_RESULTS = Arrays.asList( - ConnectionResult.SERVICE_DISABLED, - ConnectionResult.SERVICE_MISSING, - ConnectionResult.SERVICE_INVALID); - - private GoogleMapFactory() {} - - @NonNull - @Override - public BitmapDescriptor.Factory getBitmapDescriptorFactory() { - return GoogleBitmapDescriptor.FACTORY; - } - - @NonNull - @Override - public ButtCap newButtCap() { - return new GoogleButtCap(); - } - - @NonNull - @Override - public CameraUpdate.Factory getCameraUpdateFactory() { - return GoogleCameraUpdate.FACTORY; - } - - @NonNull - @Override - public CameraPosition newCameraPositionFromLatLngZoom(@NonNull LatLng target, float zoom) { - return newCameraPositionBuilder() - .target(target) - .zoom(zoom) - .build(); - } - - @NonNull - @Override - public CameraPosition.Builder newCameraPositionBuilder() { - return new GoogleCameraPosition.Builder(); - } - - @NonNull - @Override - public CameraPosition.Builder newCameraPositionBuilder(@NonNull CameraPosition camera) { - return new GoogleCameraPosition.Builder(camera); - } - - @NonNull - @Override - public Circle.Options newCircleOptions() { - return new GoogleCircle.Options(); - } - - @NonNull - @Override - public CustomCap newCustomCap(@NonNull BitmapDescriptor bitmapDescriptor, float refWidth) { - return new GoogleCustomCap(bitmapDescriptor, refWidth); - } - - @NonNull - @Override - public CustomCap newCustomCap(@NonNull BitmapDescriptor bitmapDescriptor) { - return new GoogleCustomCap(bitmapDescriptor); - } - - @NonNull - @Override - public Dot newDot() { - return new GoogleDot(); - } - - @NonNull - @Override - public Dash newDash(float length) { - return new GoogleDash(length); - } - - @NonNull - @Override - public Gap newGap(float length) { - return new GoogleGap(length); - } - - @NonNull - @Override - public GroundOverlay.Options newGroundOverlayOptions() { - return new GoogleGroundOverlay.Options(); - } - - @NonNull - @Override - public LatLng newLatLng(double latitude, double longitude) { - return new GoogleLatLng(latitude, longitude); - } - - @NonNull - @Override - public LatLngBounds newLatLngBounds(@NonNull LatLng southwest, @NonNull LatLng northeast) { - return new GoogleLatLngBounds(southwest, northeast); - } - - @NonNull - @Override - public LatLngBounds.Builder newLatLngBoundsBuilder() { - return new GoogleLatLngBounds.Builder(); - } - - @NonNull - @Override - public MapClient.Style.Options newMapStyleOptions(String json) { - return new GoogleMapClient.Style.Options(json); - } - - @NonNull - @Override - public MapClient.Style.Options newMapStyleOptions( - @NonNull Context context, @RawRes int resourceId) { - return new GoogleMapClient.Style.Options(context, resourceId); - } - - @NonNull - @Override - public Marker.Options newMarkerOptions() { - return new GoogleMarker.Options(); - } - - @NonNull - @Override - public Polygon.Options newPolygonOptions() { - return new GooglePolygon.Options(); - } - - @NonNull - @Override - public Polyline.Options newPolylineOptions() { - return new GooglePolyline.Options(); - } - - @NonNull - @Override - public RoundCap newRoundCap() { - return new GoogleRoundCap(); - } - - @NonNull - @Override - public SquareCap newSquareCap() { - return new GoogleSquareCap(); - } - - @NonNull - @Override - public TileOverlay.Options newTileOverlayOptions() { - return new GoogleTileOverlay.Options(); - } - - @NonNull - @Override - public Tile newTile(int width, int height, byte[] data) { - return new GoogleTile(width, height, data); - } - - @NonNull - @Override - public Tile noTile() { - return GoogleTileProvider.NO_TILE; - } - - @NonNull - @Override - public TileProvider newUrlTileProvider( - int width, int height, @NonNull UrlTileProvider tileProvider) { - return new GoogleUrlTileProvider(width, height, tileProvider); - } - - @NonNull - @Override - public VisibleRegion newVisibleRegion( - LatLng nearLeft, - LatLng nearRight, - LatLng farLeft, - LatLng farRight, - LatLngBounds latLngBounds) { - return new GoogleVisibleRegion(nearLeft, nearRight, farLeft, farRight, latLngBounds); - } - - - /** - * @see #getMapAsync(Fragment, MapKit.OnMapReadyCallback) - * @deprecated As of 1.2.0, use {@link #getMapAsync(Fragment, MapKit.OnMapReadyCallback)} - * instead. - */ - @SuppressWarnings("deprecation") - @Deprecated - @Override - public void getMapAsync( - @NonNull Fragment fragment, - @NonNull final OnMapReadyCallback callback) { - ((com.google.android.gms.maps.SupportMapFragment) fragment) - .getMapAsync(new com.google.android.gms.maps.OnMapReadyCallback() { - @Override - public void onMapReady(com.google.android.gms.maps.GoogleMap googleMap) { - callback.onMapReady(new GoogleMapClient(googleMap)); - } - }); - } - - @Override - public void getMapAsync( - @NonNull Fragment fragment, - @NonNull final MapKit.OnMapReadyCallback callback) { - ((com.google.android.gms.maps.SupportMapFragment) fragment) - .getMapAsync(new com.google.android.gms.maps.OnMapReadyCallback() { - @Override - public void onMapReady(com.google.android.gms.maps.GoogleMap googleMap) { - callback.onMapReady(new GoogleMapClient(googleMap)); - } - }); - } - - - @NonNull - public static MapFactory buildIfSupported(@NonNull Context context) { - final int result = - GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context); - if (UNAVAILABLE_RESULTS.contains(result)) { - throw new UnsupportedOperationException("Google Maps is not available."); - } - - return new GoogleMapFactory(); - } - -} diff --git a/maps-google/src/main/res/layout/kits_maps_internal_google_map_view.xml b/maps-google/src/main/res/layout/kits_maps_internal_google_map_view.xml index a99a3c4..0c23575 100644 --- a/maps-google/src/main/res/layout/kits_maps_internal_google_map_view.xml +++ b/maps-google/src/main/res/layout/kits_maps_internal_google_map_view.xml @@ -1,19 +1,20 @@ + - + + diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiBitmapDescriptor.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiBitmapDescriptor.java similarity index 76% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiBitmapDescriptor.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiBitmapDescriptor.java index df53629..70536e9 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiBitmapDescriptor.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiBitmapDescriptor.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import android.graphics.Bitmap; @@ -23,50 +23,43 @@ import com.huawei.hms.maps.model.BitmapDescriptorFactory; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.BitmapDescriptor; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.BitmapDescriptor; class HuaweiBitmapDescriptor implements BitmapDescriptor { static final Factory FACTORY = new Factory() { - @NonNull @Override - public BitmapDescriptor defaultMarker() { + public @NonNull BitmapDescriptor defaultMarker() { return new HuaweiBitmapDescriptor(BitmapDescriptorFactory.defaultMarker()); } - @NonNull @Override - public BitmapDescriptor defaultMarker(float hue) { + public @NonNull BitmapDescriptor defaultMarker(float hue) { return new HuaweiBitmapDescriptor(BitmapDescriptorFactory.defaultMarker(hue)); } - @NonNull @Override - public BitmapDescriptor fromAsset(String assetName) { + public @NonNull BitmapDescriptor fromAsset(String assetName) { return new HuaweiBitmapDescriptor(BitmapDescriptorFactory.fromAsset(assetName)); } - @NonNull @Override - public BitmapDescriptor fromBitmap(Bitmap image) { + public @NonNull BitmapDescriptor fromBitmap(Bitmap image) { return new HuaweiBitmapDescriptor(BitmapDescriptorFactory.fromBitmap(image)); } - @NonNull @Override - public BitmapDescriptor fromFile(String fileName) { + public @NonNull BitmapDescriptor fromFile(String fileName) { return new HuaweiBitmapDescriptor(BitmapDescriptorFactory.fromFile(fileName)); } - @NonNull @Override - public BitmapDescriptor fromPath(String absolutePath) { + public @NonNull BitmapDescriptor fromPath(String absolutePath) { return new HuaweiBitmapDescriptor(BitmapDescriptorFactory.fromPath(absolutePath)); } - @NonNull @Override - public BitmapDescriptor fromResource(int resourceId) { + public @NonNull BitmapDescriptor fromResource(int resourceId) { return new HuaweiBitmapDescriptor(BitmapDescriptorFactory.fromResource(resourceId)); } }; @@ -97,9 +90,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiButtCap.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiButtCap.java similarity index 86% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiButtCap.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiButtCap.java index cc36898..5a642a3 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiButtCap.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiButtCap.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,12 +14,12 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.ButtCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.ButtCap; class HuaweiButtCap extends HuaweiCap implements ButtCap { @@ -52,9 +52,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiCameraPosition.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiCameraPosition.java similarity index 79% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiCameraPosition.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiCameraPosition.java index cf007c8..a8a506a 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiCameraPosition.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiCameraPosition.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,14 +14,14 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.FloatRange; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CameraPosition; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CameraPosition; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; class HuaweiCameraPosition implements CameraPosition { @@ -33,9 +33,8 @@ private HuaweiCameraPosition(com.huawei.hms.maps.model.CameraPosition delegate) mDelegate = delegate; } - @NonNull @Override - public LatLng getTarget() { + public @NonNull LatLng getTarget() { if (mTarget == null) { mTarget = HuaweiLatLng.wrap(mDelegate.target); } @@ -76,9 +75,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } @@ -104,37 +102,32 @@ static class Builder implements CameraPosition.Builder { HuaweiCameraPosition.unwrap(camera)); } - @NonNull @Override - public CameraPosition.Builder target(@NonNull LatLng location) { + public @NonNull CameraPosition.Builder target(@NonNull LatLng location) { mDelegate.target(HuaweiLatLng.unwrap(location)); return this; } - @NonNull @Override - public CameraPosition.Builder zoom(float zoom) { + public @NonNull CameraPosition.Builder zoom(float zoom) { mDelegate.zoom(zoom); return this; } - @NonNull @Override - public CameraPosition.Builder tilt(@FloatRange(from = 0.0, to = 90.0) float tilt) { + public @NonNull CameraPosition.Builder tilt(@FloatRange(from = 0.0, to = 90.0) float tilt) { mDelegate.tilt(tilt); return this; } - @NonNull @Override - public CameraPosition.Builder bearing(float bearing) { + public @NonNull CameraPosition.Builder bearing(float bearing) { mDelegate.bearing(bearing); return this; } - @NonNull @Override - public CameraPosition build() { + public @NonNull CameraPosition build() { return HuaweiCameraPosition.wrap(mDelegate.build()); } } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiCameraUpdate.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiCameraUpdate.java similarity index 69% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiCameraUpdate.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiCameraUpdate.java index 2d978a8..da1787b 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiCameraUpdate.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiCameraUpdate.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import android.graphics.Point; @@ -23,86 +23,78 @@ import com.huawei.hms.maps.CameraUpdateFactory; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CameraPosition; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CameraUpdate; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLngBounds; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CameraPosition; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CameraUpdate; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLngBounds; class HuaweiCameraUpdate implements CameraUpdate { static final Factory FACTORY = new Factory() { - @NonNull @Override - public CameraUpdate zoomIn() { + public @NonNull CameraUpdate zoomIn() { return new HuaweiCameraUpdate(CameraUpdateFactory.zoomIn()); } - @NonNull @Override - public CameraUpdate zoomOut() { + public @NonNull CameraUpdate zoomOut() { return new HuaweiCameraUpdate(CameraUpdateFactory.zoomOut()); } - @NonNull @Override - public CameraUpdate scrollBy(float xPixel, float yPixel) { + public @NonNull CameraUpdate scrollBy(float xPixel, float yPixel) { return new HuaweiCameraUpdate(CameraUpdateFactory.scrollBy(xPixel, yPixel)); } - @NonNull @Override - public CameraUpdate zoomTo(float zoom) { + public @NonNull CameraUpdate zoomTo(float zoom) { return new HuaweiCameraUpdate(CameraUpdateFactory.zoomTo(zoom)); } - @NonNull @Override - public CameraUpdate zoomBy(float amount) { + public @NonNull CameraUpdate zoomBy(float amount) { return new HuaweiCameraUpdate(CameraUpdateFactory.zoomBy(amount)); } - @NonNull @Override - public CameraUpdate zoomBy(float amount, Point focus) { + public @NonNull CameraUpdate zoomBy(float amount, Point focus) { return new HuaweiCameraUpdate(CameraUpdateFactory.zoomBy(amount, focus)); } - @NonNull @Override - public CameraUpdate newCameraPosition(CameraPosition cameraPosition) { + public @NonNull CameraUpdate newCameraPosition(CameraPosition cameraPosition) { return new HuaweiCameraUpdate(CameraUpdateFactory.newCameraPosition( HuaweiCameraPosition.unwrap(cameraPosition) )); } - @NonNull @Override - public CameraUpdate newLatLng(@NonNull LatLng latLng) { + public @NonNull CameraUpdate newLatLng(@NonNull LatLng latLng) { return new HuaweiCameraUpdate(CameraUpdateFactory.newLatLng( HuaweiLatLng.unwrap(latLng) )); } - @NonNull @Override - public CameraUpdate newLatLngZoom(@NonNull LatLng latLng, float zoom) { + public @NonNull CameraUpdate newLatLngZoom(@NonNull LatLng latLng, float zoom) { return new HuaweiCameraUpdate(CameraUpdateFactory.newLatLngZoom( HuaweiLatLng.unwrap(latLng), zoom )); } - @NonNull @Override - public CameraUpdate newLatLngBounds(@NonNull LatLngBounds bounds, int padding) { + public @NonNull CameraUpdate newLatLngBounds(@NonNull LatLngBounds bounds, int padding) { return new HuaweiCameraUpdate(CameraUpdateFactory.newLatLngBounds( HuaweiLatLngBounds.unwrap(bounds), padding )); } - @NonNull @Override - public CameraUpdate newLatLngBounds( - @NonNull LatLngBounds bounds, int width, int height, int padding) { + public @NonNull CameraUpdate newLatLngBounds( + @NonNull LatLngBounds bounds, + int width, + int height, + int padding) { return new HuaweiCameraUpdate(CameraUpdateFactory.newLatLngBounds( HuaweiLatLngBounds.unwrap(bounds), width, height, padding )); @@ -135,9 +127,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiCap.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiCap.java similarity index 81% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiCap.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiCap.java index 917a007..4ac3623 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiCap.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiCap.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,13 +14,13 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.ButtCap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Cap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CustomCap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.RoundCap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.SquareCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.ButtCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Cap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CustomCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.RoundCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.SquareCap; abstract class HuaweiCap implements Cap { diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiCircle.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiCircle.java similarity index 82% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiCircle.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiCircle.java index 8254f8f..173cfc9 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiCircle.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiCircle.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,16 +14,16 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import java.util.List; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Circle; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.PatternItem; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Circle; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.PatternItem; class HuaweiCircle implements Circle { @@ -88,9 +88,8 @@ public void setStrokePattern(@Nullable List pattern) { mDelegate.setStrokePattern(HuaweiPatternItem.unwrap(pattern)); } - @Nullable @Override - public List getStrokePattern() { + public @Nullable List getStrokePattern() { return HuaweiPatternItem.wrap(mDelegate.getStrokePattern()); } @@ -139,9 +138,8 @@ public void setTag(@Nullable Object tag) { mDelegate.setTag(tag); } - @Nullable @Override - public Object getTag() { + public @Nullable Object getTag() { return mDelegate.getTag(); } @@ -164,9 +162,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } @@ -183,65 +180,56 @@ static class Options implements Circle.Options { mDelegate = new com.huawei.hms.maps.model.CircleOptions(); } - @NonNull @Override - public Circle.Options center(LatLng center) { + public @NonNull Circle.Options center(LatLng center) { mDelegate.center(HuaweiLatLng.unwrap(center)); return this; } - @NonNull @Override - public Circle.Options radius(double radius) { + public @NonNull Circle.Options radius(double radius) { mDelegate.radius(radius); return this; } - @NonNull @Override - public Circle.Options strokeWidth(float width) { + public @NonNull Circle.Options strokeWidth(float width) { mDelegate.strokeWidth(width); return this; } - @NonNull @Override - public Circle.Options strokeColor(int color) { + public @NonNull Circle.Options strokeColor(int color) { mDelegate.strokeColor(color); return this; } - @NonNull @Override - public Circle.Options strokePattern(@Nullable List pattern) { + public @NonNull Circle.Options strokePattern(@Nullable List pattern) { mDelegate.strokePattern(HuaweiPatternItem.unwrap(pattern)); return this; } - @NonNull @Override - public Circle.Options fillColor(int color) { + public @NonNull Circle.Options fillColor(int color) { mDelegate.fillColor(color); return this; } - @NonNull @Override - public Circle.Options zIndex(float zIndex) { + public @NonNull Circle.Options zIndex(float zIndex) { mDelegate.zIndex(zIndex); return this; } - @NonNull @Override - public Circle.Options visible(boolean visible) { + public @NonNull Circle.Options visible(boolean visible) { mDelegate.visible(visible); return this; } - @NonNull @Override - public Circle.Options clickable(boolean clickable) { + public @NonNull Circle.Options clickable(boolean clickable) { mDelegate.clickable(clickable); return this; } @@ -266,9 +254,8 @@ public int getStrokeColor() { return mDelegate.getStrokeColor(); } - @Nullable @Override - public List getStrokePattern() { + public @Nullable List getStrokePattern() { return HuaweiPatternItem.wrap(mDelegate.getStrokePattern()); } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiCustomCap.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiCustomCap.java similarity index 85% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiCustomCap.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiCustomCap.java index d6008da..674cdcb 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiCustomCap.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiCustomCap.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,13 +14,13 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.BitmapDescriptor; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CustomCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.BitmapDescriptor; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CustomCap; class HuaweiCustomCap extends HuaweiCap implements CustomCap { @@ -42,9 +42,8 @@ private HuaweiCustomCap(com.huawei.hms.maps.model.CustomCap delegate) { HuaweiBitmapDescriptor.unwrap(bitmapDescriptor))); } - @NonNull @Override - public BitmapDescriptor getBitmapDescriptor() { + public @NonNull BitmapDescriptor getBitmapDescriptor() { if (mBitmapDescriptor == null) { mBitmapDescriptor = HuaweiBitmapDescriptor.wrap(mDelegate.bitmapDescriptor); } @@ -75,9 +74,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiDash.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiDash.java similarity index 86% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiDash.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiDash.java index a368bcb..fd98963 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiDash.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiDash.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,12 +14,12 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Dash; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Dash; class HuaweiDash extends HuaweiPatternItem implements Dash { @@ -57,9 +57,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiDot.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiDot.java similarity index 85% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiDot.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiDot.java index 75e0723..ff13e66 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiDot.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiDot.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,12 +14,12 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Dot; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Dot; class HuaweiDot extends HuaweiPatternItem implements Dot { @@ -52,9 +52,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiGap.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiGap.java similarity index 86% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiGap.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiGap.java index 2ef4242..9147e47 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiGap.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiGap.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,12 +14,12 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Gap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Gap; class HuaweiGap extends HuaweiPatternItem implements Gap { @@ -57,9 +57,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiGroundOverlay.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiGroundOverlay.java similarity index 83% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiGroundOverlay.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiGroundOverlay.java index fb3ce8d..1ef4f81 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiGroundOverlay.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiGroundOverlay.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,15 +14,15 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.BitmapDescriptor; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.GroundOverlay; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLngBounds; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.BitmapDescriptor; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.GroundOverlay; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLngBounds; class HuaweiGroundOverlay implements GroundOverlay { @@ -166,9 +166,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } @@ -185,72 +184,65 @@ static class Options implements GroundOverlay.Options { mDelegate = new com.huawei.hms.maps.model.GroundOverlayOptions(); } - @NonNull @Override - public GroundOverlay.Options image(@NonNull BitmapDescriptor imageDescriptor) { + public @NonNull GroundOverlay.Options image(@NonNull BitmapDescriptor imageDescriptor) { mDelegate.image(HuaweiBitmapDescriptor.unwrap(imageDescriptor)); return this; } - @NonNull @Override - public GroundOverlay.Options anchor(float anchorU, float anchorV) { + public @NonNull GroundOverlay.Options anchor(float anchorU, float anchorV) { mDelegate.anchor(anchorU, anchorV); return this; } - @NonNull @Override - public GroundOverlay.Options position(@NonNull LatLng location, float width) { + public @NonNull GroundOverlay.Options position(@NonNull LatLng location, float width) { mDelegate.position(HuaweiLatLng.unwrap(location), width); return this; } - @NonNull @Override - public GroundOverlay.Options position(@NonNull LatLng location, float width, float height) { + public @NonNull GroundOverlay.Options position( + @NonNull LatLng location, + float width, + float height) { mDelegate.position(HuaweiLatLng.unwrap(location), width, height); return this; } - @NonNull @Override - public GroundOverlay.Options positionFromBounds(LatLngBounds bounds) { + public @NonNull GroundOverlay.Options positionFromBounds(LatLngBounds bounds) { mDelegate.positionFromBounds(HuaweiLatLngBounds.unwrap(bounds)); return this; } - @NonNull @Override - public GroundOverlay.Options bearing(float bearing) { + public @NonNull GroundOverlay.Options bearing(float bearing) { mDelegate.bearing(bearing); return this; } - @NonNull @Override - public GroundOverlay.Options zIndex(float zIndex) { + public @NonNull GroundOverlay.Options zIndex(float zIndex) { mDelegate.zIndex(zIndex); return this; } - @NonNull @Override - public GroundOverlay.Options visible(boolean visible) { + public @NonNull GroundOverlay.Options visible(boolean visible) { mDelegate.visible(visible); return this; } - @NonNull @Override - public GroundOverlay.Options transparency(float transparency) { + public @NonNull GroundOverlay.Options transparency(float transparency) { mDelegate.transparency(transparency); return this; } - @NonNull @Override - public GroundOverlay.Options clickable(boolean clickable) { + public @NonNull GroundOverlay.Options clickable(boolean clickable) { mDelegate.clickable(clickable); return this; } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiIndoorBuilding.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiIndoorBuilding.java similarity index 81% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiIndoorBuilding.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiIndoorBuilding.java index 7718bbe..0c0cab1 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiIndoorBuilding.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiIndoorBuilding.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,15 +14,15 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import java.util.List; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.IndoorBuilding; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.IndoorLevel; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.IndoorBuilding; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.IndoorLevel; class HuaweiIndoorBuilding implements IndoorBuilding { @@ -72,15 +72,14 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } - @Nullable - static IndoorBuilding wrap(@Nullable com.huawei.hms.maps.model.IndoorBuilding delegate) { + static @Nullable IndoorBuilding wrap( + @Nullable com.huawei.hms.maps.model.IndoorBuilding delegate) { return delegate == null ? null : new HuaweiIndoorBuilding(delegate); } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiIndoorLevel.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiIndoorLevel.java similarity index 88% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiIndoorLevel.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiIndoorLevel.java index 4406a11..39a92d2 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiIndoorLevel.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiIndoorLevel.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -22,7 +22,7 @@ import java.util.ArrayList; import java.util.List; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.IndoorLevel; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.IndoorLevel; class HuaweiIndoorLevel implements IndoorLevel { @@ -66,9 +66,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiLatLng.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiLatLng.java similarity index 91% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiLatLng.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiLatLng.java index 6914215..bef20f5 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiLatLng.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiLatLng.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -23,7 +23,7 @@ import java.util.Iterator; import java.util.List; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; class HuaweiLatLng implements LatLng { @@ -66,9 +66,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiLatLngBounds.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiLatLngBounds.java similarity index 79% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiLatLngBounds.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiLatLngBounds.java index b52aa92..cb7d93e 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiLatLngBounds.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiLatLngBounds.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,13 +14,13 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLngBounds; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLngBounds; class HuaweiLatLngBounds implements LatLngBounds { @@ -39,18 +39,16 @@ private HuaweiLatLngBounds(@NonNull com.huawei.hms.maps.model.LatLngBounds deleg HuaweiLatLng.unwrap(southwest), HuaweiLatLng.unwrap(northeast))); } - @NonNull @Override - public LatLng getSouthwest() { + public @NonNull LatLng getSouthwest() { if (mSouthwest == null) { mSouthwest = HuaweiLatLng.wrap(mDelegate.southwest); } return mSouthwest; } - @NonNull @Override - public LatLng getNortheast() { + public @NonNull LatLng getNortheast() { if (mNortheast == null) { mNortheast = HuaweiLatLng.wrap(mDelegate.northeast); } @@ -62,15 +60,13 @@ public boolean contains(@NonNull LatLng point) { return mDelegate.contains(HuaweiLatLng.unwrap(point)); } - @NonNull @Override - public LatLngBounds including(@NonNull LatLng point) { + public @NonNull LatLngBounds including(@NonNull LatLng point) { return HuaweiLatLngBounds.wrap(mDelegate.including(HuaweiLatLng.unwrap(point))); } - @NonNull @Override - public LatLng getCenter() { + public @NonNull LatLng getCenter() { if (mCenter == null) { mCenter = HuaweiLatLng.wrap(mDelegate.getCenter()); } @@ -96,9 +92,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } @@ -107,8 +102,7 @@ static LatLngBounds wrap(com.huawei.hms.maps.model.LatLngBounds delegate) { return new HuaweiLatLngBounds(delegate); } - @Nullable - static com.huawei.hms.maps.model.LatLngBounds unwrap(@Nullable LatLngBounds wrapped) { + static @Nullable com.huawei.hms.maps.model.LatLngBounds unwrap(@Nullable LatLngBounds wrapped) { return wrapped == null ? null : ((HuaweiLatLngBounds) wrapped).mDelegate; } @@ -120,16 +114,14 @@ static class Builder implements LatLngBounds.Builder { mDelegate = com.huawei.hms.maps.model.LatLngBounds.builder(); } - @NonNull @Override - public LatLngBounds.Builder include(@NonNull LatLng point) { + public @NonNull LatLngBounds.Builder include(@NonNull LatLng point) { mDelegate.include(HuaweiLatLng.unwrap(point)); return this; } - @NonNull @Override - public LatLngBounds build() { + public @NonNull LatLngBounds build() { return HuaweiLatLngBounds.wrap(mDelegate.build()); } } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiMapClient.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiMapClient.java similarity index 93% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiMapClient.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiMapClient.java index 0151324..99276c0 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiMapClient.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiMapClient.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import android.content.Context; import android.graphics.Bitmap; @@ -28,19 +28,19 @@ import androidx.annotation.RawRes; import androidx.annotation.RequiresPermission; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CameraPosition; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CameraUpdate; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Circle; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.GroundOverlay; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.IndoorBuilding; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLngBounds; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LocationSource; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Marker; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Polygon; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Polyline; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Projection; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.TileOverlay; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CameraPosition; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CameraUpdate; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Circle; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.GroundOverlay; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.IndoorBuilding; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLngBounds; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LocationSource; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Marker; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Polygon; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Polyline; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Projection; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.TileOverlay; import static android.Manifest.permission.ACCESS_COARSE_LOCATION; import static android.Manifest.permission.ACCESS_FINE_LOCATION; @@ -58,9 +58,8 @@ class HuaweiMapClient implements MapClient { mSettings = new UiSettings(map.getUiSettings()); } - @NonNull @Override - public CameraPosition getCameraPosition() { + public @NonNull CameraPosition getCameraPosition() { return HuaweiCameraPosition.wrap(mDelegate.getCameraPosition()); } @@ -134,40 +133,34 @@ public void stopAnimation() { mDelegate.stopAnimation(); } - @NonNull @Override - public Polyline addPolyline(Polyline.Options options) { + public @NonNull Polyline addPolyline(Polyline.Options options) { return HuaweiPolyline.wrap(mDelegate.addPolyline(HuaweiPolyline.Options.unwrap(options))); } - @NonNull @Override - public Polygon addPolygon(Polygon.Options options) { + public @NonNull Polygon addPolygon(Polygon.Options options) { return HuaweiPolygon.wrap(mDelegate.addPolygon(HuaweiPolygon.Options.unwrap(options))); } - @NonNull @Override - public Circle addCircle(Circle.Options options) { + public @NonNull Circle addCircle(Circle.Options options) { return HuaweiCircle.wrap(mDelegate.addCircle(HuaweiCircle.Options.unwrap(options))); } - @NonNull @Override - public Marker addMarker(Marker.Options options) { + public @NonNull Marker addMarker(Marker.Options options) { return HuaweiMarker.wrap(mDelegate.addMarker(HuaweiMarker.Options.unwrap(options))); } - @NonNull @Override - public GroundOverlay addGroundOverlay(GroundOverlay.Options options) { + public @NonNull GroundOverlay addGroundOverlay(GroundOverlay.Options options) { return HuaweiGroundOverlay.wrap( mDelegate.addGroundOverlay(HuaweiGroundOverlay.Options.unwrap(options))); } - @NonNull @Override - public TileOverlay addTileOverlay(TileOverlay.Options options) { + public @NonNull TileOverlay addTileOverlay(TileOverlay.Options options) { return HuaweiTileOverlay.wrap( mDelegate.addTileOverlay(HuaweiTileOverlay.Options.unwrap(options))); } @@ -177,9 +170,8 @@ public void clear() { mDelegate.clear(); } - @Nullable @Override - public IndoorBuilding getFocusedBuilding() { + public @Nullable IndoorBuilding getFocusedBuilding() { return HuaweiIndoorBuilding.wrap(mDelegate.getFocusedBuilding()); } @@ -280,15 +272,13 @@ public void deactivate() { }); } - @NonNull @Override - public MapClient.UiSettings getUiSettings() { + public @NonNull MapClient.UiSettings getUiSettings() { return mSettings; } - @NonNull @Override - public Projection getProjection() { + public @NonNull Projection getProjection() { return HuaweiProjection.wrap(mDelegate.getProjection()); } @@ -675,15 +665,13 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } - @Nullable - static com.huawei.hms.maps.model.MapStyleOptions unwrap( + static @Nullable com.huawei.hms.maps.model.MapStyleOptions unwrap( @Nullable MapClient.Style.Options wrapped) { return wrapped == null ? null : ((Style.Options) wrapped).mDelegate; } diff --git a/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiMapFactory.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiMapFactory.java new file mode 100644 index 0000000..35dff42 --- /dev/null +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiMapFactory.java @@ -0,0 +1,251 @@ +/* + * Copyright 2020 Supasin Tatiyanupanwong + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; + +import android.content.Context; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.RawRes; +import androidx.fragment.app.Fragment; + +import com.huawei.hms.api.ConnectionResult; +import com.huawei.hms.api.HuaweiApiAvailability; + +import java.util.Arrays; +import java.util.List; + +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.BitmapDescriptor; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.ButtCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CameraPosition; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CameraUpdate; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Circle; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CustomCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Dash; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Dot; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Gap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.GroundOverlay; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLngBounds; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapFactory; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Marker; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Polygon; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Polyline; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.RoundCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.SquareCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Tile; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.TileOverlay; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.TileProvider; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.UrlTileProvider; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.VisibleRegion; + +@SuppressWarnings("unused") +public class HuaweiMapFactory implements MapFactory { + private static final List UNAVAILABLE_RESULTS = Arrays.asList( + ConnectionResult.SERVICE_DISABLED, + ConnectionResult.SERVICE_MISSING, + ConnectionResult.SERVICE_INVALID); + + private HuaweiMapFactory() {} + + @Override + public @NonNull BitmapDescriptor.Factory getBitmapDescriptorFactory() { + return HuaweiBitmapDescriptor.FACTORY; + } + + @Override + public @NonNull ButtCap newButtCap() { + return new HuaweiButtCap(); + } + + @Override + public @NonNull CameraUpdate.Factory getCameraUpdateFactory() { + return HuaweiCameraUpdate.FACTORY; + } + + @Override + public @NonNull CameraPosition newCameraPositionFromLatLngZoom( + @NonNull LatLng target, + float zoom) { + return newCameraPositionBuilder() + .target(target) + .zoom(zoom) + .build(); + } + + @Override + public @NonNull CameraPosition.Builder newCameraPositionBuilder() { + return new HuaweiCameraPosition.Builder(); + } + + @Override + public @NonNull CameraPosition.Builder newCameraPositionBuilder( + @NonNull CameraPosition camera) { + return new HuaweiCameraPosition.Builder(camera); + } + + @Override + public @NonNull Circle.Options newCircleOptions() { + return new HuaweiCircle.Options(); + } + + @Override + public @NonNull CustomCap newCustomCap( + @NonNull BitmapDescriptor bitmapDescriptor, + float refWidth) { + return new HuaweiCustomCap(bitmapDescriptor, refWidth); + } + + @Override + public @NonNull CustomCap newCustomCap(@NonNull BitmapDescriptor bitmapDescriptor) { + return new HuaweiCustomCap(bitmapDescriptor); + } + + @Override + public @NonNull Dot newDot() { + return new HuaweiDot(); + } + + @Override + public @NonNull Dash newDash(float length) { + return new HuaweiDash(length); + } + + @Override + public @NonNull Gap newGap(float length) { + return new HuaweiGap(length); + } + + @Override + public @NonNull GroundOverlay.Options newGroundOverlayOptions() { + return new HuaweiGroundOverlay.Options(); + } + + @Override + public @NonNull LatLng newLatLng(double latitude, double longitude) { + return new HuaweiLatLng(latitude, longitude); + } + + @Override + public @NonNull LatLngBounds newLatLngBounds( + @NonNull LatLng southwest, + @NonNull LatLng northeast) { + return new HuaweiLatLngBounds(southwest, northeast); + } + + @Override + public @NonNull LatLngBounds.Builder newLatLngBoundsBuilder() { + return new HuaweiLatLngBounds.Builder(); + } + + @Override + public @NonNull MapClient.Style.Options newMapStyleOptions(String json) { + return new HuaweiMapClient.Style.Options(json); + } + + @Override + public @NonNull MapClient.Style.Options newMapStyleOptions( + @NonNull Context context, + @RawRes int resourceId) { + return new HuaweiMapClient.Style.Options(context, resourceId); + } + + @Override + public @NonNull Marker.Options newMarkerOptions() { + return new HuaweiMarker.Options(); + } + + @Override + public @NonNull Polygon.Options newPolygonOptions() { + return new HuaweiPolygon.Options(); + } + + @Override + public @NonNull Polyline.Options newPolylineOptions() { + return new HuaweiPolyline.Options(); + } + + @Override + public @NonNull RoundCap newRoundCap() { + return new HuaweiRoundCap(); + } + + @Override + public @NonNull SquareCap newSquareCap() { + return new HuaweiSquareCap(); + } + + @Override + public @NonNull TileOverlay.Options newTileOverlayOptions() { + return new HuaweiTileOverlay.Options(); + } + + @Override + public @NonNull Tile newTile(int width, int height, byte[] data) { + return new HuaweiTile(width, height, data); + } + + @Override + public @NonNull Tile noTile() { + return HuaweiTileProvider.NO_TILE; + } + + @Override + public @NonNull TileProvider newUrlTileProvider( + int width, + int height, + @NonNull UrlTileProvider tileProvider) { + return new HuaweiUrlTileProvider(width, height, tileProvider); + } + + @Override + public @NonNull VisibleRegion newVisibleRegion( + LatLng nearLeft, + LatLng nearRight, + LatLng farLeft, + LatLng farRight, + LatLngBounds latLngBounds) { + return new HuaweiVisibleRegion(nearLeft, nearRight, farLeft, farRight, latLngBounds); + } + + @Override + public void getMapAsync( + @NonNull Fragment fragment, + @NonNull final MapKit.OnMapReadyCallback callback) { + ((com.huawei.hms.maps.SupportMapFragment) fragment) + .getMapAsync(new com.huawei.hms.maps.OnMapReadyCallback() { + @Override + public void onMapReady(com.huawei.hms.maps.HuaweiMap huaweiMap) { + callback.onMapReady(new HuaweiMapClient(huaweiMap)); + } + }); + } + + + public static @Nullable MapFactory buildIfSupported(@NonNull Context context) { + final int result = + HuaweiApiAvailability.getInstance().isHuaweiMobileServicesAvailable(context); + if (UNAVAILABLE_RESULTS.contains(result)) { + return null; + } + + return new HuaweiMapFactory(); + } + +} diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiMarker.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiMarker.java similarity index 82% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiMarker.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiMarker.java index 1ce6fb7..e252472 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiMarker.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiMarker.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,14 +14,14 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.BitmapDescriptor; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Marker; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.BitmapDescriptor; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Marker; class HuaweiMarker implements Marker { @@ -36,9 +36,8 @@ public void remove() { mDelegate.remove(); } - @NonNull @Override - public String getId() { + public @NonNull String getId() { return mDelegate.getId(); } @@ -47,9 +46,8 @@ public void setPosition(@NonNull LatLng latLng) { mDelegate.setPosition(HuaweiLatLng.unwrap(latLng)); } - @NonNull @Override - public LatLng getPosition() { + public @NonNull LatLng getPosition() { return HuaweiLatLng.wrap(mDelegate.getPosition()); } @@ -168,9 +166,8 @@ public void setTag(@Nullable Object tag) { mDelegate.setTag(tag); } - @Nullable @Override - public Object getTag() { + public @Nullable Object getTag() { return mDelegate.getTag(); } @@ -193,9 +190,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } @@ -212,86 +208,74 @@ static class Options implements Marker.Options { mDelegate = new com.huawei.hms.maps.model.MarkerOptions(); } - @NonNull @Override - public Marker.Options position(@NonNull LatLng latLng) { + public @NonNull Marker.Options position(@NonNull LatLng latLng) { mDelegate.position(HuaweiLatLng.unwrap(latLng)); return this; } - @NonNull @Override - public Marker.Options zIndex(float zIndex) { + public @NonNull Marker.Options zIndex(float zIndex) { mDelegate.zIndex(zIndex); return this; } - @NonNull @Override - public Marker.Options icon(@Nullable BitmapDescriptor iconDescriptor) { + public @NonNull Marker.Options icon(@Nullable BitmapDescriptor iconDescriptor) { mDelegate.icon(HuaweiBitmapDescriptor.unwrap(iconDescriptor)); return this; } - @NonNull @Override - public Marker.Options anchor(float anchorU, float anchorV) { + public @NonNull Marker.Options anchor(float anchorU, float anchorV) { mDelegate.anchorMarker(anchorU, anchorV); return this; } - @NonNull @Override - public Marker.Options infoWindowAnchor(float anchorU, float anchorV) { + public @NonNull Marker.Options infoWindowAnchor(float anchorU, float anchorV) { mDelegate.infoWindowAnchor(anchorU, anchorV); return this; } - @NonNull @Override - public Marker.Options title(@Nullable String title) { + public @NonNull Marker.Options title(@Nullable String title) { mDelegate.title(title); return this; } - @NonNull @Override - public Marker.Options snippet(@Nullable String snippet) { + public @NonNull Marker.Options snippet(@Nullable String snippet) { mDelegate.snippet(snippet); return this; } - @NonNull @Override - public Marker.Options draggable(boolean draggable) { + public @NonNull Marker.Options draggable(boolean draggable) { mDelegate.draggable(draggable); return this; } - @NonNull @Override - public Marker.Options visible(boolean visible) { + public @NonNull Marker.Options visible(boolean visible) { mDelegate.visible(visible); return this; } - @NonNull @Override - public Marker.Options flat(boolean flat) { + public @NonNull Marker.Options flat(boolean flat) { mDelegate.flat(flat); return this; } - @NonNull @Override - public Marker.Options rotation(float rotation) { + public @NonNull Marker.Options rotation(float rotation) { mDelegate.rotation(rotation); return this; } - @NonNull @Override - public Marker.Options alpha(float alpha) { + public @NonNull Marker.Options alpha(float alpha) { mDelegate.alpha(alpha); return this; } @@ -311,9 +295,8 @@ public String getSnippet() { return mDelegate.getSnippet(); } - @Nullable @Override - public BitmapDescriptor getIcon() { + public @Nullable BitmapDescriptor getIcon() { return HuaweiBitmapDescriptor.wrap(mDelegate.getIcon()); } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiPatternItem.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiPatternItem.java similarity index 86% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiPatternItem.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiPatternItem.java index 8506b2a..aa00142 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiPatternItem.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiPatternItem.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,15 +14,15 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import java.util.ArrayList; import java.util.List; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Dash; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Dot; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Gap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.PatternItem; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Dash; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Dot; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Gap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.PatternItem; abstract class HuaweiPatternItem implements PatternItem { diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiPointOfInterest.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiPointOfInterest.java similarity index 83% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiPointOfInterest.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiPointOfInterest.java index c5d2325..4e70baf 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiPointOfInterest.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiPointOfInterest.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,13 +14,13 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.PointOfInterest; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.PointOfInterest; class HuaweiPointOfInterest implements PointOfInterest { @@ -32,9 +32,8 @@ private HuaweiPointOfInterest(com.huawei.hms.maps.model.PointOfInterest delegate mDelegate = delegate; } - @NonNull @Override - public LatLng getLatLng() { + public @NonNull LatLng getLatLng() { if (mLatLng == null) { mLatLng = HuaweiLatLng.wrap(mDelegate.latLng); } @@ -70,9 +69,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiPolygon.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiPolygon.java similarity index 83% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiPolygon.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiPolygon.java index 72a380b..5499557 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiPolygon.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiPolygon.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -23,9 +23,9 @@ import java.util.Arrays; import java.util.List; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.PatternItem; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Polygon; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.PatternItem; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Polygon; class HuaweiPolygon implements Polygon { @@ -108,9 +108,8 @@ public void setStrokePattern(@Nullable List pattern) { mDelegate.setStrokePattern(HuaweiPatternItem.unwrap(pattern)); } - @Nullable @Override - public List getStrokePattern() { + public @Nullable List getStrokePattern() { return HuaweiPatternItem.wrap(mDelegate.getStrokePattern()); } @@ -169,9 +168,8 @@ public void setTag(@Nullable Object tag) { mDelegate.setTag(tag); } - @Nullable @Override - public Object getTag() { + public @Nullable Object getTag() { return mDelegate.getTag(); } @@ -194,9 +192,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } @@ -213,93 +210,80 @@ static class Options implements Polygon.Options { mDelegate = new com.huawei.hms.maps.model.PolygonOptions(); } - @NonNull @Override - public Polygon.Options add(LatLng point) { + public @NonNull Polygon.Options add(LatLng point) { mDelegate.add(HuaweiLatLng.unwrap(point)); return this; } - @NonNull @Override - public Polygon.Options add(LatLng... points) { + public @NonNull Polygon.Options add(LatLng... points) { mDelegate.addAll(HuaweiLatLng.unwrap(Arrays.asList(points))); return this; } - @NonNull @Override - public Polygon.Options addAll(Iterable points) { + public @NonNull Polygon.Options addAll(Iterable points) { mDelegate.addAll(HuaweiLatLng.unwrap(points)); return this; } - @NonNull @Override - public Polygon.Options addHole(Iterable points) { + public @NonNull Polygon.Options addHole(Iterable points) { mDelegate.addHole(HuaweiLatLng.unwrap(points)); return this; } - @NonNull @Override - public Polygon.Options strokeWidth(float width) { + public @NonNull Polygon.Options strokeWidth(float width) { mDelegate.strokeWidth(width); return this; } - @NonNull @Override - public Polygon.Options strokeColor(int color) { + public @NonNull Polygon.Options strokeColor(int color) { mDelegate.strokeColor(color); return this; } - @NonNull @Override - public Polygon.Options strokeJointType(int jointType) { + public @NonNull Polygon.Options strokeJointType(int jointType) { mDelegate.strokeJointType(jointType); return this; } - @NonNull @Override - public Polygon.Options strokePattern(@Nullable List pattern) { + public @NonNull Polygon.Options strokePattern(@Nullable List pattern) { mDelegate.strokePattern(HuaweiPatternItem.unwrap(pattern)); return this; } - @NonNull @Override - public Polygon.Options fillColor(int color) { + public @NonNull Polygon.Options fillColor(int color) { mDelegate.fillColor(color); return this; } - @NonNull @Override - public Polygon.Options zIndex(float zIndex) { + public @NonNull Polygon.Options zIndex(float zIndex) { mDelegate.zIndex(zIndex); return this; } - @NonNull @Override - public Polygon.Options visible(boolean visible) { + public @NonNull Polygon.Options visible(boolean visible) { mDelegate.visible(visible); return this; } - @NonNull @Override - public Polygon.Options geodesic(boolean geodesic) { + public @NonNull Polygon.Options geodesic(boolean geodesic) { mDelegate.geodesic(geodesic); return this; } - @NonNull @Override - public Polygon.Options clickable(boolean clickable) { + public @NonNull Polygon.Options clickable(boolean clickable) { mDelegate.clickable(clickable); return this; } @@ -333,9 +317,8 @@ public int getStrokeJointType() { return mDelegate.getStrokeJointType(); } - @Nullable @Override - public List getStrokePattern() { + public @Nullable List getStrokePattern() { return HuaweiPatternItem.wrap(mDelegate.getStrokePattern()); } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiPolyline.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiPolyline.java similarity index 79% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiPolyline.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiPolyline.java index 8e3753a..905437f 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiPolyline.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiPolyline.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -22,10 +22,10 @@ import java.util.Arrays; import java.util.List; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Cap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.PatternItem; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Polyline; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Cap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.PatternItem; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Polyline; class HuaweiPolyline implements Polyline { @@ -80,9 +80,8 @@ public void setStartCap(@NonNull Cap startCap) { mDelegate.setStartCap(HuaweiCap.unwrap(startCap)); } - @NonNull @Override - public Cap getStartCap() { + public @NonNull Cap getStartCap() { return HuaweiCap.wrap(mDelegate.getStartCap()); } @@ -91,9 +90,8 @@ public void setEndCap(@NonNull Cap endCap) { mDelegate.setEndCap(HuaweiCap.unwrap(endCap)); } - @NonNull @Override - public Cap getEndCap() { + public @NonNull Cap getEndCap() { return HuaweiCap.wrap(mDelegate.getEndCap()); } @@ -112,9 +110,8 @@ public void setPattern(@Nullable List pattern) { mDelegate.setPattern(HuaweiPatternItem.unwrap(pattern)); } - @Nullable @Override - public List getPattern() { + public @Nullable List getPattern() { return HuaweiPatternItem.wrap(mDelegate.getPattern()); } @@ -163,9 +160,8 @@ public void setTag(@Nullable Object tag) { mDelegate.setTag(tag); } - @Nullable @Override - public Object getTag() { + public @Nullable Object getTag() { return mDelegate.getTag(); } @@ -188,9 +184,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } @@ -207,93 +202,80 @@ static class Options implements Polyline.Options { mDelegate = new com.huawei.hms.maps.model.PolylineOptions(); } - @NonNull @Override - public Polyline.Options add(LatLng point) { + public @NonNull Polyline.Options add(LatLng point) { mDelegate.add(HuaweiLatLng.unwrap(point)); return this; } - @NonNull @Override - public Polyline.Options add(LatLng... points) { + public @NonNull Polyline.Options add(LatLng... points) { mDelegate.addAll(HuaweiLatLng.unwrap(Arrays.asList(points))); return this; } - @NonNull @Override - public Polyline.Options addAll(Iterable points) { + public @NonNull Polyline.Options addAll(Iterable points) { mDelegate.addAll(HuaweiLatLng.unwrap(points)); return this; } - @NonNull @Override - public Polyline.Options width(float width) { + public @NonNull Polyline.Options width(float width) { mDelegate.width(width); return this; } - @NonNull @Override - public Polyline.Options color(int color) { + public @NonNull Polyline.Options color(int color) { mDelegate.color(color); return this; } - @NonNull @Override - public Polyline.Options startCap(@NonNull Cap startCap) { + public @NonNull Polyline.Options startCap(@NonNull Cap startCap) { mDelegate.startCap(HuaweiCap.unwrap(startCap)); return this; } - @NonNull @Override - public Polyline.Options endCap(@NonNull Cap endCap) { + public @NonNull Polyline.Options endCap(@NonNull Cap endCap) { mDelegate.endCap(HuaweiCap.unwrap(endCap)); return this; } - @NonNull @Override - public Polyline.Options jointType(int jointType) { + public @NonNull Polyline.Options jointType(int jointType) { mDelegate.jointType(jointType); return this; } - @NonNull @Override - public Polyline.Options pattern(@Nullable List pattern) { + public @NonNull Polyline.Options pattern(@Nullable List pattern) { mDelegate.pattern(HuaweiPatternItem.unwrap(pattern)); return this; } - @NonNull @Override - public Polyline.Options zIndex(float zIndex) { + public @NonNull Polyline.Options zIndex(float zIndex) { mDelegate.zIndex(zIndex); return this; } - @NonNull @Override - public Polyline.Options visible(boolean visible) { + public @NonNull Polyline.Options visible(boolean visible) { mDelegate.visible(visible); return this; } - @NonNull @Override - public Polyline.Options geodesic(boolean geodesic) { + public @NonNull Polyline.Options geodesic(boolean geodesic) { mDelegate.geodesic(geodesic); return this; } - @NonNull @Override - public Polyline.Options clickable(boolean clickable) { + public @NonNull Polyline.Options clickable(boolean clickable) { mDelegate.clickable(clickable); return this; } @@ -313,15 +295,13 @@ public int getColor() { return mDelegate.getColor(); } - @NonNull @Override - public Cap getStartCap() { + public @NonNull Cap getStartCap() { return HuaweiCap.wrap(mDelegate.getStartCap()); } - @NonNull @Override - public Cap getEndCap() { + public @NonNull Cap getEndCap() { return HuaweiCap.wrap(mDelegate.getEndCap()); } @@ -330,9 +310,8 @@ public int getJointType() { return mDelegate.getJointType(); } - @Nullable @Override - public List getPattern() { + public @Nullable List getPattern() { return HuaweiPatternItem.wrap(mDelegate.getPattern()); } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiProjection.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiProjection.java similarity index 75% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiProjection.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiProjection.java index 28f320c..c0872f4 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiProjection.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiProjection.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,16 +14,16 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import android.graphics.Point; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Projection; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.VisibleRegion; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Projection; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.VisibleRegion; class HuaweiProjection implements Projection { @@ -33,21 +33,18 @@ private HuaweiProjection(com.huawei.hms.maps.Projection delegate) { mDelegate = delegate; } - @Nullable @Override - public LatLng fromScreenLocation(Point point) { + public @Nullable LatLng fromScreenLocation(Point point) { return HuaweiLatLng.wrap(mDelegate.fromScreenLocation(point)); } - @NonNull @Override - public Point toScreenLocation(LatLng location) { + public @NonNull Point toScreenLocation(LatLng location) { return mDelegate.toScreenLocation(HuaweiLatLng.unwrap(location)); } - @NonNull @Override - public VisibleRegion getVisibleRegion() { + public @NonNull VisibleRegion getVisibleRegion() { return HuaweiVisibleRegion.wrap(mDelegate.getVisibleRegion()); } @@ -70,9 +67,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiRoundCap.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiRoundCap.java similarity index 86% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiRoundCap.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiRoundCap.java index 1f5b8bc..1da654c 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiRoundCap.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiRoundCap.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,12 +14,12 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.RoundCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.RoundCap; class HuaweiRoundCap extends HuaweiCap implements RoundCap { @@ -52,9 +52,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiSquareCap.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiSquareCap.java similarity index 86% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiSquareCap.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiSquareCap.java index cce90dc..e470400 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiSquareCap.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiSquareCap.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,12 +14,12 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.SquareCap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.SquareCap; class HuaweiSquareCap extends HuaweiCap implements SquareCap { @@ -52,9 +52,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiTile.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiTile.java similarity index 85% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiTile.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiTile.java index f681620..ade4e36 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiTile.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiTile.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,12 +14,12 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Tile; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Tile; class HuaweiTile implements Tile { @@ -43,9 +43,8 @@ public int getHeight() { return mDelegate.height; } - @Nullable @Override - public byte[] getData() { + public @Nullable byte[] getData() { return mDelegate.data; } @@ -68,9 +67,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiTileOverlay.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiTileOverlay.java similarity index 84% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiTileOverlay.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiTileOverlay.java index 6e10c22..7e382bb 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiTileOverlay.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiTileOverlay.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,13 +14,13 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.TileOverlay; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.TileProvider; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.TileOverlay; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.TileProvider; class HuaweiTileOverlay implements TileOverlay { @@ -104,9 +104,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } @@ -123,37 +122,32 @@ static class Options implements TileOverlay.Options { mDelegate = new com.huawei.hms.maps.model.TileOverlayOptions(); } - @NonNull @Override - public TileOverlay.Options tileProvider(TileProvider tileProvider) { + public @NonNull TileOverlay.Options tileProvider(TileProvider tileProvider) { mDelegate.tileProvider(HuaweiTileProvider.unwrap(tileProvider)); return this; } - @NonNull @Override - public TileOverlay.Options zIndex(float zIndex) { + public @NonNull TileOverlay.Options zIndex(float zIndex) { mDelegate.zIndex(zIndex); return this; } - @NonNull @Override - public TileOverlay.Options visible(boolean visible) { + public @NonNull TileOverlay.Options visible(boolean visible) { mDelegate.visible(visible); return this; } - @NonNull @Override - public TileOverlay.Options fadeIn(boolean fadeIn) { + public @NonNull TileOverlay.Options fadeIn(boolean fadeIn) { mDelegate.fadeIn(fadeIn); return this; } - @NonNull @Override - public TileOverlay.Options transparency(float transparency) { + public @NonNull TileOverlay.Options transparency(float transparency) { mDelegate.transparency(transparency); return this; } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiTileProvider.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiTileProvider.java similarity index 86% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiTileProvider.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiTileProvider.java index 185c66c..211fb56 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiTileProvider.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiTileProvider.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,13 +14,13 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Tile; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.TileProvider; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Tile; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.TileProvider; class HuaweiTileProvider implements TileProvider { static final Tile NO_TILE = @@ -65,9 +65,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiUrlTileProvider.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiUrlTileProvider.java similarity index 87% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiUrlTileProvider.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiUrlTileProvider.java index 8d582f8..a031a2c 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiUrlTileProvider.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiUrlTileProvider.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,14 +14,14 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import java.net.URL; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.UrlTileProvider; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.UrlTileProvider; class HuaweiUrlTileProvider extends HuaweiTileProvider implements UrlTileProvider { @@ -65,9 +65,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiVisibleRegion.java b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiVisibleRegion.java similarity index 82% rename from maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiVisibleRegion.java rename to maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiVisibleRegion.java index 4772336..4b1815d 100644 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiVisibleRegion.java +++ b/maps-huawei/src/main/java/dev/supasintatiyanupanwong/libraries/android/kits/maps/internal/huawei/model/HuaweiVisibleRegion.java @@ -1,11 +1,11 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong + * Copyright 2020 Supasin Tatiyanupanwong * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,14 +14,14 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; +package dev.supasintatiyanupanwong.libraries.android.kits.maps.internal.huawei.model; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLngBounds; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.VisibleRegion; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLngBounds; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.VisibleRegion; class HuaweiVisibleRegion implements VisibleRegion { @@ -51,45 +51,40 @@ private HuaweiVisibleRegion(com.huawei.hms.maps.model.VisibleRegion delegate) { HuaweiLatLngBounds.unwrap(latLngBounds))); } - @NonNull @Override - public LatLng getNearLeft() { + public @NonNull LatLng getNearLeft() { if (mNearLeft == null) { mNearLeft = HuaweiLatLng.wrap(mDelegate.nearLeft); } return mNearLeft; } - @NonNull @Override - public LatLng getNearRight() { + public @NonNull LatLng getNearRight() { if (mNearRight == null) { mNearRight = HuaweiLatLng.wrap(mDelegate.nearRight); } return mNearRight; } - @NonNull @Override - public LatLng getFarLeft() { + public @NonNull LatLng getFarLeft() { if (mFarLeft == null) { mFarLeft = HuaweiLatLng.wrap(mDelegate.farLeft); } return mFarLeft; } - @NonNull @Override - public LatLng getFarRight() { + public @NonNull LatLng getFarRight() { if (mFarRight == null) { mFarRight = HuaweiLatLng.wrap(mDelegate.farRight); } return mFarRight; } - @NonNull @Override - public LatLngBounds getLatLngBounds() { + public @NonNull LatLngBounds getLatLngBounds() { if (mLatLngBounds == null) { mLatLngBounds = HuaweiLatLngBounds.wrap(mDelegate.latLngBounds); } @@ -115,9 +110,8 @@ public int hashCode() { return mDelegate.hashCode(); } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return mDelegate.toString(); } @@ -126,4 +120,4 @@ static VisibleRegion wrap(com.huawei.hms.maps.model.VisibleRegion delegate) { return new HuaweiVisibleRegion(delegate); } -} \ No newline at end of file +} diff --git a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiMapFactory.java b/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiMapFactory.java deleted file mode 100644 index 900e1d1..0000000 --- a/maps-huawei/src/main/java/me/tatiyanupanwong/supasin/android/libraries/kits/maps/internal/huawei/model/HuaweiMapFactory.java +++ /dev/null @@ -1,274 +0,0 @@ -package me.tatiyanupanwong.supasin.android.libraries.kits.maps.internal.huawei.model; - -import android.content.Context; - -import androidx.annotation.NonNull; -import androidx.annotation.RawRes; -import androidx.fragment.app.Fragment; - -import com.huawei.hms.api.ConnectionResult; -import com.huawei.hms.api.HuaweiApiAvailability; - -import java.util.Arrays; -import java.util.List; - -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.BitmapDescriptor; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.ButtCap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CameraPosition; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CameraUpdate; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Circle; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CustomCap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Dash; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Dot; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Gap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.GroundOverlay; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLngBounds; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapFactory; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Marker; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Polygon; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Polyline; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.RoundCap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.SquareCap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Tile; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.TileOverlay; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.TileProvider; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.UrlTileProvider; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.VisibleRegion; - -@SuppressWarnings("unused") -public class HuaweiMapFactory implements MapFactory { - private static final List UNAVAILABLE_RESULTS = Arrays.asList( - ConnectionResult.SERVICE_DISABLED, - ConnectionResult.SERVICE_MISSING, - ConnectionResult.SERVICE_INVALID); - - private HuaweiMapFactory() {} - - @NonNull - @Override - public BitmapDescriptor.Factory getBitmapDescriptorFactory() { - return HuaweiBitmapDescriptor.FACTORY; - } - - @NonNull - @Override - public ButtCap newButtCap() { - return new HuaweiButtCap(); - } - - @NonNull - @Override - public CameraUpdate.Factory getCameraUpdateFactory() { - return HuaweiCameraUpdate.FACTORY; - } - - @NonNull - @Override - public CameraPosition newCameraPositionFromLatLngZoom(@NonNull LatLng target, float zoom) { - return newCameraPositionBuilder() - .target(target) - .zoom(zoom) - .build(); - } - - @NonNull - @Override - public CameraPosition.Builder newCameraPositionBuilder() { - return new HuaweiCameraPosition.Builder(); - } - - @NonNull - @Override - public CameraPosition.Builder newCameraPositionBuilder(@NonNull CameraPosition camera) { - return new HuaweiCameraPosition.Builder(camera); - } - - @NonNull - @Override - public Circle.Options newCircleOptions() { - return new HuaweiCircle.Options(); - } - - @NonNull - @Override - public CustomCap newCustomCap(@NonNull BitmapDescriptor bitmapDescriptor, float refWidth) { - return new HuaweiCustomCap(bitmapDescriptor, refWidth); - } - - @NonNull - @Override - public CustomCap newCustomCap(@NonNull BitmapDescriptor bitmapDescriptor) { - return new HuaweiCustomCap(bitmapDescriptor); - } - - @NonNull - @Override - public Dot newDot() { - return new HuaweiDot(); - } - - @NonNull - @Override - public Dash newDash(float length) { - return new HuaweiDash(length); - } - - @NonNull - @Override - public Gap newGap(float length) { - return new HuaweiGap(length); - } - - @NonNull - @Override - public GroundOverlay.Options newGroundOverlayOptions() { - return new HuaweiGroundOverlay.Options(); - } - - @NonNull - @Override - public LatLng newLatLng(double latitude, double longitude) { - return new HuaweiLatLng(latitude, longitude); - } - - @NonNull - @Override - public LatLngBounds newLatLngBounds(@NonNull LatLng southwest, @NonNull LatLng northeast) { - return new HuaweiLatLngBounds(southwest, northeast); - } - - @NonNull - @Override - public LatLngBounds.Builder newLatLngBoundsBuilder() { - return new HuaweiLatLngBounds.Builder(); - } - - @NonNull - @Override - public MapClient.Style.Options newMapStyleOptions(String json) { - return new HuaweiMapClient.Style.Options(json); - } - - @NonNull - @Override - public MapClient.Style.Options newMapStyleOptions( - @NonNull Context context, @RawRes int resourceId) { - return new HuaweiMapClient.Style.Options(context, resourceId); - } - - @NonNull - @Override - public Marker.Options newMarkerOptions() { - return new HuaweiMarker.Options(); - } - - @NonNull - @Override - public Polygon.Options newPolygonOptions() { - return new HuaweiPolygon.Options(); - } - - @NonNull - @Override - public Polyline.Options newPolylineOptions() { - return new HuaweiPolyline.Options(); - } - - @NonNull - @Override - public RoundCap newRoundCap() { - return new HuaweiRoundCap(); - } - - @NonNull - @Override - public SquareCap newSquareCap() { - return new HuaweiSquareCap(); - } - - @NonNull - @Override - public TileOverlay.Options newTileOverlayOptions() { - return new HuaweiTileOverlay.Options(); - } - - @NonNull - @Override - public Tile newTile(int width, int height, byte[] data) { - return new HuaweiTile(width, height, data); - } - - @NonNull - @Override - public Tile noTile() { - return HuaweiTileProvider.NO_TILE; - } - - @NonNull - @Override - public TileProvider newUrlTileProvider( - int width, int height, @NonNull UrlTileProvider tileProvider) { - return new HuaweiUrlTileProvider(width, height, tileProvider); - } - - @NonNull - @Override - public VisibleRegion newVisibleRegion( - LatLng nearLeft, - LatLng nearRight, - LatLng farLeft, - LatLng farRight, - LatLngBounds latLngBounds) { - return new HuaweiVisibleRegion(nearLeft, nearRight, farLeft, farRight, latLngBounds); - } - - - /** - * @see #getMapAsync(Fragment, MapKit.OnMapReadyCallback) - * @deprecated As of 1.2.0, use {@link #getMapAsync(Fragment, MapKit.OnMapReadyCallback)} - * instead. - */ - @SuppressWarnings("deprecation") - @Deprecated - @Override - public void getMapAsync( - @NonNull Fragment fragment, - @NonNull final OnMapReadyCallback callback) { - ((com.huawei.hms.maps.SupportMapFragment) fragment) - .getMapAsync(new com.huawei.hms.maps.OnMapReadyCallback() { - @Override - public void onMapReady(com.huawei.hms.maps.HuaweiMap huaweiMap) { - callback.onMapReady(new HuaweiMapClient(huaweiMap)); - } - }); - } - - @Override - public void getMapAsync( - @NonNull Fragment fragment, - @NonNull final MapKit.OnMapReadyCallback callback) { - ((com.huawei.hms.maps.SupportMapFragment) fragment) - .getMapAsync(new com.huawei.hms.maps.OnMapReadyCallback() { - @Override - public void onMapReady(com.huawei.hms.maps.HuaweiMap huaweiMap) { - callback.onMapReady(new HuaweiMapClient(huaweiMap)); - } - }); - } - - - @NonNull - public static MapFactory buildIfSupported(@NonNull Context context) { - final int result = - HuaweiApiAvailability.getInstance().isHuaweiMobileServicesAvailable(context); - if (UNAVAILABLE_RESULTS.contains(result)) { - throw new UnsupportedOperationException("Huawei Maps is not available."); - } - - return new HuaweiMapFactory(); - } - -} diff --git a/maps-huawei/src/main/res/layout/kits_maps_internal_huawei_map_view.xml b/maps-huawei/src/main/res/layout/kits_maps_internal_huawei_map_view.xml index 9fba1a2..a0f162b 100644 --- a/maps-huawei/src/main/res/layout/kits_maps_internal_huawei_map_view.xml +++ b/maps-huawei/src/main/res/layout/kits_maps_internal_huawei_map_view.xml @@ -1,19 +1,20 @@ + + diff --git a/sample/src/google/res/values/google_maps_api.xml b/sample/src/google/res/values/google_maps_api.xml index 2e9d25e..84a8e7f 100644 --- a/sample/src/google/res/values/google_maps_api.xml +++ b/sample/src/google/res/values/google_maps_api.xml @@ -1,4 +1,20 @@ + + + + package="dev.supasintatiyanupanwong.samples.android.kits.maps"> + android:theme="@style/Theme.AppCompat.Light.DarkActionBar"> diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/BasicMapDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/BasicMapDemoActivity.java similarity index 80% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/BasicMapDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/BasicMapDemoActivity.java index 27ff1b6..a28fa33 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/BasicMapDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/BasicMapDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,16 +15,16 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.os.Bundle; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; /** * This shows how to create a simple activity with a map and a marker on the map. diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/CameraClampingDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/CameraClampingDemoActivity.java similarity index 91% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/CameraClampingDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/CameraClampingDemoActivity.java index 764bd79..c9d6727 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/CameraClampingDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/CameraClampingDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2016 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.os.Bundle; import android.view.View; @@ -25,11 +25,11 @@ import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CameraPosition; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLngBounds; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CameraPosition; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLngBounds; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; /** * This shows how to constrain the camera to specific boundaries and zoom levels. diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/CameraDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/CameraDemoActivity.java similarity index 94% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/CameraDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/CameraDemoActivity.java index 7c42466..6270b1e 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/CameraDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/CameraDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.graphics.Color; import android.os.Bundle; @@ -28,13 +28,13 @@ import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CameraPosition; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.CameraUpdate; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Polyline; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CameraPosition; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.CameraUpdate; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Polyline; /** * This shows how to change the camera position for the map. diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/CircleDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/CircleDemoActivity.java similarity index 93% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/CircleDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/CircleDemoActivity.java index 3a511da..1ee8db0 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/CircleDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/CircleDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.graphics.Color; import android.graphics.Point; @@ -37,17 +37,17 @@ import java.util.List; import java.util.Objects; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.BitmapDescriptor; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Circle; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Dash; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Dot; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Gap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Marker; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.PatternItem; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.BitmapDescriptor; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Circle; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Dash; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Dot; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Gap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Marker; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.PatternItem; /** * This shows how to draw circles on a map. diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/DemoDetails.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/DemoDetails.java similarity index 86% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/DemoDetails.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/DemoDetails.java index 93798ab..f997b41 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/DemoDetails.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/DemoDetails.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.app.Activity; diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/DemoDetailsList.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/DemoDetailsList.java similarity index 95% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/DemoDetailsList.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/DemoDetailsList.java index 2ce4009..1c74740 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/DemoDetailsList.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/DemoDetailsList.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; /** * A list of all the demos we have available. diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/EventsDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/EventsDemoActivity.java similarity index 82% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/EventsDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/EventsDemoActivity.java index c5c5ee6..b1df16d 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/EventsDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/EventsDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.os.Bundle; import android.widget.TextView; @@ -23,10 +23,10 @@ import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; /** * This shows how to listen to some {@link MapClient} events. diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/FeatureView.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/FeatureView.java similarity index 88% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/FeatureView.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/FeatureView.java index 7389e80..283aa37 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/FeatureView.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/FeatureView.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.content.Context; import android.view.LayoutInflater; diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/GroundOverlayDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/GroundOverlayDemoActivity.java similarity index 89% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/GroundOverlayDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/GroundOverlayDemoActivity.java index e61191e..44dff6e 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/GroundOverlayDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/GroundOverlayDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.os.Bundle; import android.view.View; @@ -28,12 +28,12 @@ import java.util.ArrayList; import java.util.List; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.BitmapDescriptor; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.GroundOverlay; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.BitmapDescriptor; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.GroundOverlay; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; /** * This shows how to add a ground overlay to a map. diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/IndoorDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/IndoorDemoActivity.java similarity index 88% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/IndoorDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/IndoorDemoActivity.java index 3a0cbc4..e81e8cd 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/IndoorDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/IndoorDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.os.Bundle; import android.view.View; @@ -26,11 +26,11 @@ import java.util.List; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.IndoorBuilding; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.IndoorLevel; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.IndoorBuilding; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.IndoorLevel; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; /** * A demo activity showing how to use indoor. diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/LayersDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/LayersDemoActivity.java similarity index 94% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/LayersDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/LayersDemoActivity.java index 3554dfb..78300f5 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/LayersDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/LayersDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.Manifest; import android.content.pm.PackageManager; @@ -33,9 +33,9 @@ import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; /** * Demonstrates the different base layers of a map. diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/LocationSourceDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/LocationSourceDemoActivity.java similarity index 86% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/LocationSourceDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/LocationSourceDemoActivity.java index 6f37071..047ea8f 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/LocationSourceDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/LocationSourceDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.location.Location; import android.os.Bundle; @@ -23,11 +23,11 @@ import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LocationSource; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LocationSource; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; /** * This shows how to use a custom location source. diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/MainActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/MainActivity.java similarity index 90% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/MainActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/MainActivity.java index de9039d..1ab98b1 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/MainActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/MainActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.content.Context; import android.content.Intent; @@ -54,9 +54,8 @@ private static class CustomArrayAdapter extends ArrayAdapter { super(context, R.layout.feature, R.id.title, demos); } - @NonNull @Override - public View getView(int position, View convertView, @NonNull ViewGroup parent) { + public @NonNull View getView(int position, View convertView, @NonNull ViewGroup parent) { FeatureView featureView; if (convertView instanceof FeatureView) { featureView = (FeatureView) convertView; diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/MapInPagerDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/MapInPagerDemoActivity.java similarity index 88% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/MapInPagerDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/MapInPagerDemoActivity.java index 64d8248..71498b3 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/MapInPagerDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/MapInPagerDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.os.Bundle; import android.view.LayoutInflater; @@ -29,7 +29,7 @@ import androidx.fragment.app.FragmentPagerAdapter; import androidx.viewpager.widget.ViewPager; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; /** * This shows how to add a map to a ViewPager. Note the use of @@ -73,9 +73,8 @@ public int getCount() { return 3; } - @NonNull @Override - public Fragment getItem(int position) { + public @NonNull Fragment getItem(int position) { switch (position) { case 0: case 1: diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/MarkerCloseInfoWindowOnRetapDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/MarkerCloseInfoWindowOnRetapDemoActivity.java similarity index 86% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/MarkerCloseInfoWindowOnRetapDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/MarkerCloseInfoWindowOnRetapDemoActivity.java index 4b4ce7b..2a6e7ae 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/MarkerCloseInfoWindowOnRetapDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/MarkerCloseInfoWindowOnRetapDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2016 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,19 +15,19 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.os.Bundle; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLngBounds; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Marker; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLngBounds; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Marker; /** * This shows how to close the info window when the currently selected marker is re-tapped. @@ -35,7 +35,7 @@ public class MarkerCloseInfoWindowOnRetapDemoActivity extends AppCompatActivity implements MapClient.OnMapClickListener, MapClient.OnMarkerClickListener, - OnMapAndViewReadyListener.OnGlobalLayoutAndMapReadyListener { + MapKit.OnMapAndViewReadyCallback { private static final LatLng BRISBANE = MapKit.newLatLng(-27.47093, 153.0235); private static final LatLng MELBOURNE = MapKit.newLatLng(-37.81319, 144.96298); @@ -58,12 +58,12 @@ protected void onCreate(Bundle savedInstanceState) { MapFragment mapFragment = (MapFragment) getSupportFragmentManager().findFragmentById(R.id.map); if (mapFragment != null) { - new OnMapAndViewReadyListener(mapFragment, this); + mapFragment.getMapAsync(this); } } @Override - public void onMapReady(@NonNull MapClient map) { + public void onMapAndViewReady(@NonNull MapClient map) { mMap = map; // Hide the zoom controls. diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/MarkerDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/MarkerDemoActivity.java similarity index 95% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/MarkerDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/MarkerDemoActivity.java index f1b87df..d36061c 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/MarkerDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/MarkerDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.graphics.Bitmap; import android.graphics.Canvas; @@ -48,13 +48,13 @@ import java.util.Objects; import java.util.Random; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.BitmapDescriptor; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLngBounds; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Marker; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.BitmapDescriptor; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLngBounds; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Marker; /** * This shows how to place markers on a map. @@ -66,7 +66,7 @@ public class MarkerDemoActivity extends AppCompatActivity implements MapClient.OnInfoWindowLongClickListener, MapClient.OnMarkerClickListener, MapClient.OnMarkerDragListener, - OnMapAndViewReadyListener.OnGlobalLayoutAndMapReadyListener { + MapKit.OnMapAndViewReadyCallback { private static final LatLng BRISBANE = MapKit.newLatLng(-27.47093, 153.0235); @@ -230,12 +230,12 @@ public void onCheckedChanged(RadioGroup group, int checkedId) { MapFragment mapFragment = (MapFragment) getSupportFragmentManager().findFragmentById(R.id.map); if (mapFragment != null) { - new OnMapAndViewReadyListener(mapFragment, this); + mapFragment.getMapAsync(this); } } @Override - public void onMapReady(@NonNull MapClient map) { + public void onMapAndViewReady(@NonNull MapClient map) { mMap = map; // Hide the zoom controls as the button panel will cover it. diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/MultiMapDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/MultiMapDemoActivity.java similarity index 81% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/MultiMapDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/MultiMapDemoActivity.java index e9c167c..d3073b3 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/MultiMapDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/MultiMapDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.os.Bundle; diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/MyLocationDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/MyLocationDemoActivity.java similarity index 92% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/MyLocationDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/MyLocationDemoActivity.java index 0f2be3d..a658286 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/MyLocationDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/MyLocationDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.Manifest; import android.content.pm.PackageManager; @@ -28,9 +28,9 @@ import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; /** * This demo shows how GMS Location can be used to check for changes to the users location. The diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/PermissionUtils.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/PermissionUtils.java similarity index 94% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/PermissionUtils.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/PermissionUtils.java index c31fe25..3c7820f 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/PermissionUtils.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/PermissionUtils.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2015 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2015 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.Manifest; import android.app.AlertDialog; @@ -91,9 +91,8 @@ static PermissionDeniedDialog newInstance(boolean finishActivity) { return dialog; } - @NonNull @Override - public Dialog onCreateDialog(Bundle savedInstanceState) { + public @NonNull Dialog onCreateDialog(Bundle savedInstanceState) { mFinishActivity = requireArguments().getBoolean(ARGUMENT_FINISH_ACTIVITY); return new AlertDialog.Builder(getActivity()) @@ -150,9 +149,8 @@ static RationaleDialog newInstance(int requestCode, boolean finishActivity) { return dialog; } - @NonNull @Override - public Dialog onCreateDialog(Bundle savedInstanceState) { + public @NonNull Dialog onCreateDialog(Bundle savedInstanceState) { Bundle arguments = requireArguments(); final int requestCode = arguments.getInt(ARGUMENT_PERMISSION_REQUEST_CODE); mFinishActivity = arguments.getBoolean(ARGUMENT_FINISH_ACTIVITY); diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/PolygonDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/PolygonDemoActivity.java similarity index 93% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/PolygonDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/PolygonDemoActivity.java index 4640183..76b29d3 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/PolygonDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/PolygonDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.graphics.Color; import android.os.Bundle; @@ -32,16 +32,16 @@ import java.util.Arrays; import java.util.List; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Dash; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Dot; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Gap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.JointType; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.PatternItem; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Polygon; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Dash; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Dot; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Gap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.JointType; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.PatternItem; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Polygon; /** * This shows how to draw polygons on a map. diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/PolylineDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/PolylineDemoActivity.java similarity index 93% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/PolylineDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/PolylineDemoActivity.java index fb20f59..e6c6c55 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/PolylineDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/PolylineDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.graphics.Color; import android.os.Bundle; @@ -32,17 +32,17 @@ import java.util.Arrays; import java.util.List; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Cap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Dash; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Dot; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Gap; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.JointType; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.PatternItem; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Polyline; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Cap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Dash; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Dot; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Gap; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.JointType; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.PatternItem; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Polyline; /** * This shows how to draw polylines on a map. diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/ProgrammaticDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/ProgrammaticDemoActivity.java similarity index 84% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/ProgrammaticDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/ProgrammaticDemoActivity.java index b6b3f2f..eb6ee41 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/ProgrammaticDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/ProgrammaticDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.os.Bundle; @@ -23,9 +23,9 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.FragmentTransaction; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; /** * Demonstrates how to instantiate a MapFragment programmatically and add a marker to it. diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/RetainMapDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/RetainMapDemoActivity.java similarity index 80% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/RetainMapDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/RetainMapDemoActivity.java index 78fb38c..f0bdf49 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/RetainMapDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/RetainMapDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,16 +15,16 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.os.Bundle; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; /** * This shows how to retain a map across activity restarts (e.g., from screen rotations), which can diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/SnapshotDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/SnapshotDemoActivity.java similarity index 87% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/SnapshotDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/SnapshotDemoActivity.java index 4bc8a4a..99fe79a 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/SnapshotDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/SnapshotDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.graphics.Bitmap; import android.os.Bundle; @@ -26,9 +26,9 @@ import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; /** * This shows how to take a snapshot of the map. diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/StyledMapDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/StyledMapDemoActivity.java similarity index 93% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/StyledMapDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/StyledMapDemoActivity.java index 9f1a1dd..e4313c0 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/StyledMapDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/StyledMapDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2016 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.content.DialogInterface; import android.os.Bundle; @@ -31,10 +31,10 @@ import java.util.ArrayList; import java.util.List; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; /** * This shows how to style a map with JSON. diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/TagsDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/TagsDemoActivity.java similarity index 87% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/TagsDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/TagsDemoActivity.java index 7e11ad1..9b746a9 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/TagsDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/TagsDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.graphics.Color; import android.os.Bundle; @@ -26,16 +26,16 @@ import java.util.Objects; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Circle; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.GroundOverlay; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLngBounds; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Marker; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Polygon; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Polyline; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Circle; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.GroundOverlay; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLngBounds; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Marker; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Polygon; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Polyline; /** * This shows how to use setTag/getTag on API objects. @@ -46,7 +46,7 @@ public class TagsDemoActivity extends AppCompatActivity implements MapClient.OnMarkerClickListener, MapClient.OnPolygonClickListener, MapClient.OnPolylineClickListener, - OnMapAndViewReadyListener.OnGlobalLayoutAndMapReadyListener { + MapKit.OnMapAndViewReadyCallback { private static final LatLng ADELAIDE = MapKit.newLatLng(-34.92873, 138.59995); private static final LatLng BRISBANE = MapKit.newLatLng(-27.47093, 153.0235); @@ -68,9 +68,8 @@ void incrementClickCount() { mClickCount++; } - @NonNull @Override - public String toString() { + public @NonNull String toString() { return "The " + mDescription + " has been clicked " + mClickCount + " times."; } } @@ -89,12 +88,12 @@ protected void onCreate(Bundle savedInstanceState) { MapFragment mapFragment = (MapFragment) getSupportFragmentManager().findFragmentById(R.id.map); if (mapFragment != null) { - new OnMapAndViewReadyListener(mapFragment, this); + mapFragment.getMapAsync(this); } } @Override - public void onMapReady(MapClient map) { + public void onMapAndViewReady(@NonNull MapClient map) { mMap = map; MapClient.UiSettings uiSettings = mMap.getUiSettings(); diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/TileCoordinateDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/TileCoordinateDemoActivity.java similarity index 88% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/TileCoordinateDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/TileCoordinateDemoActivity.java index c9f0ff3..757d246 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/TileCoordinateDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/TileCoordinateDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.content.Context; import android.graphics.Bitmap; @@ -28,11 +28,11 @@ import java.io.ByteArrayOutputStream; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.Tile; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.TileProvider; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.Tile; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.TileProvider; /** * This demonstrates tile overlay coordinates. diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/TileOverlayDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/TileOverlayDemoActivity.java similarity index 85% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/TileOverlayDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/TileOverlayDemoActivity.java index 7ca433f..fbe212e 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/TileOverlayDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/TileOverlayDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.os.Bundle; import android.view.View; @@ -29,12 +29,12 @@ import java.net.URL; import java.util.Locale; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.TileOverlay; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.TileProvider; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.UrlTileProvider; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.TileOverlay; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.TileProvider; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.UrlTileProvider; /** * This demonstrates how to add a tile overlay to a map. diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/UiSettingsDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/UiSettingsDemoActivity.java similarity index 95% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/UiSettingsDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/UiSettingsDemoActivity.java index c4847af..9144afb 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/UiSettingsDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/UiSettingsDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.Manifest; import android.content.pm.PackageManager; @@ -29,9 +29,9 @@ import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; /** * This shows how UI settings can be toggled. diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/VisibleRegionDemoActivity.java b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/VisibleRegionDemoActivity.java similarity index 89% rename from sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/VisibleRegionDemoActivity.java rename to sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/VisibleRegionDemoActivity.java index d7cb88d..ba14243 100644 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/VisibleRegionDemoActivity.java +++ b/sample/src/main/java/dev/supasintatiyanupanwong/samples/android/kits/maps/VisibleRegionDemoActivity.java @@ -1,12 +1,12 @@ /* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2012 The Android Open Source Project + * Copyright 2020 Supasin Tatiyanupanwong + * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ * limitations under the License. */ -package me.tatiyanupanwong.supasin.android.samples.kits.maps; +package dev.supasintatiyanupanwong.samples.android.kits.maps; import android.os.Bundle; import android.os.Handler; @@ -26,23 +26,24 @@ import android.widget.TextView; import android.widget.Toast; +import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.Fragment; import java.util.Objects; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLng; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.LatLngBounds; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapFragment; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.MapKit; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLng; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.LatLngBounds; +import dev.supasintatiyanupanwong.libraries.android.kits.maps.model.MapClient; /** * This shows how to use setPadding to allow overlays that obscure part of the map without * obscuring the map UI or copyright notices. */ public class VisibleRegionDemoActivity extends AppCompatActivity implements - OnMapAndViewReadyListener.OnGlobalLayoutAndMapReadyListener { + MapKit.OnMapAndViewReadyCallback { /** * Note that this may be null if the MapClient is not available. @@ -78,12 +79,12 @@ protected void onCreate(Bundle savedInstanceState) { MapFragment mapFragment = (MapFragment) getSupportFragmentManager().findFragmentById(R.id.map); if (mapFragment != null) { - new OnMapAndViewReadyListener(mapFragment, this); + mapFragment.getMapAsync(this); } } @Override - public void onMapReady(MapClient map) { + public void onMapAndViewReady(@NonNull MapClient map) { mMap = map; // Move to a place with indoor (SFO airport). diff --git a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/OnMapAndViewReadyListener.java b/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/OnMapAndViewReadyListener.java deleted file mode 100644 index b6365db..0000000 --- a/sample/src/main/java/me/tatiyanupanwong/supasin/android/samples/kits/maps/OnMapAndViewReadyListener.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2020 Supasin Tatiyanupanwong - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package me.tatiyanupanwong.supasin.android.samples.kits.maps; - -import android.annotation.SuppressLint; -import android.view.View; -import android.view.ViewTreeObserver; - -import androidx.annotation.NonNull; - -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapFragment; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.MapKit; -import me.tatiyanupanwong.supasin.android.libraries.kits.maps.model.MapClient; - -/** - * Helper class that will delay triggering the OnMapReady callback until both the MapClient and the - * View having completed initialization. This is only necessary if a developer wishes to immediately - * invoke any method on the MapClient that also requires the View to have finished layout - * (ie. anything that needs to know the View's true size like snapshotting). - */ -class OnMapAndViewReadyListener implements - ViewTreeObserver.OnGlobalLayoutListener, - MapKit.OnMapReadyCallback { - - /** A listener that needs to wait for both the MapClient and the View to be initialized. */ - interface OnGlobalLayoutAndMapReadyListener { - void onMapReady(MapClient map); - } - - private final MapFragment mMapFragment; - private final View mMapView; - private final OnGlobalLayoutAndMapReadyListener mCallback; - - private boolean mIsViewReady; - private boolean mIsMapReady; - private MapClient mMap; - - OnMapAndViewReadyListener(MapFragment mapFragment, OnGlobalLayoutAndMapReadyListener callback) { - mMapFragment = mapFragment; - mMapView = mapFragment.getView(); - mCallback = callback; - mIsViewReady = false; - mIsMapReady = false; - mMap = null; - - registerListeners(); - } - - private void registerListeners() { - // View layout. - if ((mMapView.getWidth() != 0) && (mMapView.getHeight() != 0)) { - // View has already completed layout. - mIsViewReady = true; - } else { - // Map has not undergone layout, register a View observer. - mMapView.getViewTreeObserver().addOnGlobalLayoutListener(this); - } - - // Note if the MapClient is already ready it will still fire the callback later. - mMapFragment.getMapAsync(this); - } - - @Override - public void onMapReady(@NonNull MapClient map) { - mMap = map; - mIsMapReady = true; - fireCallbackIfReady(); - } - - @SuppressLint("NewApi") // We check which build version we are using. - @Override - public void onGlobalLayout() { - // Remove our listener. - mMapView.getViewTreeObserver().removeOnGlobalLayoutListener(this); - mIsViewReady = true; - fireCallbackIfReady(); - } - - private void fireCallbackIfReady() { - if (mIsViewReady && mIsMapReady) { - mCallback.onMapReady(mMap); - } - } - -} diff --git a/sample/src/main/res/drawable/ic_android.xml b/sample/src/main/res/drawable/ic_android.xml index deb26eb..ef892b2 100644 --- a/sample/src/main/res/drawable/ic_android.xml +++ b/sample/src/main/res/drawable/ic_android.xml @@ -1,3 +1,21 @@ + + + + diff --git a/sample/src/main/res/layout/basic_demo.xml b/sample/src/main/res/layout/basic_demo.xml index c56569e..5372d2b 100644 --- a/sample/src/main/res/layout/basic_demo.xml +++ b/sample/src/main/res/layout/basic_demo.xml @@ -1,24 +1,25 @@ + diff --git a/sample/src/main/res/layout/camera_clamping_demo.xml b/sample/src/main/res/layout/camera_clamping_demo.xml index 5904a05..977fe1d 100644 --- a/sample/src/main/res/layout/camera_clamping_demo.xml +++ b/sample/src/main/res/layout/camera_clamping_demo.xml @@ -1,20 +1,21 @@ + diff --git a/sample/src/main/res/layout/camera_demo.xml b/sample/src/main/res/layout/camera_demo.xml index 9239a8f..f1e0dfc 100644 --- a/sample/src/main/res/layout/camera_demo.xml +++ b/sample/src/main/res/layout/camera_demo.xml @@ -1,20 +1,21 @@ + diff --git a/sample/src/main/res/layout/circle_demo.xml b/sample/src/main/res/layout/circle_demo.xml index 91a8e01..46c9a2a 100644 --- a/sample/src/main/res/layout/circle_demo.xml +++ b/sample/src/main/res/layout/circle_demo.xml @@ -1,20 +1,21 @@ + diff --git a/sample/src/main/res/layout/custom_info_contents.xml b/sample/src/main/res/layout/custom_info_contents.xml index fc06575..ca57b6c 100644 --- a/sample/src/main/res/layout/custom_info_contents.xml +++ b/sample/src/main/res/layout/custom_info_contents.xml @@ -1,20 +1,21 @@ + + + + + diff --git a/sample/src/main/res/layout/indoor_demo.xml b/sample/src/main/res/layout/indoor_demo.xml index 48dc046..6a11375 100644 --- a/sample/src/main/res/layout/indoor_demo.xml +++ b/sample/src/main/res/layout/indoor_demo.xml @@ -1,20 +1,21 @@ + diff --git a/sample/src/main/res/layout/layers_demo.xml b/sample/src/main/res/layout/layers_demo.xml index c6d6366..1336bb3 100644 --- a/sample/src/main/res/layout/layers_demo.xml +++ b/sample/src/main/res/layout/layers_demo.xml @@ -1,20 +1,21 @@ + @@ -31,7 +32,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="6dp" - android:background="@color/white" + android:background="@android:color/white" android:orientation="vertical"> + + + diff --git a/sample/src/main/res/layout/marker_demo.xml b/sample/src/main/res/layout/marker_demo.xml index 17502e5..94b2069 100644 --- a/sample/src/main/res/layout/marker_demo.xml +++ b/sample/src/main/res/layout/marker_demo.xml @@ -1,20 +1,21 @@ + @@ -67,7 +68,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|left" - android:background="@color/white" + android:background="@android:color/white" android:orientation="vertical" android:padding="5dp"> diff --git a/sample/src/main/res/layout/multimap_demo.xml b/sample/src/main/res/layout/multimap_demo.xml index db80584..1733610 100644 --- a/sample/src/main/res/layout/multimap_demo.xml +++ b/sample/src/main/res/layout/multimap_demo.xml @@ -1,20 +1,21 @@ + @@ -56,14 +57,14 @@ diff --git a/sample/src/main/res/layout/my_location_demo.xml b/sample/src/main/res/layout/my_location_demo.xml index c56569e..5372d2b 100644 --- a/sample/src/main/res/layout/my_location_demo.xml +++ b/sample/src/main/res/layout/my_location_demo.xml @@ -1,24 +1,25 @@ + diff --git a/sample/src/main/res/layout/polygon_demo.xml b/sample/src/main/res/layout/polygon_demo.xml index 293f610..f674ab9 100644 --- a/sample/src/main/res/layout/polygon_demo.xml +++ b/sample/src/main/res/layout/polygon_demo.xml @@ -1,20 +1,21 @@ + diff --git a/sample/src/main/res/layout/polyline_demo.xml b/sample/src/main/res/layout/polyline_demo.xml index 81cc188..04b83a7 100644 --- a/sample/src/main/res/layout/polyline_demo.xml +++ b/sample/src/main/res/layout/polyline_demo.xml @@ -1,20 +1,21 @@ + diff --git a/sample/src/main/res/layout/snapshot_demo.xml b/sample/src/main/res/layout/snapshot_demo.xml index 187f274..3ce6e5a 100644 --- a/sample/src/main/res/layout/snapshot_demo.xml +++ b/sample/src/main/res/layout/snapshot_demo.xml @@ -1,20 +1,21 @@ + diff --git a/sample/src/main/res/layout/styled_map_demo.xml b/sample/src/main/res/layout/styled_map_demo.xml index bd86047..c5d9c79 100644 --- a/sample/src/main/res/layout/styled_map_demo.xml +++ b/sample/src/main/res/layout/styled_map_demo.xml @@ -1,24 +1,25 @@ + diff --git a/sample/src/main/res/layout/tags_demo.xml b/sample/src/main/res/layout/tags_demo.xml index c17480b..781cc89 100644 --- a/sample/src/main/res/layout/tags_demo.xml +++ b/sample/src/main/res/layout/tags_demo.xml @@ -1,20 +1,21 @@ + diff --git a/sample/src/main/res/layout/text_fragment.xml b/sample/src/main/res/layout/text_fragment.xml index 7bb14c8..dec9e62 100644 --- a/sample/src/main/res/layout/text_fragment.xml +++ b/sample/src/main/res/layout/text_fragment.xml @@ -1,20 +1,21 @@ + + diff --git a/sample/src/main/res/layout/tile_overlay_demo.xml b/sample/src/main/res/layout/tile_overlay_demo.xml index 04223a8..9403615 100644 --- a/sample/src/main/res/layout/tile_overlay_demo.xml +++ b/sample/src/main/res/layout/tile_overlay_demo.xml @@ -1,20 +1,21 @@ + @@ -30,7 +31,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom" - android:background="@color/white" + android:background="@android:color/white" android:orientation="vertical"> + @@ -30,7 +31,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom" - android:background="@color/white" + android:background="@android:color/white" android:orientation="vertical" android:padding="5dp"> diff --git a/sample/src/main/res/layout/visible_region_demo.xml b/sample/src/main/res/layout/visible_region_demo.xml index 8d39d79..f695681 100644 --- a/sample/src/main/res/layout/visible_region_demo.xml +++ b/sample/src/main/res/layout/visible_region_demo.xml @@ -1,20 +1,21 @@ + diff --git a/sample/src/main/res/menu/styled_map.xml b/sample/src/main/res/menu/styled_map.xml index f454550..0f453aa 100644 --- a/sample/src/main/res/menu/styled_map.xml +++ b/sample/src/main/res/menu/styled_map.xml @@ -1,20 +1,21 @@ +

diff --git a/sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index 09d28b7..0d90614 100644 --- a/sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -1,4 +1,21 @@ + + diff --git a/sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml index 09d28b7..0d90614 100644 --- a/sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ b/sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -1,4 +1,21 @@ + + diff --git a/sample/src/main/res/values/colors.xml b/sample/src/main/res/values/colors.xml deleted file mode 100644 index 80d402d..0000000 --- a/sample/src/main/res/values/colors.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - #008577 - #00574B - #D81B60 - #D0FFFFFF - - diff --git a/sample/src/main/res/values/ic_launcher_background.xml b/sample/src/main/res/values/ic_launcher_background.xml index bbc1c93..883cbac 100644 --- a/sample/src/main/res/values/ic_launcher_background.xml +++ b/sample/src/main/res/values/ic_launcher_background.xml @@ -1,4 +1,20 @@ + + #FFFFFF diff --git a/sample/src/main/res/values/strings.xml b/sample/src/main/res/values/strings.xml index 96b8726..38bcd1d 100644 --- a/sample/src/main/res/values/strings.xml +++ b/sample/src/main/res/values/strings.xml @@ -1,20 +1,21 @@ + Map Kit Sample diff --git a/sample/src/main/res/values/styles.xml b/sample/src/main/res/values/styles.xml deleted file mode 100644 index 1831d89..0000000 --- a/sample/src/main/res/values/styles.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - diff --git a/settings.gradle b/settings.gradle index cb8cf21..6b56278 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,17 @@ +/* + * Copyright 2020 Supasin Tatiyanupanwong + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + include ':sample', ':maps-core', ':maps-google', ':maps-huawei'