├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── layout │ │ │ │ └── activity_main.xml │ │ │ └── drawable │ │ │ │ └── ic_launcher_background.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── taskail │ │ │ └── simpleplacessearchdialog │ │ │ ├── JavaExample.java │ │ │ └── MainActivity.kt │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── taskail │ │ │ └── simpleplacessearchdialog │ │ │ └── ExampleUnitTest.kt │ └── androidTest │ │ └── java │ │ └── com │ │ └── taskail │ │ └── simpleplacessearchdialog │ │ └── ExampleInstrumentedTest.kt ├── proguard-rules.pro └── build.gradle ├── googleplacessearchdialog ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable │ │ │ │ ├── white_background.xml │ │ │ │ ├── ic_search_black_24dp.xml │ │ │ │ └── ic_location_off_black_24dp.xml │ │ │ ├── values │ │ │ │ └── strings.xml │ │ │ └── layout │ │ │ │ ├── custom_expadable_list_item.xml │ │ │ │ └── dialog_simple_search.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── taskail │ │ │ │ └── googleplacessearchdialog │ │ │ │ ├── PlaceCallback.kt │ │ │ │ ├── SimplePlacesSearchDialogBuilder.kt │ │ │ │ ├── SimplePlacesSearchDialog.kt │ │ │ │ └── PlaceAutocompleteAdapter.kt │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── taskail │ │ │ └── googleplacessearchdialog │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── taskail │ │ └── googleplacessearchdialog │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── images └── image.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── gradlew.bat ├── README.md ├── gradlew └── LICENSE /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /googleplacessearchdialog/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':googleplacessearchdialog' 2 | -------------------------------------------------------------------------------- /images/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edTheGuy00/SimplePlacesSearchDialog/HEAD/images/image.png -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Simple Places Search Dialog 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edTheGuy00/SimplePlacesSearchDialog/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edTheGuy00/SimplePlacesSearchDialog/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edTheGuy00/SimplePlacesSearchDialog/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edTheGuy00/SimplePlacesSearchDialog/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edTheGuy00/SimplePlacesSearchDialog/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edTheGuy00/SimplePlacesSearchDialog/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edTheGuy00/SimplePlacesSearchDialog/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edTheGuy00/SimplePlacesSearchDialog/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edTheGuy00/SimplePlacesSearchDialog/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edTheGuy00/SimplePlacesSearchDialog/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edTheGuy00/SimplePlacesSearchDialog/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Jan 21 18:47:45 EST 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip 7 | -------------------------------------------------------------------------------- /googleplacessearchdialog/src/main/res/drawable/white_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /googleplacessearchdialog/src/main/java/com/taskail/googleplacessearchdialog/PlaceCallback.kt: -------------------------------------------------------------------------------- 1 | package com.taskail.googleplacessearchdialog 2 | 3 | import com.google.android.gms.location.places.Place 4 | 5 | /** 6 | *Created by ed on 1/21/18. 7 | */ 8 | interface PlaceCallback { 9 | 10 | fun onLoading(showLoading: Boolean) 11 | fun onPlaceSelected(place: Place) 12 | fun onNoResultsReturned() 13 | fun resultsReturned() 14 | fun onError() 15 | } -------------------------------------------------------------------------------- /googleplacessearchdialog/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Google Places Search Dialog 3 | Enter Location.... 4 | Enter City.... 5 | Enter Establishment.... 6 | Enter Address.... 7 | Nothing Found 8 | 9 | -------------------------------------------------------------------------------- /app/src/test/java/com/taskail/simpleplacessearchdialog/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.taskail.simpleplacessearchdialog 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /googleplacessearchdialog/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /googleplacessearchdialog/src/test/java/com/taskail/googleplacessearchdialog/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.taskail.googleplacessearchdialog; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /googleplacessearchdialog/src/main/res/drawable/ic_search_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /googleplacessearchdialog/src/main/res/drawable/ic_location_off_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | # Intellij 36 | *.iml 37 | .idea 38 | 39 | # Keystore files 40 | *.jks 41 | 42 | # External native build folder generated in Android Studio 2.2 and later 43 | .externalNativeBuild 44 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/taskail/simpleplacessearchdialog/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.taskail.simpleplacessearchdialog 2 | 3 | import android.support.test.InstrumentationRegistry 4 | import android.support.test.runner.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getTargetContext() 22 | assertEquals("com.taskail.simpleplacessearchdialog", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /googleplacessearchdialog/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /googleplacessearchdialog/src/androidTest/java/com/taskail/googleplacessearchdialog/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.taskail.googleplacessearchdialog; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.taskail.googleplacessearchdialog.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | apply plugin: 'kotlin-android' 4 | 5 | apply plugin: 'kotlin-android-extensions' 6 | 7 | android { 8 | compileSdkVersion 26 9 | defaultConfig { 10 | applicationId "com.taskail.simpleplacessearchdialog" 11 | minSdkVersion 14 12 | targetSdkVersion 26 13 | versionCode 1 14 | versionName "1.0" 15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 16 | } 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | 24 | } 25 | 26 | dependencies { 27 | implementation fileTree(dir: 'libs', include: ['*.jar']) 28 | 29 | implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" 30 | implementation 'com.android.support:appcompat-v7:26.1.0' 31 | implementation 'com.android.support.constraint:constraint-layout:1.0.2' 32 | implementation 'com.google.android.gms:play-services-places:11.8.0' 33 | 34 | implementation 'com.taskail:simple-places-search-dialog:1.0' 35 | testImplementation 'junit:junit:4.12' 36 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 37 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 38 | } 39 | -------------------------------------------------------------------------------- /googleplacessearchdialog/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'kotlin-android' 3 | 4 | ext { 5 | PUBLISH_GROUP_ID = 'com.taskail' 6 | PUBLISH_ARTIFACT_ID = 'simple-places-search-dialog' 7 | PUBLISH_VERSION = '1.0' 8 | } 9 | 10 | android { 11 | compileSdkVersion 26 12 | 13 | 14 | 15 | defaultConfig { 16 | minSdkVersion 14 17 | targetSdkVersion 26 18 | versionCode 1 19 | versionName "1.0" 20 | 21 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 22 | 23 | } 24 | 25 | buildTypes { 26 | release { 27 | minifyEnabled false 28 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 29 | } 30 | } 31 | 32 | } 33 | 34 | dependencies { 35 | implementation fileTree(dir: 'libs', include: ['*.jar']) 36 | 37 | compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 38 | 39 | implementation 'com.android.support:appcompat-v7:26.1.0' 40 | implementation 'com.android.support:recyclerview-v7:26.1.0' 41 | implementation 'com.android.support:design:26.1.0' 42 | implementation 'com.google.android.gms:play-services-places:11.8.0' 43 | testImplementation 'junit:junit:4.12' 44 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 45 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 46 | 47 | } 48 | 49 | apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle' -------------------------------------------------------------------------------- /app/src/main/java/com/taskail/simpleplacessearchdialog/JavaExample.java: -------------------------------------------------------------------------------- 1 | package com.taskail.simpleplacessearchdialog; 2 | 3 | import android.os.Bundle; 4 | import android.os.PersistableBundle; 5 | import android.support.annotation.Nullable; 6 | import android.support.v7.app.AppCompatActivity; 7 | import android.view.View; 8 | import android.widget.Button; 9 | 10 | import com.google.android.gms.location.places.Place; 11 | import com.taskail.googleplacessearchdialog.SimplePlacesSearchDialogBuilder; 12 | import com.taskail.googleplacessearchdialog.SimplePlacesSearchDialog; 13 | 14 | import org.jetbrains.annotations.NotNull; 15 | 16 | /** 17 | * Created by ed on 1/22/18. 18 | */ 19 | 20 | public class JavaExample extends AppCompatActivity { 21 | 22 | @Override 23 | public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) { 24 | super.onCreate(savedInstanceState, persistentState); 25 | 26 | Button searchBtn = findViewById(R.id.locationBtn); 27 | 28 | final SimplePlacesSearchDialog searchDialog = new SimplePlacesSearchDialogBuilder(this) 29 | .setLocationListener(new SimplePlacesSearchDialog.PlaceSelectedCallback() { 30 | @Override 31 | public void onPlaceSelected(@NotNull Place place) { 32 | 33 | } 34 | }).build(); 35 | 36 | searchBtn.setOnClickListener(new View.OnClickListener() { 37 | @Override 38 | public void onClick(View view) { 39 | searchDialog.show(); 40 | } 41 | }); 42 | 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/taskail/simpleplacessearchdialog/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.taskail.simpleplacessearchdialog 2 | 3 | import android.support.v7.app.AppCompatActivity 4 | import android.os.Bundle 5 | import com.google.android.gms.location.places.AutocompleteFilter 6 | import com.google.android.gms.location.places.Place 7 | import com.google.android.gms.maps.model.LatLng 8 | import com.google.android.gms.maps.model.LatLngBounds 9 | import com.taskail.googleplacessearchdialog.SimplePlacesSearchDialog 10 | import com.taskail.googleplacessearchdialog.SimplePlacesSearchDialogBuilder 11 | import kotlinx.android.synthetic.main.activity_main.* 12 | 13 | class MainActivity : AppCompatActivity() { 14 | 15 | override fun onCreate(savedInstanceState: Bundle?) { 16 | super.onCreate(savedInstanceState) 17 | setContentView(R.layout.activity_main) 18 | 19 | val MT_VIEW_CALIFORNIA = LatLngBounds(LatLng(37.398160, -122.180831), LatLng(37.430610, -121.972090)) 20 | 21 | 22 | locationBtn.setOnClickListener { 23 | SimplePlacesSearchDialogBuilder(this) 24 | //Filter for cities only 25 | .setResultsFilter(AutocompleteFilter.TYPE_FILTER_CITIES) 26 | // enter a custom hint 27 | .setSearchHint("Enter Location...") 28 | // enter bounds, Mountain View California in this case 29 | .setLatLngBounds(MT_VIEW_CALIFORNIA) 30 | //set the place selected callback 31 | .setLocationListener(object : SimplePlacesSearchDialog.PlaceSelectedCallback { 32 | override fun onPlaceSelected(place: Place) { 33 | 34 | placeName.text = place.name 35 | fullAddress.text = place.address 36 | lat.text = place.latLng.latitude.toString() 37 | lng.text = place.latLng.longitude.toString() 38 | } 39 | 40 | }) 41 | .build() 42 | .show() 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /googleplacessearchdialog/src/main/res/layout/custom_expadable_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 28 | 29 | 36 | 37 | 46 | 47 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 19 | 20 | 25 | 26 | 30 | 31 | 35 | 36 | 40 | 41 | 42 | 43 |