Tabs
This commit is contained in:
parent
0b100efcf0
commit
f2eca251f8
@ -20,28 +20,27 @@
|
||||
|
||||
</activity>
|
||||
|
||||
<!--NOTE: a:configChanges="orientation|keyboardHidden" is needed to correct work of dialog windows (not to close them on orientation change) -->
|
||||
<activity android:configChanges="orientation|keyboardHidden" android:label="@string/c_app_settings" android:name=".CalculatorPreferencesActivity"/>
|
||||
<activity android:label="@string/c_app_settings" android:name=".CalculatorPreferencesActivity"/>
|
||||
|
||||
<activity android:configChanges="orientation|keyboardHidden" android:label="@string/c_history" android:name=".history.CalculatorHistoryFragmentActivity"/>
|
||||
<activity android:label="@string/c_history" android:name=".history.CalculatorHistoryFragmentActivity"/>
|
||||
|
||||
<activity android:configChanges="orientation|keyboardHidden" android:label="@string/c_about" android:name=".about.CalculatorAboutTabActivity"/>
|
||||
<activity android:label="@string/c_about" android:name=".about.CalculatorAboutTabActivity"/>
|
||||
|
||||
<activity android:configChanges="orientation|keyboardHidden" android:label="@string/c_about" android:name=".about.CalculatorAboutActivity"/>
|
||||
<activity android:label="@string/c_about" android:name=".about.CalculatorAboutActivity"/>
|
||||
|
||||
<activity android:configChanges="orientation|keyboardHidden" android:label="@string/c_about" android:name=".about.CalculatorReleaseNotesActivity"/>
|
||||
<activity android:label="@string/c_about" android:name=".about.CalculatorReleaseNotesActivity"/>
|
||||
|
||||
<activity android:configChanges="orientation|keyboardHidden" android:label="@string/c_help" android:name=".help.CalculatorHelpTabActivity"/>
|
||||
<activity android:label="@string/c_help" android:name=".help.CalculatorHelpTabActivity"/>
|
||||
|
||||
<activity android:configChanges="orientation|keyboardHidden" android:label="@string/c_help" android:name=".help.HelpFaqActivity"/>
|
||||
<activity android:label="@string/c_help" android:name=".help.HelpFaqActivity"/>
|
||||
|
||||
<activity android:configChanges="orientation|keyboardHidden" android:label="@string/c_help" android:name=".help.HelpHintsActivity"/>
|
||||
<activity android:label="@string/c_help" android:name=".help.HelpHintsActivity"/>
|
||||
|
||||
<activity android:configChanges="orientation|keyboardHidden" android:label="@string/c_help" android:name=".help.HelpScreensActivity"/>
|
||||
<activity android:label="@string/c_help" android:name=".help.HelpScreensActivity"/>
|
||||
|
||||
<activity android:configChanges="orientation|keyboardHidden" android:label="@string/c_functions" android:name=".math.edit.CalculatorFunctionsFragmentActivity"/>
|
||||
<activity android:label="@string/c_functions" android:name=".math.edit.CalculatorFunctionsFragmentActivity"/>
|
||||
|
||||
<activity android:configChanges="orientation|keyboardHidden" android:label="@string/c_operators" android:name=".math.edit.CalculatorOperatorsFragmentActivity"/>
|
||||
<activity android:label="@string/c_operators" android:name=".math.edit.CalculatorOperatorsFragmentActivity"/>
|
||||
|
||||
<activity android:label="@string/c_vars_and_constants" android:name=".math.edit.CalculatorVarsFragmentActivity"/>
|
||||
|
||||
|
@ -1,213 +1,215 @@
|
||||
<?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
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<string name="c_app_name">Calculator++</string>
|
||||
<string name="c_app_name_free">Calculator++ Free</string>
|
||||
<string name="c_app_icon_name">Calc++</string>
|
||||
<string name="c_app_settings">Settings</string>
|
||||
<string name="c_syntax_error">Error</string>
|
||||
<string name="c_result_copied">Result copied to clipboard!</string>
|
||||
<string name="c_settings">Settings</string>
|
||||
<string name="c_help">Help</string>
|
||||
<string name="c_vars_and_constants">Variables And Constants</string>
|
||||
<!--PREFERENCE ACTIVITY-->
|
||||
<string name="c_prefs_main_category">Main settings</string>
|
||||
<string name="c_prefs_calculations_category">Calculation settings</string>
|
||||
<string name="c_prefs_appearance_category">Appearance settings</string>
|
||||
<string name="c_prefs_other_category">Other settings</string>
|
||||
<string name="c_prefs_drag_button_category">Drag buttons settings</string>
|
||||
|
||||
|
||||
<string name="c_down">Down</string>
|
||||
<string name="c_up">Up</string>
|
||||
<string name="c_restart">Restart</string>
|
||||
|
||||
<string name="c_undo">undo</string>
|
||||
<string name="c_redo">redo</string>
|
||||
<string name="c_clear">C</string>
|
||||
<string name="c_erase">clear</string>
|
||||
<string name="c_paste">paste</string>
|
||||
<string name="c_vars">vars</string>
|
||||
|
||||
<string name="c_copy">Copy</string>
|
||||
<string name="c_plot">Plot graph</string>
|
||||
<string name="c_graph">Graph</string>
|
||||
|
||||
<string name="c_calc_color_display_title">Highlight expressions</string>
|
||||
<string name="c_calc_round_result_title">Round result</string>
|
||||
<string name="c_calc_round_result_summary">Toggles rounding of the result</string>
|
||||
<string name="c_calc_science_notation_title">Always scientific notation</string>
|
||||
<string name="c_calc_science_notation_summary">If turned on forces to use only scientific notation of output (12.34E-12)</string>
|
||||
<string name="p_calc_result_precision_title">Precision of result</string>
|
||||
<string name="p_calc_max_calculation_time_title">Maximum calculation time</string>
|
||||
<string name="p_calc_max_calculation_time_summary">If calculations exceed specified limit - calculator halts with error</string>
|
||||
<string name="c_exit">Exit</string>
|
||||
<string name="c_add">Add</string>
|
||||
<string name="c_cancel">Cancel</string>
|
||||
<string name="c_save">Save</string>
|
||||
<string name="c_remove">Remove</string>
|
||||
<string name="c_yes">Yes</string>
|
||||
<string name="c_no">No</string>
|
||||
<string name="c_var_removal_confirmation">Removal confirmation</string>
|
||||
<string name="c_var_removal_confirmation_question">Do you really want to delete \'%s\' variable?</string>
|
||||
<string name="c_var_name">Name</string>
|
||||
<string name="c_var_value">Value</string>
|
||||
<string name="c_var_description">Description</string>
|
||||
<string name="c_var_create_var">Create variable</string>
|
||||
<string name="c_var_edit_var">Edit variable</string>
|
||||
|
||||
<string name="c_value.is.not.a.number">Value must be either number or empty!</string>
|
||||
<string name="c_var.name.clashes">Variable name clashes with function name!</string>
|
||||
<string name="c_var.already.exists">Variable with same name already exists!</string>
|
||||
<string name="c_name.is.not.valid">Name of constant is not valid: name must start with letter, can contain letters, digits and underscore.</string>
|
||||
<string name="c_sys.var.cannot.be.changed">System variable cannot be changed!</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_history">History</string>
|
||||
<string name="c_history_button">M</string>
|
||||
<string name="c_history_is_empty">History is empty!</string>
|
||||
<string name="c_app_history">History</string>
|
||||
<string name="c_char_is_not_accepted">Character \'%s\' is not accepted in variable name!</string>
|
||||
|
||||
<string name="c_calc_angle_units">Angle Units</string>
|
||||
<string name="p_deg">Degrees</string>
|
||||
<string name="p_rad">Radians</string>
|
||||
<string name="p_grad">Gradians</string>
|
||||
<string name="p_turns">Turns</string>
|
||||
<string name="c_angle_units_summary">Defines the default units for angles.</string>
|
||||
|
||||
<string name="c_calc_numeral_bases">Numeral systems</string>
|
||||
<string name="c_numeral_bases_summary">Defines the default numeral system for all input numbers.</string>
|
||||
<string name="p_dec">Decimal</string>
|
||||
<string name="p_hex">Hexadecimal</string>
|
||||
<string name="p_oct">Octal</string>
|
||||
<string name="p_bin">Binary</string>
|
||||
|
||||
<string name="c_calc_theme">Theme</string>
|
||||
<string name="p_default_theme">Grey</string>
|
||||
<string name="p_violet_theme">Violet</string>
|
||||
<string name="p_light_blue_theme">Light Blue</string>
|
||||
<string name="p_metro_blue_theme">Metro Blue (Default)</string>
|
||||
<string name="p_metro_green_theme">Metro Green</string>
|
||||
<string name="p_metro_purple_theme">Metro Purple</string>
|
||||
<string name="c_calc_result_precision_summary">Precision of result value (all calculations are done with maximum precision regardless of the value of this option)</string>
|
||||
<string name="c_calc_color_display_summary">Toggles colouring and styling in calculator editor</string>
|
||||
<string name="c_calc_theme_summary">Sets the theme for calculator</string>
|
||||
<string name="c_clear_history">Clear history</string>
|
||||
<string name="c_simplify_instead_of_numeric">Next constants are undefined: {0}!</string>
|
||||
|
||||
<string name="p_grouping_separator_no">No grouping separator</string>
|
||||
<string name="p_grouping_separator_apostrophe">Apostrophe (\')</string>
|
||||
<string name="p_grouping_separator_space">Space ( )</string>
|
||||
<string name="c_calc_grouping_separator">Grouping separator</string>
|
||||
<string name="c_calc_grouping_separator_summary">Sets grouping separator</string>
|
||||
<string name="c_calc_multiplication_sign">Multiplication sign</string>
|
||||
<string name="c_calc_multiplication_sign_summary">Sets multiplication sign</string>
|
||||
|
||||
<string name="c_calc_layout">Layout</string>
|
||||
<string name="p_layout_cellphone">Scientific (cellphone)</string>
|
||||
<string name="p_layout_calculator">Scientific</string>
|
||||
<string name="p_layout_simple">Simple</string>
|
||||
<string name="c_calc_layout_summary">Sets layout of buttons</string>
|
||||
|
||||
<string name="c_calc_haptic_feedback_title">Haptic feedback</string>
|
||||
<string name="c_calc_haptic_feedback_summary">Toggles vibration on button click</string>
|
||||
|
||||
<string name="p_calc_haptic_feedback_strength_short">Short</string>
|
||||
<string name="p_calc_haptic_feedback_strength_middle">Middle</string>
|
||||
<string name="p_calc_haptic_feedback_strength_long">Long</string>
|
||||
|
||||
<string name="p_calc_haptic_feedback_duration_title">Haptic feedback duration</string>
|
||||
<string name="p_calc_haptic_feedback_duration_summary">Duration vibration on button click</string>
|
||||
|
||||
<string name="c_empty_var_error">Unable to create empty constant!</string>
|
||||
<string name="c_not_valid_result">Current result is not valid!</string>
|
||||
|
||||
<string name="c_plot_graph">Graph</string>
|
||||
<string name="c_min_x_value">From</string>
|
||||
<string name="c_max_x_value">To</string>
|
||||
|
||||
<string name="c_swipe_distance">Swipe distance for buttons</string>
|
||||
<string name="c_swipe_distance_summary">Sets swipe distance for buttons that support additional swipe actions</string>
|
||||
|
||||
<string name="c_comment">Comment</string>
|
||||
<string name="c_history_item_saved">Saved</string>
|
||||
<string name="c_history_item_not_saved">Not saved</string>
|
||||
<string name="c_expression_copied">Expression copied to the clipboard!</string>
|
||||
<string name="c_history_item_status">Status: </string>
|
||||
<string name="c_history_item_comment">Comment: </string>
|
||||
<string name="c_use">Use</string>
|
||||
<string name="c_use_short">Use</string>
|
||||
<string name="c_copy_expression">Copy expression</string>
|
||||
<string name="c_copy_result">Copy result</string>
|
||||
<string name="c_history_expression">Value</string>
|
||||
<string name="c_history_item_already_saved">Saved (see \'Saved history\' tab)</string>
|
||||
<string name="c_history_comment">Comment</string>
|
||||
<string name="c_save_history">Save history</string>
|
||||
<string name="c_edit_history">Modify history</string>
|
||||
<string name="c_edit">Modify</string>
|
||||
<string name="c_saved_history">Saved history</string>
|
||||
|
||||
<string name="c_history_already_saved">History was already saved!</string>
|
||||
<string name="c_history_must_be_saved">History must be saved before editing!</string>
|
||||
<string name="c_history_was_removed">History was successfully removed!</string>
|
||||
<string name="c_history_saved">History was successfully saved!</string>
|
||||
|
||||
<string name="c_copy_description">Copy description</string>
|
||||
<string name="c_copy_value">Copy value</string>
|
||||
|
||||
<string name="c_first_start_text">Thank you for choosing Calculator++!\n\nCalculator++ is a powerful tool for making everyday calculations.\n\nTo remove the ads and support the project you can use special option from application settings.\n\nIt\'s highly recommended to read the FAQ and hints before the work to use all the features of application (press Menu button and then Help)</string>
|
||||
<string name="c_first_start_text_title">Welcome</string>
|
||||
|
||||
<string name="c_calc_show_release_notes_title">Show release notes</string>
|
||||
<string name="c_calc_show_release_notes_summary">Defines if release notes popup window should appear after update to the new version</string>
|
||||
|
||||
<string name="c_calc_use_back_button_as_prev_summary">Defines the behaviour of the Back button</string>
|
||||
<string name="c_calc_use_back_button_as_prev_title">Use Back button as history prev</string>
|
||||
|
||||
<string name="c_clear_billing_info_summary">Billing information will be reloaded from the server</string>
|
||||
<string name="c_clear_billing_info_title">Clear billing information</string>
|
||||
|
||||
<string name="c_warning">Warning</string>
|
||||
<string name="c_error">Error</string>
|
||||
<string name="c_billing_error">Billing is not supported: you must have Google Checkout account linked to your Google account and must be connected to the internet.</string>
|
||||
|
||||
<string name="c_calc_ad_free_title">Support the project</string>
|
||||
<string name="c_calc_ad_free_summary">And remove the advertisement</string>
|
||||
|
||||
<string name="c_calc_already_purchased">Ad free option has been already purchased!</string>
|
||||
<string name="c_calc_purchasing">Purchasing…</string>
|
||||
<string name="c_calc_clearing">Clearing…</string>
|
||||
|
||||
<string name="c_feedback_title">Feedback</string>
|
||||
<string name="c_feedback_text">You have been using Calculator++ for some time \n
|
||||
and it\'s important for us to know your opinion about application.\n\n
|
||||
Please rate Calculator++ \non <a href="https://market.android.com/details?id=org.solovyev.android.calculator">Google Play</a>,\n leave a comment or \ndiscuss application \non our <a href="http://calculatorpp.com/forum/">forum</a>
|
||||
</string>
|
||||
|
||||
<string name="c_notespp_announce_text">Good news - I just released new application for Android called <a href="https://play.google.com/store/apps/details?id=org.solovyev.android.notes">Notes++</a>.\n
|
||||
If you\'re interesting in fast and easy way of making notes please follow the <a href="https://play.google.com/store/apps/details?id=org.solovyev.android.notes">link</a> and try Notes++!
|
||||
</string>
|
||||
|
||||
<string name="c_angle_units_changed_to">Angle units changed to \'%s\'!</string>
|
||||
<string name="c_numeral_base_changed_to">Numeral base changed to \'%s\'!</string>
|
||||
<string name="c_conversion_tool">Conversion tool</string>
|
||||
|
||||
<string name="c_convert">Convert to…</string>
|
||||
|
||||
<string name="convert_to_hex">Convert to hex</string>
|
||||
<string name="convert_to_bin">Convert to bin</string>
|
||||
<string name="convert_to_dec">Convert to dec</string>
|
||||
|
||||
<string name="editor">Editor</string>
|
||||
<string name="result">Result</string>
|
||||
|
||||
<?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
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<string name="c_app_name">Calculator++</string>
|
||||
<string name="c_app_name_free">Calculator++ Free</string>
|
||||
<string name="c_app_icon_name">Calc++</string>
|
||||
<string name="c_app_settings">Settings</string>
|
||||
<string name="c_syntax_error">Error</string>
|
||||
<string name="c_result_copied">Result copied to clipboard!</string>
|
||||
<string name="c_settings">Settings</string>
|
||||
<string name="c_help">Help</string>
|
||||
<string name="c_vars_and_constants">Variables And Constants</string>
|
||||
<!--PREFERENCE ACTIVITY-->
|
||||
<string name="c_prefs_main_category">Main settings</string>
|
||||
<string name="c_prefs_calculations_category">Calculation settings</string>
|
||||
<string name="c_prefs_appearance_category">Appearance settings</string>
|
||||
<string name="c_prefs_other_category">Other settings</string>
|
||||
<string name="c_prefs_drag_button_category">Drag buttons settings</string>
|
||||
|
||||
|
||||
<string name="c_down">Down</string>
|
||||
<string name="c_up">Up</string>
|
||||
<string name="c_restart">Restart</string>
|
||||
|
||||
<string name="c_undo">undo</string>
|
||||
<string name="c_redo">redo</string>
|
||||
<string name="c_clear">C</string>
|
||||
<string name="c_erase">clear</string>
|
||||
<string name="c_paste">paste</string>
|
||||
<string name="c_vars">vars</string>
|
||||
|
||||
<string name="c_copy">Copy</string>
|
||||
<string name="c_plot">Plot graph</string>
|
||||
<string name="c_graph">Graph</string>
|
||||
|
||||
<string name="c_calc_color_display_title">Highlight expressions</string>
|
||||
<string name="c_calc_round_result_title">Round result</string>
|
||||
<string name="c_calc_round_result_summary">Toggles rounding of the result</string>
|
||||
<string name="c_calc_science_notation_title">Always scientific notation</string>
|
||||
<string name="c_calc_science_notation_summary">If turned on forces to use only scientific notation of output (12.34E-12)</string>
|
||||
<string name="p_calc_result_precision_title">Precision of result</string>
|
||||
<string name="p_calc_max_calculation_time_title">Maximum calculation time</string>
|
||||
<string name="p_calc_max_calculation_time_summary">If calculations exceed specified limit - calculator halts with error</string>
|
||||
<string name="c_exit">Exit</string>
|
||||
<string name="c_add">Add</string>
|
||||
<string name="c_cancel">Cancel</string>
|
||||
<string name="c_save">Save</string>
|
||||
<string name="c_remove">Remove</string>
|
||||
<string name="c_yes">Yes</string>
|
||||
<string name="c_no">No</string>
|
||||
<string name="c_var_removal_confirmation">Removal confirmation</string>
|
||||
<string name="c_var_removal_confirmation_question">Do you really want to delete \'%s\' variable?</string>
|
||||
<string name="c_var_name">Name</string>
|
||||
<string name="c_var_value">Value</string>
|
||||
<string name="c_var_description">Description</string>
|
||||
<string name="c_var_create_var">Create variable</string>
|
||||
<string name="c_var_edit_var">Edit variable</string>
|
||||
|
||||
<string name="c_value.is.not.a.number">Value must be either number or empty!</string>
|
||||
<string name="c_var.name.clashes">Variable name clashes with function name!</string>
|
||||
<string name="c_var.already.exists">Variable with same name already exists!</string>
|
||||
<string name="c_name.is.not.valid">Name of constant is not valid: name must start with letter, can contain letters, digits and underscore.</string>
|
||||
<string name="c_sys.var.cannot.be.changed">System variable cannot be changed!</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_history">History</string>
|
||||
<string name="c_history_button">M</string>
|
||||
<string name="c_history_is_empty">History is empty!</string>
|
||||
<string name="c_app_history">History</string>
|
||||
<string name="c_char_is_not_accepted">Character \'%s\' is not accepted in variable name!</string>
|
||||
|
||||
<string name="c_calc_angle_units">Angle Units</string>
|
||||
<string name="p_deg">Degrees</string>
|
||||
<string name="p_rad">Radians</string>
|
||||
<string name="p_grad">Gradians</string>
|
||||
<string name="p_turns">Turns</string>
|
||||
<string name="c_angle_units_summary">Defines the default units for angles.</string>
|
||||
|
||||
<string name="c_calc_numeral_bases">Numeral systems</string>
|
||||
<string name="c_numeral_bases_summary">Defines the default numeral system for all input numbers.</string>
|
||||
<string name="p_dec">Decimal</string>
|
||||
<string name="p_hex">Hexadecimal</string>
|
||||
<string name="p_oct">Octal</string>
|
||||
<string name="p_bin">Binary</string>
|
||||
|
||||
<string name="c_calc_theme">Theme</string>
|
||||
<string name="p_default_theme">Grey</string>
|
||||
<string name="p_violet_theme">Violet</string>
|
||||
<string name="p_light_blue_theme">Light Blue</string>
|
||||
<string name="p_metro_blue_theme">Metro Blue (Default)</string>
|
||||
<string name="p_metro_green_theme">Metro Green</string>
|
||||
<string name="p_metro_purple_theme">Metro Purple</string>
|
||||
<string name="c_calc_result_precision_summary">Precision of result value (all calculations are done with maximum precision regardless of the value of this option)</string>
|
||||
<string name="c_calc_color_display_summary">Toggles colouring and styling in calculator editor</string>
|
||||
<string name="c_calc_theme_summary">Sets the theme for calculator</string>
|
||||
<string name="c_clear_history">Clear history</string>
|
||||
<string name="c_simplify_instead_of_numeric">Next constants are undefined: {0}!</string>
|
||||
|
||||
<string name="p_grouping_separator_no">No grouping separator</string>
|
||||
<string name="p_grouping_separator_apostrophe">Apostrophe (\')</string>
|
||||
<string name="p_grouping_separator_space">Space ( )</string>
|
||||
<string name="c_calc_grouping_separator">Grouping separator</string>
|
||||
<string name="c_calc_grouping_separator_summary">Sets grouping separator</string>
|
||||
<string name="c_calc_multiplication_sign">Multiplication sign</string>
|
||||
<string name="c_calc_multiplication_sign_summary">Sets multiplication sign</string>
|
||||
|
||||
<string name="c_calc_layout">Layout</string>
|
||||
<string name="p_layout_cellphone">Scientific (cellphone)</string>
|
||||
<string name="p_layout_calculator">Scientific</string>
|
||||
<string name="p_layout_simple">Simple</string>
|
||||
<string name="c_calc_layout_summary">Sets layout of buttons</string>
|
||||
|
||||
<string name="c_calc_haptic_feedback_title">Haptic feedback</string>
|
||||
<string name="c_calc_haptic_feedback_summary">Toggles vibration on button click</string>
|
||||
|
||||
<string name="p_calc_haptic_feedback_strength_short">Short</string>
|
||||
<string name="p_calc_haptic_feedback_strength_middle">Middle</string>
|
||||
<string name="p_calc_haptic_feedback_strength_long">Long</string>
|
||||
|
||||
<string name="p_calc_haptic_feedback_duration_title">Haptic feedback duration</string>
|
||||
<string name="p_calc_haptic_feedback_duration_summary">Duration vibration on button click</string>
|
||||
|
||||
<string name="c_empty_var_error">Unable to create empty constant!</string>
|
||||
<string name="c_not_valid_result">Current result is not valid!</string>
|
||||
|
||||
<string name="c_plot_graph">Graph</string>
|
||||
<string name="c_min_x_value">From</string>
|
||||
<string name="c_max_x_value">To</string>
|
||||
|
||||
<string name="c_swipe_distance">Swipe distance for buttons</string>
|
||||
<string name="c_swipe_distance_summary">Sets swipe distance for buttons that support additional swipe actions</string>
|
||||
|
||||
<string name="c_comment">Comment</string>
|
||||
<string name="c_history_item_saved">Saved</string>
|
||||
<string name="c_history_item_not_saved">Not saved</string>
|
||||
<string name="c_expression_copied">Expression copied to the clipboard!</string>
|
||||
<string name="c_history_item_status">Status: </string>
|
||||
<string name="c_history_item_comment">Comment: </string>
|
||||
<string name="c_use">Use</string>
|
||||
<string name="c_use_short">Use</string>
|
||||
<string name="c_copy_expression">Copy expression</string>
|
||||
<string name="c_copy_result">Copy result</string>
|
||||
<string name="c_history_expression">Value</string>
|
||||
<string name="c_history_item_already_saved">Saved (see \'Saved history\' tab)</string>
|
||||
<string name="c_history_comment">Comment</string>
|
||||
<string name="c_save_history">Save history</string>
|
||||
<string name="c_edit_history">Modify history</string>
|
||||
<string name="c_edit">Modify</string>
|
||||
<string name="c_saved_history">Saved history</string>
|
||||
|
||||
<string name="c_history_already_saved">History was already saved!</string>
|
||||
<string name="c_history_must_be_saved">History must be saved before editing!</string>
|
||||
<string name="c_history_was_removed">History was successfully removed!</string>
|
||||
<string name="c_history_saved">History was successfully saved!</string>
|
||||
|
||||
<string name="c_copy_description">Copy description</string>
|
||||
<string name="c_copy_value">Copy value</string>
|
||||
|
||||
<string name="c_first_start_text">Thank you for choosing Calculator++!\n\nCalculator++ is a powerful tool for making everyday calculations.\n\nTo remove the ads and support the project you can use special option from application settings.\n\nIt\'s highly recommended to read the FAQ and hints before the work to use all the features of application (press Menu button and then Help)</string>
|
||||
<string name="c_first_start_text_title">Welcome</string>
|
||||
|
||||
<string name="c_calc_show_release_notes_title">Show release notes</string>
|
||||
<string name="c_calc_show_release_notes_summary">Defines if release notes popup window should appear after update to the new version</string>
|
||||
|
||||
<string name="c_calc_use_back_button_as_prev_summary">Defines the behaviour of the Back button</string>
|
||||
<string name="c_calc_use_back_button_as_prev_title">Use Back button as history prev</string>
|
||||
|
||||
<string name="c_clear_billing_info_summary">Billing information will be reloaded from the server</string>
|
||||
<string name="c_clear_billing_info_title">Clear billing information</string>
|
||||
|
||||
<string name="c_warning">Warning</string>
|
||||
<string name="c_error">Error</string>
|
||||
<string name="c_billing_error">Billing is not supported: you must have Google Checkout account linked to your Google account and must be connected to the internet.</string>
|
||||
|
||||
<string name="c_calc_ad_free_title">Support the project</string>
|
||||
<string name="c_calc_ad_free_summary">And remove the advertisement</string>
|
||||
|
||||
<string name="c_calc_already_purchased">Ad free option has been already purchased!</string>
|
||||
<string name="c_calc_purchasing">Purchasing…</string>
|
||||
<string name="c_calc_clearing">Clearing…</string>
|
||||
|
||||
<string name="c_feedback_title">Feedback</string>
|
||||
<string name="c_feedback_text">You have been using Calculator++ for some time \n
|
||||
and it\'s important for us to know your opinion about application.\n\n
|
||||
Please rate Calculator++ \non <a href="https://market.android.com/details?id=org.solovyev.android.calculator">Google Play</a>,\n leave a comment or \ndiscuss application \non our <a href="http://calculatorpp.com/forum/">forum</a>
|
||||
</string>
|
||||
|
||||
<string name="c_notespp_announce_text">Good news - I just released new application for Android called <a href="https://play.google.com/store/apps/details?id=org.solovyev.android.notes">Notes++</a>.\n
|
||||
If you\'re interesting in fast and easy way of making notes please follow the <a href="https://play.google.com/store/apps/details?id=org.solovyev.android.notes">link</a> and try Notes++!
|
||||
</string>
|
||||
|
||||
<string name="c_angle_units_changed_to">Angle units changed to \'%s\'!</string>
|
||||
<string name="c_numeral_base_changed_to">Numeral base changed to \'%s\'!</string>
|
||||
<string name="c_conversion_tool">Conversion tool</string>
|
||||
|
||||
<string name="c_convert">Convert to…</string>
|
||||
|
||||
<string name="convert_to_hex">Convert to hex</string>
|
||||
<string name="convert_to_bin">Convert to bin</string>
|
||||
<string name="convert_to_dec">Convert to dec</string>
|
||||
|
||||
<string name="editor">Editor</string>
|
||||
<string name="result">Result</string>
|
||||
<string name="other">Other</string>
|
||||
<string name="derivatives">Derivatives/Integrals</string>
|
||||
|
||||
</resources>
|
@ -25,6 +25,7 @@ import net.robotmedia.billing.IBillingObserver;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.solovyev.android.AndroidUtils;
|
||||
import org.solovyev.android.calculator.about.CalculatorFragmentType;
|
||||
import org.solovyev.android.calculator.about.CalculatorReleaseNotesActivity;
|
||||
import org.solovyev.android.calculator.history.CalculatorHistoryFragment;
|
||||
import org.solovyev.android.calculator.history.CalculatorSavedHistoryFragment;
|
||||
@ -44,7 +45,7 @@ public class CalculatorActivity extends SherlockFragmentActivity implements Shar
|
||||
@NotNull
|
||||
public static final String TAG = CalculatorActivity.class.getSimpleName();
|
||||
|
||||
@Nullable
|
||||
@Nullable
|
||||
private IBillingObserver billingObserver;
|
||||
|
||||
private boolean useBackAsPrev;
|
||||
@ -74,14 +75,12 @@ public class CalculatorActivity extends SherlockFragmentActivity implements Shar
|
||||
activityHelper.logDebug("super.onCreate");
|
||||
|
||||
if (findViewById(R.id.main_second_pane) != null) {
|
||||
activityHelper.addTab(this, "history", CalculatorHistoryFragment.class, null, R.string.c_history, R.id.main_second_pane);
|
||||
activityHelper.addTab(this, "saved_history", CalculatorSavedHistoryFragment.class, null, R.string.c_saved_history, R.id.main_second_pane);
|
||||
activityHelper.addTab(this, "vars", CalculatorVarsFragment.class, null, R.string.c_vars, R.id.main_second_pane);
|
||||
activityHelper.addTab(this, "functions", CalculatorFunctionsFragment.class, null, R.string.c_functions, R.id.main_second_pane);
|
||||
activityHelper.addTab(this, "operators", CalculatorOperatorsFragment.class, null, R.string.c_operators, R.id.main_second_pane);
|
||||
activityHelper.addTab(this, "plot", CalculatorPlotFragment.class, null, R.string.c_plot, R.id.main_second_pane);
|
||||
|
||||
activityHelper.restoreSavedTab(this);
|
||||
activityHelper.addTab(this, CalculatorFragmentType.history, null, R.id.main_second_pane);
|
||||
activityHelper.addTab(this, CalculatorFragmentType.saved_history, null, R.id.main_second_pane);
|
||||
activityHelper.addTab(this, CalculatorFragmentType.variables, null, R.id.main_second_pane);
|
||||
activityHelper.addTab(this, CalculatorFragmentType.functions, null, R.id.main_second_pane);
|
||||
activityHelper.addTab(this, CalculatorFragmentType.operators, null, R.id.main_second_pane);
|
||||
activityHelper.addTab(this, CalculatorFragmentType.plotter, null, R.id.main_second_pane);
|
||||
} else {
|
||||
getSupportActionBar().hide();
|
||||
}
|
||||
@ -208,6 +207,13 @@ public class CalculatorActivity extends SherlockFragmentActivity implements Shar
|
||||
getCalculator().evaluate();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
this.activityHelper.onPause(this);
|
||||
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
@ -1,46 +1,56 @@
|
||||
package org.solovyev.android.calculator;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.View;
|
||||
import com.actionbarsherlock.app.SherlockFragmentActivity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 9/25/12
|
||||
* Time: 10:31 PM
|
||||
*/
|
||||
public interface CalculatorActivityHelper {
|
||||
|
||||
void onCreate(@NotNull SherlockFragmentActivity activity, @Nullable Bundle savedInstanceState);
|
||||
void onCreate(@NotNull Activity activity, @Nullable Bundle savedInstanceState);
|
||||
|
||||
void onSaveInstanceState(@NotNull SherlockFragmentActivity activity, @NotNull Bundle outState);
|
||||
void onSaveInstanceState(@NotNull Activity activity, @NotNull Bundle outState);
|
||||
|
||||
int getLayoutId();
|
||||
|
||||
@NotNull
|
||||
CalculatorPreferences.Gui.Theme getTheme();
|
||||
|
||||
void onResume(@NotNull SherlockFragmentActivity activity);
|
||||
void onResume(@NotNull Activity activity);
|
||||
|
||||
void onDestroy(@NotNull SherlockFragmentActivity activity);
|
||||
void onDestroy(@NotNull Activity activity);
|
||||
|
||||
void addTab(@NotNull SherlockFragmentActivity activity,
|
||||
@NotNull String tag,
|
||||
@NotNull Class<? extends Fragment> fragmentClass,
|
||||
@Nullable Bundle fragmentArgs,
|
||||
int captionResId, int parentViewId);
|
||||
|
||||
void restoreSavedTab(@NotNull SherlockFragmentActivity activity);
|
||||
|
||||
void logDebug(@NotNull String message);
|
||||
|
||||
void processButtons(@NotNull Activity activity, @NotNull View root);
|
||||
}
|
||||
package org.solovyev.android.calculator;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.View;
|
||||
import com.actionbarsherlock.app.SherlockFragmentActivity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.solovyev.android.calculator.about.CalculatorFragmentType;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 9/25/12
|
||||
* Time: 10:31 PM
|
||||
*/
|
||||
public interface CalculatorActivityHelper {
|
||||
|
||||
void onCreate(@NotNull SherlockFragmentActivity activity, @Nullable Bundle savedInstanceState);
|
||||
void onCreate(@NotNull Activity activity, @Nullable Bundle savedInstanceState);
|
||||
|
||||
void onSaveInstanceState(@NotNull SherlockFragmentActivity activity, @NotNull Bundle outState);
|
||||
void onSaveInstanceState(@NotNull Activity activity, @NotNull Bundle outState);
|
||||
|
||||
int getLayoutId();
|
||||
|
||||
@NotNull
|
||||
CalculatorPreferences.Gui.Theme getTheme();
|
||||
|
||||
void onResume(@NotNull SherlockFragmentActivity activity);
|
||||
void onResume(@NotNull Activity activity);
|
||||
|
||||
void onPause(@NotNull Activity activity);
|
||||
void onPause(@NotNull SherlockFragmentActivity activity);
|
||||
|
||||
void onDestroy(@NotNull SherlockFragmentActivity activity);
|
||||
void onDestroy(@NotNull Activity activity);
|
||||
|
||||
void addTab(@NotNull SherlockFragmentActivity activity,
|
||||
@NotNull String tag,
|
||||
@NotNull Class<? extends Fragment> fragmentClass,
|
||||
@Nullable Bundle fragmentArgs,
|
||||
int captionResId,
|
||||
int parentViewId);
|
||||
|
||||
void addTab(@NotNull SherlockFragmentActivity activity,
|
||||
@NotNull CalculatorFragmentType fragmentType,
|
||||
@Nullable Bundle fragmentArgs,
|
||||
int parentViewId);
|
||||
|
||||
|
||||
void logDebug(@NotNull String message);
|
||||
|
||||
void processButtons(@NotNull Activity activity, @NotNull View root);
|
||||
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import com.actionbarsherlock.app.SherlockFragmentActivity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.solovyev.android.AndroidUtils;
|
||||
import org.solovyev.android.calculator.about.CalculatorFragmentType;
|
||||
import org.solovyev.android.sherlock.tabs.ActionBarFragmentTabListener;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -32,7 +33,6 @@ public class CalculatorActivityHelperImpl extends AbstractCalculatorHelper imple
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
private static final String SELECTED_NAV = "selected_nav";
|
||||
|
||||
/*
|
||||
**********************************************************************
|
||||
@ -51,8 +51,8 @@ public class CalculatorActivityHelperImpl extends AbstractCalculatorHelper imple
|
||||
|
||||
@NotNull
|
||||
private CalculatorPreferences.Gui.Theme theme;
|
||||
private int navPosition = 0;
|
||||
|
||||
private int selectedNavigationIndex = 0;
|
||||
|
||||
public CalculatorActivityHelperImpl(int layoutId, @NotNull String logTag) {
|
||||
super(logTag);
|
||||
@ -68,8 +68,8 @@ public class CalculatorActivityHelperImpl extends AbstractCalculatorHelper imple
|
||||
public void onCreate(@NotNull Activity activity, @Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(activity);
|
||||
|
||||
if ( activity instanceof CalculatorEventListener) {
|
||||
CalculatorLocatorImpl.getInstance().getCalculator().addCalculatorEventListener((CalculatorEventListener)activity);
|
||||
if (activity instanceof CalculatorEventListener) {
|
||||
CalculatorLocatorImpl.getInstance().getCalculator().addCalculatorEventListener((CalculatorEventListener) activity);
|
||||
}
|
||||
|
||||
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||
@ -85,10 +85,6 @@ public class CalculatorActivityHelperImpl extends AbstractCalculatorHelper imple
|
||||
} else {
|
||||
Log.e(CalculatorActivityHelperImpl.class.getSimpleName(), "Root is null for " + activity.getClass().getName());
|
||||
}
|
||||
|
||||
if (savedInstanceState != null) {
|
||||
navPosition = savedInstanceState.getInt(SELECTED_NAV, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -101,29 +97,34 @@ public class CalculatorActivityHelperImpl extends AbstractCalculatorHelper imple
|
||||
actionBar.setHomeButtonEnabled(false);
|
||||
actionBar.setDisplayShowHomeEnabled(true);
|
||||
|
||||
if (activity instanceof CalculatorActivity) {
|
||||
if ( AndroidUtils.getScreenOrientation(activity) == Configuration.ORIENTATION_PORTRAIT ) {
|
||||
actionBar.setDisplayShowTitleEnabled(true);
|
||||
} else {
|
||||
}
|
||||
} else {
|
||||
actionBar.setDisplayShowTitleEnabled(true);
|
||||
}
|
||||
toggleTitle(activity, true);
|
||||
actionBar.setIcon(R.drawable.icon_action_bar);
|
||||
}
|
||||
|
||||
@Override
|
||||
private void toggleTitle(@NotNull SherlockFragmentActivity activity, boolean showTitle) {
|
||||
final ActionBar actionBar = activity.getSupportActionBar();
|
||||
|
||||
if (activity instanceof CalculatorActivity) {
|
||||
if (AndroidUtils.getScreenOrientation(activity) == Configuration.ORIENTATION_PORTRAIT) {
|
||||
actionBar.setDisplayShowTitleEnabled(true);
|
||||
} else {
|
||||
actionBar.setDisplayShowTitleEnabled(false);
|
||||
}
|
||||
} else {
|
||||
actionBar.setDisplayShowTitleEnabled(showTitle);
|
||||
}
|
||||
}
|
||||
|
||||
public void restoreSavedTab(@NotNull SherlockFragmentActivity activity) {
|
||||
final ActionBar actionBar = activity.getSupportActionBar();
|
||||
if (navPosition >= 0 && navPosition < actionBar.getTabCount()) {
|
||||
activity.getSupportActionBar().setSelectedNavigationItem(navPosition);
|
||||
if (selectedNavigationIndex >= 0 && selectedNavigationIndex < actionBar.getTabCount()) {
|
||||
actionBar.setSelectedNavigationItem(selectedNavigationIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(@NotNull SherlockFragmentActivity activity, @NotNull Bundle outState) {
|
||||
onSaveInstanceState((Activity) activity, outState);
|
||||
outState.putInt(SELECTED_NAV, activity.getSupportActionBar().getSelectedNavigationIndex());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -140,18 +141,41 @@ public class CalculatorActivityHelperImpl extends AbstractCalculatorHelper imple
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause(@NotNull Activity activity) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause(@NotNull SherlockFragmentActivity activity) {
|
||||
onPause((Activity) activity);
|
||||
|
||||
final int selectedNavigationIndex = activity.getSupportActionBar().getSelectedNavigationIndex();
|
||||
if (selectedNavigationIndex >= 0) {
|
||||
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||
final SharedPreferences.Editor editor = preferences.edit();
|
||||
editor.putInt(getSavedTabPreferenceName(activity), selectedNavigationIndex);
|
||||
editor.commit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String getSavedTabPreferenceName(@NotNull Activity activity) {
|
||||
return "tab_" + activity.getClass().getSimpleName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy(@NotNull Activity activity) {
|
||||
super.onDestroy(activity);
|
||||
|
||||
if ( activity instanceof CalculatorEventListener) {
|
||||
CalculatorLocatorImpl.getInstance().getCalculator().removeCalculatorEventListener((CalculatorEventListener)activity);
|
||||
if (activity instanceof CalculatorEventListener) {
|
||||
CalculatorLocatorImpl.getInstance().getCalculator().removeCalculatorEventListener((CalculatorEventListener) activity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy(@NotNull SherlockFragmentActivity activity) {
|
||||
this.onDestroy((Activity)activity);
|
||||
this.onDestroy((Activity) activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -161,9 +185,10 @@ public class CalculatorActivityHelperImpl extends AbstractCalculatorHelper imple
|
||||
@Nullable Bundle fragmentArgs,
|
||||
int captionResId,
|
||||
int parentViewId) {
|
||||
activity.getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
|
||||
|
||||
final ActionBar actionBar = activity.getSupportActionBar();
|
||||
|
||||
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
|
||||
|
||||
final ActionBar.Tab tab = actionBar.newTab();
|
||||
tab.setTag(tag);
|
||||
tab.setText(captionResId);
|
||||
@ -173,8 +198,11 @@ public class CalculatorActivityHelperImpl extends AbstractCalculatorHelper imple
|
||||
actionBar.addTab(tab);
|
||||
|
||||
fragmentTags.add(tag);
|
||||
}
|
||||
|
||||
restoreSavedTab(activity);
|
||||
@Override
|
||||
public void addTab(@NotNull SherlockFragmentActivity activity, @NotNull CalculatorFragmentType fragmentType, @Nullable Bundle fragmentArgs, int parentViewId) {
|
||||
addTab(activity, fragmentType.getFragmentTag(), fragmentType.getFragmentClass(), fragmentArgs, fragmentType.getDefaultTitleResId(), parentViewId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -191,5 +219,9 @@ public class CalculatorActivityHelperImpl extends AbstractCalculatorHelper imple
|
||||
@Override
|
||||
public void onResume(@NotNull SherlockFragmentActivity activity) {
|
||||
onResume((Activity) activity);
|
||||
|
||||
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||
selectedNavigationIndex = preferences.getInt(getSavedTabPreferenceName(activity), -1);
|
||||
restoreSavedTab(activity);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,59 @@
|
||||
package org.solovyev.android.calculator.about;
|
||||
|
||||
import android.support.v4.app.Fragment;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.solovyev.android.calculator.R;
|
||||
import org.solovyev.android.calculator.history.CalculatorHistoryFragment;
|
||||
import org.solovyev.android.calculator.history.CalculatorSavedHistoryFragment;
|
||||
import org.solovyev.android.calculator.math.edit.CalculatorFunctionsFragment;
|
||||
import org.solovyev.android.calculator.math.edit.CalculatorOperatorsFragment;
|
||||
import org.solovyev.android.calculator.math.edit.CalculatorVarsFragment;
|
||||
import org.solovyev.android.calculator.plot.CalculatorPlotFragment;
|
||||
|
||||
/**
|
||||
* User: Solovyev_S
|
||||
* Date: 03.10.12
|
||||
* Time: 11:30
|
||||
*/
|
||||
public enum CalculatorFragmentType {
|
||||
|
||||
history(CalculatorHistoryFragment.class, "history", R.string.c_history),
|
||||
saved_history(CalculatorSavedHistoryFragment.class, "saved_history", R.string.c_saved_history),
|
||||
variables(CalculatorVarsFragment.class, "vars", R.string.c_vars),
|
||||
functions(CalculatorFunctionsFragment.class, "functions", R.string.c_functions),
|
||||
operators(CalculatorOperatorsFragment.class, "operators", R.string.c_operators),
|
||||
plotter(CalculatorPlotFragment.class, "plotter", R.string.c_plot);
|
||||
|
||||
@NotNull
|
||||
private Class<? extends Fragment> fragmentClass;
|
||||
|
||||
@NotNull
|
||||
private final String fragmentTag;
|
||||
|
||||
private int defaultTitleResId;
|
||||
|
||||
private CalculatorFragmentType(@NotNull Class<? extends Fragment> fragmentClass, @NotNull String fragmentTag, int defaultTitleResId) {
|
||||
this.fragmentClass = fragmentClass;
|
||||
this.fragmentTag = fragmentTag;
|
||||
this.defaultTitleResId = defaultTitleResId;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getFragmentTag() {
|
||||
return fragmentTag;
|
||||
}
|
||||
|
||||
public int getDefaultTitleResId() {
|
||||
return defaultTitleResId;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Class<? extends Fragment> getFragmentClass() {
|
||||
return fragmentClass;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String createSubFragmentTag(@NotNull String subFragmentTag) {
|
||||
return this.fragmentTag + "_" + subFragmentTag;
|
||||
}
|
||||
}
|
@ -1,62 +1,71 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
package org.solovyev.android.calculator.history;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.actionbarsherlock.app.SherlockFragmentActivity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.solovyev.android.calculator.*;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 12/18/11
|
||||
* Time: 7:37 PM
|
||||
*/
|
||||
public class CalculatorHistoryFragmentActivity extends SherlockFragmentActivity implements CalculatorEventListener {
|
||||
|
||||
@NotNull
|
||||
private final CalculatorActivityHelper activityHelper = CalculatorApplication.getInstance().createActivityHelper(R.layout.main_empty, CalculatorHistoryFragmentActivity.class.getSimpleName());
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
activityHelper.onCreate(this, savedInstanceState);
|
||||
|
||||
activityHelper.addTab(this, "history", CalculatorHistoryFragment.class, null, R.string.c_history, R.id.main_layout);
|
||||
activityHelper.addTab(this, "saved_history", CalculatorSavedHistoryFragment.class, null, R.string.c_saved_history, R.id.main_layout);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
|
||||
activityHelper.onSaveInstanceState(this, outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
activityHelper.onResume(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
activityHelper.onDestroy(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCalculatorEvent(@NotNull CalculatorEventData calculatorEventData, @NotNull CalculatorEventType calculatorEventType, @Nullable Object data) {
|
||||
if ( calculatorEventType == CalculatorEventType.use_history_state ) {
|
||||
this.finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
package org.solovyev.android.calculator.history;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.actionbarsherlock.app.SherlockFragmentActivity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.solovyev.android.calculator.*;
|
||||
import org.solovyev.android.calculator.about.CalculatorFragmentType;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 12/18/11
|
||||
* Time: 7:37 PM
|
||||
*/
|
||||
public class CalculatorHistoryFragmentActivity extends SherlockFragmentActivity implements CalculatorEventListener {
|
||||
|
||||
@NotNull
|
||||
private final CalculatorActivityHelper activityHelper = CalculatorApplication.getInstance().createActivityHelper(R.layout.main_empty, CalculatorHistoryFragmentActivity.class.getSimpleName());
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
activityHelper.onCreate(this, savedInstanceState);
|
||||
|
||||
activityHelper.addTab(this, CalculatorFragmentType.history, null, R.id.main_layout);
|
||||
activityHelper.addTab(this, CalculatorFragmentType.saved_history, null, R.id.main_layout);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
|
||||
activityHelper.onSaveInstanceState(this, outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
activityHelper.onResume(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
this.activityHelper.onPause(this);
|
||||
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
activityHelper.onDestroy(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCalculatorEvent(@NotNull CalculatorEventData calculatorEventData, @NotNull CalculatorEventType calculatorEventType, @Nullable Object data) {
|
||||
if ( calculatorEventType == CalculatorEventType.use_history_state ) {
|
||||
this.finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,67 +1,79 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
package org.solovyev.android.calculator.math.edit;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.actionbarsherlock.app.SherlockFragmentActivity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.solovyev.android.calculator.*;
|
||||
import org.solovyev.android.calculator.history.CalculatorHistoryFragmentActivity;
|
||||
import org.solovyev.android.calculator.model.AndroidFunctionsMathRegistry;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 12/21/11
|
||||
* Time: 10:33 PM
|
||||
*/
|
||||
public class CalculatorFunctionsFragmentActivity extends SherlockFragmentActivity implements CalculatorEventListener {
|
||||
|
||||
@NotNull
|
||||
private final CalculatorActivityHelper activityHelper = CalculatorApplication.getInstance().createActivityHelper(R.layout.main_empty, CalculatorHistoryFragmentActivity.class.getSimpleName());
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
activityHelper.onCreate(this, savedInstanceState);
|
||||
|
||||
for (AndroidFunctionsMathRegistry.Category category : AndroidFunctionsMathRegistry.Category.getCategoriesByTabOrder()) {
|
||||
activityHelper.addTab(this, category.name(), CalculatorFunctionsFragment.class, AbstractMathEntityListFragment.createBundleFor(category.name()), category.getCaptionId(), R.id.main_layout);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
|
||||
activityHelper.onSaveInstanceState(this, outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
activityHelper.onResume(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
this.activityHelper.onDestroy(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCalculatorEvent(@NotNull CalculatorEventData calculatorEventData, @NotNull CalculatorEventType calculatorEventType, @Nullable Object data) {
|
||||
switch (calculatorEventType) {
|
||||
case use_function:
|
||||
this.finish();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
package org.solovyev.android.calculator.math.edit;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.actionbarsherlock.app.SherlockFragmentActivity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.solovyev.android.calculator.*;
|
||||
import org.solovyev.android.calculator.about.CalculatorFragmentType;
|
||||
import org.solovyev.android.calculator.history.CalculatorHistoryFragmentActivity;
|
||||
import org.solovyev.android.calculator.model.AndroidFunctionsMathRegistry;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 12/21/11
|
||||
* Time: 10:33 PM
|
||||
*/
|
||||
public class CalculatorFunctionsFragmentActivity extends SherlockFragmentActivity implements CalculatorEventListener {
|
||||
|
||||
@NotNull
|
||||
private final CalculatorActivityHelper activityHelper = CalculatorApplication.getInstance().createActivityHelper(R.layout.main_empty, CalculatorHistoryFragmentActivity.class.getSimpleName());
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
activityHelper.onCreate(this, savedInstanceState);
|
||||
|
||||
final CalculatorFragmentType fragmentType = CalculatorFragmentType.functions;
|
||||
|
||||
for (AndroidFunctionsMathRegistry.Category category : AndroidFunctionsMathRegistry.Category.getCategoriesByTabOrder()) {
|
||||
activityHelper.addTab(this, fragmentType.createSubFragmentTag(category.name()), fragmentType.getFragmentClass(), AbstractMathEntityListFragment.createBundleFor(category.name()), category.getCaptionId(), R.id.main_layout);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
|
||||
activityHelper.onSaveInstanceState(this, outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
activityHelper.onResume(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
this.activityHelper.onPause(this);
|
||||
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
this.activityHelper.onDestroy(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCalculatorEvent(@NotNull CalculatorEventData calculatorEventData, @NotNull CalculatorEventType calculatorEventType, @Nullable Object data) {
|
||||
switch (calculatorEventType) {
|
||||
case use_function:
|
||||
this.finish();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,64 +1,79 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
package org.solovyev.android.calculator.math.edit;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.actionbarsherlock.app.SherlockFragmentActivity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.solovyev.android.calculator.*;
|
||||
import org.solovyev.android.calculator.history.CalculatorHistoryFragmentActivity;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 12/21/11
|
||||
* Time: 10:33 PM
|
||||
*/
|
||||
public class CalculatorOperatorsFragmentActivity extends SherlockFragmentActivity implements CalculatorEventListener {
|
||||
|
||||
@NotNull
|
||||
private final CalculatorActivityHelper activityHelper = CalculatorApplication.getInstance().createActivityHelper(R.layout.main_empty, CalculatorHistoryFragmentActivity.class.getSimpleName());
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
activityHelper.onCreate(this, savedInstanceState);
|
||||
|
||||
activityHelper.addTab(this, "operators", CalculatorOperatorsFragment.class, null, R.string.c_operators, R.id.main_layout);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
|
||||
activityHelper.onSaveInstanceState(this, outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
activityHelper.onResume(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
this.activityHelper.onDestroy(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCalculatorEvent(@NotNull CalculatorEventData calculatorEventData, @NotNull CalculatorEventType calculatorEventType, @Nullable Object data) {
|
||||
switch (calculatorEventType) {
|
||||
case use_operator:
|
||||
this.finish();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
package org.solovyev.android.calculator.math.edit;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.actionbarsherlock.app.SherlockFragmentActivity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.solovyev.android.calculator.*;
|
||||
import org.solovyev.android.calculator.about.CalculatorFragmentType;
|
||||
import org.solovyev.android.calculator.history.CalculatorHistoryFragmentActivity;
|
||||
import org.solovyev.android.calculator.model.AndroidFunctionsMathRegistry;
|
||||
import org.solovyev.android.calculator.model.AndroidOperatorsMathRegistry;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 12/21/11
|
||||
* Time: 10:33 PM
|
||||
*/
|
||||
public class CalculatorOperatorsFragmentActivity extends SherlockFragmentActivity implements CalculatorEventListener {
|
||||
|
||||
@NotNull
|
||||
private final CalculatorActivityHelper activityHelper = CalculatorApplication.getInstance().createActivityHelper(R.layout.main_empty, CalculatorHistoryFragmentActivity.class.getSimpleName());
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
activityHelper.onCreate(this, savedInstanceState);
|
||||
|
||||
final CalculatorFragmentType fragmentType = CalculatorFragmentType.operators;
|
||||
|
||||
for (AndroidOperatorsMathRegistry.Category category : AndroidOperatorsMathRegistry.Category.getCategoriesByTabOrder()) {
|
||||
activityHelper.addTab(this, fragmentType.createSubFragmentTag(category.name()), fragmentType.getFragmentClass(), AbstractMathEntityListFragment.createBundleFor(category.name()), category.getCaptionId(), R.id.main_layout);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
|
||||
activityHelper.onSaveInstanceState(this, outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
activityHelper.onResume(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
this.activityHelper.onPause(this);
|
||||
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
this.activityHelper.onDestroy(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCalculatorEvent(@NotNull CalculatorEventData calculatorEventData, @NotNull CalculatorEventType calculatorEventType, @Nullable Object data) {
|
||||
switch (calculatorEventType) {
|
||||
case use_operator:
|
||||
this.finish();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,89 +1,100 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
package org.solovyev.android.calculator.math.edit;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import com.actionbarsherlock.app.SherlockFragmentActivity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.solovyev.android.calculator.*;
|
||||
import org.solovyev.android.calculator.history.CalculatorHistoryFragmentActivity;
|
||||
import org.solovyev.android.calculator.model.VarCategory;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 12/21/11
|
||||
* Time: 11:05 PM
|
||||
*/
|
||||
public class CalculatorVarsFragmentActivity extends SherlockFragmentActivity implements CalculatorEventListener {
|
||||
|
||||
@NotNull
|
||||
private final CalculatorActivityHelper activityHelper = CalculatorApplication.getInstance().createActivityHelper(R.layout.main_empty, CalculatorHistoryFragmentActivity.class.getSimpleName());
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
activityHelper.onCreate(this, savedInstanceState);
|
||||
|
||||
final Bundle bundle;
|
||||
|
||||
final Intent intent = getIntent();
|
||||
if (intent != null) {
|
||||
bundle = intent.getExtras();
|
||||
} else {
|
||||
bundle = null;
|
||||
}
|
||||
|
||||
|
||||
for (VarCategory category : VarCategory.getCategoriesByTabOrder()) {
|
||||
|
||||
final Bundle fragmentParameters;
|
||||
|
||||
if (category == VarCategory.my && bundle != null) {
|
||||
AbstractMathEntityListFragment.putCategory(bundle, category.name());
|
||||
fragmentParameters = bundle;
|
||||
} else {
|
||||
fragmentParameters = AbstractMathEntityListFragment.createBundleFor(category.name());
|
||||
}
|
||||
|
||||
activityHelper.addTab(this, category.name(), CalculatorVarsFragment.class, fragmentParameters, category.getCaptionId(), R.id.main_layout);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
|
||||
activityHelper.onSaveInstanceState(this, outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
activityHelper.onResume(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
this.activityHelper.onDestroy(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCalculatorEvent(@NotNull CalculatorEventData calculatorEventData, @NotNull CalculatorEventType calculatorEventType, @Nullable Object data) {
|
||||
switch (calculatorEventType) {
|
||||
case use_constant:
|
||||
this.finish();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
package org.solovyev.android.calculator.math.edit;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import com.actionbarsherlock.app.SherlockFragmentActivity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.solovyev.android.calculator.*;
|
||||
import org.solovyev.android.calculator.about.CalculatorFragmentType;
|
||||
import org.solovyev.android.calculator.history.CalculatorHistoryFragmentActivity;
|
||||
import org.solovyev.android.calculator.model.VarCategory;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 12/21/11
|
||||
* Time: 11:05 PM
|
||||
*/
|
||||
public class CalculatorVarsFragmentActivity extends SherlockFragmentActivity implements CalculatorEventListener {
|
||||
|
||||
@NotNull
|
||||
private final CalculatorActivityHelper activityHelper = CalculatorApplication.getInstance().createActivityHelper(R.layout.main_empty, CalculatorHistoryFragmentActivity.class.getSimpleName());
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
activityHelper.onCreate(this, savedInstanceState);
|
||||
|
||||
final Bundle bundle;
|
||||
|
||||
final Intent intent = getIntent();
|
||||
if (intent != null) {
|
||||
bundle = intent.getExtras();
|
||||
} else {
|
||||
bundle = null;
|
||||
}
|
||||
|
||||
final CalculatorFragmentType fragmentType = CalculatorFragmentType.variables;
|
||||
|
||||
for (VarCategory category : VarCategory.getCategoriesByTabOrder()) {
|
||||
|
||||
final Bundle fragmentParameters;
|
||||
|
||||
if (category == VarCategory.my && bundle != null) {
|
||||
AbstractMathEntityListFragment.putCategory(bundle, category.name());
|
||||
fragmentParameters = bundle;
|
||||
} else {
|
||||
fragmentParameters = AbstractMathEntityListFragment.createBundleFor(category.name());
|
||||
}
|
||||
|
||||
|
||||
activityHelper.addTab(this, fragmentType.createSubFragmentTag(category.name()), fragmentType.getFragmentClass(), fragmentParameters, category.getCaptionId(), R.id.main_layout);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
|
||||
activityHelper.onSaveInstanceState(this, outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
activityHelper.onResume(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
this.activityHelper.onPause(this);
|
||||
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
this.activityHelper.onDestroy(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCalculatorEvent(@NotNull CalculatorEventData calculatorEventData, @NotNull CalculatorEventType calculatorEventType, @Nullable Object data) {
|
||||
switch (calculatorEventType) {
|
||||
case use_constant:
|
||||
this.finish();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,9 +2,7 @@ package org.solovyev.android.calculator.math.edit;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.DialogFragment;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.LayoutInflater;
|
||||
|
@ -1,92 +1,180 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
package org.solovyev.android.calculator.model;
|
||||
|
||||
import android.app.Application;
|
||||
import jscl.math.operator.Operator;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.solovyev.common.JBuilder;
|
||||
import org.solovyev.common.math.MathRegistry;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 11/17/11
|
||||
* Time: 11:29 PM
|
||||
*/
|
||||
public class AndroidOperatorsMathRegistry extends AbstractAndroidMathRegistry<Operator, MathPersistenceEntity> {
|
||||
|
||||
@NotNull
|
||||
private static final Map<String, String> substitutes = new HashMap<String, String>();
|
||||
static {
|
||||
substitutes.put("Σ", "sum");
|
||||
substitutes.put("∏", "product");
|
||||
substitutes.put("∂", "derivative");
|
||||
substitutes.put("∫ab", "integral_ab");
|
||||
substitutes.put("∫", "integral");
|
||||
substitutes.put("Σ", "sum");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static final String OPERATOR_DESCRIPTION_PREFIX = "c_op_description_";
|
||||
|
||||
protected AndroidOperatorsMathRegistry(@NotNull MathRegistry<Operator> functionsRegistry,
|
||||
@NotNull Application application) {
|
||||
super(functionsRegistry, OPERATOR_DESCRIPTION_PREFIX, application);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Map<String, String> getSubstitutes() {
|
||||
return substitutes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCategory(@NotNull Operator mathEntity) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
// not supported yet
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected JBuilder<? extends Operator> createBuilder(@NotNull MathPersistenceEntity entity) {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Class<? extends MathEntityPersistenceContainer<MathPersistenceEntity>> getPersistenceContainerClass() {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Integer getPreferenceStringId() {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
// not supported yet
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MathPersistenceEntity transform(@NotNull Operator entity) {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected MathEntityPersistenceContainer<MathPersistenceEntity> createPersistenceContainer() {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
package org.solovyev.android.calculator.model;
|
||||
|
||||
import android.app.Application;
|
||||
import jscl.math.function.ArcTrigonometric;
|
||||
import jscl.math.function.Comparison;
|
||||
import jscl.math.function.Trigonometric;
|
||||
import jscl.math.operator.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.solovyev.android.calculator.R;
|
||||
import org.solovyev.common.JBuilder;
|
||||
import org.solovyev.common.collections.CollectionsUtils;
|
||||
import org.solovyev.common.math.MathRegistry;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 11/17/11
|
||||
* Time: 11:29 PM
|
||||
*/
|
||||
public class AndroidOperatorsMathRegistry extends AbstractAndroidMathRegistry<Operator, MathPersistenceEntity> {
|
||||
|
||||
@NotNull
|
||||
private static final Map<String, String> substitutes = new HashMap<String, String>();
|
||||
static {
|
||||
substitutes.put("Σ", "sum");
|
||||
substitutes.put("∏", "product");
|
||||
substitutes.put("∂", "derivative");
|
||||
substitutes.put("∫ab", "integral_ab");
|
||||
substitutes.put("∫", "integral");
|
||||
substitutes.put("Σ", "sum");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static final String OPERATOR_DESCRIPTION_PREFIX = "c_op_description_";
|
||||
|
||||
protected AndroidOperatorsMathRegistry(@NotNull MathRegistry<Operator> functionsRegistry,
|
||||
@NotNull Application application) {
|
||||
super(functionsRegistry, OPERATOR_DESCRIPTION_PREFIX, application);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Map<String, String> getSubstitutes() {
|
||||
return substitutes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCategory(@NotNull Operator operator) {
|
||||
for (Category category : Category.values()) {
|
||||
if ( category.isInCategory(operator) ) {
|
||||
return category.name();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
// not supported yet
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected JBuilder<? extends Operator> createBuilder(@NotNull MathPersistenceEntity entity) {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Class<? extends MathEntityPersistenceContainer<MathPersistenceEntity>> getPersistenceContainerClass() {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Integer getPreferenceStringId() {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
// not supported yet
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MathPersistenceEntity transform(@NotNull Operator entity) {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected MathEntityPersistenceContainer<MathPersistenceEntity> createPersistenceContainer() {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
/*
|
||||
**********************************************************************
|
||||
*
|
||||
* STATIC
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
|
||||
public static enum Category {
|
||||
|
||||
derivatives(R.string.derivatives, 100){
|
||||
@Override
|
||||
boolean isInCategory(@NotNull Operator operator) {
|
||||
return operator instanceof Derivative || operator instanceof Integral || operator instanceof IndefiniteIntegral;
|
||||
}
|
||||
},
|
||||
|
||||
other(R.string.other, 200) {
|
||||
@Override
|
||||
boolean isInCategory(@NotNull Operator operator) {
|
||||
return operator instanceof Sum || operator instanceof Product;
|
||||
}
|
||||
},
|
||||
|
||||
my(R.string.c_fun_category_my, 0) {
|
||||
@Override
|
||||
boolean isInCategory(@NotNull Operator operator) {
|
||||
return !operator.isSystem();
|
||||
}
|
||||
},
|
||||
|
||||
common(R.string.c_fun_category_common, 50) {
|
||||
@Override
|
||||
boolean isInCategory(@NotNull Operator operator) {
|
||||
for (Category category : values()) {
|
||||
if ( category != this ) {
|
||||
if ( category.isInCategory(operator) ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
private final int captionId;
|
||||
|
||||
private final int tabOrder;
|
||||
|
||||
Category(int captionId, int tabOrder) {
|
||||
this.captionId = captionId;
|
||||
this.tabOrder = tabOrder;
|
||||
}
|
||||
|
||||
public int getCaptionId() {
|
||||
return captionId;
|
||||
}
|
||||
|
||||
abstract boolean isInCategory(@NotNull Operator operator);
|
||||
|
||||
@NotNull
|
||||
public static List<Category> getCategoriesByTabOrder() {
|
||||
final List<Category> result = CollectionsUtils.asList(Category.values());
|
||||
|
||||
Collections.sort(result, new Comparator<Category>() {
|
||||
@Override
|
||||
public int compare(Category category, Category category1) {
|
||||
return category.tabOrder - category1.tabOrder;
|
||||
}
|
||||
});
|
||||
|
||||
// todo serso: current solution (as creating operators is not implemented yet)
|
||||
result.remove(my);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,91 +1,96 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
package org.solovyev.android.calculator.model;
|
||||
|
||||
import android.app.Application;
|
||||
import jscl.math.operator.Operator;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.solovyev.common.JBuilder;
|
||||
import org.solovyev.common.math.MathRegistry;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 11/19/11
|
||||
* Time: 1:48 PM
|
||||
*/
|
||||
public class AndroidPostfixFunctionsRegistry extends AbstractAndroidMathRegistry<Operator, MathPersistenceEntity> {
|
||||
|
||||
@NotNull
|
||||
private static final Map<String, String> substitutes = new HashMap<String, String>();
|
||||
static {
|
||||
substitutes.put("%", "percent");
|
||||
substitutes.put("!", "factorial");
|
||||
substitutes.put("!!", "double_factorial");
|
||||
substitutes.put("°", "degree");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static final String POSTFIX_FUNCTION_DESCRIPTION_PREFIX = "c_pf_description_";
|
||||
|
||||
protected AndroidPostfixFunctionsRegistry(@NotNull MathRegistry<Operator> functionsRegistry,
|
||||
@NotNull Application application) {
|
||||
super(functionsRegistry, POSTFIX_FUNCTION_DESCRIPTION_PREFIX, application);
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Map<String, String> getSubstitutes() {
|
||||
return substitutes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCategory(@NotNull Operator mathEntity) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
// not supported yet
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected JBuilder<? extends Operator> createBuilder(@NotNull MathPersistenceEntity entity) {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Class<? extends MathEntityPersistenceContainer<MathPersistenceEntity>> getPersistenceContainerClass() {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Integer getPreferenceStringId() {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
// not supported yet
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MathPersistenceEntity transform(@NotNull Operator entity) {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected MathEntityPersistenceContainer<MathPersistenceEntity> createPersistenceContainer() {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
package org.solovyev.android.calculator.model;
|
||||
|
||||
import android.app.Application;
|
||||
import jscl.math.operator.Operator;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.solovyev.common.JBuilder;
|
||||
import org.solovyev.common.math.MathRegistry;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 11/19/11
|
||||
* Time: 1:48 PM
|
||||
*/
|
||||
public class AndroidPostfixFunctionsRegistry extends AbstractAndroidMathRegistry<Operator, MathPersistenceEntity> {
|
||||
|
||||
@NotNull
|
||||
private static final Map<String, String> substitutes = new HashMap<String, String>();
|
||||
static {
|
||||
substitutes.put("%", "percent");
|
||||
substitutes.put("!", "factorial");
|
||||
substitutes.put("!!", "double_factorial");
|
||||
substitutes.put("°", "degree");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static final String POSTFIX_FUNCTION_DESCRIPTION_PREFIX = "c_pf_description_";
|
||||
|
||||
protected AndroidPostfixFunctionsRegistry(@NotNull MathRegistry<Operator> functionsRegistry,
|
||||
@NotNull Application application) {
|
||||
super(functionsRegistry, POSTFIX_FUNCTION_DESCRIPTION_PREFIX, application);
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Map<String, String> getSubstitutes() {
|
||||
return substitutes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCategory(@NotNull Operator operator) {
|
||||
for (AndroidOperatorsMathRegistry.Category category : AndroidOperatorsMathRegistry.Category.values()) {
|
||||
if ( category.isInCategory(operator) ) {
|
||||
return category.name();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
// not supported yet
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected JBuilder<? extends Operator> createBuilder(@NotNull MathPersistenceEntity entity) {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Class<? extends MathEntityPersistenceContainer<MathPersistenceEntity>> getPersistenceContainerClass() {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Integer getPreferenceStringId() {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
// not supported yet
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MathPersistenceEntity transform(@NotNull Operator entity) {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected MathEntityPersistenceContainer<MathPersistenceEntity> createPersistenceContainer() {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
@ -1,62 +1,71 @@
|
||||
package org.solovyev.android.calculator.plot;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import com.actionbarsherlock.app.SherlockFragmentActivity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.solovyev.android.calculator.CalculatorActivityHelper;
|
||||
import org.solovyev.android.calculator.CalculatorApplication;
|
||||
import org.solovyev.android.calculator.R;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 9/30/12
|
||||
* Time: 4:56 PM
|
||||
*/
|
||||
public class CalculatorPlotActivity extends SherlockFragmentActivity {
|
||||
|
||||
@NotNull
|
||||
private final CalculatorActivityHelper activityHelper = CalculatorApplication.getInstance().createActivityHelper(R.layout.main_empty, CalculatorPlotActivity.class.getSimpleName());
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
activityHelper.onCreate(this, savedInstanceState);
|
||||
|
||||
final Intent intent = getIntent();
|
||||
|
||||
final Bundle arguments;
|
||||
if (intent != null) {
|
||||
arguments = intent.getExtras();
|
||||
} else {
|
||||
arguments = null;
|
||||
}
|
||||
|
||||
activityHelper.addTab(this, "plot", CalculatorPlotFragment.class, arguments, R.string.c_plot, R.id.main_layout);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
|
||||
activityHelper.onSaveInstanceState(this, outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
activityHelper.onResume(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
activityHelper.onDestroy(this);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
package org.solovyev.android.calculator.plot;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import com.actionbarsherlock.app.SherlockFragmentActivity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.solovyev.android.calculator.CalculatorActivityHelper;
|
||||
import org.solovyev.android.calculator.CalculatorApplication;
|
||||
import org.solovyev.android.calculator.R;
|
||||
import org.solovyev.android.calculator.about.CalculatorFragmentType;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 9/30/12
|
||||
* Time: 4:56 PM
|
||||
*/
|
||||
public class CalculatorPlotActivity extends SherlockFragmentActivity {
|
||||
|
||||
@NotNull
|
||||
private final CalculatorActivityHelper activityHelper = CalculatorApplication.getInstance().createActivityHelper(R.layout.main_empty, CalculatorPlotActivity.class.getSimpleName());
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
activityHelper.onCreate(this, savedInstanceState);
|
||||
|
||||
final Intent intent = getIntent();
|
||||
|
||||
final Bundle arguments;
|
||||
if (intent != null) {
|
||||
arguments = intent.getExtras();
|
||||
} else {
|
||||
arguments = null;
|
||||
}
|
||||
|
||||
activityHelper.addTab(this, CalculatorFragmentType.plotter, arguments, R.id.main_layout);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
|
||||
activityHelper.onSaveInstanceState(this, outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
activityHelper.onResume(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
this.activityHelper.onPause(this);
|
||||
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
activityHelper.onDestroy(this);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user