AkashG58 / AKPlacePicker

Custom place picker using google map

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AKPlacePicker

Custom place picker using google map(Image sample)

Download

How to

To get a Git project into your build:

Step 1. Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Step 2. Add the dependency

dependencies {
       implementation 'com.github.AkashG58:AKPlacePicker:1.0.0'
}

Hands on

Check the sample project for a full working example.

Java

Intent intent = new PlacePicker.IntentBuilder()
                .setGoogleMapApiKey("Your API Key")
                .setLatLong(18.520430, 73.856743)
                .setMapZoom(19.0f)
                .setAddressRequired(true)
                .setPrimaryTextColor(R.color.black)
                .build(this);
startActivityForResult(intent, Constants.PLACE_PICKER_REQUEST);


@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
       super.onActivityResult(requestCode, resultCode, data);
       if (requestCode == Constants.PLACE_PICKER_REQUEST) {
           if (resultCode == Activity.RESULT_OK && data != null) {
               AddressData addressData =  data.getParcelableExtra(Constants.ADDRESS_INTENT);
              // your code
           }
       }
}

License

AKPlacePicker is released under the MIT license. See LICENSE for details.

About

Custom place picker using google map

License:MIT License


Languages

Language:Java 100.0%