master 8cb789f665a2 cached
78 files
191.9 KB
46.2k tokens
421 symbols
1 requests
Download .txt
Showing preview only (216K chars total). Download the full file or copy to clipboard to get everything.
Repository: akexorcist/Android-GoogleDirectionLibrary
Branch: master
Commit: 8cb789f665a2
Files: 78
Total size: 191.9 KB

Directory structure:
gitextract_z5u3xqar/

├── .github/
│   └── workflows/
│       └── android.yml
├── .gitignore
├── CHANGELOG.md
├── LICENSE.txt
├── README.md
├── app/
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── com/
│       │           └── akexorcist/
│       │               └── library/
│       │                   └── googledirectionandplace/
│       │                       └── sample/
│       │                           └── ApplicationTest.java
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── akexorcist/
│       │   │           └── googledirection/
│       │   │               └── sample/
│       │   │                   ├── AlternativeDirectionActivity.kt
│       │   │                   ├── MainActivity.kt
│       │   │                   ├── SimpleDirectionActivity.kt
│       │   │                   ├── TransitDirectionActivity.kt
│       │   │                   └── WaypointsDirectionActivity.kt
│       │   └── res/
│       │       ├── layout/
│       │       │   ├── activity_alternative_direction.xml
│       │       │   ├── activity_main.xml
│       │       │   ├── activity_simple_direction.xml
│       │       │   ├── activity_transit_direction.xml
│       │       │   └── activity_waypoints_direction.xml
│       │       ├── mipmap-anydpi-v26/
│       │       │   ├── ic_launcher.xml
│       │       │   └── ic_launcher_round.xml
│       │       └── values/
│       │           ├── colors.xml
│       │           ├── dimens.xml
│       │           ├── strings.xml
│       │           └── styles.xml
│       └── test/
│           └── java/
│               └── com/
│                   └── akexorcist/
│                       └── library/
│                           └── googledirectionandplace/
│                               └── sample/
│                                   └── ExampleUnitTest.java
├── build.gradle
├── google-direction/
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   └── java/
│       │       └── com/
│       │           └── akexorcist/
│       │               └── googledirection/
│       │                   ├── DirectionCallback.java
│       │                   ├── GoogleDirection.java
│       │                   ├── config/
│       │                   │   └── GoogleDirectionConfiguration.java
│       │                   ├── constant/
│       │                   │   ├── AvoidType.java
│       │                   │   ├── DirectionUrl.java
│       │                   │   ├── Language.java
│       │                   │   ├── Maneuver.java
│       │                   │   ├── RequestResult.java
│       │                   │   ├── TrafficModel.java
│       │                   │   ├── TransitMode.java
│       │                   │   ├── TransitRoutingPreference.java
│       │                   │   ├── TransportMode.java
│       │                   │   ├── Unit.java
│       │                   │   └── VehicleType.java
│       │                   ├── model/
│       │                   │   ├── Agency.java
│       │                   │   ├── Bound.java
│       │                   │   ├── Coordination.java
│       │                   │   ├── Direction.java
│       │                   │   ├── Fare.java
│       │                   │   ├── GeocodedWaypoint.java
│       │                   │   ├── Info.java
│       │                   │   ├── Leg.java
│       │                   │   ├── Line.java
│       │                   │   ├── Route.java
│       │                   │   ├── RoutePolyline.java
│       │                   │   ├── Step.java
│       │                   │   ├── StopPoint.java
│       │                   │   ├── TimeInfo.java
│       │                   │   ├── TransitDetail.java
│       │                   │   ├── Vehicle.java
│       │                   │   └── Waypoint.java
│       │                   ├── network/
│       │                   │   ├── DirectionConnection.java
│       │                   │   └── DirectionService.java
│       │                   ├── request/
│       │                   │   ├── DirectionDestinationRequest.java
│       │                   │   ├── DirectionOriginRequest.java
│       │                   │   ├── DirectionRequest.java
│       │                   │   ├── DirectionRequestParam.java
│       │                   │   └── DirectionTask.java
│       │                   └── util/
│       │                       ├── DirectionConverter.java
│       │                       └── DirectionExtension.kt
│       └── test/
│           └── java/
│               └── com/
│                   └── akexorcist/
│                       └── library/
│                           └── googledirectionandplace/
│                               └── ExampleUnitTest.java
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── publish/
│   └── mavencentral.gradle
└── settings.gradle

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/workflows/android.yml
================================================
name: Android CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  test:
    name: Unit Test
    runs-on: ubuntu-latest
    
    steps:
    - uses: actions/checkout@v2
    - name: set up JDK 1.8
      uses: actions/setup-java@v1
      with:
        java-version: 1.8
    - name: Grant execute permission for gradlew
      run: chmod +x gradlew
      
    - name: Run Unit test
      run: ./gradlew test


================================================
FILE: .gitignore
================================================
# Built application files
*.apk
*.ap_

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# IntelliJ
*.iml
.idea

# Keystore files
# Uncomment the following line if you do not want to check your keystore files in.
#*.jks

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild

# Google Services (e.g. APIs or Firebase)
google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md
*.gpg
.DS_Store


================================================
FILE: CHANGELOG.md
================================================
Release Notes
====

1.2.1
-- 
* Update target and compile SDK version 30 
* Add @StringDef to all parameters
* Add traffic model and transit routing preference parameters support
* Fix incorrect Romanian language value

1.2.0
----
* Update minimum SDK version to 16
* Update target and compile SDK version 29
* Migrate to AndroidX
* Migrate the sample code to Kotlin
* Add total distance and duration calculation in route
* Remove raw string from success callback
* Add more customizable polyline in DirectionConverter
* Fix issue #70


================================================
FILE: LICENSE.txt
================================================

                              Apache License
                        Version 2.0, January 2004
                     http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

   "License" shall mean the terms and conditions for use, reproduction,
   and distribution as defined by Sections 1 through 9 of this document.

   "Licensor" shall mean the copyright owner or entity authorized by
   the copyright owner that is granting the License.

   "Legal Entity" shall mean the union of the acting entity and all
   other entities that control, are controlled by, or are under common
   control with that entity. For the purposes of this definition,
   "control" means (i) the power, direct or indirect, to cause the
   direction or management of such entity, whether by contract or
   otherwise, or (ii) ownership of fifty percent (50%) or more of the
   outstanding shares, or (iii) beneficial ownership of such entity.

   "You" (or "Your") shall mean an individual or Legal Entity
   exercising permissions granted by this License.

   "Source" form shall mean the preferred form for making modifications,
   including but not limited to software source code, documentation
   source, and configuration files.

   "Object" form shall mean any form resulting from mechanical
   transformation or translation of a Source form, including but
   not limited to compiled object code, generated documentation,
   and conversions to other media types.

   "Work" shall mean the work of authorship, whether in Source or
   Object form, made available under the License, as indicated by a
   copyright notice that is included in or attached to the work
   (an example is provided in the Appendix below).

   "Derivative Works" shall mean any work, whether in Source or Object
   form, that is based on (or derived from) the Work and for which the
   editorial revisions, annotations, elaborations, or other modifications
   represent, as a whole, an original work of authorship. For the purposes
   of this License, Derivative Works shall not include works that remain
   separable from, or merely link (or bind by name) to the interfaces of,
   the Work and Derivative Works thereof.

   "Contribution" shall mean any work of authorship, including
   the original version of the Work and any modifications or additions
   to that Work or Derivative Works thereof, that is intentionally
   submitted to Licensor for inclusion in the Work by the copyright owner
   or by an individual or Legal Entity authorized to submit on behalf of
   the copyright owner. For the purposes of this definition, "submitted"
   means any form of electronic, verbal, or written communication sent
   to the Licensor or its representatives, including but not limited to
   communication on electronic mailing lists, source code control systems,
   and issue tracking systems that are managed by, or on behalf of, the
   Licensor for the purpose of discussing and improving the Work, but
   excluding communication that is conspicuously marked or otherwise
   designated in writing by the copyright owner as "Not a Contribution."

   "Contributor" shall mean Licensor and any individual or Legal Entity
   on behalf of whom a Contribution has been received by Licensor and
   subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
   this License, each Contributor hereby grants to You a perpetual,
   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
   copyright license to reproduce, prepare Derivative Works of,
   publicly display, publicly perform, sublicense, and distribute the
   Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
   this License, each Contributor hereby grants to You a perpetual,
   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
   (except as stated in this section) patent license to make, have made,
   use, offer to sell, sell, import, and otherwise transfer the Work,
   where such license applies only to those patent claims licensable
   by such Contributor that are necessarily infringed by their
   Contribution(s) alone or by combination of their Contribution(s)
   with the Work to which such Contribution(s) was submitted. If You
   institute patent litigation against any entity (including a
   cross-claim or counterclaim in a lawsuit) alleging that the Work
   or a Contribution incorporated within the Work constitutes direct
   or contributory patent infringement, then any patent licenses
   granted to You under this License for that Work shall terminate
   as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
   Work or Derivative Works thereof in any medium, with or without
   modifications, and in Source or Object form, provided that You
   meet the following conditions:

   (a) You must give any other recipients of the Work or
       Derivative Works a copy of this License; and

   (b) You must cause any modified files to carry prominent notices
       stating that You changed the files; and

   (c) You must retain, in the Source form of any Derivative Works
       that You distribute, all copyright, patent, trademark, and
       attribution notices from the Source form of the Work,
       excluding those notices that do not pertain to any part of
       the Derivative Works; and

   (d) If the Work includes a "NOTICE" text file as part of its
       distribution, then any Derivative Works that You distribute must
       include a readable copy of the attribution notices contained
       within such NOTICE file, excluding those notices that do not
       pertain to any part of the Derivative Works, in at least one
       of the following places: within a NOTICE text file distributed
       as part of the Derivative Works; within the Source form or
       documentation, if provided along with the Derivative Works; or,
       within a display generated by the Derivative Works, if and
       wherever such third-party notices normally appear. The contents
       of the NOTICE file are for informational purposes only and
       do not modify the License. You may add Your own attribution
       notices within Derivative Works that You distribute, alongside
       or as an addendum to the NOTICE text from the Work, provided
       that such additional attribution notices cannot be construed
       as modifying the License.

   You may add Your own copyright statement to Your modifications and
   may provide additional or different license terms and conditions
   for use, reproduction, or distribution of Your modifications, or
   for any such Derivative Works as a whole, provided Your use,
   reproduction, and distribution of the Work otherwise complies with
   the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
   names, trademarks, service marks, or product names of the Licensor,
   except as required for reasonable and customary use in describing the
   origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
   agreed to in writing, Licensor provides the Work (and each
   Contributor provides its Contributions) on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
   implied, including, without limitation, any warranties or conditions
   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
   PARTICULAR PURPOSE. You are solely responsible for determining the
   appropriateness of using or redistributing the Work and assume any
   risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
   whether in tort (including negligence), contract, or otherwise,
   unless required by applicable law (such as deliberate and grossly
   negligent acts) or agreed to in writing, shall any Contributor be
   liable to You for damages, including any direct, indirect, special,
   incidental, or consequential damages of any character arising as a
   result of this License or out of the use or inability to use the
   Work (including but not limited to damages for loss of goodwill,
   work stoppage, computer failure or malfunction, or any and all
   other commercial damages or losses), even if such Contributor
   has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
   the Work or Derivative Works thereof, You may choose to offer,
   and charge a fee for, acceptance of support, warranty, indemnity,
   or other liability obligations and/or rights consistent with this
   License. However, in accepting such obligations, You may act only
   on Your own behalf and on Your sole responsibility, not on behalf
   of any other Contributor, and only if You agree to indemnify,
   defend, and hold each Contributor harmless for any liability
   incurred by, or claims asserted against, such Contributor by reason
   of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

   To apply the Apache License to your work, attach the following
   boilerplate notice, with the fields enclosed by brackets "[]"
   replaced with your own identifying information. (Don't include
   the brackets!)  The text should be enclosed in the appropriate
   comment syntax for the file format. We also recommend that a
   file or class name and description of purpose be included on the
   same "printed page" as the copyright notice for easier
   identification within third-party archives.

Copyright 2015 Akexorcist

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.

================================================
FILE: README.md
================================================
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Android--GoogleDirectionAndPlaceLibrary-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/1374)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.akexorcist/google-direction-library/badge.svg)](https://search.maven.org/artifact/com.akexorcist/google-direction-library)
![Minimum SDK Version](https://img.shields.io/badge/minSdkVersion-16-brightgreen) 
[![Workflow Status](https://github.com/akexorcist/GoogleDirectionLibrary/actions/workflows/android.yml/badge.svg)](https://github.com/akexorcist/GoogleDirectionLibrary/actions)

# Android-GoogleDirectionLibrary
![Google Direction Library](https://raw.githubusercontent.com/akexorcist/Android-GoogleDirectionLibrary/master/image/google-direction-library_header.jpg)

Google Maps Direction API helper for Android

![Google Direction Library](https://raw.githubusercontent.com/akexorcist/Android-GoogleDirectionLibrary/master/image/google-direction-library_01.jpg)

![Google Direction Library](https://raw.githubusercontent.com/akexorcist/Android-GoogleDirectionLibrary/master/image/google-direction-library_02.jpg)


Download
===============================
Since version 2.1.2 will [move from JCenter to MavenCentral](https://developer.android.com/studio/build/jcenter-migration)
```groovy
// build.gradle (project)
allprojects {
    repositories {
        mavenCentral()
        /* ... */
    }
}
```

**Gradle**
```
implementation 'com.akexorcist:google-direction-library:1.2.1'
```


Sample Code
===============================

Simple Direction Request
```kotlin
GoogleDirection.withServerKey("YOUR_SERVER_API_KEY")
        .from(LatLng(37.7681994, -122.444538))
        .to(LatLng(37.7749003,-122.4034934))
        .avoid(AvoidType.FERRIES)
        .avoid(AvoidType.HIGHWAYS)
        .execute(
            onDirectionSuccess = { direction: Direction? -> 
                if(direction.isOK()) {
                    // Do something
                } else {
                    // Do something
                }
            }, 
            onDirectionFailure = { t: Throwable -> 
                // Do something
            }
        )
```


Multiple Waypoints Direction Request
```kotlin
GoogleDirection.withServerKey("YOUR_SERVER_API_KEY")
        .from(LatLng(41.8838111, -87.6657851))
        .and(LatLng(41.8766061, -87.6556908))
        .and(LatLng(41.8909056, -87.6467561))
        .to(LatLng(41.9007082, -87.6488802))
        .transportMode(TransportMode.DRIVING)
        .execute(
            onDirectionSuccess = { direction: Direction? -> 
                if(direction.isOK()) {
                    // Do something
                } else {
                    // Do something
                }
            }, 
            onDirectionFailure = { t: Throwable -> 
                // Do something
            }
        )
```

or 

```kotlin
val waypoints: List<LatLng> = listOf(
        LatLng(41.8766061, -87.6556908), 
        LatLng(41.8909056, -87.6467561)
)
GoogleDirection.withServerKey("YOUR_SERVER_API_KEY")
        .from(LatLng(41.8838111, -87.6657851))
        .and(waypoints)
        .to(LatLng(41.9007082, -87.6488802))
        .transportMode(TransportMode.DRIVING)
        .execute(
            onDirectionSuccess = { direction: Direction? -> 
                if(direction.isOK()) {
                    // Do something
                } else {
                    // Do something
                }
            }, 
            onDirectionFailure = { t: Throwable -> 
                // Do something
            }
        )
```

See example code for more detail

To get API key, please read [Get Google Maps Direction API Key](https://developers.google.com/maps/documentation/directions/get-api-key)


Demo
===============================

Try it at [Google Play](https://play.google.com/store/apps/details?id=com.akexorcist.googledirection.sample)


ProGuard
===========================
```
-keep class com.google.android.gms.maps.** { *; }
-keep interface com.google.android.gms.maps.* { *; }

-dontwarn retrofit2.**
-keep class retrofit2.** { *; }
-keepattributes Signature
-keepattributes Exceptions

-keepclasseswithmembers class * {
    @retrofit2.http.* <methods>;
}

-keep class com.akexorcist.googledirection.model.** { *;}
```


Change Log
====
See [CHANGELOG.md](CHANGELOG.md)


Licence
===========================
Copyright 2021 Akexorcist

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or 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.



================================================
FILE: app/build.gradle
================================================
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
    compileSdkVersion project.compileSdkVersion

    defaultConfig {
        applicationId "com.akexorcist.googledirection.sample"
        minSdkVersion project.minSdkVersion
        targetSdkVersion project.targetSdkVersion
        versionCode project.versionCode
        versionName project.versionName
    }

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

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = "1.8"
    }

    buildFeatures {
        viewBinding = true
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation project(':google-direction')
    testImplementation 'junit:junit:4.13.2'
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.3.0'
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
}


================================================
FILE: app/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Applications/ADT/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

-keep class com.google.android.gms.maps.** { *; }
-keep interface com.google.android.gms.maps.* { *; }

-dontwarn okhttp3.**
-dontwarn okio.**

-dontwarn retrofit2.**
-keep class retrofit2.** { *; }
-keepattributes Signature
-keepattributes Exceptions

-keepclasseswithmembers class * {
    @retrofit2.http.* <methods>;
}


================================================
FILE: app/src/androidTest/java/com/akexorcist/library/googledirectionandplace/sample/ApplicationTest.java
================================================
package com.akexorcist.library.googledirectionandplace.sample;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
 * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
 */
public class ApplicationTest extends ApplicationTestCase<Application> {
    public ApplicationTest() {
        super(Application.class);
    }
}

================================================
FILE: app/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.akexorcist.googledirection.sample">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:ignore="AllowBackup,GoogleAppIndexingWarning">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity
            android:name=".SimpleDirectionActivity"
            android:label="@string/simple_direction" />

        <activity
            android:name=".TransitDirectionActivity"
            android:label="@string/transit_direction" />

        <activity
            android:name=".AlternativeDirectionActivity"
            android:label="@string/alternative_direction" />

        <activity
            android:name=".WaypointsDirectionActivity"
            android:label="@string/waypoints_direction" />

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="YOUR_GOOGLE_MAPS_API_KEY" />

    </application>

</manifest>


================================================
FILE: app/src/main/java/com/akexorcist/googledirection/sample/AlternativeDirectionActivity.kt
================================================
package com.akexorcist.googledirection.sample

import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import com.akexorcist.googledirection.GoogleDirection
import com.akexorcist.googledirection.config.GoogleDirectionConfiguration
import com.akexorcist.googledirection.constant.TransportMode
import com.akexorcist.googledirection.model.Direction
import com.akexorcist.googledirection.model.Route
import com.akexorcist.googledirection.sample.databinding.ActivityAlternativeDirectionBinding
import com.akexorcist.googledirection.util.DirectionConverter
import com.akexorcist.googledirection.util.execute
import com.google.android.gms.maps.CameraUpdateFactory
import com.google.android.gms.maps.GoogleMap
import com.google.android.gms.maps.SupportMapFragment
import com.google.android.gms.maps.model.LatLng
import com.google.android.gms.maps.model.LatLngBounds
import com.google.android.gms.maps.model.MarkerOptions
import com.google.android.material.snackbar.Snackbar

class AlternativeDirectionActivity : AppCompatActivity() {
    private val binding: ActivityAlternativeDirectionBinding by lazy {
        ActivityAlternativeDirectionBinding.inflate(layoutInflater)
    }

    companion object {
        private const val serverKey = "YOUR_SERVER_KEY"
        private val origin = LatLng(35.1766982, 136.9413508)
        private val destination = LatLng(35.1735305, 136.9484515)
        private val pathColors = arrayOf(
            R.color.path_color_1,
            R.color.path_color_2,
            R.color.path_color_3
        )
    }

    private var googleMap: GoogleMap? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(binding.root)

        binding.buttonRequestDirection.setOnClickListener { requestDirection() }

        (supportFragmentManager.findFragmentById(R.id.maps) as SupportMapFragment).getMapAsync { googleMap ->
            this.googleMap = googleMap
        }
    }

    private fun requestDirection() {
        showSnackbar(getString(R.string.direction_requesting))
        GoogleDirectionConfiguration.getInstance().isLogEnabled = BuildConfig.DEBUG
        GoogleDirection.withServerKey(serverKey)
            .from(origin)
            .to(destination)
            .transportMode(TransportMode.DRIVING)
            .alternativeRoute(true)
            .execute(
                onDirectionSuccess = { direction -> onDirectionSuccess(direction) },
                onDirectionFailure = { t -> onDirectionFailure(t) }
            )
    }

    private fun onDirectionSuccess(direction: Direction?) {
        direction?.let {
            showSnackbar(getString(R.string.success_with_status, direction.status))
            if (direction.isOK) {
                googleMap?.addMarker(MarkerOptions().position(origin))
                googleMap?.addMarker(MarkerOptions().position(destination))
                for (i in 0 until direction.routeList.size) {
                    val route = direction.routeList[i]
                    val color = ContextCompat.getColor(this, pathColors[i % pathColors.size])
                    val directionPositionList = route.legList[0].directionPoint
                    googleMap?.addPolyline(
                        DirectionConverter.createPolyline(
                            this,
                            directionPositionList,
                            5,
                            color
                        )
                    )
                }
                setCameraWithCoordinationBounds(direction.routeList[0])
                binding.buttonRequestDirection.visibility = View.GONE
            } else {
                showSnackbar(direction.status)
            }
        } ?: run {
            showSnackbar(getString(R.string.success_with_empty))
        }
    }

    private fun onDirectionFailure(t: Throwable) {
        showSnackbar(t.message)
    }

    private fun setCameraWithCoordinationBounds(route: Route) {
        val southwest = route.bound.southwestCoordination.coordination
        val northeast = route.bound.northeastCoordination.coordination
        val bounds = LatLngBounds(southwest, northeast)
        googleMap?.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 100))
    }

    private fun showSnackbar(message: String?) {
        message?.let {
            Snackbar.make(findViewById(android.R.id.content), message, Snackbar.LENGTH_SHORT).show()
        }
    }
}


================================================
FILE: app/src/main/java/com/akexorcist/googledirection/sample/MainActivity.kt
================================================
package com.akexorcist.googledirection.sample

import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.akexorcist.googledirection.sample.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {
    private val binding: ActivityMainBinding by lazy {
        ActivityMainBinding.inflate(layoutInflater)
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(binding.root)

        binding.buttonSimple.setOnClickListener { goToSimpleDirection() }
        binding.buttonTransit.setOnClickListener { goToTransitDirection() }
        binding.buttonAlternative.setOnClickListener { goToAlternativeDirection() }
        binding.buttonWaypoints.setOnClickListener { goToWaypointsDirection() }
    }

    private fun goToSimpleDirection() {
        openActivity(SimpleDirectionActivity::class.java)
    }

    private fun goToTransitDirection() {
        openActivity(TransitDirectionActivity::class.java)
    }

    private fun goToAlternativeDirection() {
        openActivity(AlternativeDirectionActivity::class.java)
    }

    private fun goToWaypointsDirection() {
        openActivity(WaypointsDirectionActivity::class.java)
    }

    private fun openActivity(cs: Class<*>) {
        startActivity(Intent(this, cs))
    }
}


================================================
FILE: app/src/main/java/com/akexorcist/googledirection/sample/SimpleDirectionActivity.kt
================================================
package com.akexorcist.googledirection.sample

import android.graphics.Color
import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.akexorcist.googledirection.GoogleDirection
import com.akexorcist.googledirection.config.GoogleDirectionConfiguration
import com.akexorcist.googledirection.constant.TransportMode
import com.akexorcist.googledirection.model.Direction
import com.akexorcist.googledirection.model.Route
import com.akexorcist.googledirection.sample.databinding.ActivitySimpleDirectionBinding
import com.akexorcist.googledirection.util.DirectionConverter
import com.akexorcist.googledirection.util.execute
import com.google.android.gms.maps.CameraUpdateFactory
import com.google.android.gms.maps.GoogleMap
import com.google.android.gms.maps.SupportMapFragment
import com.google.android.gms.maps.model.LatLng
import com.google.android.gms.maps.model.LatLngBounds
import com.google.android.gms.maps.model.MarkerOptions
import com.google.android.material.snackbar.Snackbar

class SimpleDirectionActivity : AppCompatActivity() {
    private val binding: ActivitySimpleDirectionBinding by lazy {
        ActivitySimpleDirectionBinding.inflate(layoutInflater)
    }

    companion object {
        private const val serverKey = "YOUR_SERVER_KEY"
        private val origin = LatLng(37.7849569, -122.4068855)
        private val destination = LatLng(37.7814432, -122.4460177)
    }

    private var googleMap: GoogleMap? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(binding.root)

        binding.buttonRequestDirection.setOnClickListener { requestDirection() }

        (supportFragmentManager.findFragmentById(R.id.maps) as SupportMapFragment).getMapAsync { googleMap ->
            this.googleMap = googleMap
        }
    }

    private fun requestDirection() {
        showSnackbar(getString(R.string.direction_requesting))
        GoogleDirectionConfiguration.getInstance().isLogEnabled = BuildConfig.DEBUG
        GoogleDirection.withServerKey(serverKey)
            .from(origin)
            .to(destination)
            .transportMode(TransportMode.DRIVING)
            .execute(
                onDirectionSuccess = { direction -> onDirectionSuccess(direction) },
                onDirectionFailure = { t -> onDirectionFailure(t) }
            )
    }

    private fun onDirectionSuccess(direction: Direction?) {
        direction?.let {
            showSnackbar(getString(R.string.success_with_status, direction.status))
            if (direction.isOK) {
                val route = direction.routeList[0]
                googleMap?.addMarker(MarkerOptions().position(origin))
                googleMap?.addMarker(MarkerOptions().position(destination))
                val directionPositionList = route.legList[0].directionPoint
                googleMap?.addPolyline(
                    DirectionConverter.createPolyline(
                        this,
                        directionPositionList,
                        5,
                        Color.RED
                    )
                )
                setCameraWithCoordinationBounds(route)
                binding.buttonRequestDirection.visibility = View.GONE
            } else {
                showSnackbar(direction.status)
            }
        } ?: run {
            showSnackbar(getString(R.string.success_with_empty))
        }
    }

    private fun onDirectionFailure(t: Throwable) {
        showSnackbar(t.message)
    }

    private fun setCameraWithCoordinationBounds(route: Route) {
        val southwest = route.bound.southwestCoordination.coordination
        val northeast = route.bound.northeastCoordination.coordination
        val bounds = LatLngBounds(southwest, northeast)
        googleMap?.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 100))
    }

    private fun showSnackbar(message: String?) {
        message?.let {
            Snackbar.make(findViewById(android.R.id.content), message, Snackbar.LENGTH_SHORT).show()
        }
    }
}


================================================
FILE: app/src/main/java/com/akexorcist/googledirection/sample/TransitDirectionActivity.kt
================================================
package com.akexorcist.googledirection.sample

import android.graphics.Color
import android.os.Bundle
import android.view.View

import androidx.appcompat.app.AppCompatActivity

import com.akexorcist.googledirection.GoogleDirection
import com.akexorcist.googledirection.config.GoogleDirectionConfiguration
import com.akexorcist.googledirection.constant.TransportMode
import com.akexorcist.googledirection.model.Direction
import com.akexorcist.googledirection.model.Route
import com.akexorcist.googledirection.sample.databinding.ActivityTransitDirectionBinding
import com.akexorcist.googledirection.util.DirectionConverter
import com.akexorcist.googledirection.util.execute
import com.google.android.gms.maps.CameraUpdateFactory
import com.google.android.gms.maps.GoogleMap
import com.google.android.gms.maps.SupportMapFragment
import com.google.android.gms.maps.model.LatLng
import com.google.android.gms.maps.model.LatLngBounds
import com.google.android.gms.maps.model.MarkerOptions
import com.google.android.material.snackbar.Snackbar

class TransitDirectionActivity : AppCompatActivity() {
    private val binding: ActivityTransitDirectionBinding by lazy {
        ActivityTransitDirectionBinding.inflate(layoutInflater)
    }

    companion object {
        private const val serverKey = "YOUR_SERVER_KEY"
        private val origin = LatLng(13.7371063, 100.5642539)
        private val destination = LatLng(13.7604896, 100.5594266)
    }

    private var googleMap: GoogleMap? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(binding.root)

        binding.buttonRequestDirection.setOnClickListener { requestDirection() }

        (supportFragmentManager.findFragmentById(R.id.maps) as SupportMapFragment).getMapAsync { googleMap ->
            this.googleMap = googleMap
        }
    }

    private fun requestDirection() {
        showSnackbar(getString(R.string.direction_requesting))
        GoogleDirectionConfiguration.getInstance().isLogEnabled = BuildConfig.DEBUG
        GoogleDirection.withServerKey(serverKey)
            .from(origin)
            .to(destination)
            .transportMode(TransportMode.TRANSIT)
            .execute(
                onDirectionSuccess = { direction -> onDirectionSuccess(direction) },
                onDirectionFailure = { t -> onDirectionFailure(t) }
            )
    }

    private fun onDirectionSuccess(direction: Direction?) {
        direction?.let {
            showSnackbar(getString(R.string.success_with_status, direction.status))
            if (direction.isOK) {
                val route = direction.routeList[0]
                val leg = route.legList[0]
                val sectionPositionList = leg.sectionPoint
                for (position in sectionPositionList) {
                    googleMap?.addMarker(MarkerOptions().position(position))
                }
                val stepList = leg.stepList
                val polylineOptionList = DirectionConverter.createTransitPolyline(
                    this,
                    stepList,
                    5,
                    Color.RED,
                    3,
                    Color.BLUE
                )
                for (polylineOption in polylineOptionList) {
                    googleMap?.addPolyline(polylineOption)
                }
                setCameraWithCoordinationBounds(route)
                binding.buttonRequestDirection.visibility = View.GONE
            } else {
                showSnackbar(direction.status)
            }
        } ?: run {
            showSnackbar(getString(R.string.success_with_empty))
        }
    }

    private fun onDirectionFailure(t: Throwable) {
        showSnackbar(t.message)
    }

    private fun setCameraWithCoordinationBounds(route: Route) {
        val southwest = route.bound.southwestCoordination.coordination
        val northeast = route.bound.northeastCoordination.coordination
        val bounds = LatLngBounds(southwest, northeast)
        googleMap?.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 100))
    }

    private fun showSnackbar(message: String?) {
        message?.let {
            Snackbar.make(findViewById(android.R.id.content), message, Snackbar.LENGTH_SHORT).show()
        }
    }
}


================================================
FILE: app/src/main/java/com/akexorcist/googledirection/sample/WaypointsDirectionActivity.kt
================================================
package com.akexorcist.googledirection.sample

import android.graphics.Color
import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.akexorcist.googledirection.GoogleDirection
import com.akexorcist.googledirection.config.GoogleDirectionConfiguration
import com.akexorcist.googledirection.constant.TransportMode
import com.akexorcist.googledirection.model.Direction
import com.akexorcist.googledirection.model.Route
import com.akexorcist.googledirection.sample.databinding.ActivityWaypointsDirectionBinding
import com.akexorcist.googledirection.util.DirectionConverter
import com.akexorcist.googledirection.util.execute
import com.google.android.gms.maps.CameraUpdateFactory
import com.google.android.gms.maps.GoogleMap
import com.google.android.gms.maps.SupportMapFragment
import com.google.android.gms.maps.model.LatLng
import com.google.android.gms.maps.model.LatLngBounds
import com.google.android.gms.maps.model.MarkerOptions
import com.google.android.material.snackbar.Snackbar

class WaypointsDirectionActivity : AppCompatActivity() {
    private val binding: ActivityWaypointsDirectionBinding by lazy {
        ActivityWaypointsDirectionBinding.inflate(layoutInflater)
    }

    companion object {
        private const val serverKey = "YOUR_SERVER_KEY"
        private val park = LatLng(41.8838111, -87.6657851)
        private val shopping = LatLng(41.8766061, -87.6556908)
        private val dinner = LatLng(41.8909056, -87.6467561)
        private val gallery = LatLng(41.9007082, -87.6488802)
    }

    private var googleMap: GoogleMap? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_waypoints_direction)

        binding.buttonRequestDirection.setOnClickListener { requestDirection() }

        (supportFragmentManager.findFragmentById(R.id.maps) as SupportMapFragment).getMapAsync { googleMap ->
            this.googleMap = googleMap
        }
    }

    private fun requestDirection() {
        showSnackbar(getString(R.string.direction_requesting))
        GoogleDirectionConfiguration.getInstance().isLogEnabled = BuildConfig.DEBUG
        GoogleDirection.withServerKey(serverKey)
            .from(park)
            .and(shopping)
            .and(dinner)
            .to(gallery)
            .transportMode(TransportMode.DRIVING)
            .execute(
                onDirectionSuccess = { direction -> onDirectionSuccess(direction) },
                onDirectionFailure = { t -> onDirectionFailure(t) }
            )
    }

    private fun onDirectionSuccess(direction: Direction?) {
        direction?.let {
            showSnackbar(getString(R.string.success_with_status, direction.status))
            if (direction.isOK) {
                val route = direction.routeList[0]
                val legCount = route.legList.size
                for (index in 0 until legCount) {
                    val leg = route.legList[index]
                    googleMap?.addMarker(MarkerOptions().position(leg.startLocation.coordination))
                    if (index == legCount - 1) {
                        googleMap?.addMarker(MarkerOptions().position(leg.endLocation.coordination))
                    }
                    val stepList = leg.stepList
                    val polylineOptionList = DirectionConverter.createTransitPolyline(
                        this,
                        stepList,
                        5,
                        Color.RED,
                        3,
                        Color.BLUE
                    )
                    for (polylineOption in polylineOptionList) {
                        googleMap?.addPolyline(polylineOption)
                    }
                }
                setCameraWithCoordinationBounds(route)
                binding.buttonRequestDirection.visibility = View.GONE
            } else {
                showSnackbar(direction.status)
            }
        } ?: run {
            showSnackbar(getString(R.string.success_with_empty))
        }
    }

    private fun onDirectionFailure(t: Throwable) {
        showSnackbar(t.message)
    }

    private fun setCameraWithCoordinationBounds(route: Route) {
        val southwest = route.bound.southwestCoordination.coordination
        val northeast = route.bound.northeastCoordination.coordination
        val bounds = LatLngBounds(southwest, northeast)
        googleMap?.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 100))
    }

    private fun showSnackbar(message: String?) {
        message?.let {
            Snackbar.make(findViewById(android.R.id.content), message, Snackbar.LENGTH_SHORT).show()
        }
    }
}


================================================
FILE: app/src/main/res/layout/activity_alternative_direction.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".AlternativeDirectionActivity">

    <fragment
        android:id="@+id/maps"
        android:name="com.google.android.gms.maps.SupportMapFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MapsActivity" />

    <com.google.android.material.button.MaterialButton
        android:id="@+id/buttonRequestDirection"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|center_horizontal"
        android:layout_marginBottom="@dimen/default_margin_padding"
        android:text="@string/request_direction" />

</FrameLayout>


================================================
FILE: app/src/main/res/layout/activity_main.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:orientation="vertical">

        <Button
            android:id="@+id/buttonSimple"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:text="@string/simple_direction" />

        <Button
            android:id="@+id/buttonTransit"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:text="@string/transit_direction" />

        <Button
            android:id="@+id/buttonAlternative"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:text="@string/alternative_direction" />

        <Button
            android:id="@+id/buttonWaypoints"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:text="@string/waypoints_direction" />

    </LinearLayout>
</FrameLayout>


================================================
FILE: app/src/main/res/layout/activity_simple_direction.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".SimpleDirectionActivity">

    <fragment
        android:id="@+id/maps"
        android:name="com.google.android.gms.maps.SupportMapFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MapsActivity" />

    <Button
        android:id="@+id/buttonRequestDirection"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|center_horizontal"
        android:layout_marginBottom="@dimen/default_margin_padding"
        android:text="@string/request_direction" />

</FrameLayout>


================================================
FILE: app/src/main/res/layout/activity_transit_direction.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".TransitDirectionActivity">

    <fragment
        android:id="@+id/maps"
        android:name="com.google.android.gms.maps.SupportMapFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MapsActivity" />

    <Button
        android:id="@+id/buttonRequestDirection"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|center_horizontal"
        android:layout_marginBottom="@dimen/default_margin_padding"
        android:text="@string/request_direction" />

</FrameLayout>


================================================
FILE: app/src/main/res/layout/activity_waypoints_direction.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".WaypointsDirectionActivity">

    <fragment
        android:id="@+id/maps"
        android:name="com.google.android.gms.maps.SupportMapFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MapsActivity" />

    <Button
        android:id="@+id/buttonRequestDirection"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|center_horizontal"
        android:layout_marginBottom="@dimen/default_margin_padding"
        android:text="@string/request_direction" />

</FrameLayout>


================================================
FILE: app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@mipmap/ic_launcher_background"/>
    <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

================================================
FILE: app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@mipmap/ic_launcher_background"/>
    <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

================================================
FILE: app/src/main/res/values/colors.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#3F51B5</color>
    <color name="colorPrimaryDark">#303F9F</color>
    <color name="colorAccent">#FF4081</color>

    <color name="path_color_1">#7fff7272</color>
    <color name="path_color_2">#7f31c7c5</color>
    <color name="path_color_3">#7fff8a00</color>
</resources>


================================================
FILE: app/src/main/res/values/dimens.xml
================================================
<resources>
    <dimen name="default_margin_padding">16dp</dimen>
</resources>


================================================
FILE: app/src/main/res/values/strings.xml
================================================
<resources>
    <string name="app_name">Google Direction Library Demo</string>
    <string name="simple_direction">Simple Direction</string>
    <string name="transit_direction">Transit Direction</string>
    <string name="alternative_direction">Alternative Direction</string>
    <string name="waypoints_direction">Waypoints Direction</string>
    <string name="request_direction">Request Direction</string>
    <string name="success_with_status">Success with status : %1$s</string>
    <string name="success_with_empty">Success with empty result</string>
    <string name="direction_requesting">Direction Requesting...</string>
</resources>


================================================
FILE: app/src/main/res/values/styles.xml
================================================
<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

</resources>


================================================
FILE: app/src/test/java/com/akexorcist/library/googledirectionandplace/sample/ExampleUnitTest.java
================================================
package com.akexorcist.library.googledirectionandplace;

import org.junit.Test;

import static org.junit.Assert.*;

/**
 * To work on unit tests, switch the Test Artifact in the Build Variants view.
 */
public class ExampleUnitTest {
    @Test
    public void addition_isCorrect() throws Exception {
        assertEquals(4, 2 + 2);
    }
}

================================================
FILE: build.gradle
================================================
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    project.ext {
        kotlin_version = '1.4.32'
        compileSdkVersion = 30
        targetSdkVersion = 30
        minSdkVersion = 16

        versionName = '1.2.1'
        versionCode = 10201

        libraryName = 'Google Direction Library'
        libraryDescription = 'Google Direction API for Android'

        groupId = 'com.akexorcist'
        artifactId = 'google-direction-library'

        siteUrl = 'https://github.com/akexorcist/Android-GoogleDirectionLibrary'
        gitUrl = 'https://github.com/akexorcist/Android-GoogleDirectionLibrary.git'

        developerId = 'akexorcist'
        developName = 'Somkiat Khitwongwattana'
        developerEmail = 'akexorcist@gmail.com'

        licenseName = 'The Apache License, Version 2.0'
        licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$project.kotlin_version"
        classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:0.9.17"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}


================================================
FILE: google-direction/build.gradle
================================================
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'org.jetbrains.dokka-android'

android {
    compileSdkVersion project.compileSdkVersion

    defaultConfig {
        minSdkVersion project.minSdkVersion
        targetSdkVersion project.targetSdkVersion
        versionCode project.versionCode
        versionName project.versionName
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        main {
            manifest.srcFile 'src/main/AndroidManifest.xml'
            java.srcDirs = ['src/main/java']
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = "1.8"
    }
}

dokka {
    outputFormat = 'html'
    outputDirectory = "$buildDir/javadoc"
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    testImplementation 'junit:junit:4.13.2'
    implementation 'androidx.annotation:annotation:1.2.0'
    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0'
    implementation('com.squareup.retrofit2:converter-gson:2.9.0') {
        exclude module: 'retrofit'
    }
    implementation('com.google.android.gms:play-services-maps:17.0.0') {
        exclude module: 'support-annotations'
        exclude module: 'support-v4'
        exclude module: 'play-services-base'
    }
    implementation 'com.google.maps.android:android-maps-utils:0.5'
}

//apply from: '../publish/mavencentral.gradle'


================================================
FILE: google-direction/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Applications/ADT/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

# Retrofit library
-dontwarn retrofit.**
-keep class retrofit.** { *; }
-keepattributes Signature
-keepattributes Exceptions

# Parcel library
-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}

-keep class org.parceler.Parceler$$Parcels

================================================
FILE: google-direction/src/main/AndroidManifest.xml
================================================
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.akexorcist.googledirection">

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

</manifest>


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/DirectionCallback.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.akexorcist.googledirection.model.Direction;

/**
 * Interface for the response from the direction request of the Google Direction API.
 *
 * @since 1.0.0
 */
public interface DirectionCallback {
    /**
     * Retrieve the response from direction request successfully.
     *
     * @param direction The direction result from the Google Direction API
     * @since 1.0.0
     */
    void onDirectionSuccess(@Nullable Direction direction);

    /**
     * Retrieve the response from direction request with error result.
     *
     * @param t A throwable from the response of Google Direction API.
     * @since 1.0.0
     */
    void onDirectionFailure(@NonNull Throwable t);
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/GoogleDirection.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection;

import androidx.annotation.NonNull;

import com.akexorcist.googledirection.request.DirectionOriginRequest;

/**
 * Initiate class for direction request of the Google Direction API.
 *
 * @since 1.0.0
 */
public class GoogleDirection {
    /**
     * Create the Google Direction with Google Direction API Key.
     * <BR />
     * <B>Notes</B> - Do not put your Web API Key in the code directly.
     * The key may be stole and misused by malicious parties.
     *
     * @param apiKey Web API Key for the Google Direction API
     * @return The origin request object
     * @since 1.0.0
     */
    public static DirectionOriginRequest withServerKey(@NonNull String apiKey) {
        return new DirectionOriginRequest(apiKey);
    }
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/config/GoogleDirectionConfiguration.java
================================================
package com.akexorcist.googledirection.config;

import okhttp3.OkHttpClient;

/**
 * Configuration class for the Google Direction Library.
 *
 * @since 1.0.0
 */

@SuppressWarnings("unused")
public class GoogleDirectionConfiguration {
    private static GoogleDirectionConfiguration configuration;

    /**
     * Call the class with singleton pattern
     *
     * @return The singleton object of this class
     * @since 1.0.0
     */
    public static GoogleDirectionConfiguration getInstance() {
        if (configuration == null) {
            configuration = new GoogleDirectionConfiguration();
        }
        return configuration;
    }

    private OkHttpClient customClient;
    private boolean isLogEnabled = false;

    /**
     * Get the custom OkHttpClient
     *
     * @return The OkHttpClient object
     * @since 1.0.0
     */
    public OkHttpClient getCustomClient() {
        return customClient;
    }

    /**
     * Set the custom OkHttpClient to replace the default client in this library
     *
     * @param customClient The OkHttpClient object
     * @since 1.0.0
     */
    public void setCustomClient(OkHttpClient customClient) {
        this.customClient = customClient;
    }

    /**
     * Is the API request logging enable or disable
     *
     * @return The value will be true for enable and false for disable
     * @since 1.0.0
     */
    public boolean isLogEnabled() {
        return isLogEnabled;
    }

    /**
     * Enable or disable the API request logging (Powered by OkHttp Logging Interceptor)
     *
     * @param logEnabled true for enable and false for disable
     * @since 1.0.0
     */
    public void setLogEnabled(boolean logEnabled) {
        isLogEnabled = logEnabled;
    }
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/constant/AvoidType.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.constant;

import androidx.annotation.StringDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Route restriction to avoid.
 *
 * @since 1.0.0
 */
public class AvoidType {
    /**
     * Indicates that the calculated route should avoid toll roads/bridges.
     *
     * @since 1.0.0
     */
    public static final String TOLLS = "tolls";
    /**
     * Indicates that the calculated route should avoid highways.
     *
     * @since 1.0.0
     */
    public static final String HIGHWAYS = "highways";
    /**
     * Indicates that the calculated route should avoid ferries.
     *
     * @since 1.0.0
     */
    public static final String FERRIES = "ferries";
    /**
     * Indicates that the calculated route should avoid indoor
     * steps for walking and transit directions.
     *
     * @since 1.0.0
     */
    public static final String INDOOR = "indoor";

    @Retention(RetentionPolicy.SOURCE)
    @StringDef({
            TOLLS,
            HIGHWAYS,
            FERRIES,
            INDOOR
    })
    public @interface Value {
    }
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/constant/DirectionUrl.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.constant;

/**
 * For internal use.
 */
public class DirectionUrl {
    public static final String MAPS_API_URL = "https://maps.googleapis.com/maps/api/";
    public static final String DIRECTION_API_URL = "directions/json";

}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/constant/Language.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.constant;

import androidx.annotation.StringDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Supported languages in the Google Direction API.
 *
 * @since 1.0.0
 */
public class Language {
    public static final String AFRIKAANS = "af";
    public static final String ALBANIAN = "sq";
    public static final String AMHARIC = "am";
    public static final String ARABIC = "ar";
    public static final String ARMENIAN = "hy";
    public static final String AZERBAIJANI = "az";
    public static final String BASQUE = "eu";
    public static final String BELARUSIAN = "be";
    public static final String BENGALI = "bn";
    public static final String BOSNIAN = "bs";
    public static final String BULGARIAN = "bg";
    public static final String BURMESE = "my";
    public static final String CATALAN = "ca";
    public static final String CHINESE = "zh";
    public static final String CHINESE_Simplified = "zh-CN";
    public static final String CHINESE_HONG_KONG = "zh-HK";
    public static final String CHINESE_TRADITIONAL = "zh-TW";
    public static final String CROATIAN = "hr";
    public static final String CZECH = "cs";
    public static final String DANISH = "da";
    public static final String DUTCH = "nl";
    public static final String ENGLISH = "en";
    public static final String ENGLISH_AUSTRALIAN = "en-AU";
    public static final String ENGLISH_GREAT_BRITAIN = "en-GB";
    public static final String ESTONIAN = "et";
    public static final String FARSI = "fa";
    public static final String FINNISH = "fi";
    public static final String FILIPINO = "fil";
    public static final String FRENCH = "fr";
    public static final String FRENCH_CANADA = "fr-CA";
    public static final String GALICIAN = "gl";
    public static final String GEORGIAN = "ka";
    public static final String GERMAN = "de";
    public static final String GREEK = "el";
    public static final String GUJARATI = "gu";
    public static final String HEBREW = "iw";
    public static final String HINDI = "hi";
    public static final String HUNGARIAN = "hu";
    public static final String ICELANDIC = "is";
    public static final String INDONESIAN = "id";
    public static final String ITALIAN = "it";
    public static final String JAPANESE = "ja";
    public static final String KANNADA = "kn";
    public static final String KAZAKH = "kk";
    public static final String KHMER = "km";
    public static final String KOREAN = "ko";
    public static final String KYRGYZ = "ky";
    public static final String LAO = "lo";
    public static final String LATVIAN = "lv";
    public static final String LITHUANIAN = "lt";
    public static final String MACEDONIAN = "mk";
    public static final String MALAY = "ms";
    public static final String MALAYALAM = "ml";
    public static final String MARATHI = "mr";
    public static final String MONGOLIAN = "mn";
    public static final String NEPALI = "ne";
    public static final String NORWEGIAN = "no";
    public static final String POLISH = "pl";
    public static final String PORTUGUESE = "pt";
    public static final String PORTUGUESE_BRAZIL = "pt-BR";
    public static final String PORTUGUESE_PORTUGAL = "pt-PT";
    public static final String PUNJABI = "pa";
    public static final String ROMANIAN = "ro";
    public static final String RUSSIAN = "ru";
    public static final String SERBIAN = "sr";
    public static final String SINHALESE = "si";
    public static final String SLOVAK = "sk";
    public static final String SLOVENIAN = "sl";
    public static final String SPANISH = "es";
    public static final String SPANISH_LATIN_AMERICA = "es-419";
    public static final String SWAHILI = "sw";
    public static final String SWEDISH = "sv";
    public static final String TAMIL = "ta";
    public static final String TELUGU = "te";
    public static final String THAI = "th";
    public static final String TURKISH = "tr";
    public static final String UKRAINIAN = "uk";
    public static final String URDU = "ur";
    public static final String UZBEK = "uz";
    public static final String VIETNAMESE = "vi";
    public static final String ZULU = "zu";


    @Retention(RetentionPolicy.SOURCE)
    @StringDef({
            AFRIKAANS,
            ALBANIAN,
            AMHARIC,
            ARABIC,
            ARMENIAN,
            AZERBAIJANI,
            BASQUE,
            BELARUSIAN,
            BENGALI,
            BOSNIAN,
            BULGARIAN,
            BURMESE,
            CATALAN,
            CHINESE,
            CHINESE_Simplified,
            CHINESE_HONG_KONG,
            CHINESE_TRADITIONAL,
            CROATIAN,
            CZECH,
            DANISH,
            DUTCH,
            ENGLISH,
            ENGLISH_AUSTRALIAN,
            ENGLISH_GREAT_BRITAIN,
            ESTONIAN,
            FARSI,
            FINNISH,
            FILIPINO,
            FRENCH,
            FRENCH_CANADA,
            GALICIAN,
            GEORGIAN,
            GERMAN,
            GREEK,
            GUJARATI,
            HEBREW,
            HINDI,
            HUNGARIAN,
            ICELANDIC,
            INDONESIAN,
            ITALIAN,
            JAPANESE,
            KANNADA,
            KAZAKH,
            KHMER,
            KOREAN,
            KYRGYZ,
            LAO,
            LATVIAN,
            LITHUANIAN,
            MACEDONIAN,
            MALAY,
            MALAYALAM,
            MARATHI,
            MONGOLIAN,
            NEPALI,
            NORWEGIAN,
            POLISH,
            PORTUGUESE,
            PORTUGUESE_BRAZIL,
            PORTUGUESE_PORTUGAL,
            PUNJABI,
            ROMANIAN,
            RUSSIAN,
            SERBIAN,
            SINHALESE,
            SLOVAK,
            SLOVENIAN,
            SPANISH,
            SPANISH_LATIN_AMERICA,
            SWAHILI,
            SWEDISH,
            TAMIL,
            TELUGU,
            THAI,
            TURKISH,
            UKRAINIAN,
            URDU,
            UZBEK,
            VIETNAMESE,
            ZULU
    })
    public @interface Value {
    }
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/constant/Maneuver.java
================================================
package com.akexorcist.googledirection.constant;

/**
 * Action to take for the current step.
 *
 * @since 1.0.0
 */
@SuppressWarnings("unused")
public class Maneuver {
    public static final String MERGE = "merge";
    public static final String STRAIGHT = "straight";
    public static final String ROUNDABOUT_LEFT = "roundabout-left";
    public static final String ROUNDABOUT_RIGHT = "roundabout-right";
    public static final String U_TURN_LEFT = "uturn-left";
    public static final String U_TURN_RIGHT = "uturn-right";
    public static final String TURN_SLIGHT_LEFT = "turn-slight-left";
    public static final String TURN_SLIGHT_RIGHT = "turn-slight-right";
    public static final String RAMP_LEFT = "ramp-left";
    public static final String RAMP_RIGHT = "ramp-right";
    public static final String TURN_LEFT = "turn-left";
    public static final String TURN_RIGHT = "turn-right";
    public static final String FORK_LEFT = "fork-left";
    public static final String FORK_RIGHT = "fork-right";
    public static final String TURN_SHARP_LEFT = "turn-sharp-left";
    public static final String TURN_SHARP_RIGHT = "turn-sharp-right";
    public static final String KEEP_LEFT = "keep-left";
    public static final String KEEP_RIGHT = "keep-right";
    public static final String FERRY = "ferry";
    public static final String FERRT_TRAIN = "ferry-train";
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/constant/RequestResult.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.constant;

/**
 * The status of the request, and may contain debugging information to
 * help you track down why the Directions service failed.
 *
 * @since 1.0.0
 */
@SuppressWarnings("unused")
public class RequestResult {
    /**
     * Indicates the response contains a valid result.
     *
     * @since 1.0.0
     */
    public static final String OK = "OK";
    /**
     * Indicates at least one of the locations specified in the request's origin,
     * destination, or waypoints could not be geocoded.
     *
     * @since 1.0.0
     */
    public static final String NOT_FOUND = "NOT_FOUND";
    /**
     * Indicates no route could be found between the origin and destination.
     *
     * @since 1.0.0
     */
    public static final String ZERO_RESULTS = "ZERO_RESULTS";
    /**
     * Indicates that too many waypoints were provided in the request.
     *
     * @since 1.0.0
     */
    public static final String MAX_WAYPOINTS_EXCEEDED = "MAX_WAYPOINTS_EXCEEDED";
    /**
     * Indicates the requested route is too long and cannot be processed.
     * This error occurs when more complex directions are returned.
     * Try reducing the number of waypoints, turns, or instructions.
     *
     * @since 1.0.0
     */
    public static final String MAX_ROUTE_LENGTH_EXCEEDED = "MAX_ROUTE_LENGTH_EXCEEDED";
    /**
     * Indicates that the provided request was invalid. Common causes of
     * this status include an invalid parameter or parameter value.
     *
     * @since 1.0.0
     */
    public static final String INVALID_REQUEST = "INVALID_REQUEST";
    /**
     * Indicates any of the following:
     * <BR />• The API key is missing or invalid.
     * <BR />• Billing has not been enabled on your account.
     * <BR />• A self-imposed usage cap has been exceeded.
     * <BR />• The provided method of payment is no longer valid (for example, a credit card has expired).
     *
     * @since 1.0.0
     */
    public static final String OVER_DAILY_LIMIT = "OVER_QUERY_LIMIT";
    /**
     * Indicates the service has received too many requests from
     * your application within the allowed time period.
     *
     * @since 1.0.0
     */
    public static final String OVER_QUERY_LIMIT = "OVER_QUERY_LIMIT";
    /**
     * Indicates that the service denied use of the directions service by your application.
     *
     * @since 1.0.0
     */
    public static final String REQUEST_DENIED = "REQUEST_DENIED";
    /**
     * Indicates a directions request could not be processed due to
     * a server error. The request may succeed if you try again.
     *
     * @since 1.0.0
     */
    public static final String UNKNOWN_ERROR = "UNKNOWN_ERROR";
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/constant/TrafficModel.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.constant;

import androidx.annotation.StringDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Traffic Model.
 *
 * @since 1.2.1
 */
public class TrafficModel {
    /**
     * (default) Indicates that the returned duration_in_traffic should be the best estimate
     * of travel time given what is known about both historical traffic conditions and live
     * traffic. Live traffic becomes more important the closer the departure_time is to now.
     *
     * @since 1.2.1
     */
    public static final String BEST_GUESS = "best_guess";
    /**
     * Indicates that the returned duration_in_traffic should be longer than the actual travel
     * time on most days, though occasional days with particularly bad traffic conditions may
     * exceed this value.
     *
     * @since 1.2.1
     */
    public static final String PESSIMISTIC = "pessimistic";
    /**
     * Indicates that the returned duration_in_traffic should be shorter than the actual travel
     * time on most days, though occasional days with particularly good traffic conditions may
     * be faster than this value.
     *
     * @since 1.2.1
     */
    public static final String OPTIMISTIC = "optimistic";

    @Retention(RetentionPolicy.SOURCE)
    @StringDef({
            BEST_GUESS,
            PESSIMISTIC,
            OPTIMISTIC
    })
    public @interface Value {
    }
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/constant/TransitMode.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.constant;

import androidx.annotation.StringDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Transit mode.
 *
 * @since 1.0.0
 */
public class TransitMode {
    /**
     * Indicates that the calculated route should prefer travel by bus.
     *
     * @since 1.0.0
     */
    public static final String BUS = "bus";
    /**
     * indicates that the calculated route should prefer travel by subway.
     *
     * @since 1.0.0
     */
    public static final String SUBWAY = "subway";
    /**
     * Indicates that the calculated route should prefer travel by train.
     *
     * @since 1.0.0
     */
    public static final String TRAIN = "train";
    /**
     * Indicates that the calculated route should prefer travel by tram and light rail.
     *
     * @since 1.0.0
     */
    public static final String TRAM = "tram";
    /**
     * Indicates that the calculated route should prefer travel by train, tram, light rail, and subway.
     *
     * @since 1.0.0
     */
    public static final String RAIL = "rail";

    @Retention(RetentionPolicy.SOURCE)
    @StringDef({
            BUS,
            SUBWAY,
            TRAIN,
            TRAM,
            RAIL
    })
    public @interface Value {
    }
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/constant/TransitRoutingPreference.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.constant;

import androidx.annotation.StringDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Traffic Model.
 *
 * @since 1.2.1
 */
public class TransitRoutingPreference {
    /**
     * Indicates that the calculated route should prefer limited amounts of walking.
     *
     * @since 1.2.1
     */
    public static final String LESS_WALKING = "less_walking";
    /**
     * Indicates that the calculated route should prefer a limited number of transfers.
     *
     * @since 1.2.1
     */
    public static final String FEWER_TRANSFERS = "fewer_transfers";

    @Retention(RetentionPolicy.SOURCE)
    @StringDef({
            LESS_WALKING,
            FEWER_TRANSFERS
    })
    public @interface Value {
    }
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/constant/TransportMode.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.constant;

import androidx.annotation.StringDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Transport mode.
 *
 * @since 1.0.0
 */
public class TransportMode {
    /**
     * (default) Indicates standard driving directions using the road network.
     *
     * @since 1.0.0
     */
    public static final String DRIVING = "driving";
    /**
     * Requests walking directions via pedestrian paths & sidewalks (where available).
     *
     * @since 1.0.0
     */
    public static final String WALKING = "walking";
    /**
     * Requests bicycling directions via bicycle paths & preferred streets (where available).
     *
     * @since 1.0.0
     */
    public static final String BICYCLING = "bicycling";
    /**
     * Requests directions via public transit routes (where available).
     *
     * @since 1.0.0
     */
    public static final String TRANSIT = "transit";

    @Retention(RetentionPolicy.SOURCE)
    @StringDef({
            DRIVING,
            WALKING,
            BICYCLING,
            TRANSIT
    })
    public @interface Value {
    }
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/constant/Unit.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.constant;

import androidx.annotation.StringDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Unit.
 *
 * @since 1.0.0
 */
public class Unit {
    /**
     * Specifies usage of the metric system. Textual distances are returned using kilometers and meters.
     *
     * @since 1.0.0
     */
    public static final String METRIC = "metric";
    /**
     * Specifies usage of the Imperial (English) system. Textual distances are returned using miles and feet.
     *
     * @since 1.0.0
     */
    public static final String IMPERIAL = "imperial";

    @Retention(RetentionPolicy.SOURCE)
    @StringDef({
            METRIC,
            IMPERIAL
    })
    public @interface Value {
    }
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/constant/VehicleType.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.constant;

/**
 * Vehicle type.
 *
 * @since 1.0.0
 */
@SuppressWarnings("unused")
public class VehicleType {
    /**
     * Rail.
     *
     * @since 1.0.0
     */
    public static final String RAIL = "RAIL";
    /**
     * Light rail transit.
     *
     * @since 1.0.0
     */
    public static final String METRO_RAIL = "METRO_RAIL";
    /**
     * Underground light rail.
     *
     * @since 1.0.0
     */
    public static final String SUBWAY = "SUBWAY";
    /**
     * Above ground light rail.
     *
     * @since 1.0.0
     */
    public static final String TRAM = "TRAM";
    /**
     * Monorail.
     *
     * @since 1.0.0
     */
    public static final String MONORAIL = "MONORAIL";
    /**
     * Heavy rail.
     *
     * @since 1.0.0
     */
    public static final String HEAVY_RAIL = "HEAVY_RAIL";
    /**
     * Commuter rail.
     *
     * @since 1.0.0
     */
    public static final String COMMUTER_TRAIN = "COMMUTER_TRAIN";
    /**
     * High speed train.
     *
     * @since 1.0.0
     */
    public static final String HIGH_SPEED_TRAIN = "HIGH_SPEED_TRAIN";
    /**
     * Long distance train.
     *
     * @since 1.2.1
     */
    public static final String LONG_DISTANCE_TRAIN = "LONG_DISTANCE_TRAIN";
    /**
     * Bus.
     *
     * @since 1.0.0
     */
    public static final String BUS = "BUS";
    /**
     * Intercity bus.
     *
     * @since 1.0.0
     */
    public static final String INTERCITY_BUS = "INTERCITY_BUS";
    /**
     * Trolleybus.
     *
     * @since 1.0.0
     */
    public static final String TROLLEYBUS = "TROLLEYBUS";
    /**
     * Share taxi is a kind of bus with the ability to drop
     * off and pick up passengers anywhere on its route.
     *
     * @since 1.0.0
     */
    public static final String SHARE_TAXI = "SHARE_TAXI";
    /**
     * Ferry.
     *
     * @since 1.0.0
     */
    public static final String FERRY = "FERRY";
    /**
     * A vehicle that operates on a cable, usually on the ground.
     * Aerial cable cars may be of the type {@value #GONDOLA_LIFT}.
     *
     * @since 1.0.0
     */
    public static final String CABLE_CAR = "CABLE_CAR";
    /**
     * An aerial cable car.
     *
     * @since 1.0.0
     */
    public static final String GONDOLA_LIFT = "GONDOLA_LIFT";
    /**
     * A vehicle that is pulled up a steep incline by a cable.
     * A Funicular typically consists of two cars, with each car
     * acting as a counterweight for the other.
     *
     * @since 1.0.0
     */
    public static final String FUNICULAR = "FUNICULAR";
    /**
     * All other vehicles will return this type.
     *
     * @since 1.0.0
     */
    public static final String OTHER = "OTHER";
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Agency.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

/**
 * Created by Akexorcist on 11/29/15 AD.
 */

@SuppressWarnings("WeakerAccess")
public class Agency implements Parcelable {
    @SerializedName("name")
    private String name;
    @SerializedName("url")
    private String url;

    public Agency() {
    }

    protected Agency(Parcel in) {
        name = in.readString();
        url = in.readString();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(name);
        dest.writeString(url);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<Agency> CREATOR = new Creator<Agency>() {
        @Override
        public Agency createFromParcel(Parcel in) {
            return new Agency(in);
        }

        @Override
        public Agency[] newArray(int size) {
            return new Agency[size];
        }
    };
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Bound.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

/**
 * Created by Akexorcist on 11/29/15 AD.
 */

@SuppressWarnings("WeakerAccess")
public class Bound implements Parcelable {
    @SerializedName("northeast")
    private Coordination northeast;
    @SerializedName("southwest")
    private Coordination southwest;

    public Bound() {
    }

    protected Bound(Parcel in) {
        northeast = in.readParcelable(Coordination.class.getClassLoader());
        southwest = in.readParcelable(Coordination.class.getClassLoader());
    }

    public Coordination getNortheastCoordination() {
        return northeast;
    }

    public void setNortheast(Coordination northeast) {
        this.northeast = northeast;
    }

    public Coordination getSouthwestCoordination() {
        return southwest;
    }

    public void setSouthwest(Coordination southwest) {
        this.southwest = southwest;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(northeast, flags);
        dest.writeParcelable(southwest, flags);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<Bound> CREATOR = new Creator<Bound>() {
        @Override
        public Bound createFromParcel(Parcel in) {
            return new Bound(in);
        }

        @Override
        public Bound[] newArray(int size) {
            return new Bound[size];
        }
    };
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Coordination.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.android.gms.maps.model.LatLng;
import com.google.gson.annotations.SerializedName;

/**
 * Created by Akexorcist on 11/29/15 AD.
 */

@SuppressWarnings("WeakerAccess")
public class Coordination implements Parcelable {
    @SerializedName("lat")
    private double latitude;
    @SerializedName("lng")
    private double longitude;

    public Coordination() {
    }

    protected Coordination(Parcel in) {
        latitude = in.readDouble();
        longitude = in.readDouble();
    }

    public double getLatitude() {
        return latitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public double getLongitude() {
        return longitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public LatLng getCoordination() {
        return new LatLng(latitude, longitude);
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeDouble(latitude);
        dest.writeDouble(longitude);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<Coordination> CREATOR = new Creator<Coordination>() {
        @Override
        public Coordination createFromParcel(Parcel in) {
            return new Coordination(in);
        }

        @Override
        public Coordination[] newArray(int size) {
            return new Coordination[size];
        }
    };
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Direction.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.akexorcist.googledirection.constant.RequestResult;
import com.google.gson.annotations.SerializedName;

import java.util.List;

/**
 * Created by Akexorcist on 11/29/15 AD.
 */

@SuppressWarnings("WeakerAccess")
public class Direction implements Parcelable {
    @SerializedName("geocoded_waypoints")
    private List<GeocodedWaypoint> geocodedWaypointList;
    @SerializedName("routes")
    private List<Route> routeList;
    @SerializedName("status")
    private String status;
    @SerializedName("error_message")
    private String errorMessage;

    public Direction() {
    }

    protected Direction(Parcel in) {
        status = in.readString();
        errorMessage = in.readString();
    }

    public void setGeocodedWaypointList(List<GeocodedWaypoint> geocodedWaypointList) {
        this.geocodedWaypointList = geocodedWaypointList;
    }

    public List<GeocodedWaypoint> getGeocodedWaypointList() {
        return geocodedWaypointList;
    }

    public void setRouteList(List<Route> routeList) {
        this.routeList = routeList;
    }

    public List<Route> getRouteList() {
        return routeList;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getStatus() {
        return status;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public boolean isOK() {
        return RequestResult.OK.equals(status);
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(status);
        dest.writeString(errorMessage);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<Direction> CREATOR = new Creator<Direction>() {
        @Override
        public Direction createFromParcel(Parcel in) {
            return new Direction(in);
        }

        @Override
        public Direction[] newArray(int size) {
            return new Direction[size];
        }
    };
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Fare.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

/**
 * Created by Akexorcist on 11/29/15 AD.
 */

@SuppressWarnings("WeakerAccess")
public class Fare implements Parcelable {
    @SerializedName("currency")
    private String currency;
    @SerializedName("value")
    private String value;
    @SerializedName("text")
    private String text;

    public Fare() {
    }

    protected Fare(Parcel in) {
        currency = in.readString();
        value = in.readString();
        text = in.readString();
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(currency);
        dest.writeString(value);
        dest.writeString(text);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<Fare> CREATOR = new Creator<Fare>() {
        @Override
        public Fare createFromParcel(Parcel in) {
            return new Fare(in);
        }

        @Override
        public Fare[] newArray(int size) {
            return new Fare[size];
        }
    };
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/GeocodedWaypoint.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

import java.util.List;

/**
 * Created by Akexorcist on 11/29/15 AD.
 */

@SuppressWarnings("WeakerAccess")
public class GeocodedWaypoint implements Parcelable {
    @SerializedName("geocoder_status")
    private String status;
    @SerializedName("place_id")
    private String placeId;
    @SerializedName("types")
    private List<String> typeList;

    public GeocodedWaypoint() {
    }

    protected GeocodedWaypoint(Parcel in) {
        status = in.readString();
        placeId = in.readString();
        typeList = in.createStringArrayList();
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getPlaceId() {
        return placeId;
    }

    public void setPlaceId(String placeId) {
        this.placeId = placeId;
    }

    public List<String> getTypeList() {
        return typeList;
    }

    public void setTypeList(List<String> typeList) {
        this.typeList = typeList;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(status);
        dest.writeString(placeId);
        dest.writeStringList(typeList);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<GeocodedWaypoint> CREATOR = new Creator<GeocodedWaypoint>() {
        @Override
        public GeocodedWaypoint createFromParcel(Parcel in) {
            return new GeocodedWaypoint(in);
        }

        @Override
        public GeocodedWaypoint[] newArray(int size) {
            return new GeocodedWaypoint[size];
        }
    };
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Info.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

/**
 * Created by Akexorcist on 11/29/15 AD.
 */

@SuppressWarnings("WeakerAccess")
public class Info implements Parcelable {
    @SerializedName("text")
    private String text;
    @SerializedName("value")
    private Long value;

    public Info() {
    }

    protected Info(Parcel in) {
        text = in.readString();
        value = in.readLong();
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public Long getValue() {
        return value;
    }

    public void setValue(Long value) {
        this.value = value;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(text);
        dest.writeLong(value);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<Info> CREATOR = new Creator<Info>() {
        @Override
        public Info createFromParcel(Parcel in) {
            return new Info(in);
        }

        @Override
        public Info[] newArray(int size) {
            return new Info[size];
        }
    };
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Leg.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.model;

import com.akexorcist.googledirection.util.DirectionConverter;
import com.google.android.gms.maps.model.LatLng;
import com.google.gson.annotations.SerializedName;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Akexorcist on 11/29/15 AD.
 */

public class Leg {
    @SerializedName("arrival_time")
    private TimeInfo arrivalTime;
    @SerializedName("departure_time")
    private TimeInfo departureTime;
    @SerializedName("distance")
    private Info distance;
    @SerializedName("duration")
    private Info duration;
    @SerializedName("duration_in_traffic")
    private Info durationInTraffic;
    @SerializedName("end_address")
    private String endAddress;
    @SerializedName("end_location")
    private Coordination endLocation;
    @SerializedName("start_address")
    private String startAddress;
    @SerializedName("start_location")
    private Coordination startLocation;
    @SerializedName("steps")
    private List<Step> stepList;
    @SerializedName("via_waypoint")
    private List<Waypoint> viaWaypointList;

    public TimeInfo getArrivalTime() {
        return arrivalTime;
    }

    public void setArrivalTime(TimeInfo arrivalTime) {
        this.arrivalTime = arrivalTime;
    }

    public TimeInfo getDepartureTime() {
        return departureTime;
    }

    public void setDepartureTime(TimeInfo departureTime) {
        this.departureTime = departureTime;
    }

    public Info getDistance() {
        return distance;
    }

    public void setDistance(Info distance) {
        this.distance = distance;
    }

    public Info getDuration() {
        return duration;
    }

    public void setDuration(Info duration) {
        this.duration = duration;
    }

    public Info getDurationInTraffic() {
        return durationInTraffic;
    }

    public void setDurationInTraffic(Info durationInTraffic) {
        this.durationInTraffic = durationInTraffic;
    }

    public String getEndAddress() {
        return endAddress;
    }

    public void setEndAddress(String endAddress) {
        this.endAddress = endAddress;
    }

    public Coordination getEndLocation() {
        return endLocation;
    }

    public void setEndLocation(Coordination endLocation) {
        this.endLocation = endLocation;
    }

    public String getStartAddress() {
        return startAddress;
    }

    public void setStartAddress(String startAddress) {
        this.startAddress = startAddress;
    }

    public Coordination getStartLocation() {
        return startLocation;
    }

    public void setStartLocation(Coordination startLocation) {
        this.startLocation = startLocation;
    }

    public List<Step> getStepList() {
        return stepList;
    }

    public void setStepList(List<Step> stepList) {
        this.stepList = stepList;
    }

    public List<Waypoint> getViaWaypointList() {
        return viaWaypointList;
    }

    public void setViaWaypointList(List<Waypoint> viaWaypointList) {
        this.viaWaypointList = viaWaypointList;
    }

    public ArrayList<LatLng> getDirectionPoint() {
        return DirectionConverter.getDirectionPoint(stepList);
    }

    public ArrayList<LatLng> getSectionPoint() {
        return DirectionConverter.getSectionPoint(stepList);
    }
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Line.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

import java.util.List;

/**
 * Created by Akexorcist on 11/29/15 AD.
 */

@SuppressWarnings("WeakerAccess")
public class Line implements Parcelable {
    @SerializedName("agencies")
    private List<Agency> agencyList;
    @SerializedName("color")
    private String color;
    @SerializedName("name")
    private String name;
    @SerializedName("short_name")
    private String shortName;
    @SerializedName("text_color")
    private String textColor;
    @SerializedName("vehicle")
    private Vehicle vehicle;

    public Line() {
    }

    protected Line(Parcel in) {
        agencyList = in.createTypedArrayList(Agency.CREATOR);
        color = in.readString();
        name = in.readString();
        shortName = in.readString();
        textColor = in.readString();
    }

    public List<Agency> getAgencyList() {
        return agencyList;
    }

    public void setAgencyList(List<Agency> agencyList) {
        this.agencyList = agencyList;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getShortName() {
        return shortName;
    }

    public void setShortName(String shortName) {
        this.shortName = shortName;
    }

    public String getTextColor() {
        return textColor;
    }

    public void setTextColor(String textColor) {
        this.textColor = textColor;
    }

    public Vehicle getVehicle() {
        return vehicle;
    }

    public void setVehicle(Vehicle vehicle) {
        this.vehicle = vehicle;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeTypedList(agencyList);
        dest.writeString(color);
        dest.writeString(name);
        dest.writeString(shortName);
        dest.writeString(textColor);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<Line> CREATOR = new Creator<Line>() {
        @Override
        public Line createFromParcel(Parcel in) {
            return new Line(in);
        }

        @Override
        public Line[] newArray(int size) {
            return new Line[size];
        }
    };
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Route.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

import java.util.List;

/**
 * Created by Akexorcist on 11/29/15 AD.
 */

@SuppressWarnings("WeakerAccess")
public class Route implements Parcelable {
    @SerializedName("bounds")
    private Bound bound;
    @SerializedName("copyrights")
    private String copyrights;
    @SerializedName("legs")
    private List<Leg> legList;
    @SerializedName("overview_polyline")
    private RoutePolyline overviewPolyline;
    @SerializedName("summary")
    private String summary;
    @SerializedName("fare")
    private Fare fare;
    @SerializedName("warnings")
    private List<String> warningList;
    @SerializedName("waypoint_order")
    private List<Long> waypointOrderList;

    public Route() {
    }

    protected Route(Parcel in) {
        bound = in.readParcelable(Bound.class.getClassLoader());
        copyrights = in.readString();
        overviewPolyline = in.readParcelable(RoutePolyline.class.getClassLoader());
        summary = in.readString();
        fare = in.readParcelable(Fare.class.getClassLoader());
        warningList = in.createStringArrayList();
    }

    public Bound getBound() {
        return bound;
    }

    public void setBound(Bound bound) {
        this.bound = bound;
    }

    public String getCopyrights() {
        return copyrights;
    }

    public void setCopyrights(String copyrights) {
        this.copyrights = copyrights;
    }

    public List<Leg> getLegList() {
        return legList;
    }

    public void setLegList(List<Leg> legList) {
        this.legList = legList;
    }

    public RoutePolyline getOverviewPolyline() {
        return overviewPolyline;
    }

    public void setOverviewPolyline(RoutePolyline overviewPolyline) {
        this.overviewPolyline = overviewPolyline;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public Fare getFare() {
        return fare;
    }

    public void setFare(Fare fare) {
        this.fare = fare;
    }

    public List<String> getWarningList() {
        return warningList;
    }

    public void setWarningList(List<String> warningList) {
        this.warningList = warningList;
    }

    public List<Long> getWaypointOrderList() {
        return waypointOrderList;
    }

    public void setWaypointOrderList(List<Long> waypointOrderList) {
        this.waypointOrderList = waypointOrderList;
    }

    /**
     * Get the total duration in meters
     */
    public Long getTotalDistance() {
        if (legList == null || legList.size() == 0) {
            return 0L;
        }
        Long totalDistance = 0L;
        for (Leg leg : legList) {
            totalDistance += leg.getDistance().getValue();
        }
        return totalDistance;
    }

    /**
     * Get the total duration in seconds
     */
    public Long getTotalDuration() {
        if (legList == null || legList.size() == 0) {
            return 0L;
        }
        Long totalDuration = 0L;
        for (Leg leg : legList) {
            totalDuration += leg.getDuration().getValue();
        }
        return totalDuration;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeParcelable(bound, i);
        parcel.writeString(copyrights);
        parcel.writeParcelable(overviewPolyline, i);
        parcel.writeString(summary);
        parcel.writeParcelable(fare, i);
        parcel.writeStringList(warningList);
    }

    public static final Creator<Route> CREATOR = new Creator<Route>() {
        @Override
        public Route createFromParcel(Parcel in) {
            return new Route(in);
        }

        @Override
        public Route[] newArray(int size) {
            return new Route[size];
        }
    };
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/RoutePolyline.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.android.gms.maps.model.LatLng;
import com.google.gson.annotations.SerializedName;
import com.google.maps.android.PolyUtil;

import java.util.List;

/**
 * Created by Akexorcist on 11/29/15 AD.
 */

@SuppressWarnings("WeakerAccess")
public class RoutePolyline implements Parcelable {
    @SerializedName("points")
    private String rawPointList;

    public RoutePolyline() {
    }

    protected RoutePolyline(Parcel in) {
        rawPointList = in.readString();
    }

    public String getRawPointList() {
        return rawPointList;
    }

    public void setRawPointList(String rawPointList) {
        this.rawPointList = rawPointList;
    }

    public List<LatLng> getPointList() {
        return PolyUtil.decode(rawPointList);
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(rawPointList);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<RoutePolyline> CREATOR = new Creator<RoutePolyline>() {
        @Override
        public RoutePolyline createFromParcel(Parcel in) {
            return new RoutePolyline(in);
        }

        @Override
        public RoutePolyline[] newArray(int size) {
            return new RoutePolyline[size];
        }
    };
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Step.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

import java.util.List;

/**
 * Created by Akexorcist on 11/29/15 AD.
 */

@SuppressWarnings("WeakerAccess")
public class Step implements Parcelable {
    @SerializedName("distance")
    private Info distance;
    @SerializedName("duration")
    private Info duration;
    @SerializedName("end_location")
    private Coordination endLocation;
    @SerializedName("html_instructions")
    private String htmlInstruction;
    @SerializedName("maneuver")
    private String maneuver;
    @SerializedName("start_location")
    private Coordination startLocation;
    @SerializedName("transit_details")
    private TransitDetail transitDetail;
    @SerializedName("steps")
    private List<Step> stepList;
    @SerializedName("polyline")
    private RoutePolyline polyline;
    @SerializedName("travel_mode")
    private String travelMode;

    public Step() {
    }

    protected Step(Parcel in) {
        distance = in.readParcelable(Info.class.getClassLoader());
        duration = in.readParcelable(Info.class.getClassLoader());
        endLocation = in.readParcelable(Coordination.class.getClassLoader());
        htmlInstruction = in.readString();
        maneuver = in.readString();
        startLocation = in.readParcelable(Coordination.class.getClassLoader());
        stepList = in.createTypedArrayList(Step.CREATOR);
        travelMode = in.readString();
    }

    public Info getDistance() {
        return distance;
    }

    public void setDistance(Info distance) {
        this.distance = distance;
    }

    public Info getDuration() {
        return duration;
    }

    public void setDuration(Info duration) {
        this.duration = duration;
    }

    public Coordination getEndLocation() {
        return endLocation;
    }

    public void setEndLocation(Coordination endLocation) {
        this.endLocation = endLocation;
    }

    public String getHtmlInstruction() {
        return htmlInstruction;
    }

    public void setHtmlInstruction(String htmlInstruction) {
        this.htmlInstruction = htmlInstruction;
    }

    public String getManeuver() {
        return maneuver;
    }

    public void setManeuver(String maneuver) {
        this.maneuver = maneuver;
    }

    public Coordination getStartLocation() {
        return startLocation;
    }

    public void setStartLocation(Coordination startLocation) {
        this.startLocation = startLocation;
    }

    public TransitDetail getTransitDetail() {
        return transitDetail;
    }

    public void setTransitDetail(TransitDetail transitDetail) {
        this.transitDetail = transitDetail;
    }

    public List<Step> getStepList() {
        return stepList;
    }

    public void setStepList(List<Step> stepList) {
        this.stepList = stepList;
    }

    public boolean isContainStepList() {
        return stepList != null && stepList.size() > 0;
    }

    public RoutePolyline getPolyline() {
        return polyline;
    }

    public void setPolyline(RoutePolyline polyline) {
        this.polyline = polyline;
    }

    public String getTravelMode() {
        return travelMode;
    }

    public void setTravelMode(String travelMode) {
        this.travelMode = travelMode;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(distance, flags);
        dest.writeParcelable(duration, flags);
        dest.writeParcelable(endLocation, flags);
        dest.writeString(htmlInstruction);
        dest.writeString(maneuver);
        dest.writeParcelable(startLocation, flags);
        dest.writeTypedList(stepList);
        dest.writeString(travelMode);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<Step> CREATOR = new Creator<Step>() {
        @Override
        public Step createFromParcel(Parcel in) {
            return new Step(in);
        }

        @Override
        public Step[] newArray(int size) {
            return new Step[size];
        }
    };
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/StopPoint.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

/**
 * Created by Akexorcist on 11/29/15 AD.
 */

@SuppressWarnings("WeakerAccess")
public class StopPoint implements Parcelable {
    @SerializedName("location")
    private Coordination location;
    @SerializedName("name")
    private String name;

    public StopPoint() {
    }

    protected StopPoint(Parcel in) {
        location = in.readParcelable(Coordination.class.getClassLoader());
        name = in.readString();
    }

    public Coordination getLocation() {
        return location;
    }

    public void setLocation(Coordination location) {
        this.location = location;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(location, flags);
        dest.writeString(name);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<StopPoint> CREATOR = new Creator<StopPoint>() {
        @Override
        public StopPoint createFromParcel(Parcel in) {
            return new StopPoint(in);
        }

        @Override
        public StopPoint[] newArray(int size) {
            return new StopPoint[size];
        }
    };
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/TimeInfo.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

/**
 * Created by Akexorcist on 11/29/15 AD.
 */

@SuppressWarnings("WeakerAccess")
public class TimeInfo implements Parcelable {
    @SerializedName("text")
    private String text;
    @SerializedName("time_zone")
    private String timeZone;
    @SerializedName("value")
    private String value;

    public TimeInfo() {
    }

    protected TimeInfo(Parcel in) {
        text = in.readString();
        timeZone = in.readString();
        value = in.readString();
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getTimeZone() {
        return timeZone;
    }

    public void setTimeZone(String timeZone) {
        this.timeZone = timeZone;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(text);
        dest.writeString(timeZone);
        dest.writeString(value);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<TimeInfo> CREATOR = new Creator<TimeInfo>() {
        @Override
        public TimeInfo createFromParcel(Parcel in) {
            return new TimeInfo(in);
        }

        @Override
        public TimeInfo[] newArray(int size) {
            return new TimeInfo[size];
        }
    };
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/TransitDetail.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

/**
 * Created by Akexorcist on 11/29/15 AD.
 */

@SuppressWarnings("WeakerAccess")
public class TransitDetail implements Parcelable {
    @SerializedName("arrival_stop")
    private StopPoint arrivalStopPoint;
    @SerializedName("arrival_time")
    private TimeInfo arrivalTime;
    @SerializedName("departure_stop")
    private StopPoint departureStopPoint;
    @SerializedName("departure_time")
    private TimeInfo departureTime;
    @SerializedName("line")
    private Line line;
    @SerializedName("headsign")
    private String headsign;
    @SerializedName("num_stops")
    private String stopNumber;

    public TransitDetail() {
    }

    protected TransitDetail(Parcel in) {
        arrivalStopPoint = in.readParcelable(StopPoint.class.getClassLoader());
        arrivalTime = in.readParcelable(TimeInfo.class.getClassLoader());
        departureStopPoint = in.readParcelable(StopPoint.class.getClassLoader());
        departureTime = in.readParcelable(TimeInfo.class.getClassLoader());
        line = in.readParcelable(Line.class.getClassLoader());
        headsign = in.readString();
        stopNumber = in.readString();
    }

    public StopPoint getArrivalStopPoint() {
        return arrivalStopPoint;
    }

    public void setArrivalStopPoint(StopPoint arrivalStopPoint) {
        this.arrivalStopPoint = arrivalStopPoint;
    }

    public TimeInfo getArrivalTime() {
        return arrivalTime;
    }

    public void setArrivalTime(TimeInfo arrivalTime) {
        this.arrivalTime = arrivalTime;
    }

    public StopPoint getDepartureStopPoint() {
        return departureStopPoint;
    }

    public void setDepartureStopPoint(StopPoint departureStopPoint) {
        this.departureStopPoint = departureStopPoint;
    }

    public TimeInfo getDepartureTime() {
        return departureTime;
    }

    public void setDepartureTime(TimeInfo departureTime) {
        this.departureTime = departureTime;
    }

    public Line getLine() {
        return line;
    }

    public void setLine(Line line) {
        this.line = line;
    }

    public String getHeadsign() {
        return headsign;
    }

    public void setHeadsign(String headsign) {
        this.headsign = headsign;
    }

    public String getStopNumber() {
        return stopNumber;
    }

    public void setStopNumber(String stopNumber) {
        this.stopNumber = stopNumber;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(arrivalStopPoint, flags);
        dest.writeParcelable(arrivalTime, flags);
        dest.writeParcelable(departureStopPoint, flags);
        dest.writeParcelable(departureTime, flags);
        dest.writeParcelable(line, flags);
        dest.writeString(headsign);
        dest.writeString(stopNumber);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<TransitDetail> CREATOR = new Creator<TransitDetail>() {
        @Override
        public TransitDetail createFromParcel(Parcel in) {
            return new TransitDetail(in);
        }

        @Override
        public TransitDetail[] newArray(int size) {
            return new TransitDetail[size];
        }
    };
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Vehicle.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

/**
 * Created by Akexorcist on 11/29/15 AD.
 */

@SuppressWarnings("WeakerAccess")
public class Vehicle implements Parcelable {
    @SerializedName("icon")
    private String iconUrl;
    @SerializedName("name")
    private String name;
    @SerializedName("type")
    private String type;

    public Vehicle() {
    }

    protected Vehicle(Parcel in) {
        iconUrl = in.readString();
        name = in.readString();
        type = in.readString();
    }

    public String getIconUrl() {
        return iconUrl;
    }

    public void setIconUrl(String iconUrl) {
        this.iconUrl = iconUrl;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(iconUrl);
        dest.writeString(name);
        dest.writeString(type);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<Vehicle> CREATOR = new Creator<Vehicle>() {
        @Override
        public Vehicle createFromParcel(Parcel in) {
            return new Vehicle(in);
        }

        @Override
        public Vehicle[] newArray(int size) {
            return new Vehicle[size];
        }
    };
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Waypoint.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;


/**
 * Created by Akexorcist on 11/29/15 AD.
 */

@SuppressWarnings("WeakerAccess")
public class Waypoint implements Parcelable {
    @SerializedName("location")
    private Coordination location;
    @SerializedName("step_index")
    private int index;
    @SerializedName("step_interpolation")
    private double interpolation;

    public Waypoint() {
    }

    protected Waypoint(Parcel in) {
        location = in.readParcelable(Coordination.class.getClassLoader());
        index = in.readInt();
        interpolation = in.readDouble();
    }

    public Coordination getLocation() {
        return location;
    }

    public void setLocation(Coordination location) {
        this.location = location;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public double getInterpolation() {
        return interpolation;
    }

    public void setInterpolation(double interpolation) {
        this.interpolation = interpolation;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(location, flags);
        dest.writeInt(index);
        dest.writeDouble(interpolation);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<Waypoint> CREATOR = new Creator<Waypoint>() {
        @Override
        public Waypoint createFromParcel(Parcel in) {
            return new Waypoint(in);
        }

        @Override
        public Waypoint[] newArray(int size) {
            return new Waypoint[size];
        }
    };
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/network/DirectionConnection.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.network;

import com.akexorcist.googledirection.config.GoogleDirectionConfiguration;
import com.akexorcist.googledirection.constant.DirectionUrl;

import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * For internal use.
 */
public class DirectionConnection {
    private static DirectionConnection connection;

    public static DirectionConnection getInstance() {
        if (connection == null) {
            connection = new DirectionConnection();
        }
        return connection;
    }

    private DirectionService service;

    public DirectionService createService() {
        if (service == null) {
            Retrofit retrofit = new Retrofit.Builder()
                    .client(getClient())
                    .baseUrl(DirectionUrl.MAPS_API_URL)
                    .addConverterFactory(GsonConverterFactory.create())
                    .build();
            service = retrofit.create(DirectionService.class);
        }
        return service;
    }

    private OkHttpClient getClient() {
        OkHttpClient client = GoogleDirectionConfiguration.getInstance().getCustomClient();
        if (client != null) {
            return client;
        }
        return createDefaultClient();
    }

    private OkHttpClient createDefaultClient() {
        OkHttpClient.Builder builder = new OkHttpClient.Builder();
        if (GoogleDirectionConfiguration.getInstance().isLogEnabled()) {
            HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
            interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
            builder.addInterceptor(interceptor);
        }
        return builder.build();
    }
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/network/DirectionService.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.network;

import com.akexorcist.googledirection.constant.DirectionUrl;
import com.akexorcist.googledirection.model.Direction;

import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;

/**
 * For internal use.
 */
public interface DirectionService {

    @GET(DirectionUrl.DIRECTION_API_URL)
    Call<Direction> getDirection(@Query("origin") String origin,
                                 @Query("destination") String destination,
                                 @Query("waypoints") String waypoints,
                                 @Query("mode") String transportMode,
                                 @Query("departure_time") String departureTime,
                                 @Query("language") String language,
                                 @Query("units") String units,
                                 @Query("avoid") String avoid,
                                 @Query("transit_mode") String transitMode,
                                 @Query("traffic_model") String trafficModel,
                                 @Query("transit_routing_preference") String transitRoutingPreference,
                                 @Query("alternatives") boolean alternatives,
                                 @Query("key") String apiKey);
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/request/DirectionDestinationRequest.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.request;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.google.android.gms.maps.model.LatLng;

import java.util.ArrayList;
import java.util.List;

/**
 * The class for assign the waypoints and destination position.
 *
 * @since 1.0.0
 */
public class DirectionDestinationRequest {
    @NonNull
    private String apiKey;
    @NonNull
    private LatLng origin;
    @Nullable
    private List<LatLng> waypointList;

    public DirectionDestinationRequest(@NonNull String apiKey, @NonNull LatLng origin) {
        this.apiKey = apiKey;
        this.origin = origin;
    }

    /**
     * Assign the waypoint position of the request
     *
     * @param waypoint The latitude and longitude of waypoint position.
     * @return This destination request object.
     * @since 1.0.0
     */
    public DirectionDestinationRequest and(@NonNull LatLng waypoint) {
        if (waypointList == null) {
            waypointList = new ArrayList<>();
        }
        waypointList.add(waypoint);
        return this;
    }

    /**
     * Assign the waypoint position of the request as a list.
     *
     * @param waypointList The list of latitude and longitude of waypoint position.
     * @return This destination request object.
     * @since 1.0.0
     */
    public DirectionDestinationRequest and(@NonNull List<LatLng> waypointList) {
        if (this.waypointList == null) {
            this.waypointList = new ArrayList<>();
        }
        this.waypointList.addAll(waypointList);
        return this;
    }

    /**
     * Assign the destination position of the request.
     *
     * @param destination The latitude and longitude of destination position.
     * @return The direction request object.
     * @since 1.0.0
     */
    public DirectionRequest to(@NonNull LatLng destination) {
        return new DirectionRequest(apiKey, origin, destination, waypointList);
    }
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/request/DirectionOriginRequest.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.request;

import androidx.annotation.NonNull;

import com.google.android.gms.maps.model.LatLng;

/**
 * The class for assign the origin position.
 *
 * @since 1.0.0
 */
public class DirectionOriginRequest {
    @NonNull
    private String apiKey;

    public DirectionOriginRequest(@NonNull String apiKey) {
        this.apiKey = apiKey;
    }

    /**
     * Assign the origin coordination of the request.
     *
     * @param origin The latitude and longitude of origin position
     * @return The destination request object.
     * @since 1.0.0
     */
    public DirectionDestinationRequest from(@NonNull LatLng origin) {
        return new DirectionDestinationRequest(apiKey, origin);
    }
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/request/DirectionRequest.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.request;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.akexorcist.googledirection.DirectionCallback;
import com.akexorcist.googledirection.constant.AvoidType;
import com.akexorcist.googledirection.constant.Language;
import com.akexorcist.googledirection.constant.TrafficModel;
import com.akexorcist.googledirection.constant.TransitMode;
import com.akexorcist.googledirection.constant.TransitRoutingPreference;
import com.akexorcist.googledirection.constant.TransportMode;
import com.akexorcist.googledirection.constant.Unit;
import com.akexorcist.googledirection.model.Direction;
import com.akexorcist.googledirection.network.DirectionConnection;
import com.google.android.gms.maps.model.LatLng;

import org.jetbrains.annotations.NotNull;

import java.util.List;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

/**
 * The class for assign the addition parameter for the request and request execution.
 *
 * @since 1.0.0
 */
@SuppressWarnings("unused")
public class DirectionRequest {
    private DirectionRequestParam param;

    public DirectionRequest(@NonNull String apiKey, @NonNull LatLng origin, @NonNull LatLng destination, @Nullable List<LatLng> waypointList) {
        param = new DirectionRequestParam().setApiKey(apiKey).setOrigin(origin).setDestination(destination).setWaypoints(waypointList);
    }

    /**
     * Assign the transport mode of the request.
     *
     * @param transportMode the language value from @see {@link com.akexorcist.googledirection.constant.TransportMode}.
     * @return This direction request object.
     * @since 1.0.0
     */
    public DirectionRequest transportMode(@Nullable @TransportMode.Value String transportMode) {
        param.setTransportMode(transportMode);
        return this;
    }

    /**
     * Assign the language of the request.
     *
     * @param language the language value from @see {@link com.akexorcist.googledirection.constant.Language}.
     * @return This direction request object.
     * @since 1.0.0
     */
    public DirectionRequest language(@Nullable @Language.Value String language) {
        param.setLanguage(language);
        return this;
    }

    /**
     * Assign the unit of the request.
     *
     * @param unit the unit value from @see {@link com.akexorcist.googledirection.constant.Unit}.
     * @return This direction request object.
     * @since 1.0.0
     */
    public DirectionRequest unit(@Nullable @Unit.Value String unit) {
        param.setUnit(unit);
        return this;
    }

    /**
     * Assign the route restriction to avoid of the request.
     *
     * @param avoid the route restriction to avoid value from @see {@link com.akexorcist.googledirection.constant.AvoidType}.
     * @return This direction request object.
     * @since 1.0.0
     */
    public DirectionRequest avoid(@Nullable @AvoidType.Value String avoid) {
        String oldAvoid = param.getAvoid();
        if (oldAvoid != null && !oldAvoid.isEmpty()) {
            oldAvoid += "|";
        } else {
            oldAvoid = "";
        }
        oldAvoid += avoid;
        param.setAvoid(oldAvoid);
        return this;
    }

    /**
     * Assign the transit mode of the request.
     *
     * @param transitMode the transit mode value from @see {@link com.akexorcist.googledirection.constant.TransitMode}.
     * @return This direction request object.
     * @since 1.0.0
     */
    public DirectionRequest transitMode(@Nullable @TransitMode.Value String transitMode) {
        String oldTransitMode = param.getTransitMode();
        if (oldTransitMode != null && !oldTransitMode.isEmpty()) {
            oldTransitMode += "|";
        } else {
            oldTransitMode = "";
        }
        oldTransitMode += transitMode;
        param.setTransitMode(oldTransitMode);
        return this;
    }

    /**
     * Specifies the assumptions to use when calculating time in traffic.
     *
     * @param trafficModel the traffic model value from @see {@link com.akexorcist.googledirection.constant.TrafficModel}.
     * @return This direction request object.
     * @since 1.2.1
     */
    public DirectionRequest trafficMode(@Nullable @TrafficModel.Value String trafficModel) {
        param.setTrafficModel(trafficModel);
        return this;
    }

    /**
     * Specifies preferences for transit routes. Using this parameter, you can bias the
     * options returned, rather than accepting the default best route chosen by the API.
     *
     * @param transitRoutingPreference the transit routing preference value from @see {@link com.akexorcist.googledirection.constant.TransitRoutingPreference}.
     * @return This direction request object.
     * @since 1.2.1
     */
    public DirectionRequest transitRoutingPreference(@Nullable @TransitRoutingPreference.Value String transitRoutingPreference) {
        param.setTransitRoutingPreference(transitRoutingPreference);
        return this;
    }

    /**
     * Specifies whether require the alternative route result of the request.
     *
     * @param alternative True for include and false for exclude.
     * @return This direction request object.
     * @since 1.0.0
     */
    public DirectionRequest alternativeRoute(boolean alternative) {
        param.setAlternatives(alternative);
        return this;
    }

    /**
     * Assign the departure time of the request.
     *
     * @param time The departure time.
     * @return This direction request object.
     * @since 1.0.0
     */
    public DirectionRequest departureTime(@Nullable String time) {
        param.setDepartureTime(time);
        return this;
    }

    /**
     * Specifies whether require the optimized waypoint by reorder the waypoint in result.
     *
     * @param optimize True for optimize the waypoint and false for do not.
     * @return This direction request object.
     * @since 1.0.0
     */
    public DirectionRequest optimizeWaypoints(boolean optimize) {
        param.setOptimizeWaypoints(optimize);
        return this;
    }

    /**
     * Require the optimized waypoint by reorder the waypoint in result.
     *
     * @param callback Callback for the direction request.
     * @return The task for direction request.
     * @since 1.0.0
     */
    public DirectionTask execute(@Nullable final DirectionCallback callback) {
        String origin = null;
        if (param.getOrigin() != null) {
            origin = param.getOrigin().latitude + "," + param.getOrigin().longitude;
        }
        String destination = null;
        if (param.getDestination() != null) {
            destination = param.getDestination().latitude + "," + param.getDestination().longitude;
        }
        Call<Direction> direction = DirectionConnection.getInstance()
                .createService()
                .getDirection(origin,
                        destination,
                        waypointsToString(param.getWaypoints()),
                        param.getTransportMode(),
                        param.getDepartureTime(),
                        param.getLanguage(),
                        param.getUnit(),
                        param.getAvoid(),
                        param.getTransitMode(),
                        param.getTrafficModel(),
                        param.getTransitRoutingPreference(),
                        param.isAlternatives(),
                        param.getApiKey());

        direction.enqueue(new Callback<Direction>() {
            @Override
            public void onResponse(@NotNull Call<Direction> call, @NotNull Response<Direction> response) {
                if (callback != null) {
                    callback.onDirectionSuccess(response.body());
                }
            }

            @Override
            public void onFailure(@NotNull Call<Direction> call, @NotNull Throwable t) {
                if (callback != null) {
                    callback.onDirectionFailure(t);
                }
            }
        });
        return new DirectionTask(direction);
    }

    /**
     * For internal use.
     */
    private String waypointsToString(@Nullable List<LatLng> waypoints) {
        if (waypoints != null && !waypoints.isEmpty()) {
            StringBuilder string = new StringBuilder(param.isOptimizeWaypoints() ? "optimize:true|" : "");
            string.append(waypoints.get(0).latitude).append(",").append(waypoints.get(0).longitude);
            for (int i = 1; i < waypoints.size(); i++) {
                string.append("|").append(waypoints.get(i).latitude).append(",").append(waypoints.get(i).longitude);
            }
            return string.toString();
        }
        return null;
    }
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/request/DirectionRequestParam.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.request;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.google.android.gms.maps.model.LatLng;

import java.util.List;

/**
 * For internal use.
 */
@SuppressWarnings({"WeakerAccess", "UnusedReturnValue"})
public class DirectionRequestParam implements Parcelable {
    private LatLng origin;
    private LatLng destination;
    private String transportMode;
    private String departureTime;
    private String language;
    private String unit;
    private String avoid;
    private String transitMode;
    private String trafficModel;
    private String transitRoutingPreference;
    private boolean alternatives;
    private String apiKey;
    private List<LatLng> waypoints;
    private boolean optimizeWaypoints;

    public DirectionRequestParam() {
    }

    protected DirectionRequestParam(Parcel in) {
        origin = in.readParcelable(LatLng.class.getClassLoader());
        destination = in.readParcelable(LatLng.class.getClassLoader());
        transportMode = in.readString();
        departureTime = in.readString();
        language = in.readString();
        unit = in.readString();
        avoid = in.readString();
        transitMode = in.readString();
        trafficModel = in.readString();
        transitRoutingPreference = in.readString();
        alternatives = in.readByte() != 0;
        apiKey = in.readString();
        waypoints = in.createTypedArrayList(LatLng.CREATOR);
        optimizeWaypoints = in.readByte() != 0;
    }

    @Nullable
    public LatLng getOrigin() {
        return origin;
    }

    public DirectionRequestParam setOrigin(@Nullable LatLng origin) {
        this.origin = origin;
        return this;
    }

    @Nullable
    public LatLng getDestination() {
        return destination;
    }

    public DirectionRequestParam setDestination(@Nullable LatLng destination) {
        this.destination = destination;
        return this;
    }

    @Nullable
    public String getTransportMode() {
        return transportMode;
    }

    public void setTransportMode(@Nullable String transportMode) {
        this.transportMode = transportMode;
    }

    @Nullable
    public String getLanguage() {
        return language;
    }

    public void setLanguage(@Nullable String language) {
        this.language = language;
    }

    @Nullable
    public String getUnit() {
        return unit;
    }

    public void setUnit(@Nullable String unit) {
        this.unit = unit;
    }

    @Nullable
    public String getAvoid() {
        return avoid;
    }

    public void setAvoid(@Nullable String avoid) {
        this.avoid = avoid;
    }

    @Nullable
    public String getTransitMode() {
        return transitMode;
    }

    public void setTransitMode(@Nullable String transitMode) {
        this.transitMode = transitMode;
    }

    @Nullable
    public String getTrafficModel() {
        return trafficModel;
    }

    public void setTrafficModel(@Nullable String trafficModel) {
        this.trafficModel = trafficModel;
    }

    @Nullable
    public String getTransitRoutingPreference() {
        return transitRoutingPreference;
    }

    public void setTransitRoutingPreference(@Nullable String transitRoutingPreference) {
        this.transitRoutingPreference = transitRoutingPreference;
    }

    public boolean isAlternatives() {
        return alternatives;
    }

    public void setAlternatives(boolean alternatives) {
        this.alternatives = alternatives;
    }

    @Nullable
    public String getApiKey() {
        return apiKey;
    }

    public DirectionRequestParam setApiKey(@Nullable String apiKey) {
        this.apiKey = apiKey;
        return this;
    }

    @Nullable
    public String getDepartureTime() {
        return departureTime;
    }

    public DirectionRequestParam setDepartureTime(@Nullable String departureTime) {
        this.departureTime = departureTime;
        return this;
    }

    @Nullable
    public List<LatLng> getWaypoints() {
        return waypoints;
    }

    public DirectionRequestParam setWaypoints(@Nullable List<LatLng> waypoints) {
        this.waypoints = waypoints;
        return this;
    }

    public boolean isOptimizeWaypoints() {
        return optimizeWaypoints;
    }

    public DirectionRequestParam setOptimizeWaypoints(boolean optimizeWaypoints) {
        this.optimizeWaypoints = optimizeWaypoints;
        return this;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(origin, flags);
        dest.writeParcelable(destination, flags);
        dest.writeString(transportMode);
        dest.writeString(departureTime);
        dest.writeString(language);
        dest.writeString(unit);
        dest.writeString(avoid);
        dest.writeString(transitMode);
        dest.writeString(trafficModel);
        dest.writeString(transitRoutingPreference);
        dest.writeByte((byte) (alternatives ? 1 : 0));
        dest.writeString(apiKey);
        dest.writeTypedList(waypoints);
        dest.writeByte((byte) (optimizeWaypoints ? 1 : 0));
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<DirectionRequestParam> CREATOR = new Creator<DirectionRequestParam>() {
        @Override
        public DirectionRequestParam createFromParcel(Parcel in) {
            return new DirectionRequestParam(in);
        }

        @Override
        public DirectionRequestParam[] newArray(int size) {
            return new DirectionRequestParam[size];
        }
    };
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/request/DirectionTask.java
================================================
package com.akexorcist.googledirection.request;

import com.akexorcist.googledirection.model.Direction;

import retrofit2.Call;

/**
 * Direction request task that given from execution of {@link DirectionRequest}.
 * For handle the request task when the request has started.
 *
 * @since 1.0.0
 */

@SuppressWarnings("unused")
public class DirectionTask {
    private Call<Direction> directionCall;

    public DirectionTask(Call<Direction> directionCall) {
        this.directionCall = directionCall;
    }

    /**
     * Cancel the task of direction request if currently running.
     *
     * @since 1.0.0
     */
    public void cancel() {
        if (directionCall != null && !directionCall.isCanceled()) {
            directionCall.cancel();
        }
    }

    /**
     * Check the direction request task completion.
     *
     * @return True for finished and false for unfinished.
     * @since 1.0.0
     */
    public boolean isFinished() {
        return directionCall != null && directionCall.isExecuted();
    }

    /**
     * Get the Retrofit's call object of the direction request.
     *
     * @return The {@link Call} object of direction request.
     * @since 1.0.0
     */
    public Call<Direction> toRetrofitCall() {
        return directionCall;
    }
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/util/DirectionConverter.java
================================================
/*

Copyright 2015 Akexorcist

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 com.akexorcist.googledirection.util;

import android.content.Context;
import android.util.DisplayMetrics;

import androidx.annotation.ColorInt;
import androidx.annotation.Dimension;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.akexorcist.googledirection.model.Step;
import com.google.android.gms.maps.model.Cap;
import com.google.android.gms.maps.model.JointType;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.PatternItem;
import com.google.android.gms.maps.model.PolylineOptions;

import java.util.ArrayList;
import java.util.List;


/**
 * Utility class for value convert in the Google Direction Library.
 *
 * @since 1.0.0
 */
@SuppressWarnings("unused")
public class DirectionConverter {
    /**
     * Convert the route paths to list of latitude and longitude.
     *
     * @param stepList The list of steps.
     * @return The list of latitude and longitude that converted from the list of steps.
     * @since 1.0.0
     */
    public static ArrayList<LatLng> getDirectionPoint(List<Step> stepList) {
        ArrayList<LatLng> directionPointList = new ArrayList<>();
        if (stepList != null && stepList.size() > 0) {
            for (Step step : stepList) {
                convertStepToPosition(step, directionPointList);
            }
        }
        return directionPointList;
    }

    /**
     * For internal use.
     */
    private static void convertStepToPosition(Step step, ArrayList<LatLng> directionPointList) {
        // Get start location
        directionPointList.add(step.getStartLocation().getCoordination());

        // Get encoded points location
        if (step.getPolyline() != null) {
            List<LatLng> decodedPointList = step.getPolyline().getPointList();
            if (decodedPointList != null && decodedPointList.size() > 0) {
                directionPointList.addAll(decodedPointList);
            }
        }

        // Get end location
        directionPointList.add(step.getEndLocation().getCoordination());
    }

    /**
     * Convert the position of each step to list of latitude and longitude.
     *
     * @param stepList The list of steps.
     * @return The list of latitude and longitude that converted from the list of steps.
     * @since 1.0.0
     */
    public static ArrayList<LatLng> getSectionPoint(List<Step> stepList) {
        ArrayList<LatLng> directionPointList = new ArrayList<>();
        if (stepList != null && stepList.size() > 0) {
            // Get start location only first position
            directionPointList.add(stepList.get(0).getStartLocation().getCoordination());
            for (Step step : stepList) {
                // Get end location
                directionPointList.add(step.getEndLocation().getCoordination());
            }
        }
        return directionPointList;
    }

    /**
     * Convert the path option to the polyline options.
     *
     * @param context    A context.
     * @param pathOption Path options of the steps.
     * @return Options for a polyline.
     * @since 1.2.0
     */
    public static PolylineOptions createPolyline(
            @NonNull Context context,
            @NonNull PathOption pathOption
    ) {
        return createPolyline(
                context,
                pathOption.locationList,
                pathOption.width,
                pathOption.color,
                pathOption.clickable,
                pathOption.jointType,
                pathOption.startCap,
                pathOption.endCap,
                pathOption.patternItemList
        );
    }

    /**
     * Convert the list of latitude and longitude to the polyline options.
     *
     * @param context      A context.
     * @param locationList A list of latitude and longitude.
     * @param width        Width of the polyline in screen pixels.
     * @param color        Color of the polyline as a 32-bit ARGB color.
     * @return Options for a polyline.
     * @since 1.0.0
     */
    public static PolylineOptions createPolyline(
            @NonNull Context context,
            @Nullable ArrayList<LatLng> locationList,
            @Dimension(unit = Dimension.DP) int width,
            @ColorInt int color
    ) {
        return createPolyline(
                context,
                locationList,
                width,
                color,
                true,
                JointType.DEFAULT,
                null,
                null,
                null
        );
    }

    /**
     * Convert the list of latitude and longitude to the polyline options.
     *
     * @param context      A context.
     * @param locationList A list of latitude and longitude.
     * @param width        Width of the polyline in screen pixels.
     * @param color        Color of the polyline as a 32-bit ARGB color.
     * @param clickable    Is polyline clickable.
     * @return Options for a polyline.
     * @since 1.2.0
     */
    public static PolylineOptions createPolyline(
            @NonNull Context context,
            @Nullable ArrayList<LatLng> locationList,
            @Dimension(unit = Dimension.DP) int width,
            @ColorInt int color,
            boolean clickable
    ) {
        return createPolyline(
                context,
                locationList,
                width,
                color,
                clickable,
                JointType.DEFAULT,
                null,
                null,
                null
        );
    }

    /**
     * Convert the list of latitude and longitude to the polyline options.
     *
     * @param context      A context.
     * @param locationList A list of latitude and longitude.
     * @param width        Width of the polyline in screen pixels.
     * @param color        Color of the polyline as a 32-bit ARGB color.
     * @param clickable    Is polyline clickable.
     * @param jointType    Joint type for all vertices of the polyline except the start and end vertices.
     * @return Options for a polyline.
     * @since 1.2.0
     */
    public static PolylineOptions createPolyline(
            @NonNull Context context,
            @Nullable ArrayList<LatLng> locationList,
            @Dimension(unit = Dimension.DP) int width,
            @ColorInt int color,
            boolean clickable,
            int jointType
    ) {
        return createPolyline(
                context,
                locationList,
                width,
                color,
                clickable,
                jointType,
                null,
                null,
                null
        );
    }

    /**
     * Convert the list of latitude and longitude to the polyline options.
     *
     * @param context      A context.
     * @param locationList A list of latitude and longitude.
     * @param width        Width of the polyline in screen pixels.
     * @param color        Color of the polyline as a 32-bit ARGB color.
     * @param clickable    Is polyline clickable.
     * @param startCap     Cap at the start vertex of the polyline.
     * @param endCap       Cap at the end vertex of the polyline.
     * @return Options for a polyline.
     * @since 1.2.0
     */
    public static PolylineOptions createPolyline(
            @NonNull Context context,
            @Nullable ArrayList<LatLng> locationList,
            @Dimension(unit = Dimension.DP) int width,
            @ColorInt int color,
            boolean clickable,
            @Nullable Cap startCap,
            @Nullable Cap endCap
    ) {
        return createPolyline(
                context,
                locationList,
                width,
                color,
                clickable,
                JointType.DEFAULT,
                startCap,
                endCap,
                null
        );
    }

    /**
     * Convert the list of latitude and longitude to the polyline options.
     *
     * @param context         A context.
     * @param locationList    A list of latitude and longitude.
     * @param width           Width of the polyline in screen pixels.
     * @param color           Color of the polyline as a 32-bit ARGB color.
     * @param clickable       Is polyline clickable.
     * @param patternItemList Stroke pattern for the polyline.
     * @return Options for a polyline.
     * @since 1.2.0
     */
    public static PolylineOptions createPolyline(
            @NonNull Context context,
            @Nullable ArrayList<LatLng> locationList,
            @Dimension(unit = Dimension.DP) int width,
            @ColorInt int color,
            boolean clickable,
            @Nullable List<PatternItem> patternItemList
    ) {
        return createPolyline(
                context,
                locationList,
                width,
                color,
                clickable,
                JointType.DEFAULT,
                null,
                null,
                patternItemList
        );
    }

    /**
     * Convert the list of latitude and longitude to the polyline options.
     *
     * @param context         A context.
     * @param locationList    A list of latitude and longitude.
     * @param width           Width of the polyline in screen pixels.
     * @param color           Color of the polyline as a 32-bit ARGB color.
     * @param clickable       Is polyline clickable.
     * @param jointType       Joint type for all vertices of the polyline except the start and end vertices.
     * @param startCap        Cap at the start vertex of the polyline.
     * @param endCap          Cap at the end vertex of the polyline.
     * @param patternItemList Stroke pattern for the polyline.
     * @return Options for a polyline.
     * @since 1.2.0
     */
    public static PolylineOptions createPolyline(
            @NonNull Context context,
            @Nullable ArrayList<LatLng> locationList,
            @Dimension(unit = Dimension.DP) int width,
            @ColorInt int color,
            boolean clickable,
            int jointType,
            @Nullable Cap startCap,
            @Nullable Cap endCap,
            @Nullable List<PatternItem> patternItemList) {
        PolylineOptions rectLine = new PolylineOptions().width(dpToPx(context, width)).color(color).geodesic(true);
        rectLine.clickable(clickable);
        rectLine.jointType(jointType);
        if (patternItemList != null) {
            rectLine.pattern(patternItemList);
        }
        if (startCap != null) {
            rectLine.startCap(startCap);
        }
        if (endCap != null) {
            rectLine.endCap(endCap);
        }
        if (locationList != null && locationList.size() > 0) {
            for (LatLng location : locationList) {
                rectLine.add(location);
            }
        }
        return rectLine;
    }

    /**
     * Convert the path option to the polyline options.
     *
     * @param context           A context.
     * @param transitPathOption Path options of the steps for transit result.
     * @return Options for a polyline.
     * @since 1.2.0
     */
    public static ArrayList<PolylineOptions> createTransitPolyline(
            @NonNull Context context,
            @NonNull TransitPathOption transitPathOption) {
        return createTransitPolyline(
                context,
                transitPathOption.stepList,
                transitPathOption.transitWidth,
                transitPathOption.transitColor,
                transitPathOption.transitPatternItemList,
                transitPathOption.walkingWidth,
                transitPathOption.walkingColor,
                transitPathOption.walkingPatternItemList,
                transitPathOption.clickable,
                transitPathOption.jointType,
                transitPathOption.startCap,
                transitPathOption.endCap
        );
    }

    /**
     * Convert the list of latitude and longitude to the polyline options in transit mode.
     *
     * @param context      A context.
     * @param stepList     A list of latitude and longitude for the steps.
     * @param transitWidth Width of the polyline in screen pixels for transit polyline.
     * @param transitColor Color of the polyline as a 32-bit ARGB color for transit polyline.
     * @param walkingWidth Width of the polyline in screen pixels for walking polyline.
     * @param walkingColor Color of the polyline as a 32-bit ARGB color for walking polyline.
     * @return Options for a polyline.
     * @since 1.0.0
     */
    public static ArrayList<PolylineOptions> createTransitPolyline(
            @NonNull Context context,
            @Nullable List<Step> stepList,
            @Dimension(unit = Dimension.DP) int transitWidth,
            @ColorInt int transitColor,
            @Dimension(unit = Dimension.DP) int walkingWidth,
            @ColorInt int walkingColor) {
        return createTransitPolyline(
                context,
                stepList,
                transitWidth,
                transitColor,
                null,
                walkingWidth,
                walkingColor,
                null,
                true,
                JointType.DEFAULT,
                null,
                null
        );
    }

    /**
     * Convert the list of latitude and longitude to the polyline options in transit mode.
     *
     * @param context                A context.
     * @param stepList               A list of latitude and longitude for the steps.
     * @param transitWidth           Width of the polyline in screen pixels for transit polyline.
     * @param transitColor           Color of the polyline as a 32-bit ARGB color for transit polyline.
     * @param transitPatternItemList Stroke pattern for the polyline for transit polyline.
     * @param walkingWidth           Width of the polyline in screen pixels for walking polyline.
     * @param walkingColor           Color of the polyline as a 32-bit ARGB color for walking polyline.
     * @param walkingPatternItemList Stroke pattern for the polyline for walking polyline.
     * @return Options for a polyline.
     * @since 1.2.0
     */
    public static ArrayList<PolylineOptions> createTransitPolyline(
            @NonNull Context context,
            @Nullable List<Step> stepList,
            @Dimension(unit = Dimension.DP) int transitWidth,
            @Nullable List<PatternItem> transitPatternItemList,
            @ColorInt int transitColor,
            @Dimension(unit = Dimension.DP) int walkingWidth,
            @ColorInt int walkingColor,
            @Nullable List<PatternItem> walkingPatternItemList) {
        return createTransitPolyline(
                context,
                stepList,
                transitWidth,
                transitColor,
                transitPatternItemList,
                walkingWidth,
                walkingColor,
                walkingPatternItemList,
                true,
                JointType.DEFAULT,
                null,
                null
        );
    }

    /**
     * Convert the list of latitude and longitude to the polyline options in transit mode.
     *
     * @param context      A context.
     * @param stepList     A list of latitude and longitude for the steps.
     * @param transitWidth Width of the polyline in screen pixels for transit polyline.
     * @param transitColor Color of the polyline as a 32-bit ARGB color for transit polyline.
     * @param walkingWidth Width of the polyline in screen pixels for walking polyline.
     * @param walkingColor Color of the polyline as a 32-bit ARGB color for walking polyline.
     * @param clickable    Is polyline clickable.
     * @return Options for a polyline.
     * @since 1.2.0
     */
    public static ArrayList<PolylineOptions> createTransitPolyline(
            @NonNull Context context,
            @Nullable List<Step> stepList,
            @Dimension(unit = Dimension.DP) int transitWidth,
            @ColorInt int transitColor,
            @Dimension(unit = Dimension.DP) int walkingWidth,
            @ColorInt int walkingColor,
            boolean clickable) {
        return createTransitPolyline(
                context,
                stepList,
                transitWidth,
                transitColor,
                null,
                walkingWidth,
                walkingColor,
                null,
                clickable,
                JointType.DEFAULT,
                null,
                null
        );
    }

    /**
     * Convert the list of latitude and longitude to the polyline options in transit mode.
     *
     * @param context      A context.
     * @param stepList     A list of latitude and longitude for the steps.
     * @param transitWidth Width of the polyline in screen pixels for transit polyline.
     * @param transitColor Color of the polyline as a 32-bit ARGB color for transit polyline.
     * @param walkingWidth Width of the polyline in screen pixels for walking polyline.
     * @param walkingColor Color of the polyline as a 32-bit ARGB color for walking polyline.
     * @param clickable    Is polyline clickable.
     * @param jointType    Joint type for all vertices of the polyline except the start and end vertices.
     * @return Options for a polyline.
     * @since 1.2.0
     */
    public static ArrayList<PolylineOptions> createTransitPolyline(
            @NonNull Context context,
            @Nullable List<Step> stepList,
            @Dimension(unit = Dimension.DP) int transitWidth,
            @ColorInt int transitColor,
            @Dimension(unit = Dimension.DP) int walkingWidth,
            @ColorInt int walkingColor,
            boolean clickable,
            int jointType) {
        return createTransitPolyline(
                context,
                stepList,
                transitWidth,
                transitColor,
                null,
                walkingWidth,
                walkingColor,
                null,
                clickable,
                jointType,
                null,
                null
        );
    }

    /**
     * Convert the list of latitude and longitude to the polyline options in transit mode.
     *
     * @param context      A context.
     * @param stepList     A list of latitude and longitude for the steps.
     * @param transitWidth Width of the polyline in screen pixels for transit polyline.
     * @param transitColor Color of the polyline as a 32-bit ARGB color for transit polyline.
     * @param walkingWidth Width of the polyline in screen pixels for walking polyline.
     * @param walkingColor Color of the polyline as a 32-bit ARGB color for walking polyline.
     * @param clickable    Is polyline clickable.
     * @param startCap     Cap at the start vertex of the polyline.
     * @param endCap       Cap at the end vertex of the polyline.
     * @return Options for a polyline.
     * @since 1.2.0
     */
    public static ArrayList<PolylineOptions> createTransitPolyline(
            @NonNull Context context,
            @Nullable List<Step> stepList,
            @Dimension(unit = Dimension.DP) int transitWidth,
            @ColorInt int transitColor,
            @Dimension(unit = Dimension.DP) int walkingWidth,
            @ColorInt int walkingColor,
            boolean clickable,
            @Nullable Cap startCap,
            @Nullable Cap endCap) {
        return createTransitPolyline(
                context,
                stepList,
                transitWidth,
                transitColor,
                null,
                walkingWidth,
                walkingColor,
                null,
                clickable,
                JointType.DEFAULT,
                startCap,
                endCap
        );
    }

    /**
     * Convert the list of latitude and longitude to the polyline options in transit mode.
     *
     * @param context                A context.
     * @param stepList               A list of latitude and longitude for the steps.
     * @param transitWidth           Width of the polyline in screen pixels for transit polyline.
     * @param transitColor           Color of the polyline as a 32-bit ARGB color for transit polyline.
     * @param transitPatternItemList Stroke pattern for the polyline for transit polyline.
     * @param walkingWidth           Width of the polyline in screen pixels for walking polyline.
     * @param walkingColor           Color of the polyline as a 32-bit ARGB color for walking polyline.
     * @param walkingPatternItemList Stroke pattern for the polyline for walking polyline.
     * @param clickable              Is polyline clickable.
     * @param jointType              Joint type for all vertices of the polyline except the start and end vertices.
     * @param startCap               Cap at the start vertex of the polyline.
     * @param endCap                 Cap at the end vertex of the polyline.
     * @return Options for a polyline.
     * @since 1.2.0
     */
    public static ArrayList<PolylineOptions> createTransitPolyline(
            @NonNull Context context,
            @Nullable List<Step> stepList,
            @Dimension(unit = Dimension.DP) int transitWidth,
            @ColorInt int transitColor,
            @Nullable List<PatternItem> transitPatternItemList,
            @Dimension(unit = Dimension.DP) int walkingWidth,
            @ColorInt int walkingColor,
            @Nullable List<PatternItem> walkingPatternItemList,
            boolean clickable,
            int jointType,
            @Nullable Cap startCap,
            @Nullable Cap endCap
    ) {
        ArrayList<PolylineOptions> polylineOptionsList = new ArrayList<>();
        if (stepList != null && stepList.size() > 0) {
            for (Step step : stepList) {
                ArrayList<LatLng> directionPointList = new ArrayList<>();
                convertStepToPosition(step, directionPointList);
                if (step.isContainStepList()) {
                    polylineOptionsList.add(createPolyline(
                            context,
                            directionPointList,
                            walkingWidth,
                            walkingColor,
                            clickable,
                            jointType,
                            startCap,
                            endCap,
                            walkingPatternItemList
                    ));
                } else {
                    polylineOptionsList.add(createPolyline(
                            context,
                            directionPointList,
                            transitWidth,
                            transitColor,
                            clickable,
                            jointType,
                            startCap,
                            endCap,
                            transitPatternItemList
                    ));
                }
            }
        }
        return polylineOptionsList;
    }

    /**
     * For internal use.
     */
    @SuppressWarnings("IntegerDivisionInFloatingPointContext")
    private static int dpToPx(@NonNull Context context, int dp) {
        DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
        return Math.round(dp * (displayMetrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT));
    }

    /**
     * A bunch of parameters for convert the step to polyline options.
     *
     * @since 1.2.0
     */
    public static class PathOption {
        ArrayList<LatLng> locationList;
        int width;
        int color;
        boolean clickable;
        int jointType;
        Cap startCap;
        Cap endCap;
        List<PatternItem> patternItemList;

        public ArrayList<LatLng> getLocationList() {
            return locationList;
        }

        public PathOption setLocationList(ArrayList<LatLng> locationList) {
            this.locationList = locationList;
            return this;
        }

        public int getWidth() {
            return width;
        }

        public PathOption setWidth(@Dimension(unit = Dimension.DP) int width) {
            this.width = width;
            return this;
        }

        public int getColor() {
            return color;
        }

        public PathOption setColor(@ColorInt int color) {
            this.color = color;
            return this;
        }

        public boolean isClickable() {
            return clickable;
        }

        public PathOption setClickable(boolean clickable) {
            this.clickable = clickable;
            return this;
        }

        public int getJointType() {
            return jointType;
        }

        public PathOption setJointType(int jointType) {
            this.jointType = jointType;
            return this;
        }

        public Cap getStartCap() {
            return startCap;
        }

        public PathOption setStartCap(Cap startCap) {
            this.startCap = startCap;
            return this;
        }

        public Cap getEndCap() {
            return endCap;
        }

        public PathOption setEndCap(Cap endCap) {
            this.endCap = endCap;
            return this;
        }

        public List<PatternItem> getPatternItemList() {
            return patternItemList;
        }

        public PathOption setPatternItemList(List<PatternItem> patternItemList) {
            this.patternItemList = patternItemList;
            return this;
        }
    }

    /**
     * A bunch of parameters for convert the step to polyline options for transit result.
     *
     * @since 1.2.0
     */
    public static class TransitPathOption {
        List<Step> stepList = null;
        int transitWidth;
        int transitColor;
        List<PatternItem> transitPatternItemList;
        int walkingWidth;
        int walkingColor;
        List<PatternItem> walkingPatternItemList;
        boolean clickable;
        int jointType;
        Cap startCap;
        Cap endCap;

        public List<Step> getStepList() {
            return stepList;
        }

        public TransitPathOption setStepList(List<Step> stepList) {
            this.stepList = stepList;
            return this;
        }

        public int getTransitWidth() {
            return transitWidth;
        }

        public TransitPathOption setTransitWidth(@Dimension(unit = Dimension.DP) int transitWidth) {
            this.transitWidth = transitWidth;
            return this;
        }

        public int getTransitColor() {
            return transitColor;
        }

        public TransitPathOption setTransitColor(@ColorInt int transitColor) {
            this.transitColor = transitColor;
            return this;
        }

        @Nullable
        public List<PatternItem> getTransitPatternItemList() {
            return transitPatternItemList;
        }

        public TransitPathOption setTransitPatternItemList(@Nullable List<PatternItem> transitPatternItemList) {
            this.transitPatternItemList = transitPatternItemList;
            return this;
        }

        public int getWalkingWidth() {
            return walkingWidth;
        }

        public TransitPathOption setWalkingWidth(@Dimension(unit = Dimension.DP) int walkingWidth) {
            this.walkingWidth = walkingWidth;
            return this;
        }

        public int getWalkingColor() {
            return walkingColor;
        }

        public TransitPathOption setWalkingColor(@ColorInt int walkingColor) {
            this.walkingColor = walkingColor;
            return this;
        }

        @Nullable
        public List<PatternItem> getWalkingPatternItemList() {
            return walkingPatternItemList;
        }

        public TransitPathOption setWalkingPatternItemList(@Nullable List<PatternItem> walkingPatternItemList) {
            this.walkingPatternItemList = walkingPatternItemList;
            return this;
        }

        public boolean isClickable() {
            return clickable;
        }

        public TransitPathOption setClickable(boolean clickable) {
            this.clickable = clickable;
            return this;
        }

        public int getJointType() {
            return jointType;
        }

        public TransitPathOption setJointType(int jointType) {
            this.jointType = jointType;
            return this;
        }

        @Nullable
        public Cap getStartCap() {
            return startCap;
        }

        public TransitPathOption setStartCap(@Nullable Cap startCap) {
            this.startCap = startCap;
            return this;
        }

        @Nullable
        public Cap getEndCap() {
            return endCap;
        }

        public TransitPathOption setEndCap(@Nullable Cap endCap) {
            this.endCap = endCap;
            return this;
        }
    }
}


================================================
FILE: google-direction/src/main/java/com/akexorcist/googledirection/util/DirectionExtension.kt
================================================
package com.akexorcist.googledirection.util

import com.akexorcist.googledirection.DirectionCallback
import com.akexorcist.googledirection.model.Direction
import com.akexorcist.googledirection.request.DirectionRequest
import com.akexorcist.googledirection.request.DirectionTask


/**
 * Kotlin extension method for direction request execution.
 *
 * @param onDirectionSuccess The function of the successful direction request.
 * @param onDirectionFailure The function of the failure direction request.
 * @return The task for direction request.
 * @since 1.2.0
 */
fun DirectionRequest.execute(
    onDirectionSuccess: ((Direction?) -> Unit)? = null,
    onDirectionFailure: ((Throwable) -> Unit)? = null
): DirectionTask = execute(object : DirectionCallback {
    override fun onDirectionSuccess(direction: Direction?) {
        onDirectionSuccess?.invoke(direction)
    }

    override fun onDirectionFailure(t: Throwable) {
        onDirectionFailure?.invoke(t)
    }
})


================================================
FILE: google-direction/src/test/java/com/akexorcist/library/googledirectionandplace/ExampleUnitTest.java
================================================
package com.akexorcist.library.googledirectionandplace;

import org.junit.Test;

import static org.junit.Assert.*;

/**
 * To work on unit tests, switch the Test Artifact in the Build Variants view.
 */
public class ExampleUnitTest {
    @Test
    public void addition_isCorrect() throws Exception {
        assertEquals(4, 2 + 2);
    }
}

================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Thu Dec 17 23:02:50 ICT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip


================================================
FILE: gradle.properties
================================================
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official

================================================
FILE: gradlew
================================================
#!/usr/bin/env bash

##############################################################################
##
##  Gradle start up script for UN*X
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
    echo "$*"
}

die ( ) {
    echo
    echo "$*"
    echo
    exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
  CYGWIN* )
    cygwin=true
    ;;
  Darwin* )
    darwin=true
    ;;
  MINGW* )
    msys=true
    ;;
esac

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
    ls=`ls -ld "$PRG"`
    link=`expr "$ls" : '.*-> \(.*\)$'`
    if expr "$link" : '/.*' > /dev/null; then
        PRG="$link"
    else
        PRG=`dirname "$PRG"`"/$link"
    fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
        # IBM's JDK on AIX uses strange locations for the executables
        JAVACMD="$JAVA_HOME/jre/sh/java"
    else
        JAVACMD="$JAVA_HOME/bin/java"
    fi
    if [ ! -x "$JAVACMD" ] ; then
        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME

Please set the JAVA_HOME variable
Download .txt
gitextract_z5u3xqar/

├── .github/
│   └── workflows/
│       └── android.yml
├── .gitignore
├── CHANGELOG.md
├── LICENSE.txt
├── README.md
├── app/
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── com/
│       │           └── akexorcist/
│       │               └── library/
│       │                   └── googledirectionandplace/
│       │                       └── sample/
│       │                           └── ApplicationTest.java
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── akexorcist/
│       │   │           └── googledirection/
│       │   │               └── sample/
│       │   │                   ├── AlternativeDirectionActivity.kt
│       │   │                   ├── MainActivity.kt
│       │   │                   ├── SimpleDirectionActivity.kt
│       │   │                   ├── TransitDirectionActivity.kt
│       │   │                   └── WaypointsDirectionActivity.kt
│       │   └── res/
│       │       ├── layout/
│       │       │   ├── activity_alternative_direction.xml
│       │       │   ├── activity_main.xml
│       │       │   ├── activity_simple_direction.xml
│       │       │   ├── activity_transit_direction.xml
│       │       │   └── activity_waypoints_direction.xml
│       │       ├── mipmap-anydpi-v26/
│       │       │   ├── ic_launcher.xml
│       │       │   └── ic_launcher_round.xml
│       │       └── values/
│       │           ├── colors.xml
│       │           ├── dimens.xml
│       │           ├── strings.xml
│       │           └── styles.xml
│       └── test/
│           └── java/
│               └── com/
│                   └── akexorcist/
│                       └── library/
│                           └── googledirectionandplace/
│                               └── sample/
│                                   └── ExampleUnitTest.java
├── build.gradle
├── google-direction/
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   └── java/
│       │       └── com/
│       │           └── akexorcist/
│       │               └── googledirection/
│       │                   ├── DirectionCallback.java
│       │                   ├── GoogleDirection.java
│       │                   ├── config/
│       │                   │   └── GoogleDirectionConfiguration.java
│       │                   ├── constant/
│       │                   │   ├── AvoidType.java
│       │                   │   ├── DirectionUrl.java
│       │                   │   ├── Language.java
│       │                   │   ├── Maneuver.java
│       │                   │   ├── RequestResult.java
│       │                   │   ├── TrafficModel.java
│       │                   │   ├── TransitMode.java
│       │                   │   ├── TransitRoutingPreference.java
│       │                   │   ├── TransportMode.java
│       │                   │   ├── Unit.java
│       │                   │   └── VehicleType.java
│       │                   ├── model/
│       │                   │   ├── Agency.java
│       │                   │   ├── Bound.java
│       │                   │   ├── Coordination.java
│       │                   │   ├── Direction.java
│       │                   │   ├── Fare.java
│       │                   │   ├── GeocodedWaypoint.java
│       │                   │   ├── Info.java
│       │                   │   ├── Leg.java
│       │                   │   ├── Line.java
│       │                   │   ├── Route.java
│       │                   │   ├── RoutePolyline.java
│       │                   │   ├── Step.java
│       │                   │   ├── StopPoint.java
│       │                   │   ├── TimeInfo.java
│       │                   │   ├── TransitDetail.java
│       │                   │   ├── Vehicle.java
│       │                   │   └── Waypoint.java
│       │                   ├── network/
│       │                   │   ├── DirectionConnection.java
│       │                   │   └── DirectionService.java
│       │                   ├── request/
│       │                   │   ├── DirectionDestinationRequest.java
│       │                   │   ├── DirectionOriginRequest.java
│       │                   │   ├── DirectionRequest.java
│       │                   │   ├── DirectionRequestParam.java
│       │                   │   └── DirectionTask.java
│       │                   └── util/
│       │                       ├── DirectionConverter.java
│       │                       └── DirectionExtension.kt
│       └── test/
│           └── java/
│               └── com/
│                   └── akexorcist/
│                       └── library/
│                           └── googledirectionandplace/
│                               └── ExampleUnitTest.java
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── publish/
│   └── mavencentral.gradle
└── settings.gradle
Download .txt
SYMBOL INDEX (421 symbols across 42 files)

FILE: app/src/androidTest/java/com/akexorcist/library/googledirectionandplace/sample/ApplicationTest.java
  class ApplicationTest (line 9) | public class ApplicationTest extends ApplicationTestCase<Application> {
    method ApplicationTest (line 10) | public ApplicationTest() {

FILE: app/src/test/java/com/akexorcist/library/googledirectionandplace/sample/ExampleUnitTest.java
  class ExampleUnitTest (line 10) | public class ExampleUnitTest {
    method addition_isCorrect (line 11) | @Test

FILE: google-direction/src/main/java/com/akexorcist/googledirection/DirectionCallback.java
  type DirectionCallback (line 31) | public interface DirectionCallback {
    method onDirectionSuccess (line 38) | void onDirectionSuccess(@Nullable Direction direction);
    method onDirectionFailure (line 46) | void onDirectionFailure(@NonNull Throwable t);

FILE: google-direction/src/main/java/com/akexorcist/googledirection/GoogleDirection.java
  class GoogleDirection (line 30) | public class GoogleDirection {
    method withServerKey (line 41) | public static DirectionOriginRequest withServerKey(@NonNull String api...

FILE: google-direction/src/main/java/com/akexorcist/googledirection/config/GoogleDirectionConfiguration.java
  class GoogleDirectionConfiguration (line 11) | @SuppressWarnings("unused")
    method getInstance (line 21) | public static GoogleDirectionConfiguration getInstance() {
    method getCustomClient (line 37) | public OkHttpClient getCustomClient() {
    method setCustomClient (line 47) | public void setCustomClient(OkHttpClient customClient) {
    method isLogEnabled (line 57) | public boolean isLogEnabled() {
    method setLogEnabled (line 67) | public void setLogEnabled(boolean logEnabled) {

FILE: google-direction/src/main/java/com/akexorcist/googledirection/constant/AvoidType.java
  class AvoidType (line 31) | public class AvoidType {

FILE: google-direction/src/main/java/com/akexorcist/googledirection/constant/DirectionUrl.java
  class DirectionUrl (line 24) | public class DirectionUrl {

FILE: google-direction/src/main/java/com/akexorcist/googledirection/constant/Language.java
  class Language (line 31) | public class Language {

FILE: google-direction/src/main/java/com/akexorcist/googledirection/constant/Maneuver.java
  class Maneuver (line 8) | @SuppressWarnings("unused")

FILE: google-direction/src/main/java/com/akexorcist/googledirection/constant/RequestResult.java
  class RequestResult (line 27) | @SuppressWarnings("unused")

FILE: google-direction/src/main/java/com/akexorcist/googledirection/constant/TrafficModel.java
  class TrafficModel (line 31) | public class TrafficModel {

FILE: google-direction/src/main/java/com/akexorcist/googledirection/constant/TransitMode.java
  class TransitMode (line 31) | public class TransitMode {

FILE: google-direction/src/main/java/com/akexorcist/googledirection/constant/TransitRoutingPreference.java
  class TransitRoutingPreference (line 31) | public class TransitRoutingPreference {

FILE: google-direction/src/main/java/com/akexorcist/googledirection/constant/TransportMode.java
  class TransportMode (line 31) | public class TransportMode {

FILE: google-direction/src/main/java/com/akexorcist/googledirection/constant/Unit.java
  class Unit (line 31) | public class Unit {

FILE: google-direction/src/main/java/com/akexorcist/googledirection/constant/VehicleType.java
  class VehicleType (line 26) | @SuppressWarnings("unused")

FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Agency.java
  class Agency (line 30) | @SuppressWarnings("WeakerAccess")
    method Agency (line 37) | public Agency() {
    method Agency (line 40) | protected Agency(Parcel in) {
    method getName (line 45) | public String getName() {
    method setName (line 49) | public void setName(String name) {
    method getUrl (line 53) | public String getUrl() {
    method setUrl (line 57) | public void setUrl(String url) {
    method writeToParcel (line 61) | @Override
    method describeContents (line 67) | @Override
    method createFromParcel (line 73) | @Override
    method newArray (line 78) | @Override

FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Bound.java
  class Bound (line 30) | @SuppressWarnings("WeakerAccess")
    method Bound (line 37) | public Bound() {
    method Bound (line 40) | protected Bound(Parcel in) {
    method getNortheastCoordination (line 45) | public Coordination getNortheastCoordination() {
    method setNortheast (line 49) | public void setNortheast(Coordination northeast) {
    method getSouthwestCoordination (line 53) | public Coordination getSouthwestCoordination() {
    method setSouthwest (line 57) | public void setSouthwest(Coordination southwest) {
    method writeToParcel (line 61) | @Override
    method describeContents (line 67) | @Override
    method createFromParcel (line 73) | @Override
    method newArray (line 78) | @Override

FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Coordination.java
  class Coordination (line 31) | @SuppressWarnings("WeakerAccess")
    method Coordination (line 38) | public Coordination() {
    method Coordination (line 41) | protected Coordination(Parcel in) {
    method getLatitude (line 46) | public double getLatitude() {
    method setLatitude (line 50) | public void setLatitude(double latitude) {
    method getLongitude (line 54) | public double getLongitude() {
    method setLongitude (line 58) | public void setLongitude(double longitude) {
    method getCoordination (line 62) | public LatLng getCoordination() {
    method writeToParcel (line 66) | @Override
    method describeContents (line 72) | @Override
    method createFromParcel (line 78) | @Override
    method newArray (line 83) | @Override

FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Direction.java
  class Direction (line 33) | @SuppressWarnings("WeakerAccess")
    method Direction (line 44) | public Direction() {
    method Direction (line 47) | protected Direction(Parcel in) {
    method setGeocodedWaypointList (line 52) | public void setGeocodedWaypointList(List<GeocodedWaypoint> geocodedWay...
    method getGeocodedWaypointList (line 56) | public List<GeocodedWaypoint> getGeocodedWaypointList() {
    method setRouteList (line 60) | public void setRouteList(List<Route> routeList) {
    method getRouteList (line 64) | public List<Route> getRouteList() {
    method setStatus (line 68) | public void setStatus(String status) {
    method getStatus (line 72) | public String getStatus() {
    method setErrorMessage (line 76) | public void setErrorMessage(String errorMessage) {
    method getErrorMessage (line 80) | public String getErrorMessage() {
    method isOK (line 84) | public boolean isOK() {
    method writeToParcel (line 88) | @Override
    method describeContents (line 94) | @Override
    method createFromParcel (line 100) | @Override
    method newArray (line 105) | @Override

FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Fare.java
  class Fare (line 30) | @SuppressWarnings("WeakerAccess")
    method Fare (line 39) | public Fare() {
    method Fare (line 42) | protected Fare(Parcel in) {
    method getCurrency (line 48) | public String getCurrency() {
    method setCurrency (line 52) | public void setCurrency(String currency) {
    method getValue (line 56) | public String getValue() {
    method setValue (line 60) | public void setValue(String value) {
    method getText (line 64) | public String getText() {
    method setText (line 68) | public void setText(String text) {
    method writeToParcel (line 72) | @Override
    method describeContents (line 79) | @Override
    method createFromParcel (line 85) | @Override
    method newArray (line 90) | @Override

FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/GeocodedWaypoint.java
  class GeocodedWaypoint (line 32) | @SuppressWarnings("WeakerAccess")
    method GeocodedWaypoint (line 41) | public GeocodedWaypoint() {
    method GeocodedWaypoint (line 44) | protected GeocodedWaypoint(Parcel in) {
    method getStatus (line 50) | public String getStatus() {
    method setStatus (line 54) | public void setStatus(String status) {
    method getPlaceId (line 58) | public String getPlaceId() {
    method setPlaceId (line 62) | public void setPlaceId(String placeId) {
    method getTypeList (line 66) | public List<String> getTypeList() {
    method setTypeList (line 70) | public void setTypeList(List<String> typeList) {
    method writeToParcel (line 74) | @Override
    method describeContents (line 81) | @Override
    method createFromParcel (line 87) | @Override
    method newArray (line 92) | @Override

FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Info.java
  class Info (line 30) | @SuppressWarnings("WeakerAccess")
    method Info (line 37) | public Info() {
    method Info (line 40) | protected Info(Parcel in) {
    method getText (line 45) | public String getText() {
    method setText (line 49) | public void setText(String text) {
    method getValue (line 53) | public Long getValue() {
    method setValue (line 57) | public void setValue(Long value) {
    method writeToParcel (line 61) | @Override
    method describeContents (line 67) | @Override
    method createFromParcel (line 73) | @Override
    method newArray (line 78) | @Override

FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Leg.java
  class Leg (line 32) | public class Leg {
    method getArrivalTime (line 56) | public TimeInfo getArrivalTime() {
    method setArrivalTime (line 60) | public void setArrivalTime(TimeInfo arrivalTime) {
    method getDepartureTime (line 64) | public TimeInfo getDepartureTime() {
    method setDepartureTime (line 68) | public void setDepartureTime(TimeInfo departureTime) {
    method getDistance (line 72) | public Info getDistance() {
    method setDistance (line 76) | public void setDistance(Info distance) {
    method getDuration (line 80) | public Info getDuration() {
    method setDuration (line 84) | public void setDuration(Info duration) {
    method getDurationInTraffic (line 88) | public Info getDurationInTraffic() {
    method setDurationInTraffic (line 92) | public void setDurationInTraffic(Info durationInTraffic) {
    method getEndAddress (line 96) | public String getEndAddress() {
    method setEndAddress (line 100) | public void setEndAddress(String endAddress) {
    method getEndLocation (line 104) | public Coordination getEndLocation() {
    method setEndLocation (line 108) | public void setEndLocation(Coordination endLocation) {
    method getStartAddress (line 112) | public String getStartAddress() {
    method setStartAddress (line 116) | public void setStartAddress(String startAddress) {
    method getStartLocation (line 120) | public Coordination getStartLocation() {
    method setStartLocation (line 124) | public void setStartLocation(Coordination startLocation) {
    method getStepList (line 128) | public List<Step> getStepList() {
    method setStepList (line 132) | public void setStepList(List<Step> stepList) {
    method getViaWaypointList (line 136) | public List<Waypoint> getViaWaypointList() {
    method setViaWaypointList (line 140) | public void setViaWaypointList(List<Waypoint> viaWaypointList) {
    method getDirectionPoint (line 144) | public ArrayList<LatLng> getDirectionPoint() {
    method getSectionPoint (line 148) | public ArrayList<LatLng> getSectionPoint() {

FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Line.java
  class Line (line 32) | @SuppressWarnings("WeakerAccess")
    method Line (line 47) | public Line() {
    method Line (line 50) | protected Line(Parcel in) {
    method getAgencyList (line 58) | public List<Agency> getAgencyList() {
    method setAgencyList (line 62) | public void setAgencyList(List<Agency> agencyList) {
    method getColor (line 66) | public String getColor() {
    method setColor (line 70) | public void setColor(String color) {
    method getName (line 74) | public String getName() {
    method setName (line 78) | public void setName(String name) {
    method getShortName (line 82) | public String getShortName() {
    method setShortName (line 86) | public void setShortName(String shortName) {
    method getTextColor (line 90) | public String getTextColor() {
    method setTextColor (line 94) | public void setTextColor(String textColor) {
    method getVehicle (line 98) | public Vehicle getVehicle() {
    method setVehicle (line 102) | public void setVehicle(Vehicle vehicle) {
    method writeToParcel (line 106) | @Override
    method describeContents (line 115) | @Override
    method createFromParcel (line 121) | @Override
    method newArray (line 126) | @Override

FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Route.java
  class Route (line 32) | @SuppressWarnings("WeakerAccess")
    method Route (line 51) | public Route() {
    method Route (line 54) | protected Route(Parcel in) {
    method getBound (line 63) | public Bound getBound() {
    method setBound (line 67) | public void setBound(Bound bound) {
    method getCopyrights (line 71) | public String getCopyrights() {
    method setCopyrights (line 75) | public void setCopyrights(String copyrights) {
    method getLegList (line 79) | public List<Leg> getLegList() {
    method setLegList (line 83) | public void setLegList(List<Leg> legList) {
    method getOverviewPolyline (line 87) | public RoutePolyline getOverviewPolyline() {
    method setOverviewPolyline (line 91) | public void setOverviewPolyline(RoutePolyline overviewPolyline) {
    method getSummary (line 95) | public String getSummary() {
    method setSummary (line 99) | public void setSummary(String summary) {
    method getFare (line 103) | public Fare getFare() {
    method setFare (line 107) | public void setFare(Fare fare) {
    method getWarningList (line 111) | public List<String> getWarningList() {
    method setWarningList (line 115) | public void setWarningList(List<String> warningList) {
    method getWaypointOrderList (line 119) | public List<Long> getWaypointOrderList() {
    method setWaypointOrderList (line 123) | public void setWaypointOrderList(List<Long> waypointOrderList) {
    method getTotalDistance (line 130) | public Long getTotalDistance() {
    method getTotalDuration (line 144) | public Long getTotalDuration() {
    method describeContents (line 155) | @Override
    method writeToParcel (line 160) | @Override
    method createFromParcel (line 171) | @Override
    method newArray (line 176) | @Override

FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/RoutePolyline.java
  class RoutePolyline (line 34) | @SuppressWarnings("WeakerAccess")
    method RoutePolyline (line 39) | public RoutePolyline() {
    method RoutePolyline (line 42) | protected RoutePolyline(Parcel in) {
    method getRawPointList (line 46) | public String getRawPointList() {
    method setRawPointList (line 50) | public void setRawPointList(String rawPointList) {
    method getPointList (line 54) | public List<LatLng> getPointList() {
    method writeToParcel (line 58) | @Override
    method describeContents (line 63) | @Override
    method createFromParcel (line 69) | @Override
    method newArray (line 74) | @Override

FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Step.java
  class Step (line 32) | @SuppressWarnings("WeakerAccess")
    method Step (line 55) | public Step() {
    method Step (line 58) | protected Step(Parcel in) {
    method getDistance (line 69) | public Info getDistance() {
    method setDistance (line 73) | public void setDistance(Info distance) {
    method getDuration (line 77) | public Info getDuration() {
    method setDuration (line 81) | public void setDuration(Info duration) {
    method getEndLocation (line 85) | public Coordination getEndLocation() {
    method setEndLocation (line 89) | public void setEndLocation(Coordination endLocation) {
    method getHtmlInstruction (line 93) | public String getHtmlInstruction() {
    method setHtmlInstruction (line 97) | public void setHtmlInstruction(String htmlInstruction) {
    method getManeuver (line 101) | public String getManeuver() {
    method setManeuver (line 105) | public void setManeuver(String maneuver) {
    method getStartLocation (line 109) | public Coordination getStartLocation() {
    method setStartLocation (line 113) | public void setStartLocation(Coordination startLocation) {
    method getTransitDetail (line 117) | public TransitDetail getTransitDetail() {
    method setTransitDetail (line 121) | public void setTransitDetail(TransitDetail transitDetail) {
    method getStepList (line 125) | public List<Step> getStepList() {
    method setStepList (line 129) | public void setStepList(List<Step> stepList) {
    method isContainStepList (line 133) | public boolean isContainStepList() {
    method getPolyline (line 137) | public RoutePolyline getPolyline() {
    method setPolyline (line 141) | public void setPolyline(RoutePolyline polyline) {
    method getTravelMode (line 145) | public String getTravelMode() {
    method setTravelMode (line 149) | public void setTravelMode(String travelMode) {
    method writeToParcel (line 153) | @Override
    method describeContents (line 165) | @Override
    method createFromParcel (line 171) | @Override
    method newArray (line 176) | @Override

FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/StopPoint.java
  class StopPoint (line 30) | @SuppressWarnings("WeakerAccess")
    method StopPoint (line 37) | public StopPoint() {
    method StopPoint (line 40) | protected StopPoint(Parcel in) {
    method getLocation (line 45) | public Coordination getLocation() {
    method setLocation (line 49) | public void setLocation(Coordination location) {
    method getName (line 53) | public String getName() {
    method setName (line 57) | public void setName(String name) {
    method writeToParcel (line 61) | @Override
    method describeContents (line 67) | @Override
    method createFromParcel (line 73) | @Override
    method newArray (line 78) | @Override

FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/TimeInfo.java
  class TimeInfo (line 30) | @SuppressWarnings("WeakerAccess")
    method TimeInfo (line 39) | public TimeInfo() {
    method TimeInfo (line 42) | protected TimeInfo(Parcel in) {
    method getText (line 48) | public String getText() {
    method setText (line 52) | public void setText(String text) {
    method getTimeZone (line 56) | public String getTimeZone() {
    method setTimeZone (line 60) | public void setTimeZone(String timeZone) {
    method getValue (line 64) | public String getValue() {
    method setValue (line 68) | public void setValue(String value) {
    method writeToParcel (line 72) | @Override
    method describeContents (line 79) | @Override
    method createFromParcel (line 85) | @Override
    method newArray (line 90) | @Override

FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/TransitDetail.java
  class TransitDetail (line 30) | @SuppressWarnings("WeakerAccess")
    method TransitDetail (line 47) | public TransitDetail() {
    method TransitDetail (line 50) | protected TransitDetail(Parcel in) {
    method getArrivalStopPoint (line 60) | public StopPoint getArrivalStopPoint() {
    method setArrivalStopPoint (line 64) | public void setArrivalStopPoint(StopPoint arrivalStopPoint) {
    method getArrivalTime (line 68) | public TimeInfo getArrivalTime() {
    method setArrivalTime (line 72) | public void setArrivalTime(TimeInfo arrivalTime) {
    method getDepartureStopPoint (line 76) | public StopPoint getDepartureStopPoint() {
    method setDepartureStopPoint (line 80) | public void setDepartureStopPoint(StopPoint departureStopPoint) {
    method getDepartureTime (line 84) | public TimeInfo getDepartureTime() {
    method setDepartureTime (line 88) | public void setDepartureTime(TimeInfo departureTime) {
    method getLine (line 92) | public Line getLine() {
    method setLine (line 96) | public void setLine(Line line) {
    method getHeadsign (line 100) | public String getHeadsign() {
    method setHeadsign (line 104) | public void setHeadsign(String headsign) {
    method getStopNumber (line 108) | public String getStopNumber() {
    method setStopNumber (line 112) | public void setStopNumber(String stopNumber) {
    method writeToParcel (line 116) | @Override
    method describeContents (line 127) | @Override
    method createFromParcel (line 133) | @Override
    method newArray (line 138) | @Override

FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Vehicle.java
  class Vehicle (line 30) | @SuppressWarnings("WeakerAccess")
    method Vehicle (line 39) | public Vehicle() {
    method Vehicle (line 42) | protected Vehicle(Parcel in) {
    method getIconUrl (line 48) | public String getIconUrl() {
    method setIconUrl (line 52) | public void setIconUrl(String iconUrl) {
    method getName (line 56) | public String getName() {
    method setName (line 60) | public void setName(String name) {
    method getType (line 64) | public String getType() {
    method setType (line 68) | public void setType(String type) {
    method writeToParcel (line 72) | @Override
    method describeContents (line 79) | @Override
    method createFromParcel (line 85) | @Override
    method newArray (line 90) | @Override

FILE: google-direction/src/main/java/com/akexorcist/googledirection/model/Waypoint.java
  class Waypoint (line 31) | @SuppressWarnings("WeakerAccess")
    method Waypoint (line 40) | public Waypoint() {
    method Waypoint (line 43) | protected Waypoint(Parcel in) {
    method getLocation (line 49) | public Coordination getLocation() {
    method setLocation (line 53) | public void setLocation(Coordination location) {
    method getIndex (line 57) | public int getIndex() {
    method setIndex (line 61) | public void setIndex(int index) {
    method getInterpolation (line 65) | public double getInterpolation() {
    method setInterpolation (line 69) | public void setInterpolation(double interpolation) {
    method writeToParcel (line 73) | @Override
    method describeContents (line 80) | @Override
    method createFromParcel (line 86) | @Override
    method newArray (line 91) | @Override

FILE: google-direction/src/main/java/com/akexorcist/googledirection/network/DirectionConnection.java
  class DirectionConnection (line 32) | public class DirectionConnection {
    method getInstance (line 35) | public static DirectionConnection getInstance() {
    method createService (line 44) | public DirectionService createService() {
    method getClient (line 56) | private OkHttpClient getClient() {
    method createDefaultClient (line 64) | private OkHttpClient createDefaultClient() {

FILE: google-direction/src/main/java/com/akexorcist/googledirection/network/DirectionService.java
  type DirectionService (line 31) | public interface DirectionService {
    method getDirection (line 33) | @GET(DirectionUrl.DIRECTION_API_URL)

FILE: google-direction/src/main/java/com/akexorcist/googledirection/request/DirectionDestinationRequest.java
  class DirectionDestinationRequest (line 34) | public class DirectionDestinationRequest {
    method DirectionDestinationRequest (line 42) | public DirectionDestinationRequest(@NonNull String apiKey, @NonNull La...
    method and (line 54) | public DirectionDestinationRequest and(@NonNull LatLng waypoint) {
    method and (line 69) | public DirectionDestinationRequest and(@NonNull List<LatLng> waypointL...
    method to (line 84) | public DirectionRequest to(@NonNull LatLng destination) {

FILE: google-direction/src/main/java/com/akexorcist/googledirection/request/DirectionOriginRequest.java
  class DirectionOriginRequest (line 30) | public class DirectionOriginRequest {
    method DirectionOriginRequest (line 34) | public DirectionOriginRequest(@NonNull String apiKey) {
    method from (line 45) | public DirectionDestinationRequest from(@NonNull LatLng origin) {

FILE: google-direction/src/main/java/com/akexorcist/googledirection/request/DirectionRequest.java
  class DirectionRequest (line 49) | @SuppressWarnings("unused")
    method DirectionRequest (line 53) | public DirectionRequest(@NonNull String apiKey, @NonNull LatLng origin...
    method transportMode (line 64) | public DirectionRequest transportMode(@Nullable @TransportMode.Value S...
    method language (line 76) | public DirectionRequest language(@Nullable @Language.Value String lang...
    method unit (line 88) | public DirectionRequest unit(@Nullable @Unit.Value String unit) {
    method avoid (line 100) | public DirectionRequest avoid(@Nullable @AvoidType.Value String avoid) {
    method transitMode (line 119) | public DirectionRequest transitMode(@Nullable @TransitMode.Value Strin...
    method trafficMode (line 138) | public DirectionRequest trafficMode(@Nullable @TrafficModel.Value Stri...
    method transitRoutingPreference (line 151) | public DirectionRequest transitRoutingPreference(@Nullable @TransitRou...
    method alternativeRoute (line 163) | public DirectionRequest alternativeRoute(boolean alternative) {
    method departureTime (line 175) | public DirectionRequest departureTime(@Nullable String time) {
    method optimizeWaypoints (line 187) | public DirectionRequest optimizeWaypoints(boolean optimize) {
    method execute (line 199) | public DirectionTask execute(@Nullable final DirectionCallback callbac...
    method waypointsToString (line 245) | private String waypointsToString(@Nullable List<LatLng> waypoints) {

FILE: google-direction/src/main/java/com/akexorcist/googledirection/request/DirectionRequestParam.java
  class DirectionRequestParam (line 34) | @SuppressWarnings({"WeakerAccess", "UnusedReturnValue"})
    method DirectionRequestParam (line 51) | public DirectionRequestParam() {
    method DirectionRequestParam (line 54) | protected DirectionRequestParam(Parcel in) {
    method getOrigin (line 71) | @Nullable
    method setOrigin (line 76) | public DirectionRequestParam setOrigin(@Nullable LatLng origin) {
    method getDestination (line 81) | @Nullable
    method setDestination (line 86) | public DirectionRequestParam setDestination(@Nullable LatLng destinati...
    method getTransportMode (line 91) | @Nullable
    method setTransportMode (line 96) | public void setTransportMode(@Nullable String transportMode) {
    method getLanguage (line 100) | @Nullable
    method setLanguage (line 105) | public void setLanguage(@Nullable String language) {
    method getUnit (line 109) | @Nullable
    method setUnit (line 114) | public void setUnit(@Nullable String unit) {
    method getAvoid (line 118) | @Nullable
    method setAvoid (line 123) | public void setAvoid(@Nullable String avoid) {
    method getTransitMode (line 127) | @Nullable
    method setTransitMode (line 132) | public void setTransitMode(@Nullable String transitMode) {
    method getTrafficModel (line 136) | @Nullable
    method setTrafficModel (line 141) | public void setTrafficModel(@Nullable String trafficModel) {
    method getTransitRoutingPreference (line 145) | @Nullable
    method setTransitRoutingPreference (line 150) | public void setTransitRoutingPreference(@Nullable String transitRoutin...
    method isAlternatives (line 154) | public boolean isAlternatives() {
    method setAlternatives (line 158) | public void setAlternatives(boolean alternatives) {
    method getApiKey (line 162) | @Nullable
    method setApiKey (line 167) | public DirectionRequestParam setApiKey(@Nullable String apiKey) {
    method getDepartureTime (line 172) | @Nullable
    method setDepartureTime (line 177) | public DirectionRequestParam setDepartureTime(@Nullable String departu...
    method getWaypoints (line 182) | @Nullable
    method setWaypoints (line 187) | public DirectionRequestParam setWaypoints(@Nullable List<LatLng> waypo...
    method isOptimizeWaypoints (line 192) | public boolean isOptimizeWaypoints() {
    method setOptimizeWaypoints (line 196) | public DirectionRequestParam setOptimizeWaypoints(boolean optimizeWayp...
    method writeToParcel (line 201) | @Override
    method describeContents (line 219) | @Override
    method createFromParcel (line 225) | @Override
    method newArray (line 230) | @Override

FILE: google-direction/src/main/java/com/akexorcist/googledirection/request/DirectionTask.java
  class DirectionTask (line 14) | @SuppressWarnings("unused")
    method DirectionTask (line 18) | public DirectionTask(Call<Direction> directionCall) {
    method cancel (line 27) | public void cancel() {
    method isFinished (line 39) | public boolean isFinished() {
    method toRetrofitCall (line 49) | public Call<Direction> toRetrofitCall() {

FILE: google-direction/src/main/java/com/akexorcist/googledirection/util/DirectionConverter.java
  class DirectionConverter (line 45) | @SuppressWarnings("unused")
    method getDirectionPoint (line 54) | public static ArrayList<LatLng> getDirectionPoint(List<Step> stepList) {
    method convertStepToPosition (line 67) | private static void convertStepToPosition(Step step, ArrayList<LatLng>...
    method getSectionPoint (line 90) | public static ArrayList<LatLng> getSectionPoint(List<Step> stepList) {
    method createPolyline (line 111) | public static PolylineOptions createPolyline(
    method createPolyline (line 138) | public static PolylineOptions createPolyline(
    method createPolyline (line 168) | public static PolylineOptions createPolyline(
    method createPolyline (line 200) | public static PolylineOptions createPolyline(
    method createPolyline (line 234) | public static PolylineOptions createPolyline(
    method createPolyline (line 268) | public static PolylineOptions createPolyline(
    method createPolyline (line 304) | public static PolylineOptions createPolyline(
    method createTransitPolyline (line 342) | public static ArrayList<PolylineOptions> createTransitPolyline(
    method createTransitPolyline (line 373) | public static ArrayList<PolylineOptions> createTransitPolyline(
    method createTransitPolyline (line 410) | public static ArrayList<PolylineOptions> createTransitPolyline(
    method createTransitPolyline (line 448) | public static ArrayList<PolylineOptions> createTransitPolyline(
    method createTransitPolyline (line 486) | public static ArrayList<PolylineOptions> createTransitPolyline(
    method createTransitPolyline (line 526) | public static ArrayList<PolylineOptions> createTransitPolyline(
    method createTransitPolyline (line 570) | public static ArrayList<PolylineOptions> createTransitPolyline(
    method dpToPx (line 622) | @SuppressWarnings("IntegerDivisionInFloatingPointContext")
    class PathOption (line 633) | public static class PathOption {
      method getLocationList (line 643) | public ArrayList<LatLng> getLocationList() {
      method setLocationList (line 647) | public PathOption setLocationList(ArrayList<LatLng> locationList) {
      method getWidth (line 652) | public int getWidth() {
      method setWidth (line 656) | public PathOption setWidth(@Dimension(unit = Dimension.DP) int width) {
      method getColor (line 661) | public int getColor() {
      method setColor (line 665) | public PathOption setColor(@ColorInt int color) {
      method isClickable (line 670) | public boolean isClickable() {
      method setClickable (line 674) | public PathOption setClickable(boolean clickable) {
      method getJointType (line 679) | public int getJointType() {
      method setJointType (line 683) | public PathOption setJointType(int jointType) {
      method getStartCap (line 688) | public Cap getStartCap() {
      method setStartCap (line 692) | public PathOption setStartCap(Cap startCap) {
      method getEndCap (line 697) | public Cap getEndCap() {
      method setEndCap (line 701) | public PathOption setEndCap(Cap endCap) {
      method getPatternItemList (line 706) | public List<PatternItem> getPatternItemList() {
      method setPatternItemList (line 710) | public PathOption setPatternItemList(List<PatternItem> patternItemLi...
    class TransitPathOption (line 721) | public static class TransitPathOption {
      method getStepList (line 734) | public List<Step> getStepList() {
      method setStepList (line 738) | public TransitPathOption setStepList(List<Step> stepList) {
      method getTransitWidth (line 743) | public int getTransitWidth() {
      method setTransitWidth (line 747) | public TransitPathOption setTransitWidth(@Dimension(unit = Dimension...
      method getTransitColor (line 752) | public int getTransitColor() {
      method setTransitColor (line 756) | public TransitPathOption setTransitColor(@ColorInt int transitColor) {
      method getTransitPatternItemList (line 761) | @Nullable
      method setTransitPatternItemList (line 766) | public TransitPathOption setTransitPatternItemList(@Nullable List<Pa...
      method getWalkingWidth (line 771) | public int getWalkingWidth() {
      method setWalkingWidth (line 775) | public TransitPathOption setWalkingWidth(@Dimension(unit = Dimension...
      method getWalkingColor (line 780) | public int getWalkingColor() {
      method setWalkingColor (line 784) | public TransitPathOption setWalkingColor(@ColorInt int walkingColor) {
      method getWalkingPatternItemList (line 789) | @Nullable
      method setWalkingPatternItemList (line 794) | public TransitPathOption setWalkingPatternItemList(@Nullable List<Pa...
      method isClickable (line 799) | public boolean isClickable() {
      method setClickable (line 803) | public TransitPathOption setClickable(boolean clickable) {
      method getJointType (line 808) | public int getJointType() {
      method setJointType (line 812) | public TransitPathOption setJointType(int jointType) {
      method getStartCap (line 817) | @Nullable
      method setStartCap (line 822) | public TransitPathOption setStartCap(@Nullable Cap startCap) {
      method getEndCap (line 827) | @Nullable
      method setEndCap (line 832) | public TransitPathOption setEndCap(@Nullable Cap endCap) {

FILE: google-direction/src/test/java/com/akexorcist/library/googledirectionandplace/ExampleUnitTest.java
  class ExampleUnitTest (line 10) | public class ExampleUnitTest {
    method addition_isCorrect (line 11) | @Test
Condensed preview — 78 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (212K chars).
[
  {
    "path": ".github/workflows/android.yml",
    "chars": 441,
    "preview": "name: Android CI\n\non:\n  push:\n    branches: [ master ]\n  pull_request:\n    branches: [ master ]\n\njobs:\n  test:\n    name:"
  },
  {
    "path": ".gitignore",
    "chars": 893,
    "preview": "# Built application files\n*.apk\n*.ap_\n\n# Files for the ART/Dalvik VM\n*.dex\n\n# Java class files\n*.class\n\n# Generated file"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 535,
    "preview": "Release Notes\n====\n\n1.2.1\n-- \n* Update target and compile SDK version 30 \n* Add @StringDef to all parameters\n* Add traff"
  },
  {
    "path": "LICENSE.txt",
    "chars": 10833,
    "preview": "\n                              Apache License\n                        Version 2.0, January 2004\n                     htt"
  },
  {
    "path": "README.md",
    "chars": 4975,
    "preview": "[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Android--GoogleDirectionAndPlaceLibrary-brightgreen.s"
  },
  {
    "path": "app/build.gradle",
    "chars": 1173,
    "preview": "apply plugin: 'com.android.application'\napply plugin: 'kotlin-android'\n\nandroid {\n    compileSdkVersion project.compileS"
  },
  {
    "path": "app/proguard-rules.pro",
    "chars": 975,
    "preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /A"
  },
  {
    "path": "app/src/androidTest/java/com/akexorcist/library/googledirectionandplace/sample/ApplicationTest.java",
    "chars": 384,
    "preview": "package com.akexorcist.library.googledirectionandplace.sample;\n\nimport android.app.Application;\nimport android.test.Appl"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "chars": 2000,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:to"
  },
  {
    "path": "app/src/main/java/com/akexorcist/googledirection/sample/AlternativeDirectionActivity.kt",
    "chars": 4543,
    "preview": "package com.akexorcist.googledirection.sample\n\nimport android.os.Bundle\nimport android.view.View\nimport androidx.appcomp"
  },
  {
    "path": "app/src/main/java/com/akexorcist/googledirection/sample/MainActivity.kt",
    "chars": 1375,
    "preview": "package com.akexorcist.googledirection.sample\n\nimport android.content.Intent\nimport android.os.Bundle\nimport androidx.ap"
  },
  {
    "path": "app/src/main/java/com/akexorcist/googledirection/sample/SimpleDirectionActivity.kt",
    "chars": 4096,
    "preview": "package com.akexorcist.googledirection.sample\n\nimport android.graphics.Color\nimport android.os.Bundle\nimport android.vie"
  },
  {
    "path": "app/src/main/java/com/akexorcist/googledirection/sample/TransitDirectionActivity.kt",
    "chars": 4304,
    "preview": "package com.akexorcist.googledirection.sample\n\nimport android.graphics.Color\nimport android.os.Bundle\nimport android.vie"
  },
  {
    "path": "app/src/main/java/com/akexorcist/googledirection/sample/WaypointsDirectionActivity.kt",
    "chars": 4734,
    "preview": "package com.akexorcist.googledirection.sample\n\nimport android.graphics.Color\nimport android.os.Bundle\nimport android.vie"
  },
  {
    "path": "app/src/main/res/layout/activity_alternative_direction.xml",
    "chars": 928,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "chars": 1368,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns"
  },
  {
    "path": "app/src/main/res/layout/activity_simple_direction.xml",
    "chars": 880,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns"
  },
  {
    "path": "app/src/main/res/layout/activity_transit_direction.xml",
    "chars": 881,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns"
  },
  {
    "path": "app/src/main/res/layout/activity_waypoints_direction.xml",
    "chars": 883,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns"
  },
  {
    "path": "app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml",
    "chars": 266,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <b"
  },
  {
    "path": "app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml",
    "chars": 266,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <b"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "chars": 356,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#3F51B5</color>\n    <color name=\"color"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "chars": 79,
    "preview": "<resources>\n    <dimen name=\"default_margin_padding\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "chars": 643,
    "preview": "<resources>\n    <string name=\"app_name\">Google Direction Library Demo</string>\n    <string name=\"simple_direction\">Simpl"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "chars": 392,
    "preview": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.MaterialComponents.Light.Dark"
  },
  {
    "path": "app/src/test/java/com/akexorcist/library/googledirectionandplace/sample/ExampleUnitTest.java",
    "chars": 339,
    "preview": "package com.akexorcist.library.googledirectionandplace;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n"
  },
  {
    "path": "build.gradle",
    "chars": 1387,
    "preview": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    p"
  },
  {
    "path": "google-direction/build.gradle",
    "chars": 1706,
    "preview": "apply plugin: 'com.android.library'\napply plugin: 'kotlin-android'\napply plugin: 'org.jetbrains.dokka-android'\n\nandroid "
  },
  {
    "path": "google-direction/proguard-rules.pro",
    "chars": 945,
    "preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /A"
  },
  {
    "path": "google-direction/src/main/AndroidManifest.xml",
    "chars": 196,
    "preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.akexorcist.googledirection\">\n\n    "
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/DirectionCallback.java",
    "chars": 1360,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/GoogleDirection.java",
    "chars": 1332,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/config/GoogleDirectionConfiguration.java",
    "chars": 1740,
    "preview": "package com.akexorcist.googledirection.config;\n\nimport okhttp3.OkHttpClient;\n\n/**\n * Configuration class for the Google "
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/constant/AvoidType.java",
    "chars": 1691,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/constant/DirectionUrl.java",
    "chars": 823,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/constant/Language.java",
    "chars": 6688,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/constant/Maneuver.java",
    "chars": 1375,
    "preview": "package com.akexorcist.googledirection.constant;\n\n/**\n * Action to take for the current step.\n *\n * @since 1.0.0\n */\n@Su"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/constant/RequestResult.java",
    "chars": 3274,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/constant/TrafficModel.java",
    "chars": 2000,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/constant/TransitMode.java",
    "chars": 1856,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/constant/TransitRoutingPreference.java",
    "chars": 1360,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/constant/TransportMode.java",
    "chars": 1708,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/constant/Unit.java",
    "chars": 1334,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/constant/VehicleType.java",
    "chars": 3284,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/model/Agency.java",
    "chars": 1856,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/model/Bound.java",
    "chars": 2117,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/model/Coordination.java",
    "chars": 2141,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/model/Direction.java",
    "chars": 2755,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/model/Fare.java",
    "chars": 2145,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/model/GeocodedWaypoint.java",
    "chars": 2357,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/model/Info.java",
    "chars": 1848,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/model/Leg.java",
    "chars": 3865,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/model/Line.java",
    "chars": 3038,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/model/Route.java",
    "chars": 4553,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/model/RoutePolyline.java",
    "chars": 1964,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/model/Step.java",
    "chars": 4709,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/model/StopPoint.java",
    "chars": 2001,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/model/TimeInfo.java",
    "chars": 2182,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/model/TransitDetail.java",
    "chars": 3929,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/model/Vehicle.java",
    "chars": 2149,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/model/Waypoint.java",
    "chars": 2335,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/network/DirectionConnection.java",
    "chars": 2353,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/network/DirectionService.java",
    "chars": 1865,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/request/DirectionDestinationRequest.java",
    "chars": 2513,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/request/DirectionOriginRequest.java",
    "chars": 1293,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/request/DirectionRequest.java",
    "chars": 9282,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/request/DirectionRequestParam.java",
    "chars": 6217,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/request/DirectionTask.java",
    "chars": 1281,
    "preview": "package com.akexorcist.googledirection.request;\n\nimport com.akexorcist.googledirection.model.Direction;\n\nimport retrofit"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/util/DirectionConverter.java",
    "chars": 29356,
    "preview": "/*\n\nCopyright 2015 Akexorcist\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file"
  },
  {
    "path": "google-direction/src/main/java/com/akexorcist/googledirection/util/DirectionExtension.kt",
    "chars": 974,
    "preview": "package com.akexorcist.googledirection.util\n\nimport com.akexorcist.googledirection.DirectionCallback\nimport com.akexorci"
  },
  {
    "path": "google-direction/src/test/java/com/akexorcist/library/googledirectionandplace/ExampleUnitTest.java",
    "chars": 339,
    "preview": "package com.akexorcist.library.googledirectionandplace;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "chars": 230,
    "preview": "#Thu Dec 17 23:02:50 ICT 2020\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
  },
  {
    "path": "gradle.properties",
    "chars": 1184,
    "preview": "# Project-wide Gradle settings.\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will ov"
  },
  {
    "path": "gradlew",
    "chars": 4971,
    "preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start "
  },
  {
    "path": "gradlew.bat",
    "chars": 2314,
    "preview": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem "
  },
  {
    "path": "publish/mavencentral.gradle",
    "chars": 3726,
    "preview": "apply plugin: 'maven-publish'\napply plugin: 'signing'\n\n\ntask androidJavadocJar(type: Jar) {\n    archiveClassifier.set('j"
  },
  {
    "path": "settings.gradle",
    "chars": 42,
    "preview": "include ':app'\ninclude ':google-direction'"
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the akexorcist/Android-GoogleDirectionLibrary GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 78 files (191.9 KB), approximately 46.2k tokens, and a symbol index with 421 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!