/**
* Function toastandroid (used to display a hover message on Android device)
* */
ImportReact,{purecomponent} from' react '
Import{view,text,touchableopacity,toastandroid} from' react-native '
classVibrationfunctionextendspurecomponent {
Render() {
return(
<View>
<Touchableopacity
onpress={() = toastandroid.Show(' I am the information of the hover window ',20000)}
style={{Height: -,BackgroundColor:' #0f0 ',Borderradius: -,margintop: -,justifycontent:' Center ',Alignitems:' Center '}}
>
<View>
<Textstyle={{textAlign:' Center '}}>Hover tip information (toastandroid)</Text>
</View>
</touchableopacity>
<touchableopacity
onpress={() = toastandroid.showwithgravity(' I am the information of the hover window ',10000, Toastandroid.LONG, Toastandroid.TOP)}
style={{Height: -,BackgroundColor:' #0f0 ',Borderradius: -,margintop: -,justifycontent:' Center ',Alignitems:' Center '}}
>
<View>
<Textstyle={{textAlign:' Center '}}>Hover Tip Top (toastandroid)</Text>
</View>
</touchableopacity>
<touchableopacity
onpress={() = toastandroid.showwithgravity(' I am the information of the hover window ', Toastandroid. Short, Toastandroid.BOTTOM)}
style={{Height: -,BackgroundColor:' #0f0 ',Borderradius: -,margintop: -,justifycontent:' Center ',Alignitems:' Center '}}
>
<View>
<Textstyle={{textAlign:' Center '}}>Suspension of Information Bottom (toastandroid)</Text>
</View>
</touchableopacity>
<touchableopacity
onpress={() = toastandroid.showwithgravity(' I am the information of the hover window ', Toastandroid. Short, Toastandroid.CENTER)}
style={{Height: -,BackgroundColor:' #0f0 ',Borderradius: -,margintop: -,justifycontent:' Center ',Alignitems:' Center '}}
>
<View>
<Textstyle={{textAlign:' Center '}}>Hover Tip Information Center (toastandroid)</Text>
</View>
</touchableopacity>
</View>
);
}
}
Export DefaultVibrationfunction;
/***
*
*
* This module exports the native Toastandroid module as a JS module for displaying a hover message on an Android device. This module contains a show method that accepts the following parameters:
String message: A string that represents the text content that will be displayed.
int Duration: The time at which the message continues to be displayed. It could be toastandroid.short or Toastandroid.long.
There is also a method named Showwithgravity that specifies where to eject. Available options are: Toastandroid.top, Toastandroid.bottom, Toastandroid.center.
Usage Examples:
//method
Static Show (message:string, Duration:number)
Display (Message: String, Duration: number)
static showwithgravity (message, duration, gravity)
showwithgravity (message, duration, location)
Properties
short:memberexpression
long:memberexpression
Time Constants
top:memberexpression
//Top
bottom:memberexpression
//Bottom
center:memberexpression
//Middle
//Position constant
* ***/
function share (used to open a dialog box on an Android device to share or send text content)
Example and description of function toastandroid in react native