Example usage for android.app DialogFragment getDialog

List of usage examples for android.app DialogFragment getDialog

Introduction

In this page you can find the example usage for android.app DialogFragment getDialog.

Prototype

public Dialog getDialog() 

Source Link

Usage

From source file:org.openlmis.core.view.fragment.VIARequisitionFragmentTest.java

@Test
public void shouldShowSubmitSignatureDialog() {
    VIARequisitionFragment.showSignDialog(true);

    DialogFragment fragment = (DialogFragment) (VIARequisitionFragment.getActivity().getFragmentManager()
            .findFragmentByTag("signature_dialog"));

    assertThat(fragment).isNotNull();//w w  w .ja va 2 s . com

    Dialog dialog = fragment.getDialog();

    assertThat(dialog).isNotNull();

    String alertMessage = VIARequisitionFragment.getString(R.string.msg_via_submit_signature);
    assertThat(fragment.getArguments().getString("title")).isEqualTo(alertMessage);
}

From source file:org.openlmis.core.view.fragment.VIARequisitionFragmentTest.java

@Test
public void shouldShowApproveSignatureDialog() {
    VIARequisitionFragment.showSignDialog(false);

    DialogFragment fragment = (DialogFragment) (VIARequisitionFragment.getActivity().getFragmentManager()
            .findFragmentByTag("signature_dialog"));

    assertThat(fragment).isNotNull();/*from w  ww.j a  v a2  s. c  o m*/

    Dialog dialog = fragment.getDialog();

    assertThat(dialog).isNotNull();

    String alertMessage = VIARequisitionFragment.getString(R.string.msg_approve_signature_via);
    assertThat(fragment.getArguments().getString("title")).isEqualTo(alertMessage);
}

From source file:org.openlmis.core.view.fragment.VIARequisitionFragmentTest.java

@Test
public void shouldShowAlertDialogWhenPressedBack() {
    VIARequisitionFragment.onBackPressed();

    DialogFragment fragment = (DialogFragment) (VIARequisitionFragment.getActivity().getFragmentManager()
            .findFragmentByTag("back_confirm_dialog"));

    assertThat(fragment).isNotNull();//  ww  w  . j  av  a2s  .c  o  m

    AlertDialog dialog = (AlertDialog) fragment.getDialog();

    assertThat(dialog).isNotNull();
}

From source file:org.openlmis.core.view.fragment.VIARequisitionFragmentTest.java

@Test
public void shouldMessageNotifyDialog() {
    VIARequisitionFragment.showMessageNotifyDialog();

    DialogFragment fragment = (DialogFragment) (VIARequisitionFragment.getActivity().getFragmentManager()
            .findFragmentByTag("showMessageNotifyDialog"));

    assertThat(fragment).isNotNull();//from www  . j a  v  a 2 s .  c o  m

    AlertDialog dialog = (AlertDialog) fragment.getDialog();

    assertThat(dialog).isNotNull();
}

From source file:com.google.sample.devicelab.MainActivity.java

@Override
public void onDialogPositiveClick(DialogFragment dialog) {
    // User touched the dialog's positive button
    EditText idET = (EditText) dialog.getDialog().findViewById(R.id.idET);
    EditText numberET = (EditText) dialog.getDialog().findViewById(R.id.numberET);
    UserSettings.setAppEngineId(this, idET.getText().toString().trim());
    UserSettings.setAppEngineNumber(this, numberET.getText().toString().trim());
    if (!UserSettings.getAppEngineNumber(this).equals("")) {
        registerWithPush();/*ww w  . ja  va 2  s  .  co m*/
    }
    if (!UserSettings.getAppEngineId(this).equals("")) {
        new GAEIdVerifier(this).execute();
    }

    refreshUI();

}

From source file:org.opendatakit.survey.activities.MainMenuActivity.java

@Override
public void onBackPressed() {
    if ((currentFragment == ScreenList.WEBKIT) && getInstanceId() != null && getCurrentForm() != null
            && getCurrentForm().tableId != null) {

        // try to retrieve the active dialog
        DialogFragment dialog = (DialogFragment) getFragmentManager().findFragmentByTag(BACKPRESS_DIALOG_TAG);

        if (dialog != null && dialog.getDialog() != null) {
            // as-is
        } else {//from  w w  w  .  j  av  a  2s . co  m
            dialog = new BackPressWebkitConfirmationDialogFragment();
        }
        dialog.show(getFragmentManager(), BACKPRESS_DIALOG_TAG);
    } else {
        popBackStack();
    }
}