Java Code Examples for android.app.DialogFragment#dismiss()

The following examples show how to use android.app.DialogFragment#dismiss() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CustomKeysActivity.java    From kboard with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onDialogPositiveClick(DialogFragment dialog, int index) {
    TextView t = dialog.getDialog().findViewById(R.id.word);
    String text = t.getText().toString();
    if(text.length() > 0) {
        if (index >= 0) {
            adapter.set(index, t.getText().toString());
        } else {
            adapter.add(t.getText().toString());

        }
    }
    dialog.dismiss();
}
 
Example 2
Source File: FragmentContainerActivity.java    From SecondScreen with Apache License 2.0 5 votes vote down vote up
@Override
public void dismissKeepOverscanDialog() {
    if(getFragmentManager().findFragmentByTag("keep-overscan") != null) {
        DialogFragment keepOverscanFragment = (DialogFragment) getFragmentManager().findFragmentByTag("keep-overscan");
        keepOverscanFragment.dismiss();
    }
}
 
Example 3
Source File: MainActivity.java    From SecondScreen with Apache License 2.0 5 votes vote down vote up
@Override
public void onUpgradeDialogNegativeClick(DialogFragment dialog) {
    dialog.dismiss();
    U.checkForUpdates(this);

    SharedPreferences prefMain = U.getPrefMain(this);
    SharedPreferences.Editor editor = prefMain.edit();
    editor.putFloat("current_api_version_new", U.getCurrentApiVersion());
    editor.apply();
}
 
Example 4
Source File: MainActivity.java    From SecondScreen with Apache License 2.0 5 votes vote down vote up
@Override
public void onUpgradeDialogPositiveClick(DialogFragment dialog) {
    dialog.dismiss();

    SharedPreferences prefMain = U.getPrefMain(this);
    SharedPreferences.Editor editor = prefMain.edit();
    editor.putFloat("current_api_version_new", U.getCurrentApiVersion());
    editor.apply();
}
 
Example 5
Source File: CustomKeysActivity.java    From kboard with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onDialogNegativeClick(DialogFragment dialog, int index) {
    if(index > 0) {
        adapter.remove(index);
    }
    dialog.dismiss();
}
 
Example 6
Source File: SyncCustomizationFragment.java    From 365browser with Apache License 2.0 5 votes vote down vote up
private void closeDialogIfOpen(String tag) {
    FragmentManager manager = getFragmentManager();
    if (manager == null) {
        // Do nothing if the manager doesn't exist yet; see http://crbug.com/480544.
        return;
    }
    DialogFragment df = (DialogFragment) manager.findFragmentByTag(tag);
    if (df != null) {
        df.dismiss();
    }
}
 
Example 7
Source File: CustomKeysActivity.java    From kboard with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onDialogNegativeClick(DialogFragment dialog, int index) {
    if(index > 0) {
        adapter.remove(index);
    }
    dialog.dismiss();
}
 
Example 8
Source File: CustomKeysActivity.java    From kboard with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onDialogPositiveClick(DialogFragment dialog, int index) {
    TextView t = dialog.getDialog().findViewById(R.id.word);
    String text = t.getText().toString();
    if(text.length() > 0) {
        if (index >= 0) {
            adapter.set(index, t.getText().toString());
        } else {
            adapter.add(t.getText().toString());

        }
    }
    dialog.dismiss();
}
 
Example 9
Source File: SyncCustomizationFragment.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
private void closeDialogIfOpen(String tag) {
    FragmentManager manager = getFragmentManager();
    if (manager == null) {
        // Do nothing if the manager doesn't exist yet; see http://crbug.com/480544.
        return;
    }
    DialogFragment df = (DialogFragment) manager.findFragmentByTag(tag);
    if (df != null) {
        df.dismiss();
    }
}
 
Example 10
Source File: SyncCustomizationFragment.java    From delion with Apache License 2.0 5 votes vote down vote up
private void closeDialogIfOpen(String tag) {
    FragmentManager manager = getFragmentManager();
    if (manager == null) {
        // Do nothing if the manager doesn't exist yet; see http://crbug.com/480544.
        return;
    }
    DialogFragment df = (DialogFragment) manager.findFragmentByTag(tag);
    if (df != null) {
        df.dismiss();
    }
}
 
Example 11
Source File: MainActivity.java    From RoMote with Apache License 2.0 4 votes vote down vote up
@Override
public void onDialogCancelled(DialogFragment dialog) {
    dialog.dismiss();
}
 
Example 12
Source File: MainActivity.java    From RoMote with Apache License 2.0 4 votes vote down vote up
@Override
public void onInstallSelected(DialogFragment dialog) {
    dialog.dismiss();
}
 
Example 13
Source File: GenericProgressDialogFragment.java    From United4 with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Dismisses the current dialog
 * @param fragmentManager the manager used to find the fragment to dismiss
 */
public static void dismiss(FragmentManager fragmentManager) {
    DialogFragment f = (DialogFragment) fragmentManager.findFragmentByTag("progress_dialog");
    if (f != null) f.dismiss();
}
 
Example 14
Source File: DialogSafeOperator.java    From ESeal with Apache License 2.0 4 votes vote down vote up
public static void safeDismissDialog(DialogFragment dialog) {
    if (dialog == null || dialog.isDetached()) {
        return;
    }
    dialog.dismiss();
}
 
Example 15
Source File: bk.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public void onLeftClicked(DialogFragment dialogfragment)
{
    dialogfragment.dismiss();
    PersonInfoFragment.d(a);
}
 
Example 16
Source File: bk.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public void onRightClicked(DialogFragment dialogfragment)
{
    dialogfragment.dismiss();
}
 
Example 17
Source File: as.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public void onEmptyAreaClicked(DialogFragment dialogfragment)
{
    dialogfragment.dismiss();
}
 
Example 18
Source File: as.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public void onRightClicked(DialogFragment dialogfragment)
{
    dialogfragment.dismiss();
}
 
Example 19
Source File: bd.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public void onLeftClicked(DialogFragment dialogfragment)
{
    dialogfragment.dismiss();
}
 
Example 20
Source File: MirrorActivity.java    From mirror with Apache License 2.0 4 votes vote down vote up
private void hideDialogFragment(final DialogFragment dialogFragment) {
    dialogFragment.dismiss();
}