donate + translations
This commit is contained in:
parent
7c9a29b420
commit
f6aa0c9fdb
@ -10,13 +10,14 @@
|
||||
<application a:icon="@drawable/icon" a:label="@string/c_app_name">
|
||||
|
||||
<activity a:name=".CalculatorActivity"
|
||||
a:windowSoftInputMode="stateHidden"
|
||||
a:label="@string/c_app_name">
|
||||
|
||||
<intent-filter>
|
||||
<action a:name="android.intent.action.MAIN"/>
|
||||
<category a:name="android.intent.category.LAUNCHER"/>
|
||||
<action a:name="org.solovyev.android.calculator.CalculatorActivity.insertText"/>
|
||||
</intent-filter>
|
||||
|
||||
</activity>
|
||||
|
||||
<activity a:name=".CalculatorPreferencesActivity"
|
||||
|
@ -75,8 +75,8 @@
|
||||
<include layout="@layout/calc_left_button"/>
|
||||
<include layout="@layout/calc_right_button"/>
|
||||
<include layout="@layout/calc_vars_button"/>
|
||||
<include layout="@layout/calc_donate_button"/>
|
||||
<include layout="@layout/calc_history_button"/>
|
||||
<include layout="@layout/calc_donate_button"/>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
@ -14,9 +14,7 @@
|
||||
|
||||
<TextView
|
||||
a:id="@+id/aboutTextView"
|
||||
a:textSize="20dp"
|
||||
a:text="@string/c_copyright"
|
||||
style="@style/display_style"
|
||||
a:gravity="center|top"/>
|
||||
style="@style/about_style"/>
|
||||
|
||||
</LinearLayout>
|
19
res/layout/donate.xml
Normal file
19
res/layout/donate.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ Copyright (c) 2009-2011. Created by serso aka se.solovyev.
|
||||
~ For more information, please, contact se.solovyev@gmail.com
|
||||
~ or visit http://se.solovyev.org
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
|
||||
a:layout_width="match_parent"
|
||||
a:layout_height="match_parent">
|
||||
|
||||
<TextView a:id="@+id/donateText"
|
||||
style="@style/about_style"
|
||||
a:layout_width="match_parent"
|
||||
a:text="@string/c_donate_text"
|
||||
a:layout_height="match_parent"/>
|
||||
|
||||
</LinearLayout>
|
@ -19,9 +19,11 @@
|
||||
<string name="c_restart">Перезапуск</string>
|
||||
|
||||
<!--ABOUT ACTIVITY-->
|
||||
<string name="c_copyright">Copyright (c) 2009-2011.\nПрограмма создана serso aka se.solovyev.\n
|
||||
За подробной информацией, пожалуйста,\nобращайтесь на почту\n<a href="mailto:se.solovyev@gmail.com">se.solovyev@gmail.com</a>
|
||||
\nили посетите\n<a href="http://se.solovyev.org">http://se.solovyev.org</a>
|
||||
<string name="c_copyright">Copyright (c) 2009-2011\n\n<b>Программа создана\nserso aka se.solovyev</b>\n\n
|
||||
Эта программа бесплатна и открыта.\nИсходный код может быть найден на \n<a href="https://github.com/serso/android_calculator">http://github.com</a>\n\n
|
||||
За подробной информацией, пожалуйста,\nобращайтесь на почту\n<a href="mailto:se.solovyev@gmail.com">se.solovyev@gmail.com</a>\n
|
||||
или посетите сайт \n<a href="http://se.solovyev.org">http://se.solovyev.org</a>\n\n
|
||||
Если вы хотите поддержать проект материально\nвы можете сделать это через \n<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=se%2esolovyev%40gmail%2ecom&lc=RU&item_name=Android%20Calculator&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted">http://paypal.com</a>
|
||||
</string>
|
||||
|
||||
<string name="c_undo">назад</string>
|
||||
@ -53,7 +55,18 @@
|
||||
<string name="c_sys.var.cannot.be.changed">Системная переменная не может быть изменена!</string>
|
||||
|
||||
<string name="c_pi_description">Отношение длины окружности к диаметру</string>
|
||||
<string name="c_e_description">Вещесвтенное число, такое что производная функции f(x) = e^x в точке x = 0 равно 1</string>
|
||||
<string name="c_e_description">Вещесвтенное число, такое что производная функции f(x) = e^x в точке x = 0 равно 1
|
||||
</string>
|
||||
<string name="c_i_description">Мнимая единица, определённая как i^2 = −1</string>
|
||||
<string name="c_calc_editor_hint">Введите новое выражение</string>
|
||||
<string name="c_continue">Продолжить</string>
|
||||
<string name="c_press_to_copy">Нажмите для копирования</string>
|
||||
<string name="c_donate">Пожертвовать</string>
|
||||
<string name="c_donate_text">Вы можете отблагодарить автора по почте\n\n
|
||||
<a href="mailto:se.solovyev@gmail.com">se.solovyev@gmail.com</a>\n\n
|
||||
или пожертвовать денег через\n\n
|
||||
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=se%2esolovyev%40gmail%2ecom&lc=RU&item_name=Android%20Calculator&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted">
|
||||
http://paypal.com</a>\n
|
||||
</string>
|
||||
|
||||
</resources>
|
||||
|
@ -20,9 +20,11 @@
|
||||
<string name="c_restart">Restart</string>
|
||||
|
||||
<!--ABOUT ACTIVITY-->
|
||||
<string name="c_copyright">Copyright (c) 2009-2011.\nCreated by serso aka se.solovyev.\n
|
||||
For more information please\ncontact me via email\n<a href="mailto:se.solovyev@gmail.com">se.solovyev@gmail.com</a>
|
||||
\nor visit\n<a href="http://se.solovyev.org">http://se.solovyev.org</a>
|
||||
<string name="c_copyright">Copyright (c) 2009-2011\n\n<b>Created by serso aka se.solovyev</b>\n\n
|
||||
This program is free and open source.\nSource code can be found on\n<a href="https://github.com/serso/android_calculator">http://github.com</a>\n\n
|
||||
For more information please\ncontact the author by email\n<a href="mailto:se.solovyev@gmail.com">se.solovyev@gmail.com</a>
|
||||
\nor visit\n<a href="http://se.solovyev.org">http://se.solovyev.org</a>\n\n
|
||||
If you want to support the project\nyou can donate money via\n<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=se%2esolovyev%40gmail%2ecom&lc=RU&item_name=Android%20Calculator&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted">http://paypal.com</a>
|
||||
</string>
|
||||
|
||||
<string name="c_undo">undo</string>
|
||||
@ -60,4 +62,9 @@
|
||||
<string name="c_i_description">Imaginary unit, defined such that i^2 = −1</string>
|
||||
<string name="c_calc_editor_hint">Enter new expression</string>
|
||||
<string name="c_press_to_copy">Press to copy</string>
|
||||
<string name="c_continue">Continue</string>
|
||||
<string name="c_donate">Donate</string>
|
||||
<string name="c_donate_text">You can thank the author of this program by email\n\n
|
||||
<a href="mailto:se.solovyev@gmail.com">se.solovyev@gmail.com</a>\n\n
|
||||
or donate money via\n\n<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=se%2esolovyev%40gmail%2ecom&lc=RU&item_name=Android%20Calculator&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted">http://paypal.com</a>\n</string>
|
||||
</resources>
|
||||
|
@ -46,4 +46,15 @@
|
||||
<item name="android:layout_height">match_parent</item>
|
||||
</style>
|
||||
|
||||
<style name="about_style">
|
||||
<item name="android:textSize">15dp</item>
|
||||
<item name="android:background">#000000</item>
|
||||
<item name="android:textColor">@color/text_color</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:padding">5dp</item>
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">match_parent</item>
|
||||
</style>
|
||||
|
||||
|
||||
</resources>
|
||||
|
@ -6,11 +6,13 @@
|
||||
package org.solovyev.android.calculator;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.*;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.text.ClipboardManager;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.*;
|
||||
@ -213,13 +215,31 @@ public class CalculatorActivity extends Activity implements FontSizeAdjuster, Sh
|
||||
startActivity(new Intent(this, CalculatorVarsActivity.class));
|
||||
}
|
||||
|
||||
private final static String paypalDonateUrl = "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=se%2esolovyev%40gmail%2ecom&lc=RU&item_name=Android%20Calculator¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted";
|
||||
|
||||
@SuppressWarnings({"UnusedDeclaration"})
|
||||
public void donateButtonClickHandler(@NotNull View v) {
|
||||
final String paypalDonateUrl = "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=se%2esolovyev%40gmail%2ecom&lc=RU&item_name=android%2ecalculator%40se%2esolovyev¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted";
|
||||
final LayoutInflater layoutInflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
|
||||
final View view = layoutInflater.inflate(R.layout.donate, null);
|
||||
|
||||
final TextView donate = (TextView) view.findViewById(R.id.donateText);
|
||||
donate.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
|
||||
final AlertDialog.Builder builder = new AlertDialog.Builder(this)
|
||||
.setCancelable(true)
|
||||
.setNegativeButton(R.string.c_cancel, null)
|
||||
.setPositiveButton(R.string.c_donate, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
final Intent i = new Intent(Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse(paypalDonateUrl));
|
||||
startActivity(i);
|
||||
}
|
||||
})
|
||||
.setView(view);
|
||||
|
||||
builder.create().show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
|
Loading…
Reference in New Issue
Block a user