FileDocCategorySizeDatePackage
AndroidBidi_Delegate.javaAPI DocAndroid 5.1 API2184Thu Mar 12 22:22:44 GMT 2015android.text

AndroidBidi_Delegate

public class AndroidBidi_Delegate extends Object
Delegate used to provide new implementation for the native methods of {@link AndroidBidi} Through the layoutlib_create tool, the original methods of AndroidBidi have been replaced by calls to methods of the same name in this delegate class.

Fields Summary
Constructors Summary
Methods Summary
static intrunBidi(int dir, char[] chars, byte[] charInfo, int count, boolean haveInfo)


        switch (dir) {
        case 0: // Layout.DIR_REQUEST_LTR
            dir = Bidi.LTR;
            break;
        case 1: // Layout.DIR_REQUEST_RTL
            dir = Bidi.RTL;
            break;
        case -1: // Layout.DIR_REQUEST_DEFAULT_RTL
            dir = Bidi.LEVEL_DEFAULT_RTL;
            break;
        case -2: // Layout.DIR_REQUEST_DEFAULT_LTR
            dir = Bidi.LEVEL_DEFAULT_LTR;
            break;
        default:
            // Invalid code. Log error, assume LEVEL_DEFAULT_LTR and continue.
            Bridge.getLog().error(LayoutLog.TAG_BROKEN, "Invalid direction flag", null);
            dir = Bidi.LEVEL_DEFAULT_LTR;
        }
        Bidi bidi = new Bidi(chars, 0, null, 0, count, dir);
        if (charInfo != null) {
            for (int i = 0; i < count; ++i)
            charInfo[i] = bidi.getLevelAt(i);
        }
        return bidi.getParaLevel();