This is a module for accessing Native Android AutoCompleteTextView.
Note : Please note that this module has been written based on one particular project requirement. It might not have support of special functionalities you want. In such cases feel free to open an issue. I will add the support at earliest.
If anyone would like to help me maintain this repo, then that would be a great help to me. Please reach me out on Hangout. My gmail id is rajsuvariya@gmail.com
npm install autocompletetextview --save
. include ':autocompletetextview'
project(':autocompletetextview').projectDir = file("../node_modules/autocompletetextview/android")
dependencies {
compile project(':autocompletetextview')
...
}
Open MainApplication or ReactApplication located at android/app/src/main/java/com/<your package name>/
and add following packager
new RNAutocompletetextviewPackage()
like this
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RNAutocompletetextviewPackage()
);
}
and import the following dependency
import com.reactlibrary.RNAutocompletetextviewPackage;
import { AutoCompleteTextView } from 'autocompletetextview';
render() {
...
<AutoCompleteTextView
style={{ flex: 1, flexDirection: 'row', height: 60, alignSelf: 'stretch' }}
dataSource={["Bangalore", "Pune", "Delhi", "Goa"]}
onTextChange = {(text)=>console.log(text)}
showDropDown = {true}
hint = "Your Hint"
/>
...
}
react-native run-android
command