INNER CODE UNIT · Java

applyOptions

react-native-dialogs/react-native-dialogs · android/src/main/java/com/aakashns/reactnativedialogs/modules/DialogAndroid.java:46

    private MaterialDialog.Builder applyOptions(MaterialDialog.Builder builder, ReadableMap options) throws InvocationTargetException, IllegalAccessException, NoSuchMethodException {
        ReadableMapKeySetIterator iterator = options.keySetIterator();
        while(iterator.hasNextKey()) {
            String key = iterator.nextKey();

            switch (key) {
                case "title":
                    builder.title(options.getString("title"));
                    break;
                case "content":
                    if(options.hasKey("contentIsHtml") && options.getBoolean("contentIsHtml")) {
                        // // i have no idea how to get this to work, it seems its all api level 24 stuff
                        // // requires buildToolsVersion >= "24.0.1"
                        // if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
                        //     builder.content(Html.fromHtml(options.getString("content"), Html.FROM_HTML_MODE_LEGACY | Html.FROM_HTML_MODE_COMPACT));
                        // } else {
                        //     builder.content(Html.fromHtml(options.getString("content"), Html.FROM_HTML_MODE_COMPACT));
                        // }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…