place search dialog
1.0.0
결과를 찾기 위해 Google의 장소 API를 사용하는 장소 자동완성 검색 대화상자입니다.
대화 상자는 전 세계의 위치를 검색합니다. 이를 맞춤설정하려면 .setLatLngBounds(BOUNDS)
사용하여 새 위치 경계를 설정하세요.
PlaceSearchDialog에는 Google의 Places API 키가 필요합니다. 여기에서 얻을 수 있습니다.
대화상자를 그대로 사용하세요.
PlaceSearchDialog placeSearchDialog = new PlaceSearchDialog . Builder ( this )
. setLocationNameListener ( new PlaceSearchDialog . LocationNameListener () {
@ Override
public void locationName ( String locationName ) {
//set textview or edittext
}
})
. build ();
placeSearchDialog . show ();
또는 그에 따라 사용자 정의
PlaceSearchDialog placeSearchDialog = new PlaceSearchDialog . Builder ( this )
. setHeaderImage ( R . drawable . dialog_header )
. setHintText ( "Enter location name" )
. setHintTextColor ( R . color . light_gray )
. setNegativeText ( "CANCEL" )
. setNegativeTextColor ( R . color . gray )
. setPositiveText ( "SUBMIT" )
. setPositiveTextColor ( R . color . red )
. setLatLngBounds ( BOUNDS )
. setLocationNameListener ( new PlaceSearchDialog . LocationNameListener () {
@ Override
public void locationName ( String locationName ) {
//set textview or edittext
}
})
. build ();
placeSearchDialog . show ();
애플리케이션 AndroidManifest.xml에 이를 추가하세요.
< meta-data android : name = " com.google.android.geo.API_KEY "
android : value = " YOUR_API_KEY " />
앱의 build.gradle 파일에서 종속성으로 사용하세요.
dependencies {
compile ' com.codemybrainsout.placesearchdialog:placesearch:1.0.1 '
}
aar 아카이브를 지원하는 android-maven-plugin 버전이 있는지 확인하고 다음 종속성을 추가하세요.
< dependency >
< groupId >com.codemybrainsout.placesearchdialog</ groupId >
< artifactId >placesearch</ artifactId >
< version >1.0.0</ version >
< type >pom</ type >
</ dependency >
이 프로젝트는 Code My Brains Out 에 의해 시작되었습니다. 이슈를 제출하거나 이 저장소를 포크하고 끌어오기 요청을 보내 이 프로젝트에 기여할 수 있습니다.
우리를 팔로우하세요:
저자: 라훌 준자
Copyright (C) 2016 Code My Brains Out
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.