diff --git a/app/build.gradle b/app/build.gradle index 1e8be6b..65fac44 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -49,6 +49,13 @@ android { buildConfigField "String", "SHARE_URL", "\"https://play.google.com/store/apps/details?id=org.eminix.unipatcher\"" buildConfigField "String", "GOOGLE_PLAY_PUBKEY", "\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA384jTCBEuJ8nCWaC4S6AFrnMQN4mBlmkOXHV3Xg5hlFOl8TkVwiCfqz8r20yJpEy0IJ1+3QRnlq59zadUxbkD+PacJlGB/r2b3mbKfu+m0K+e/0aL6eWupjMSIyPgpnbN3uswiBEGUb4ytzYF53ZKTbLARnruQdMnjV6+VyfwMgpor/48anVQawDARBj/AIAj6VGtRHLmg6DmKDyOGQ7uCgXSv+ysnBKJjtIX/L/5nQgL8Q+9jsr2knuWY7j9BmrtpUXaDH3Kb50M1TOCKiqxPGa8lInOOIndABWxcpqmSMXP06SPYOanUlEH7lT0jjqpHpFNx8hRTT9xf652rgMJwIDAQAB\"" } + amazon { + buildConfigField "String", "RATE_URL", "\"amzn://apps/android?p=org.emunix.unipatcher\"" + buildConfigField "String", "SHARE_URL", "\"http://www.amazon.com/gp/mas/dl/android?p=org.emunix.unipatcher\"" + buildConfigField "String", "PAYPAL_USER", "\"btimofeev@emunix.org\"" + buildConfigField "String", "PAYPAL_CURRENCY_CODE", "\"USD\"" + buildConfigField "String", "BITCOIN_ADDRESS", "\"16coztryz7xbNNDNhhf98wuHmi3hEintsW\"" + } slideme { buildConfigField "String", "RATE_URL", "\"sam://details?id=org.emunix.unipatcher\"" buildConfigField "String", "SHARE_URL", "\"http://slideme.org/application/unipatcher\"" diff --git a/app/src/amazon/java/org/emunix/unipatcher/ui/activity/DonateActivity.java b/app/src/amazon/java/org/emunix/unipatcher/ui/activity/DonateActivity.java new file mode 100644 index 0000000..3d4e0eb --- /dev/null +++ b/app/src/amazon/java/org/emunix/unipatcher/ui/activity/DonateActivity.java @@ -0,0 +1,72 @@ +/* + Copyright (c) 2017 Boris Timofeev + + This file is part of UniPatcher. + + UniPatcher is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + UniPatcher is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with UniPatcher. If not, see . + + */ + +package org.emunix.unipatcher.ui.activity; + +import android.os.Bundle; +import android.support.v4.app.FragmentTransaction; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.view.MenuItem; + +import org.emunix.unipatcher.BuildConfig; +import org.emunix.unipatcher.R; +import org.sufficientlysecure.donations.DonationsFragment; + +public class DonateActivity extends AppCompatActivity { + + @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(); + } + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + finish(); + return true; + default: + return super.onOptionsItemSelected(item); + } + } +}