Readonly
localeReadonly
getGet current layout direction.
3.1.3
Readonly
packageApplication package name.
0.1
This method checks for a permission is shown before to user and the program is about to request the same permission again
shouldShowRequestPermissionRationale
1.2
Optional
navigationThis lets you determine the navigation bar of the phone(the bar which usually has native back button and app switch) Works for Android 8.0 and above. Some phones might not have this.
This function checks if one of the dangerous permissions is granted at beginning or not. For android versions earlier than 6.0, it will return value exists in manifest or not. For permissions in same category with one of the permissions is approved earlier, checking will return as it is not required to request for the same category permission.
checkPermission
1.2
With requestPermissions, the System Dialog will appear to ask for permission grant by user for dangerous(privacy) permissions. Application.android#onRequestPermissionsResult onRequestPermissionsResult will be fired after user interact with permission dialog.
import Application from '@smartface/native/application';
const PERMISSION_CODE = 1002;
Application.android.requestPermissions(PERMISSION_CODE, Application.Android.Permissions.WRITE_EXTERNAL_STORAGE)
Application.android.onRequestPermissionsResult = (e) => {
console.log(JSON.stringify(e));
}
requestPermissions
1.2
This number will be returned in Application.android.onRequestPermissionsResult onRequestPermissionsResult when the user give permission or not.
Set the configure the native theme.
setAppTheme
4.0.2
Triggered when user press back key. The default implementation finishes the application, but you can override this to do whatever you want.
onBackButtonPressed
3.2.0
import Application from '@smartface/native/application';
Application.on(Application.Events.backButtonPressed, () => {
console.info('onBackButtonPressed');
});
Called to process touch screen events. You can assign callback to intercept all touch screen events before they are dispatched to the window (except independent windows like dialog and etc.). Be sure to call this implementation for touch screen events that should be handled normally. Callback might be fired several times.
import Application from '@smartface/native/application';
Application.android.dispatchTouchEvent = () => {
return true; //Consume all touches & do not pass to window
}
@event dispatchTouchEvent
4.0.3
This event is called after Application.requestPermissions function. This event is fired asynchronous way, there is no way to make sure which request is answered.
1.2 onRequestPermissionsResult
Use Permissions.android.onRequestPermissionsResult instead
1.2
Will return array if permission request is multiple.
Generated using TypeDoc
Set/Get the layout direction from a Locale.
Property
Android
Since
3.1.3