Citypicker
Now use more of the city selection interface like the American group and other apps.
2 steps can be achieved, it is so simple rough!
gifimageapk
Download the demo.apk experience.
Install
Gradle:
‘com.zaaach:citypicker:1.1‘
or Maven:
<dependency> <groupId>com.zaaach</groupId> <artifactId>citypicker</artifactId> <version>1.1</version> <type>pom</type></dependency>
or download the Library manual import.
Usage
CityPicker
itself has introduced the German Map positioning SDK.
Step1:
manifest.xml
Add the key for the development platform application in your project
<meta-data android:name="com.amap.api.v2.apikey" android:value="your key"/>
Also need to addCityPickerActivity
<activity android:name="com.zaaach.citypicker.CityPickerActivity" android:theme="@style/CityPicker.NoActionBar" android:screenOrientation="portrait" android:windowSoftInputMode="stateHidden|adjustPan"/>
Step2
PrivateStaticFinalint request_code_pick_city =0; //start Startactivityforresult (new Intent (MainActivity.this, Citypickeractivity.class), request_code_pick_city); //override Onactivityresult method @Override protected void onActivityResult< Span class= "Hljs-params" > (int Requestcode, int ResultCode, Intent data) {if (Requestcode = request_code_pick_city && ResultCode = = RESULT_OK) { if (data! = null) {String city = Data.getstringextra ( citypickeractivity.key_picked_city); Resulttv.settext ( "current selection:" + City);}}
STEP3:
Enjoy it.
Proguard
Attention confusion
//定位-keep class com.amap.api.location.**{*;}-keep class com.amap.api.fence.**{*;}-keep class com.autonavi.aps.amapapi.model.**{*;}
GitHub
GitHub Address: Citypicker Welcome star~
Bro0cl
Links: https://www.jianshu.com/p/b469c6f02754
Source: Pinterest
The copyright of the book is owned by the author, and any form of reprint should be contacted by the author for authorization and attribution.
"Android Open Source Library" app City selection