Example usage for android.support.v4.preference Configuration getGooglePlayApiKeyDc

List of usage examples for android.support.v4.preference Configuration getGooglePlayApiKeyDc

Introduction

In this page you can find the example usage for android.support.v4.preference Configuration getGooglePlayApiKeyDc.

Prototype

public static String getGooglePlayApiKeyDc() 

Source Link

Usage

From source file:org.namelessrom.devicecontrol.activities.DonationActivity.java

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

    // get instance of the BillingProcessor
    mBillingProcessor = new BillingProcessor(this, Configuration.getGooglePlayApiKeyDc(), this);

    // setup action bar
    final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);/*from  w  w  w  . j  a va 2  s . com*/
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            finish();
        }
    });
    final MaterialMenuIconToolbar materialMenu = new MaterialMenuIconToolbar(this, Color.WHITE,
            MaterialMenuDrawable.Stroke.THIN) {
        @Override
        public int getToolbarViewId() {
            return R.id.toolbar;
        }
    };
    materialMenu.setState(MaterialMenuDrawable.IconState.ARROW);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        materialMenu.setNeverDrawTouch(true);
    }

    // set up the buttons
    mGooglePlay = (Button) findViewById(R.id.bDonateGooglePlay);
    mGooglePlay.setText(getString(R.string.donate_via, getString(R.string.google_play)));
    mGooglePlay.setOnClickListener(this);

    final Button payPal = (Button) findViewById(R.id.bDonatePayPal);
    payPal.setText(getString(R.string.donate_via, getString(R.string.paypal)));
    payPal.setOnClickListener(this);

    // set up radio buttons
    mRadioGroup = (RadioGroup) findViewById(R.id.radioGroupDonation);
    mRadioGroup.setOnCheckedChangeListener(this);
    final String donateValue = getString(R.string.donate_value);
    ((RadioButton) findViewById(R.id.radioDonation1)).setText(String.format(donateValue, "1$"));
    ((RadioButton) findViewById(R.id.radioDonation2)).setText(String.format(donateValue, "2$"));
    ((RadioButton) findViewById(R.id.radioDonation3)).setText(String.format(donateValue, "5$"));
    ((RadioButton) findViewById(R.id.radioDonation4)).setText(String.format(donateValue, "10$"));
    ((RadioButton) findViewById(R.id.radioDonation5)).setText(String.format(donateValue, "20$"));
}