INNER CODE UNIT · Java

onSelection

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

                public void onSelection(MaterialDialog materialDialog, View view, int i, CharSequence charSequence) {
                    if (!mCallbackConsumed) {
                        mCallbackConsumed = true;
                        callback.invoke("itemsCallback", i, materialDialog.isPromptCheckBoxChecked());
                    }
                }
            });
        }

        if (options.hasKey("itemsCallbackSingleChoice")) {
            // Check if there is a preselected index
            int selectedIndex = options.hasKey("selectedIndex") ? options.getInt("selectedIndex") : -1;
            mBuilder.itemsCallbackSingleChoice(selectedIndex, new MaterialDialog.ListCallbackSingleChoice() {
                @Override
                public boolean onSelection(MaterialDialog materialDialog, View view, int i, CharSequence charSequence) {
                    if (!mCallbackConsumed) {
                        mCallbackConsumed = true;
                        charSequence = charSequence == null ? "" : charSequence;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…