Skip to content

Commit

Permalink
Change variable name and value to follow naming standards
Browse files Browse the repository at this point in the history
  • Loading branch information
mahasadhu authored and rtchagas committed Mar 5, 2020
1 parent 6504967 commit 84916e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class PingPlacePicker private constructor() {
* Set whether the library should return the place coordinate retrieved from GooglePlace or the actual selected location from google map
*/
fun setShouldReturnActualLatLng(shouldReturnActualLatLng: Boolean): IntentBuilder {
intent.putExtra(PlacePickerActivity.IS_SHOULD_RETURN_ACTUAL_LATLNG, shouldReturnActualLatLng)
intent.putExtra(PlacePickerActivity.EXTRA_SHOULD_RETURN_ACTUAL_LATLNG, shouldReturnActualLatLng)
return this
}

Expand Down Expand Up @@ -105,7 +105,7 @@ class PingPlacePicker private constructor() {
companion object {

const val EXTRA_PLACE = "extra_place"
const val ACTUAL_SELECTED_LATLNG = "actual_selected_latlng"
const val EXTRA_ACTUAL_LATLNG = "extra_actual_latlng"

var androidApiKey: String = ""
var mapsApiKey: String = ""
Expand All @@ -121,7 +121,7 @@ class PingPlacePicker private constructor() {

@JvmStatic
fun getActualLatLng(intent: Intent): LatLng? {
return intent.getParcelableExtra(ACTUAL_SELECTED_LATLNG)
return intent.getParcelableExtra(EXTRA_ACTUAL_LATLNG)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class PlacePickerActivity : AppCompatActivity(), PingKoinComponent,

// For passing extra parameters to this activity.
const val EXTRA_LOCATION = "extra_location"
const val IS_SHOULD_RETURN_ACTUAL_LATLNG = "is_should_return_actual_latlng"
const val EXTRA_SHOULD_RETURN_ACTUAL_LATLNG = "extra_should_return_actual_latlng"

// Keys for storing activity state.
private const val STATE_CAMERA_POSITION = "state_camera_position"
Expand Down Expand Up @@ -204,11 +204,11 @@ class PlacePickerActivity : AppCompatActivity(), PingKoinComponent,
override fun onPlaceConfirmed(place: Place) {
val data = Intent()

if (intent.getBooleanExtra(IS_SHOULD_RETURN_ACTUAL_LATLNG, false)){
data.putExtra(PingPlacePicker.ACTUAL_SELECTED_LATLNG, selectedLatLng)
if (intent.getBooleanExtra(EXTRA_SHOULD_RETURN_ACTUAL_LATLNG, false)){
data.putExtra(PingPlacePicker.EXTRA_ACTUAL_LATLNG, selectedLatLng)
}
else {
data.putExtra(PingPlacePicker.ACTUAL_SELECTED_LATLNG, place.latLng)
data.putExtra(PingPlacePicker.EXTRA_ACTUAL_LATLNG, place.latLng)
}

data.putExtra(PingPlacePicker.EXTRA_PLACE, place)
Expand Down

0 comments on commit 84916e7

Please sign in to comment.