-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
377 additions
and
105 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
app/src/main/java/com/uipep/android/searchplaces/ExampleLocationSearch.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.uipep.android.searchplaces | ||
|
||
import android.app.Activity | ||
import android.content.Intent | ||
import android.os.Bundle | ||
import android.support.v7.app.AppCompatActivity | ||
import android.util.Log | ||
import android.widget.Button | ||
import com.oneclickaway.opensource.placeautocomplete.api.bean.place_details.PlaceDetails | ||
import com.oneclickaway.opensource.placeautocomplete.components.StatusCodes | ||
import com.oneclickaway.opensource.placeautocomplete.ui.SearchPlaceActivity | ||
|
||
class ExampleLocationSearch : AppCompatActivity() { | ||
|
||
lateinit var searchLocationBtn : Button | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_example_location_search) | ||
|
||
searchLocationBtn = findViewById(R.id.searchLocationBTN) | ||
|
||
searchLocationBtn.setOnClickListener{ | ||
startActivityForResult(Intent(this, SearchPlaceActivity::class.java), 700) | ||
} | ||
|
||
} | ||
|
||
|
||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { | ||
super.onActivityResult(requestCode, resultCode, data) | ||
|
||
if (requestCode == 700 && resultCode == Activity.RESULT_OK){ | ||
|
||
val placeDetails = data?.getParcelableExtra<PlaceDetails>(StatusCodes.PLACE_DATA) | ||
|
||
Log.i(javaClass.simpleName, "onActivityResult: ${placeDetails?.name} ${placeDetails?.geometry?.location} ") | ||
} | ||
} | ||
} |
7 changes: 0 additions & 7 deletions
7
app/src/main/java/com/uipep/android/searchplaces/components/StatusCodes.kt
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
app/src/main/res/layout/activity_example_location_search.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".ExampleLocationSearch"> | ||
|
||
|
||
<Button | ||
android:text="@string/enter_location" | ||
android:id="@+id/searchLocationBTN" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"/> | ||
|
||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
apply plugin: 'com.android.library' | ||
apply plugin: 'kotlin-android-extensions' | ||
apply plugin: 'kotlin-android' | ||
apply plugin: 'kotlin-kapt' | ||
|
||
|
||
android { | ||
compileSdkVersion 28 | ||
|
||
defaultConfig { | ||
minSdkVersion 15 | ||
targetSdkVersion 28 | ||
versionCode 1 | ||
versionName "1.0" | ||
|
||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
|
||
} | ||
|
||
|
||
dataBinding { | ||
enabled = true | ||
} | ||
|
||
androidExtensions { | ||
experimental = true | ||
features = ["parcelize"] | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
|
||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
|
||
} | ||
|
||
dependencies { | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | ||
|
||
implementation "org.jetbrains.kotlin:kotlin-android-extensions-runtime:$kotlin_version" | ||
|
||
implementation 'com.android.support:appcompat-v7:28.0.0' | ||
implementation 'com.android.support.constraint:constraint-layout:1.1.3' | ||
testImplementation 'junit:junit:4.12' | ||
androidTestImplementation 'com.android.support.test:runner:1.0.2' | ||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' | ||
|
||
/*REST Api Libraries*/ | ||
implementation "com.squareup.okhttp3:okhttp:$rootProject.okhttp3Version" | ||
implementation "com.squareup.retrofit2:retrofit:$rootProject.retrofitVersion" | ||
|
||
implementation "com.squareup.okhttp3:logging-interceptor:$rootProject.loggingInterceptor" | ||
implementation "com.squareup.retrofit2:converter-gson:$rootProject.gsonVersion" | ||
implementation "com.android.support:recyclerview-v7:$rootProject.recyclerViewVersion" | ||
|
||
|
||
/*RXAndroid and RXJava*/ | ||
implementation "io.reactivex.rxjava2:rxandroid:$rootProject.rxAndroid" | ||
implementation "io.reactivex.rxjava2:rxjava:$rootProject.rxJava" | ||
|
||
/*Rx Binding*/ | ||
implementation "com.jakewharton.rxbinding2:rxbinding:$rootProject.rxBindingVersion" | ||
implementation "com.squareup.retrofit2:adapter-rxjava2:$rootProject.rxRoomVersion" | ||
|
||
|
||
/*life cycle components android jetpack*/ | ||
implementation "android.arch.lifecycle:extensions:$rootProject.archVersion" | ||
kapt "android.arch.lifecycle:compiler:$rootProject.archVersion" | ||
testImplementation "android.arch.core:core-testing:$rootProject.archVersion" | ||
|
||
// https://mvnrepository.com/artifact/javax.annotation/jsr250-api | ||
implementation group: 'javax.annotation', name: 'jsr250-api', version: '1.0' | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | ||
|
||
} | ||
repositories { | ||
mavenCentral() | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# 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 *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
26 changes: 26 additions & 0 deletions
26
...droidTest/java/com/oneclickaway/opensource/placeautocomplete/ExampleInstrumentedTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.oneclickaway.opensource.placeautocomplete; | ||
|
||
import android.content.Context; | ||
import android.support.test.InstrumentationRegistry; | ||
import android.support.test.runner.AndroidJUnit4; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
*/ | ||
@RunWith(AndroidJUnit4.class) | ||
public class ExampleInstrumentedTest { | ||
@Test | ||
public void useAppContext() { | ||
// Context of the app under test. | ||
Context appContext = InstrumentationRegistry.getTargetContext(); | ||
|
||
assertEquals("com.oneclickaway.opensource.placeautocomplete.test", appContext.getPackageName()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.oneclickaway.opensource.placeautocomplete"> | ||
|
||
<application> | ||
<activity android:name=".ui.SearchPlaceActivity"/> | ||
</application> | ||
|
||
</manifest> |
2 changes: 1 addition & 1 deletion
2
...d/searchplaces/api/base/RESTAPIManager.kt → ...ceautocomplete/api/base/RESTAPIManager.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
...d/searchplaces/api/base/SearchPlaceApi.kt → ...ceautocomplete/api/base/SearchPlaceApi.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.