NativeUI Class | Description |
nUIConstants | Use the following integers to represent the directionality: TEXT_DIRECTION_LTR for left-to-right directionality TEXT_DIRECTION_RTL for right-to-left directionality |
nUIController | Use the following methods to control the global behavior of the application: deviceSupportsAppDirectionality() method The deviceSupportsAppDirectionality() method indicates whether the platform supports a specified directionality at run time. The method returns true if the platform supports the directionality or false if it does not. The method might return false for one of the following reasons: Directionality support for the platform was unavailable through the NativeUI system at the current time. The device’s locale settings do not allow a directionality change at the current time. The platform does not support the directionality due to other platform-specific issues. |
void setAppDirectionality(int direction) method Use the void setAppDirectionality(int direction) method to set the directionality. For direction, specify either TEXT_DIRECTION_RTL for right-to-left or TEXT_DIRECTION_LTR for left-to-right. After changing the directionality, the getAppDirectionality() method immediately reflects the new direction. During the next UI update, the class that extends MDApplication will be notified with the new direction. Note: You can override the MDApplication.appDirectionalityChanged() in your MDApplication class if you need to handle changes in the application directionality. Because your initial Canvas class already extends CanvasNativeUI, you do not have to use a separate class to override this function. | |
getAppDirectionality() method The getAppDirectionality() method returns the application’s current global directionality setting, either TEXT_DIRECTION_LTR or TEXT_DIRECTION_RTL. | |
nUITableElement | Use the following methods to manage the directionality within a nUITableElement NativeUI object: Use the setIgnoreDirectionality() method to have the NativeUI system ignore the application’s current directionality setting. If an application’s directionality is set to right-to-left, by default, the table’s column order is reversed. If you do not want the columns reversed, use this method to ignore the directionality setting for the table columns. For example, you might want this if the table contains images that you want displayed in a specific order regardless of the application’s directionality. Use the getIgnoreDirectionality() method to determine whether the application directionality will affect the ordering of columns within the table. The method returns true if column ordering will be affected by the application directionality or false if column ordering will not be affected. |
Platform | Notes |
Android | Android version 11 and higher support right-to-left directionality. The nUICheckboxButton, nUIRadioCheckbox, and nUIDropdownlistEntry NativeUI objects display using left-to-right directionality. Additionally, non-custom dialog boxes, that is, those created using the nUIAlertDialog NativeUI object, might also retain left-to-right alignments. |
iOS | The following NativeUI objects display using left-to-right directionality. nUICheckboxButton nUIDropdownlistEntry nUIRadioCheckbox nUINavView The buttons within a nUIDialogWindow NativeUI object display using a left-to-right directionality. |
J2ME (Phoney) | The NativeUI system attempts to provide directionality features similar to those that other platforms provide. In general, the NativeUI system makes the functionality align with that provided by Android and iOS. |