Search in sources :

Example 1 with BundleBuilder

use of com.zegoggles.smssync.utils.BundleBuilder in project sms-backup-plus by jberkel.

the class AccountManagerAuthActivity method checkAccounts.

private void checkAccounts() {
    Account[] accounts = accountManager.getAccountsByType(GOOGLE_TYPE);
    if (accounts == null || accounts.length == 0) {
        Log.d(TAG, "no google accounts found on this device, using standard auth");
        setResult(RESULT_OK, new Intent(ACTION_FALLBACK_AUTH));
        finish();
    } else {
        Bundle args = new BundleBuilder().putParcelableArray(ACCOUNTS, accounts).build();
        ((DialogFragment) Fragment.instantiate(this, AccountDialogs.class.getName(), args)).show(getSupportFragmentManager(), null);
    }
}
Also used : Account(android.accounts.Account) Bundle(android.os.Bundle) BundleBuilder(com.zegoggles.smssync.utils.BundleBuilder) DialogFragment(android.support.v4.app.DialogFragment) Intent(android.content.Intent)

Example 2 with BundleBuilder

use of com.zegoggles.smssync.utils.BundleBuilder in project sms-backup-plus by jberkel.

the class DonationActivity method showSelectDialog.

private void showSelectDialog(List<SkuDetails> skuDetails) {
    if (billingClient == null)
        return;
    ArrayList<Sku> skus = new ArrayList<Sku>(skuDetails.size());
    for (SkuDetails detail : skuDetails) {
        skus.add(new Sku(detail));
    }
    if (DEBUG_IAB) {
        Collections.addAll(skus, Sku.Test.SKUS);
    }
    Collections.sort(skus);
    final DonationListFragment donationList = new DonationListFragment();
    donationList.setArguments(new BundleBuilder().putParcelableArrayList(SKUS, skus).build());
    donationList.show(getSupportFragmentManager(), null);
}
Also used : SkuDetails(com.android.billingclient.api.SkuDetails) BundleBuilder(com.zegoggles.smssync.utils.BundleBuilder) ArrayList(java.util.ArrayList)

Example 3 with BundleBuilder

use of com.zegoggles.smssync.utils.BundleBuilder in project sms-backup-plus by jberkel.

the class MainActivity method onPreferenceStartFragment.

@Override
public boolean onPreferenceStartFragment(PreferenceFragmentCompat caller, Preference preference) {
    if (LOCAL_LOGV) {
        Log.v(TAG, "onPreferenceStartFragment(" + preference + ")");
    }
    final Fragment fragment = Fragment.instantiate(this, preference.getFragment(), new BundleBuilder().putString(SCREEN_TITLE, String.valueOf(preference.getTitle())).build());
    showFragment(fragment, preference.getKey());
    return true;
}
Also used : BundleBuilder(com.zegoggles.smssync.utils.BundleBuilder) Fragment(android.support.v4.app.Fragment)

Aggregations

BundleBuilder (com.zegoggles.smssync.utils.BundleBuilder)3 Account (android.accounts.Account)1 Intent (android.content.Intent)1 Bundle (android.os.Bundle)1 DialogFragment (android.support.v4.app.DialogFragment)1 Fragment (android.support.v4.app.Fragment)1 SkuDetails (com.android.billingclient.api.SkuDetails)1 ArrayList (java.util.ArrayList)1