Closed Noitidart closed 6 years ago
May you please elaborate on how to copy the files as you suggested in the readme. I can't figure out how to copy the files correctly :(
Step 1: go to autocompletetextview/android/app/src/main/java/com/autocompletetextview/ and copy all three files and paste it inside
Step 2: go to MyReactActivity.java in your project and add this .addPackage(new AutoCompleteTextViewPackager()) like below
mReactRootView = new ReactRootView(this);
mReactInstanceManager = ReactInstanceManager.builder()
.setApplication(getApplication())
.setBundleAssetName("index.android.bundle")
.setJSMainModuleName("index.android")
.addPackage(new MainReactPackage())
.addPackage(new AutoCompleteTextViewPackager())
.setUseDeveloperSupport(BuildConfig.DEBUG)
.setInitialLifecycleState(LifecycleState.RESUMED)
.build();
Step 3: now copy src/AutoCompleteTextView.js in your project and that should be it.
Let me know in case of any issues
Thank you sir very much! Will test now! Especially for asking for me to share how it goes! Much appreciated sir will let you know.
Hi @rajsuvariya - the copying was a bit different for latest RN, im submitting a PR for it right now.
I got it imported succesfully but I'm not able to figure out how to use the component. When I do the following:
import React, { Component } from 'react';
import { Text, View } from 'react-native';
import AutoCompleteTextView from './AutoCompleteTextView'
export default class App extends Component {
state = {
value: ''
}
render() {
const { value } = this.state;
return (
<View style={{ flex:1, justifyContent:'center', alignItems:'center'}}>
<AutoCompleteTextView dataSource={['cat', 'dog', 'tiger']} value={value} onTextChange={this.handleTextChange} />
</View>
);
}
handleTextChange = value => console.log('value:', value);
}
I get red box error of:
"Error while updating property 'value' of a view managed by: RCTAutoCompleteTextView
null
android.support.v7.internal.widget.TintContextWrapper cannot be cast to com.facebook.react.bridge.ReactContext
I totally failed. I tried again at fixing this all up. I gave up for now and posted asking for help - https://www.reddit.com/r/reactnative/comments/82wobr/help_complete_native_android_autocompletetextview/
I understand your situation. If you are able to use it via copy paste method then leave the fixing part of this repo. As already stated I am not getting time from my usual routine to fix this repo. Once I will get some free time I will look into this repo on priority.
Oh wow does this repo work if copy pasted? That would be so awesome. I'm in dire need of this. Would you be available to take a screen record of copying? Or I am comfortable with teamviewer remote session if you are, you can connect to me, if you are ok with it?
Hi @Noitidart check out this branch. https://github.com/rajsuvariya/autocompletetextview/tree/development
I have solved almost all the issues. Follow the installation guide and let me know in case of any issues.
No way!!! Thank you sir! Trying right away!
This is fixed now so I am closing it
Hi there,
I'm not sure how to get this to work. I did
npm i rajsuvariya/autocompletetextview
so it install from Github instead of npm, as i saw the warning in the readme.I then did
react-native link autocompletetextview
however when I do react-native run-android I get this error:May you please advise, I have been long lookig for this module and so have others:
https://www.reddit.com/r/reactnative/comments/76ztf5/android_native_autocompletetextview_on_rn/
I have no java experience, I'm just a javascrpt guy. May you please elaborate on how to copy the files as you suggested in the readme?