Example usage for android.app DialogFragment setArguments

List of usage examples for android.app DialogFragment setArguments

Introduction

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

Prototype

public void setArguments(Bundle args) 

Source Link

Document

Supply the construction arguments for this fragment.

Usage

From source file:com.coinblesk.client.ui.dialogs.ReceiveDialogFragment.java

public static DialogFragment newInstance(BitcoinURI bitcoinURI) {
    DialogFragment fragment = new ReceiveDialogFragment();
    Bundle arguments = new Bundle();
    arguments.putString(BITCOIN_URI_KEY, ClientUtils.bitcoinUriToString(bitcoinURI));
    fragment.setArguments(arguments);
    return fragment;
}

From source file:at.bitfire.davdroid.mirakel.syncadapter.EnterCredentialsFragment.java

void queryServer() {
    FragmentTransaction ft = getFragmentManager().beginTransaction();

    Bundle args = new Bundle();

    String host_path = editBaseURL.getText().toString();
    args.putString(QueryServerDialogFragment.EXTRA_BASE_URL, URIUtils.sanitize(protocol + host_path));
    args.putString(QueryServerDialogFragment.EXTRA_USER_NAME, editUserName.getText().toString());
    args.putString(QueryServerDialogFragment.EXTRA_PASSWORD, editPassword.getText().toString());
    args.putBoolean(QueryServerDialogFragment.EXTRA_AUTH_PREEMPTIVE, checkboxPreemptive.isChecked());

    DialogFragment dialog = new QueryServerDialogFragment();
    dialog.setArguments(args);
    dialog.show(ft, QueryServerDialogFragment.class.getName());
}

From source file:at.bitfire.davdroid.mirakel.syncadapter.LoginURLFragment.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case R.id.next:
        FragmentTransaction ft = getFragmentManager().beginTransaction();

        Bundle args = new Bundle();
        String host_path = editBaseURI.getText().toString();
        args.putString(QueryServerDialogFragment.EXTRA_BASE_URI, URLUtils.sanitize(scheme + host_path));
        args.putString(QueryServerDialogFragment.EXTRA_USER_NAME, editUserName.getText().toString());
        args.putString(QueryServerDialogFragment.EXTRA_PASSWORD, editPassword.getText().toString());
        args.putBoolean(QueryServerDialogFragment.EXTRA_AUTH_PREEMPTIVE, checkboxPreemptive.isChecked());

        DialogFragment dialog = new QueryServerDialogFragment();
        dialog.setArguments(args);
        dialog.show(ft, QueryServerDialogFragment.class.getName());
        break;//  w  ww .j a va2s .  c  o m
    default:
        return false;
    }
    return true;
}

From source file:at.bitfire.davdroid.syncadapter.LoginURLFragment.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case R.id.next:
        FragmentTransaction ft = getFragmentManager().beginTransaction();

        Bundle args = new Bundle();
        try {/*from   w  ww  .ja v  a2  s. c  o m*/
            args.putString(QueryServerDialogFragment.EXTRA_BASE_URI, getBaseURI().toString());
        } catch (URISyntaxException e) {
        }
        args.putString(QueryServerDialogFragment.EXTRA_USER_NAME, editUserName.getText().toString());
        args.putString(QueryServerDialogFragment.EXTRA_PASSWORD, editPassword.getText().toString());
        args.putBoolean(QueryServerDialogFragment.EXTRA_AUTH_PREEMPTIVE, checkboxPreemptive.isChecked());

        DialogFragment dialog = new QueryServerDialogFragment();
        dialog.setArguments(args);
        dialog.show(ft, QueryServerDialogFragment.class.getName());
        break;
    default:
        return false;
    }
    return true;
}

From source file:org.exfio.csyncdroid.syncadapter.ExfioPeerEnterCredentialsFragment.java

void queryServer() {
    FragmentTransaction ft = getFragmentManager().beginTransaction();

    Bundle args = new Bundle();

    args.putString(android.accounts.AccountManager.KEY_ACCOUNT_TYPE, Constants.ACCOUNT_TYPE_EXFIOPEER);
    args.putString(ExfioPeerAccountSettings.KEY_BASE_URL,
            URIUtils.sanitize(protocol + editBaseURL.getText().toString()));
    args.putString(ExfioPeerAccountSettings.KEY_USERNAME, editUserName.getText().toString());
    args.putString(ExfioPeerAccountSettings.KEY_PASSWORD, editPassword.getText().toString());
    args.putBoolean(ExfioPeerAccountSettings.KEY_AUTH_PREEMPTIVE, true);

    DialogFragment dialog = new QueryServerDialogFragment();
    dialog.setArguments(args);
    dialog.show(ft, QueryServerDialogFragment.class.getName());
}

From source file:org.exfio.csyncdroid.syncadapter.LegacyV5EnterCredentialsFragment.java

void queryServer() {
    FragmentTransaction ft = getFragmentManager().beginTransaction();

    Bundle args = new Bundle();

    args.putString(android.accounts.AccountManager.KEY_ACCOUNT_TYPE, Constants.ACCOUNT_TYPE_LEGACYV5);
    args.putString(LegacyV5AccountSettings.KEY_BASE_URL,
            URIUtils.sanitize(protocol + editBaseURL.getText().toString()));
    args.putString(LegacyV5AccountSettings.KEY_USERNAME, editUserName.getText().toString());
    args.putString(LegacyV5AccountSettings.KEY_PASSWORD, editPassword.getText().toString());
    args.putString(LegacyV5AccountSettings.KEY_SYNCKEY, editSyncKey.getText().toString());
    args.putBoolean(LegacyV5AccountSettings.KEY_AUTH_PREEMPTIVE, true);

    DialogFragment dialog = new QueryServerDialogFragment();
    dialog.setArguments(args);
    dialog.show(ft, QueryServerDialogFragment.class.getName());
}

From source file:org.exfio.weavedroid.syncadapter.EnterCredentialsFragment.java

void queryServer() {
    FragmentTransaction ft = getFragmentManager().beginTransaction();

    Bundle args = new Bundle();

    String host_path = editBaseURL.getText().toString();
    args.putString(QueryServerDialogFragment.EXTRA_BASE_URL, URIUtils.sanitize(protocol + host_path));
    args.putString(QueryServerDialogFragment.EXTRA_USER_NAME, editUserName.getText().toString());
    args.putString(QueryServerDialogFragment.EXTRA_PASSWORD, editPassword.getText().toString());
    args.putString(QueryServerDialogFragment.EXTRA_SYNC_KEY, editSyncKey.getText().toString());
    args.putBoolean(QueryServerDialogFragment.EXTRA_AUTH_PREEMPTIVE, true);

    DialogFragment dialog = new QueryServerDialogFragment();
    dialog.setArguments(args);
    dialog.show(ft, QueryServerDialogFragment.class.getName());
}

From source file:de.uulm.graphicalpasswords.openpassgo.PassGoCreatePasswordActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_pass_go_create_password);

    SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
    int length = Integer.parseInt(sharedPref.getString("passgo_length", "6"));

    patternView = (PatternView) findViewById(R.id.passgo_patternview);
    patternView.setActivity((PassGo) this);
    patternView.setLength(length);//from   w w  w. j  a  va2s  .c om

    save = (Button) findViewById(R.id.passgo_save);
    setReady(false);

    Bundle bundle = new Bundle();
    bundle.putInt("length", length);
    DialogFragment intro = new IntroDialogFragment();
    intro.setArguments(bundle);
    intro.show(getFragmentManager(), "intro");

    // Show the Up button in the action bar.
    setupActionBar();
}

From source file:com.bodeme.easycloud.syncadapter.EnterCredentialsFragment.java

void queryServer() {
    FragmentTransaction ft = getFragmentManager().beginTransaction();

    Bundle args = new Bundle();

    String url;// w w w . ja  v  a  2 s  . c  o  m
    String username = editUserName.getText().toString();
    if (Constants.OWNCLOUD_URL == null) {
        url = editURL.getText().toString();
    } else {
        url = Constants.OWNCLOUD_URL;
    }

    if (url.charAt(url.length() - 1) != '/') {
        url = url + "/";
    }

    if (0 == typePosition) {
        url += "remote.php/caldav/principals/" + username + "/";
    } else {
        url += "remote.php/carddav/addressbooks/" + username + "/";
    }

    args.putString(QueryServerDialogFragment.EXTRA_BASE_URL, URIUtils.sanitize(url));
    args.putString(QueryServerDialogFragment.EXTRA_USER_NAME, username);
    args.putString(QueryServerDialogFragment.EXTRA_PASSWORD, editPassword.getText().toString());
    args.putBoolean(QueryServerDialogFragment.EXTRA_AUTH_PREEMPTIVE, true);

    DialogFragment dialog = new QueryServerDialogFragment();
    dialog.setArguments(args);
    dialog.show(ft, QueryServerDialogFragment.class.getName());
}

From source file:org.exfio.csyncdroid.syncadapter.FxAccountEnterCredentialsFragment.java

void queryServer() {
    FragmentTransaction ft = getFragmentManager().beginTransaction();

    Bundle args = new Bundle();

    args.putString(android.accounts.AccountManager.KEY_ACCOUNT_TYPE, Constants.ACCOUNT_TYPE_FXACCOUNT);
    args.putString(FxAccountAccountSettings.KEY_ACCOUNT_SERVER,
            URIUtils.sanitize(accountServerProtocol + editAccountServerUrl.getText().toString()));
    args.putString(FxAccountAccountSettings.KEY_TOKEN_SERVER,
            URIUtils.sanitize(tokenServerProtocol + editTokenServerUrl.getText().toString()));
    args.putString(FxAccountAccountSettings.KEY_USERNAME, editUserName.getText().toString());
    args.putString(FxAccountAccountSettings.KEY_PASSWORD, editPassword.getText().toString());

    DialogFragment dialog = new QueryServerDialogFragment();
    dialog.setArguments(args);
    dialog.show(ft, QueryServerDialogFragment.class.getName());
}