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">
|
<application a:icon="@drawable/icon" a:label="@string/c_app_name">
|
||||||
|
|
||||||
<activity a:name=".CalculatorActivity"
|
<activity a:name=".CalculatorActivity"
|
||||||
a:windowSoftInputMode="stateHidden"
|
|
||||||
a:label="@string/c_app_name">
|
a:label="@string/c_app_name">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action a:name="android.intent.action.MAIN"/>
|
<action a:name="android.intent.action.MAIN"/>
|
||||||
<category a:name="android.intent.category.LAUNCHER"/>
|
<category a:name="android.intent.category.LAUNCHER"/>
|
||||||
<action a:name="org.solovyev.android.calculator.CalculatorActivity.insertText"/>
|
<action a:name="org.solovyev.android.calculator.CalculatorActivity.insertText"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity a:name=".CalculatorPreferencesActivity"
|
<activity a:name=".CalculatorPreferencesActivity"
|
||||||
|
@ -75,8 +75,8 @@
|
|||||||
<include layout="@layout/calc_left_button"/>
|
<include layout="@layout/calc_left_button"/>
|
||||||
<include layout="@layout/calc_right_button"/>
|
<include layout="@layout/calc_right_button"/>
|
||||||
<include layout="@layout/calc_vars_button"/>
|
<include layout="@layout/calc_vars_button"/>
|
||||||
<include layout="@layout/calc_donate_button"/>
|
|
||||||
<include layout="@layout/calc_history_button"/>
|
<include layout="@layout/calc_history_button"/>
|
||||||
|
<include layout="@layout/calc_donate_button"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -14,9 +14,7 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
a:id="@+id/aboutTextView"
|
a:id="@+id/aboutTextView"
|
||||||
a:textSize="20dp"
|
|
||||||
a:text="@string/c_copyright"
|
a:text="@string/c_copyright"
|
||||||
style="@style/display_style"
|
style="@style/about_style"/>
|
||||||
a:gravity="center|top"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</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>
|
@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="c_app_name">Калькулятор</string>
|
<string name="c_app_name">Калькулятор</string>
|
||||||
<string name="c_app_settings">Калькулятор</string>
|
<string name="c_app_settings">Калькулятор</string>
|
||||||
<string name="c_syntax_error">Ошибка</string>
|
<string name="c_syntax_error">Ошибка</string>
|
||||||
<string name="c_result_copied">Результат скопирован в буфер!</string>
|
<string name="c_result_copied">Результат скопирован в буфер!</string>
|
||||||
<string name="c_settings">Настройки</string>
|
<string name="c_settings">Настройки</string>
|
||||||
<string name="c_help">Помощь</string>
|
<string name="c_help">Помощь</string>
|
||||||
<string name="c_about">О программе</string>
|
<string name="c_about">О программе</string>
|
||||||
@ -19,9 +19,11 @@
|
|||||||
<string name="c_restart">Перезапуск</string>
|
<string name="c_restart">Перезапуск</string>
|
||||||
|
|
||||||
<!--ABOUT ACTIVITY-->
|
<!--ABOUT ACTIVITY-->
|
||||||
<string name="c_copyright">Copyright (c) 2009-2011.\nПрограмма создана serso aka se.solovyev.\n
|
<string name="c_copyright">Copyright (c) 2009-2011\n\n<b>Программа создана\nserso aka se.solovyev</b>\n\n
|
||||||
За подробной информацией, пожалуйста,\nобращайтесь на почту\n<a href="mailto:se.solovyev@gmail.com">se.solovyev@gmail.com</a>
|
Эта программа бесплатна и открыта.\nИсходный код может быть найден на \n<a href="https://github.com/serso/android_calculator">http://github.com</a>\n\n
|
||||||
\nили посетите\n<a href="http://se.solovyev.org">http://se.solovyev.org</a>
|
За подробной информацией, пожалуйста,\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>
|
||||||
|
|
||||||
<string name="c_undo">назад</string>
|
<string name="c_undo">назад</string>
|
||||||
@ -53,7 +55,18 @@
|
|||||||
<string name="c_sys.var.cannot.be.changed">Системная переменная не может быть изменена!</string>
|
<string name="c_sys.var.cannot.be.changed">Системная переменная не может быть изменена!</string>
|
||||||
|
|
||||||
<string name="c_pi_description">Отношение длины окружности к диаметру</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_i_description">Мнимая единица, определённая как i^2 = −1</string>
|
||||||
<string name="c_calc_editor_hint">Введите новое выражение</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>
|
</resources>
|
||||||
|
@ -20,9 +20,11 @@
|
|||||||
<string name="c_restart">Restart</string>
|
<string name="c_restart">Restart</string>
|
||||||
|
|
||||||
<!--ABOUT ACTIVITY-->
|
<!--ABOUT ACTIVITY-->
|
||||||
<string name="c_copyright">Copyright (c) 2009-2011.\nCreated by serso aka se.solovyev.\n
|
<string name="c_copyright">Copyright (c) 2009-2011\n\n<b>Created by serso aka se.solovyev</b>\n\n
|
||||||
For more information please\ncontact me via email\n<a href="mailto:se.solovyev@gmail.com">se.solovyev@gmail.com</a>
|
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
|
||||||
\nor visit\n<a href="http://se.solovyev.org">http://se.solovyev.org</a>
|
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>
|
||||||
|
|
||||||
<string name="c_undo">undo</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_i_description">Imaginary unit, defined such that i^2 = −1</string>
|
||||||
<string name="c_calc_editor_hint">Enter new expression</string>
|
<string name="c_calc_editor_hint">Enter new expression</string>
|
||||||
<string name="c_press_to_copy">Press to copy</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>
|
</resources>
|
||||||
|
@ -46,4 +46,15 @@
|
|||||||
<item name="android:layout_height">match_parent</item>
|
<item name="android:layout_height">match_parent</item>
|
||||||
</style>
|
</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>
|
</resources>
|
||||||
|
@ -6,11 +6,13 @@
|
|||||||
package org.solovyev.android.calculator;
|
package org.solovyev.android.calculator;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.app.AlertDialog;
|
||||||
import android.content.*;
|
import android.content.*;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.text.ClipboardManager;
|
import android.text.ClipboardManager;
|
||||||
|
import android.text.method.LinkMovementMethod;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.*;
|
import android.view.*;
|
||||||
@ -213,12 +215,30 @@ public class CalculatorActivity extends Activity implements FontSizeAdjuster, Sh
|
|||||||
startActivity(new Intent(this, CalculatorVarsActivity.class));
|
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"})
|
@SuppressWarnings({"UnusedDeclaration"})
|
||||||
public void donateButtonClickHandler(@NotNull View v) {
|
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 Intent i = new Intent(Intent.ACTION_VIEW);
|
final View view = layoutInflater.inflate(R.layout.donate, null);
|
||||||
i.setData(Uri.parse(paypalDonateUrl));
|
|
||||||
startActivity(i);
|
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
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user