本文整理汇总了Java中org.sufficientlysecure.donations.DonationsFragment类的典型用法代码示例。如果您正苦于以下问题:Java DonationsFragment类的具体用法?Java DonationsFragment怎么用?Java DonationsFragment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DonationsFragment类属于org.sufficientlysecure.donations包,在下文中一共展示了DonationsFragment类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import org.sufficientlysecure.donations.DonationsFragment; //导入依赖的package包/类
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTheme(R.style.GdxTheme);
setContentView(R.layout.donations_activity);
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
if (BuildConfig.DONATIONS_GOOGLE) {
donationsFragment = DonationsFragment.newInstance(BuildConfig.DEBUG, true, GOOGLE_PUBKEY, GOOGLE_CATALOG,
getResources().getStringArray(R.array.donation_google_catalog_values), false, null, null,
null, false, null, null, false, null);
}
ft.replace(R.id.donations_activity_container, donationsFragment, "donationsFragment");
ft.commit();
}
示例2: onCreate
import org.sufficientlysecure.donations.DonationsFragment; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_donate);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
try {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} catch (NullPointerException e) {
/* empty */
}
getSupportActionBar().setTitle(R.string.donate_activity_title);
DonationsFragment fragment = (DonationsFragment) getSupportFragmentManager().findFragmentByTag("donationsFragment");
if (fragment == null) {
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
fragment = DonationsFragment.newInstance(BuildConfig.DEBUG,
true, BuildConfig.GOOGLE_PLAY_PUBKEY, GOOGLE_PLAY_CATALOG, GOOGLE_PLAY_COST,
false, null, null, null,
false, null, null,
false, null);
ft.replace(R.id.donate_fragment, fragment, "donationsFragment");
ft.commit();
}
}
示例3: onCreate
import org.sufficientlysecure.donations.DonationsFragment; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_donate);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
try {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} catch (NullPointerException e) {
/* empty */
}
getSupportActionBar().setTitle(R.string.donate_activity_title);
DonationsFragment fragment = (DonationsFragment) getSupportFragmentManager().findFragmentByTag("donationsFragment");
if (fragment == null) {
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
fragment = DonationsFragment.newInstance(BuildConfig.DEBUG,
false, null, null, null,
true, BuildConfig.PAYPAL_USER, BuildConfig.PAYPAL_CURRENCY_CODE, getString(R.string.donation),
false, null, null,
true, BuildConfig.BITCOIN_ADDRESS);
ft.replace(R.id.donate_fragment, fragment, "donationsFragment");
ft.commit();
}
}
示例4: onCreate
import org.sufficientlysecure.donations.DonationsFragment; //导入依赖的package包/类
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.donations_activity);
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
DonationsFragment donationsFragment;
donationsFragment = DonationsFragment.newInstance(false, true, GOOGLE_PUBKEY, GOOGLE_CATALOG,
getResources().getStringArray(R.array.donation_google_catalog_values), false, null, null,
null, false, null, null, false, null);
ft.replace(R.id.donations_activity_container, donationsFragment, "donationsFragment");
ft.commit();
}
示例5: onCreate
import org.sufficientlysecure.donations.DonationsFragment; //导入依赖的package包/类
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.donations_activity);
setupActionBar();
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
DonationsFragment donationsFragment;
if (BuildConfig.DONATIONS_GOOGLE) {
donationsFragment = DonationsFragment.newInstance(BuildConfig.DEBUG, true, GOOGLE_PUBKEY, GOOGLE_CATALOG,
getResources().getStringArray(R.array.donation_google_catalog_values), true, PAYPAL_USER, PAYPAL_CURRENCY_CODE,
getString(R.string.donation_paypal_item), true, FLATTR_PROJECT_URL, FLATTR_URL, false, null);
} else {
donationsFragment = DonationsFragment.newInstance(BuildConfig.DEBUG, false, null, null, null, true, PAYPAL_USER,
PAYPAL_CURRENCY_CODE, getString(R.string.donation_paypal_item), true, FLATTR_PROJECT_URL, FLATTR_URL, false, null);
}
ft.replace(R.id.donations_activity_container, donationsFragment, "donationsFragment");
ft.commit();
}
示例6: refresh
import org.sufficientlysecure.donations.DonationsFragment; //导入依赖的package包/类
@Override
public void refresh(StoreActivity activity, FrameLayout titleBackContainer) {
if (mFragment == null) {
mFragment = DonationsFragment.newInstance(false, true, StoreActivity.GOOGLE_PUBKEY,
GOOGLE_CATALOG,
getResources().getStringArray(R.array.donation_google_catalog_values), false, null, null,
null, true, FLATTR_PROJECT_URL, FLATTR_URL, true, BITCOIN_ADDRESS);
}
FragmentTransaction t = activity.getSupportFragmentManager().beginTransaction();
t.replace(R.id.store_container, mFragment, FRAGMENT_TAG);
t.commit();
requestLayout();
invalidate();
mStartedTime = System.currentTimeMillis();
}
示例7: onCreate
import org.sufficientlysecure.donations.DonationsFragment; //导入依赖的package包/类
@Override
protected void onCreate (Bundle savedInstanceState)
{
super.onCreate (savedInstanceState);
setContentView (R.layout.activity_contribute);
FragmentTransaction fragmentTransaction = this.getSupportFragmentManager ().beginTransaction ();
// I know I'm supposed to keep my key hidden but... come on. This app is open source, and donations don't unlock any additional features. If they want to circumvent it they can easily do so, and they would gain absolutely nothing from it anyway. //
DonationsFragment donationsFragment = DonationsFragment.newInstance (false, true, "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAogL8ClXWCd9fMZrDISjCN0Dtzv5E06CAZpRihm2QH6vMP64mCMkTPUb/0ti4kIwyO3OVO7uJYLgdmHnGLyjuACknRrlVD94IzQLlwRMtSyhZClhLEsaKJEUl4CM2l6ZKgdxBJNYFnRRWcnYCo5n5e5UagPcXirPPXidsxj3OYe6bLHXP27uECB6h6yeq2XU4Rs9VejgC+5BYyPB5N7xbsVBMD8k2ym8EO1qGzJoXlkUS9pS5To5pO7/1tUZRAw0eXtNoO4p/LjF8HkLuN0GhnqL3cjjxIy2S/rC+3ypWDqo1ndoLRbYRMbPTxkbZ0a8MIXW36yXw/iSZfospi5/d/QIDAQAB", IAP_CATALOG, IAP_CATALOG_VALUES, false, null, null, null, false, null, null, false, null);
fragmentTransaction.replace (R.id.flDonate, donationsFragment, "donationsFragment");
fragmentTransaction.commit ();
}
示例8: onNavigationItemSelected
import org.sufficientlysecure.donations.DonationsFragment; //导入依赖的package包/类
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case R.id.nav_flasher:
switchTo(FlashFragment.newInstance(mActivity));
item.setChecked(true);
break;
case R.id.nav_recovery_script:
switchTo(ScriptManagerFragment.newInstance());
item.setChecked(true);
break;
case R.id.nav_donate:
switchTo(DonationsFragment.newInstance(BuildConfig.DEBUG, true,
App.GOOGLE_PUBKEY, App.GOOGLE_CATALOG,
getResources().getStringArray(R.array.donation_google_catalog_values),
true, App.DEV_EMAIL, "EUR", "Donation - Rashr Developer"));
item.setChecked(true);
break;
case R.id.nav_settings:
switchTo(new SettingsFragment());
item.setChecked(true);
break;
case R.id.nav_information:
switchTo(InformationFragment.newInstance());
item.setChecked(true);
break;
case R.id.xda:
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(App.XDA_THREAD_URL)));
return true;
case R.id.google_plus:
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(App.GOOGLE_PLUS_URL)));
return true;
case R.id.github:
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(App.GITHUB_REPOSITORY_URL)));
return true;
}
mRoot.closeDrawers();
return false;
}
示例9: createDrawerAdapter
import org.sufficientlysecure.donations.DonationsFragment; //导入依赖的package包/类
public void createDrawerAdapter(final Activity context) {
mDrawerAdapter = new DrawerAdapter(context);
mDrawerAdapter.addItem(context.getString(R.string.drawer_overview),
OutletsFragment.class.getName(), 0, true).bitmap = BitmapFactory.decodeResource(context.getResources(), android.R.drawable.ic_menu_send);
mDrawerAdapter.addItem(context.getString(R.string.drawer_timer),
TimerFragment.class.getName(), 0, true).bitmap = BitmapFactory.decodeResource(context.getResources(), android.R.drawable.ic_menu_recent_history);
mDrawerAdapter.addItem(context.getString(R.string.drawer_devices),
DevicesFragment.class.getName(), 0, true).bitmap = BitmapFactory.decodeResource(context.getResources(), android.R.drawable.ic_menu_preferences);
mDrawerAdapter.addSeparator();
mDrawerAdapter.addItem(context.getString(R.string.drawer_preferences),
PreferencesFragment.class.getName(), 0, false);
mDrawerAdapter.addItem(context.getString(R.string.drawer_donate),
DonationsFragment.class.getName(), 0, false).mExtra = DonationsFragment.createExtra(
BuildConfig.DEBUG, true, DonateData.GOOGLE_PUBKEY, DonateData.GOOGLE_CATALOG,
context.getResources().getStringArray(R.array.donation_google_catalog_values), true,
DonateData.PP_USER, DonateData.PP_CURRENCY_CODE, DonateData.PP_DECODED_URI,
true, DonateData.FLATTR_PROJECT_URL, DonateData.FLATTR_URL, false, null);
mDrawerAdapter.addItem(context.getString(R.string.drawer_feedback),
FeedbackFragment.class.getName(), 0, false);
}