-
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
feat: Add Places AutoComplete for Search #1306
feat: Add Places AutoComplete for Search #1306
Conversation
@iamareebjamal Please Review |
when (requestCode) { | ||
LOCATION_PERMISSION_REQUEST -> { | ||
if (grantResults.isNotEmpty() && grantResults[0] == PackageManager.PERMISSION_GRANTED) { | ||
geoLocationViewModel.configure() | ||
} else { | ||
Snackbar.make(rootView, R.string.cannot_fetch_location, Snackbar.LENGTH_SHORT).show() | ||
Snackbar.make(rootView, R.string.cannot_fetch_location, Snackbar.LENGTH_SHORT) | ||
.show() |
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.
Unnecessary change
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.
I just ran Code Format , it did that automatically.
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.
Don't run auto format in PRs.
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.
Do I have to revert this change ?
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.
Yes
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.
ok will do it
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.
@ShridharGoel I have removed unnecessary changes . Please merge this
Great work. Ask your peers to review it first |
Thank you. And Would take care of this thing first |
Signed-off-by: thelimitbreaker <rohanmaityofficial@gmail.com>
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.
Action bar is missing in search fragment.
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { |
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.
Unnecessary changes.
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.
Umm . This is for better view of parameters used. Still don't want . I would revert it
A search bar should be there. Why you remove it? |
@liveHarshit there is search bar in the fragment itself . You could see in the gif . |
@liveHarshit , Autocomplete fragment itself give a back button . Having action bar for back button and fragment also showing backbutton will create UI confusion. |
@liveHarshit eventbrite uses Google's Autocomplete which would require Play services and show the results in custom layout. I could do that . But it won't work for f-droid (because of Play services) . |
I'm asking about the action bar in the search fragment, not in search location fragment. |
I have done no changes in SearchFragment.kt . You could see in |
One change reflects another. |
thisActivity.supportActionBar?.show() | ||
thisActivity.supportActionBar?.title = "" | ||
thisActivity.supportActionBar?.setDisplayHomeAsUpEnabled(true) | ||
thisActivity.supportActionBar?.hide() |
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.
Here you hide it in activity, not in the fragment, so you need to show it again in search 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.
Hmm , that for removing actionbar in SearchLocationFragment.kt.
Will have to enable the actionbar in onResume() of SearchFragment.kt
Thanks for pointing it out :) .will do it
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 onReasume, show it in onDestroyView of search location 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.
Yeah sorry . I forgot these are fragments. Will have to call this in onDestroyView
.
private fun checkLocationPermission() { | ||
val permission = | ||
ContextCompat.checkSelfPermission(requireContext(), Manifest.permission.ACCESS_COARSE_LOCATION) | ||
ContextCompat.checkSelfPermission(requireContext(), | ||
Manifest.permission.ACCESS_COARSE_LOCATION) |
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.
Unnecessary changes.
@@ -91,7 +81,42 @@ class SearchLocationFragment : Fragment() { | |||
Navigation.findNavController(rootView).popBackStack(fragmentId, false) | |||
} | |||
|
|||
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) { |
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.
Also change override method in MainActivity.
…android into feature/autocomplete-place
@liveHarshit I have updated it Removed unecessary changs and actionbar is also shown |
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.
Can you please update the GIF as well?
@@ -31,22 +31,19 @@ class SearchLocationFragment : Fragment() { | |||
private val geoLocationViewModel by viewModel<GeoLocationViewModel>() | |||
private val safeArgs: SearchLocationFragmentArgs by navArgs() | |||
|
|||
private val AUTOCOMPLETE_FRAG_TAG = "AutoComplete_Frag" |
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.
Declare it as constant.
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.
done
And what about it? |
I didn't change Override method then, It was syntax change, that was show,n back then . You could see in files changed |
Earlier you have removed |
The current location button at the bottom looks odd. Can you please add it at top of the list like google map. |
I mentioned this, It could not come in between, search bar and list. Alternate way is
F-Droid would still be left |
@iamareebjamal Your opinion? |
Seems fine if it is not our UI. It's less code to maintain. @liveHarshit Please approve if everything else is fine |
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.
LGTM
Resolve conflicts |
0010cf5
@iamareebjamal , after merging latest commits. New Voice button is added . But it was added for old layout. Now for adding autoplace frag. I might again have to change the layout . Could I do that ? |
Fixes #799
Changes:
Add MapBox Autocomplete Place View , as it doesn't need PlayServices
So work on both F-droid and PlayStore version :)
1.1) Changes done in the layout for Better UX
1.2) Also shows
Recents Location
Change in "Current Location" and change in place of Current Location
Because "Current Location button" could not come in between the AutoComplete Fragment
Added a custom Round background used in "Current Location Button"
For better and Nice UX
Change in the color of
ic_location_pin
and usedtint
to change the color where neededScreenshots for the change:
PlayStore
F-Droid
Update : Restore ActionBar