Example usage for android.support.v4.app DialogFragment getTag

List of usage examples for android.support.v4.app DialogFragment getTag

Introduction

In this page you can find the example usage for android.support.v4.app DialogFragment getTag.

Prototype

final public String getTag() 

Source Link

Document

Get the tag name of the fragment, if specified.

Usage

From source file:org.deviceconnect.android.deviceplugin.linking.setting.fragment.LinkingBeaconListFragment.java

@Override
public void onPositiveClick(final DialogFragment fragment) {
    String tag = fragment.getTag();
    if (TAG_ERROR_BEACON.equals(tag)) {
        transitionLinkingApp();//from  ww  w  . j  a  va  2  s  . co m
    } else if (TAG_DELETE_BEACON.equals(tag)) {
        LinkingApplication app = (LinkingApplication) getActivity().getApplication();
        LinkingBeaconManager mgr = app.getLinkingBeaconManager();
        mgr.removeBeacon(mLinkingBeacon);
        refresh();
    }
}

From source file:com.king.base.BaseActivity.java

public void showDialogFragment(DialogFragment dialogFragment) {
    String tag = dialogFragment.getTag() != null ? dialogFragment.getTag()
            : dialogFragment.getClass().getSimpleName();
    showDialogFragment(dialogFragment, tag);
}

From source file:com.wit.and.examples.dialogs.screen.ScreenDialogsHoloDark.java

@Override
public void onDialogRestored(DialogFragment dialog, int dialogID) {
    Log.d(TAG, "onDialogRestored(" + dialog.getTag() + ", " + dialogID + ")");

    DialogsFactory.FactoryDialog factoryDialog = DialogsFactory.FactoryDialog.parseDialog(dialogID);
    if (factoryDialog != null) {
        // Get the currently running progress task.
        ProgressTask currProgressTask = (sProgressDialogTask != null) ? sProgressDialogTask
                : (sLoadingDialogTask != null ? sLoadingDialogTask : null);

        // Handle restored progress dialogs.
        switch (factoryDialog) {
        case DIALOG_LOADING:
        case DIALOG_PROGRESS:
        case DIALOG_PROGRESS_NO_PROGRESS_INDICATOR:
        case DIALOG_PROGRESS_NO_TIME_INDICATOR:
            if (currProgressTask != null) {
                currProgressTask.dispatchAttachProgressDialog((ProgressDialog) dialog);
            } else {
                DIALOG_MANAGER.dismissDialog(dialog);
            }/*from ww  w  .  j a  v  a2s .co m*/
            break;
        case DIALOG_LOGIN:
            ((LoginDialog) dialog).setOnAuthenticationListener(AUTH_LISTENER);
            break;
        case DIALOG_EDIT:
            ((EditDialog) dialog).setOnEditListener(EDIT_LISTENER);
            break;
        }
    }
}

From source file:com.groksolutions.grok.mobile.notification.NotificationListActivity.java

@Override
public void onDialogPositiveClick(final DialogFragment dialog) {
    String tag = dialog.getTag();
    if (tag.equals("dismissAllNotifications")) {
        // Remove in background.
        new AsyncTask<Void, Void, Void>() {
            @Override//from   w w w . j a  v a  2s  . c  o m
            protected Void doInBackground(Void... v) {
                NotificationService.deleteAllNotifications();
                // Also cancel any pending OS notifications.
                ((NotificationManager) getSystemService(NOTIFICATION_SERVICE)).cancelAll();
                return null;
            }

            @Override
            protected void onPostExecute(Void v) {
                dialog.dismiss();
                NotificationListActivity.this.finish();
                finish();
            }
        }.execute();
    } else if (tag.equals("dismissNotification")) {
        removeDoomedNotification();
        dialog.dismiss();
    } else {
        Log.d(TAG, "Unknown dialog click: " + tag);
    }
}

From source file:com.farmerbb.taskbar.MainActivity.java

@Override
public void onColorSelection(DialogFragment dialogFragment, int color) {
    SharedPreferences pref = U.getSharedPreferences(this);
    String preferenceId = null;//  www . ja  va 2s  . c  o  m

    switch (Integer.parseInt(dialogFragment.getTag())) {
    case BACKGROUND_TINT:
        preferenceId = "background_tint";
        break;
    case ACCENT_COLOR:
        preferenceId = "accent_color";
        break;
    }

    pref.edit().putInt(preferenceId, color).apply();

    SettingsFragment fragment = (SettingsFragment) getFragmentManager()
            .findFragmentById(R.id.fragmentContainer);
    colorDialog.setColorPreferenceSummary(fragment.findPreference(preferenceId + "_pref"), color, this,
            getResources());

    U.restartTaskbar(this);
}

From source file:com.wit.and.dialog.manage.DialogManager.java

/**
 * Performs check for restored dialogs./*from w  w w . jav a2 s  .  com*/
 *
 * @return <code>True</code> if some dialog was restored, <code>false</code> otherwise.
 */
private boolean checkRestoredDialogs() {
    if (bDialogsRestoreCheckPerformed)
        return false;

    boolean restored = false;
    List<DialogFragment> restoredDialogs = getDialogs();
    if (restoredDialogs.size() > 0) {
        for (DialogFragment dialog : restoredDialogs) {
            if (USER_LOG)
                Log.i(TAG, "Restored dialog(" + dialog.getTag() + ").");

            // Fire on restored dialog callback.
            if (iRestoreListener != null) {
                if (dialog instanceof IDialog) {
                    iRestoreListener.onDialogRestored(dialog, ((IDialog) dialog).getDialogID());
                } else {
                    iRestoreListener.onDialogRestored(dialog, dialog.getId());
                }
            }
            restored = true;
        }
    }
    // Save check state.
    this.bDialogsRestoreCheckPerformed = true;
    return restored;
}