From 6035ca2eb05f53655922fb6264e879c3c5c7f826 Mon Sep 17 00:00:00 2001 From: Boris Timofeev Date: Wed, 8 Feb 2017 15:39:46 +0300 Subject: [PATCH] Merge code for amazon, slideme and free flavors --- app/build.gradle | 5 ++ .../ui/activity/DonateActivity.java | 72 ------------------- .../ui/activity/DonateActivity.java | 72 ------------------- 3 files changed, 5 insertions(+), 144 deletions(-) delete mode 100644 app/src/amazon/java/org/emunix/unipatcher/ui/activity/DonateActivity.java delete mode 100644 app/src/slideme/java/org/emunix/unipatcher/ui/activity/DonateActivity.java diff --git a/app/build.gradle b/app/build.gradle index 62c57a4..325c7f0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -65,6 +65,11 @@ android { } } + sourceSets{ + amazon.java.srcDir 'src/free/java' + slideme.java.srcDir 'src/free/java' + } + externalNativeBuild { cmake { path "CMakeLists.txt" 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 deleted file mode 100644 index 3d4e0eb..0000000 --- a/app/src/amazon/java/org/emunix/unipatcher/ui/activity/DonateActivity.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - 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); - } - } -} diff --git a/app/src/slideme/java/org/emunix/unipatcher/ui/activity/DonateActivity.java b/app/src/slideme/java/org/emunix/unipatcher/ui/activity/DonateActivity.java deleted file mode 100644 index 3d4e0eb..0000000 --- a/app/src/slideme/java/org/emunix/unipatcher/ui/activity/DonateActivity.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - 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); - } - } -}