/*
 * Copyright 2018 Nikita Shakarun
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package ru.playsoftware.j2meloader.donations;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;

import org.sufficientlysecure.donations.DonationsFragment;

import ru.playsoftware.j2meloader.BuildConfig;
import ru.playsoftware.j2meloader.R;

public class DonationsActivity extends AppCompatActivity {

	/**
	 * Google
	 */
	private static final String GOOGLE_PUBKEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjH1jO9oXfAiubICi+mOr2uJuIfqZI6hVgWPmJnOc08F6+Qe0c9sLEISiXXQXrh9rvGfc6jloN/QlsA5yXEBM3V/SVX48KpPb46mAUC+jLQCURcAazSYG7Orc6+Zo1y3JUorTOem0lSMd46uRyrRwdcsw4IPjHZV9GHfCFxz6Jm5hl3r7n5SHFZBJhixDGpoL4/HxSgtbT/kdtg7EsStB5NtnBsNzGZj+JNAyZ5yxL/7aRLQtNFLOPMPNhzMblYekcmr1IzH0MxxlpnwOOS7712InwmpRCoiAdP8wVsohi1f7DtHh0sYGYSoEwqkwG6lHrgx+XkIOm8U0l9YJphJcGQIDAQAB";

	private static final String[] GOOGLE_CATALOG = new String[]{"j2me.donation.1",
			"j2me.donation.2", "j2me.donation.3", "j2me.donation.4"};

	/**
	 * PayPal
	 */
	private static final String PAYPAL_USER = "nikita36078@mail.ru";
	private static final String PAYPAL_CURRENCY_CODE = "RUB";

	/**
	 * Called when the activity is first created.
	 */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.activity_donations);
		getSupportActionBar().setDisplayHomeAsUpEnabled(true);

		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), false, null, null,
					null, false, null, null, false, null);
		} else {
			donationsFragment = DonationsFragment.newInstance(BuildConfig.DEBUG, false, null, null, null, true, PAYPAL_USER,
					PAYPAL_CURRENCY_CODE, getString(R.string.donation_paypal_item), false, null, null, false, null);
		}

		ft.replace(R.id.donations_activity_container, donationsFragment, "donationsFragment");
		ft.commit();
	}

	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);

		FragmentManager fragmentManager = getSupportFragmentManager();
		Fragment fragment = fragmentManager.findFragmentByTag("donationsFragment");
		if (fragment != null) {
			fragment.onActivityResult(requestCode, resultCode, data);
		}
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
			case android.R.id.home:
				finish();
				break;
		}
		return super.onOptionsItemSelected(item);
	}

}
@@ -835,16 +835,57 @@
 action;%0A
+import android.support.v7.app.ActionBar;%0A
 import a
@@ -1917,65 +1917,8 @@
 %22;%0A%0A
-%09/**%0A%09 * Called when the activity is first created.%0A%09 */%0A
 %09@Ov
@@ -1916,32 +1916,32 @@
 B%22;%0A%0A%09@Override%0A
+
 %09public void onC
@@ -2013,17 +2013,16 @@
 State);%0A
-%0A
 %09%09setCon
@@ -2062,16 +2062,38 @@
 ons);%0A%09%09
+ActionBar actionBar = 
 getSuppo
@@ -2105,16 +2105,29 @@
 ionBar()
+;%0A%09%09actionBar
 .setDisp
@@ -2151,16 +2151,55 @@
 d(true);
+%0A%09%09actionBar.setTitle(R.string.donate);
 %0A%0A%09%09Frag
@@ -2689,25 +2689,30 @@
  null, null,
- 
+%0A%09%09%09%09%09
 null, true, 
@@ -2723,22 +2723,17 @@
 AL_USER,
-%0A%09%09%09%09%09
+ 
 PAYPAL_C
@@ -2745,17 +2745,22 @@
 CY_CODE,
- 
+%0A%09%09%09%09%09
 getStrin

Add title for DonationsActivity