-
Notifications
You must be signed in to change notification settings - Fork 551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added:Google PlaceAutocomplete #801
Added:Google PlaceAutocomplete #801
Conversation
@iamareebjamal please review |
app/build.gradle
Outdated
@@ -102,6 +106,8 @@ dependencies { | |||
testImplementation "androidx.room:room-testing:${roomVersion}" | |||
implementation "com.takisoft.fix:preference-v7:28.0.0.0" | |||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | |||
implementation 'com.google.android.gms:play-services-places:16.0.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Read comments from this PR - #735
@iamareebjamal i need to disable the search functionality for F-Droid application right? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build will fail because you didn't handle the case of what happens in the Fdroid build.
// Do your search | ||
searchLocationViewModel.saveSearch(query) | ||
val autocompleteFragment = fragmentManager | ||
.findFragmentById(R.id.place_autocomplete_fragment) as PlaceAutocompleteFragment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use synthetic binding
<androidx.appcompat.widget.SearchView | ||
android:id="@+id/search" | ||
<fragment | ||
android:id="@+id/place_autocomplete_fragment" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Camel case
@nikit19 i will handle the case for f- droid but if i use playStoreImplementation i'm not able to import the classes required? what's the solution to that |
What do you mean by handle the case for Fdroid? You can use those imports only in the playstore flavor. Please read about build flavors, you will get a better understanding of how to handle this case. |
@nikit19 i meant that if the build type if of play store then only I'll do this process otherwise we can do the previous method |
Yes, but you are not doing that in the code. Try building the project for the playstore flavor, the build will complete. Right now you are implementing the places API only in the playstore flavor but importing it in both the flavors. |
@nikit19 @iamareebjamal this is correct method i guess ? |
@iamareebjamal can you look at the Travis error i don't find any reason for it to fail |
The fix is literally written below the error https://travis-ci.com/fossasia/open-event-android/builds/96083368 |
|
@iamareebjamal codacy issues are regarding unsafe cast rest all is good i think ? |
@@ -24,7 +24,6 @@ class SearchLocationActivity : AppCompatActivity() { | |||
this.supportActionBar?.title = "" | |||
val bundle = intent.extras | |||
val fromSearchFragment = bundle?.getBoolean(FROM_SEARCH) ?: false | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not required
autocompleteFragment.setOnPlaceSelectedListener(object : PlaceSelectionListener { | ||
override fun onPlaceSelected(place: Place) { | ||
// Save Searched Place String | ||
searchLocationViewModel.saveSearch(place.name as String) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.toString()
would work?
@nikit19 i made two different files for f-droid and play store but github is only showing one file but it is actually two seperate files |
Fixes #799
Changes: Added Google PlaceAutocomplete for searching events
Screenshots for the change: