Skip to content

Commit

Permalink
Merge pull request #6 from alexbarry/misc_updates
Browse files Browse the repository at this point in the history
Cleanup for submission to F-Droid
  • Loading branch information
alexbarry authored Jun 6, 2024
2 parents 648f731 + 993a85c commit ebea245
Show file tree
Hide file tree
Showing 23 changed files with 1,323 additions and 16 deletions.
Binary file added metadata/en-US/10-dark_impedance_tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions metadata/en-US/changelogs/8.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated to target Android SDK level 34. (previously was 30)
15 changes: 15 additions & 0 deletions metadata/en-US/full_description.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
AlexCalc is a scientific calculator with some neat features (note: also available as a web app at https://alexbarry.github.io/AlexCalc/ ):
* nicely formatted (LaTeX) equation display. This avoids the need to count brackets to make sure the equation was entered correctly. Also includes LaTeX code generation.
* complex number support, in rectangular or polar form (e.g. `3 + 4i` or `1 angle 90`)
* variable storage (e.g. `123 -> x` then `3*x^2 - 4*x + 5 -> y`)
* units in equations, and conversion (e.g. `1 inch * 3 ft to cm^2` or `sqrt(60 acre) - 100 ft`)
* can enter input by button presses, typing, or copy/pasting. Button presses are all converted to plaintext input for easy copy/pasting.
* equation display is simplified upon pressing enter. This means that when entering an equation, it is usually possible to look only at the LaTeX display and not the plaintext input: but when pressing enter, it will look nice. Redundant brackets are removed, including those that are needed for plaintext input (e.g. `(a + b)/(c + d)` can become "a + b" on the numerator and "c + d" on the denominator without brackets).
* light/dark themes
* previous input history can be accessed and edited by pressing "up" or "down" buttons.
* previous inputs/vars/recently used units preserved when the app is closed
* standard scientific calculator features, such as:
* trigonometric functions: sin, cos, tan, arcsin, arccos, arctan
* base 10 and natural logarithmic functions: log (base 10), ln (base e)
* `e`, `pi` constants, and square root function
* scientific notation input (e.g. `1.23E6` is 1.23 times 10^6)
Binary file added metadata/en-US/images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions metadata/en-US/short_description.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Scientific calculator with LaTeX equation display
9 changes: 5 additions & 4 deletions src/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {
compileSdkVersion 30
compileSdkVersion 34
// I am not impressed that at first, Android Studio dumped the passwords here in
// plaintext.
signingConfigs {
Expand All @@ -22,9 +22,9 @@ android {
defaultConfig {
applicationId "net.alexbarry.calc_android"
minSdkVersion 23
targetSdkVersion 30
versionCode 7
versionName "1.0.3"
targetSdkVersion 34
versionCode 8
versionName "1.0.4"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -42,6 +42,7 @@ android {

externalNativeBuild {
cmake {
version "3.18.1"
path "src/main/cpp/CMakeLists.txt"

// TODO does cppFlags here work?
Expand Down
5 changes: 3 additions & 2 deletions src/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.alexbarry.calc_android"
android:versionCode="7"
android:versionName="1.0.3">
android:versionCode="8"
android:versionName="1.0.4">

<application
android:allowBackup="true"
Expand All @@ -12,6 +12,7 @@
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:exported="true"
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
Expand Down
637 changes: 637 additions & 0 deletions src/android/app/src/main/assets/html/combined_other_licenses.html

Large diffs are not rendered by default.

29 changes: 26 additions & 3 deletions src/android/app/src/main/assets/html/js_display.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
Expand Down Expand Up @@ -66,6 +67,17 @@ <h1>AlexCalc</h1>
return { elem: elem, stylesheet: stylesheet};
}

function add_latex_node_to_parent_promise(tex, arg_parent) {
MathJax.texReset();
var options = MathJax.getMetricsFor(arg_parent);
options.scale = 2.0;
return MathJax.tex2chtmlPromise(tex, options).then( (node) => {
arg_parent.appendChild(node);
MathJax.startup.document.clear();
MathJax.startup.document.updateDocument();
});
}

var output_stylesheets = [];
var output_elems = [];

Expand All @@ -79,12 +91,18 @@ <h1>AlexCalc</h1>

function add_output_line_tex(tex) {
console.debug("add_output_line_tex: " + tex);

// TODO why doesn't this work anymore???
/*
var output = generate_latex_node(tex);
output_elems.push({ elem: output.elem, stylesheets: [output.stylesheet]});
output_text_window.appendChild(output.elem);
document.head.appendChild(output.stylesheet);
remove_output_display_elems(MAX_ELEMS);
scroll_to_bottom();
*/
add_latex_node_to_parent_promise(tex, output_text_window).then( () => {
remove_output_display_elems(MAX_ELEMS);
scroll_to_bottom();
});
}

function add_output_line_txt(msg, is_err) {
Expand Down Expand Up @@ -141,12 +159,17 @@ <h1>AlexCalc</h1>

clear_wip_tex();

// TODO why doesn't this work anymore???
/*
var output = generate_latex_node(tex);
wip_stylesheets.push(output.stylesheet);
wip_elems.push(output.elem);
input_wip_display.appendChild(output.elem);
document.head.appendChild(output.stylesheet);
scroll_to_bottom();
*/
add_latex_node_to_parent_promise(tex, input_wip_display).then(() => {
scroll_to_bottom();
});
}

function clear_wip_tex() {
Expand Down
6 changes: 3 additions & 3 deletions src/android/app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.4.1)
cmake_minimum_required(VERSION 3.10.2)

set(SRC_DIR "../../../../../")

Expand All @@ -13,8 +13,8 @@ list(APPEND COMPILE_OPTS

# TODO this must not be working, because I have a ton of
# warnings that would cause errors
set(CMAKE_C_FLAGS "${COMPILE_OPTS}")
set(CMAKE_CXX_FLAGS "${COMPILE_OPTS}")
#set(CMAKE_C_FLAGS "${COMPILE_OPTS}")
#set(CMAKE_CXX_FLAGS "${COMPILE_OPTS}")

add_library(calc_android_jni SHARED
calc_android_jni.cpp)
Expand Down
4 changes: 2 additions & 2 deletions src/android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@
<string name="about_text_html">
&lt;p>Created by Alex Barry.&lt;/p>
&lt;p>Available as a web app at &lt;a href="https://alexbarry.github.io/AlexCalc/">https://alexbarry.github.io/AlexCalc/&lt;a>&lt;/p>
&lt;p>Source available at &lt;a href="https://github.com/alexbarry/AlexCalc/">github.com/alexbarry/AlexCalc&lt;a>&lt;/p>
&lt;p>Please submit comments, feedback, feature requests, or discussions to:
&lt;ul>
&lt;li>&lt;strong>Github&lt;/strong>: &lt;a href="https://github.com/alexbarry/AlexCalc">https://github.com/alexbarry/AlexCalc
&lt;/a>&lt;/li>
&lt;li>&lt;strong>Reddit&lt;/strong>: &lt;a href="https://www.reddit.com/r/alexcalc/" style="font-family:monospace">reddit.com/r/alexcalc&lt;/a>&lt;/li>
&lt;li>&lt;strong>Discord&lt;/strong>: &lt;a href="https://discord.gg/ckNstZc2nF" style="font-family:monospace">discord.gg/ckNstZc2nF&lt;/a>&lt;/li>
&lt;li>&lt;strong>Email&lt;/strong>: &lt;a href="mailto:[email protected]" style="font-family:monospace">[email protected]&lt;/a>&lt;/li>
&lt;li>&lt;strong>Matrix&lt;/strong>: &lt;a href="https://matrix.to/#/#alexcalc:matrix.org" style="font-family:monospace">#alexcalc:matrix.org&lt;/a>&lt;/li>
Expand All @@ -145,9 +145,9 @@
<string name="about_text_raw">
Created by Alex Barry.\n
Available as a web app at https://alexbarry.github.io/AlexCalc/ \n
Source available at https://github.com/alexbarry/AlexCalc/ \n
Please submit comments, feedback, feature requests, or discussions to:\n
Github: https://github.com/alexbarry/AlexCalc \n
Reddit: https://www.reddit.com/r/alexcalc/ \n
Discord: https://discord.gg/ckNstZc2nF \n
Email: [email protected] \n
Matrix: https://matrix.to/#/#alexcalc:matrix.org \n
Expand Down
2 changes: 1 addition & 1 deletion src/calc_core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.4.1)
cmake_minimum_required(VERSION 3.10.2)

#add_library(hello-jni SHARED
# hello-jni.c)
Expand Down
2 changes: 1 addition & 1 deletion src/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,6 @@ <h2 style="text-align:center;margin-top:0">About AlexCalc</h2>
<p>Please submit comments, feedback, feature requests, or discussions to:
<ul>
<li><strong>Github</strong>: <a href="https://github.com/alexbarry/AlexCalc" style="font-family:monospace">github.com/alexbarry/AlexCalc</a></li>
<li><strong>Reddit</strong>: <a href="https://www.reddit.com/r/alexcalc/" style="font-family:monospace">reddit.com/r/alexcalc</a></li>
<li><strong>Discord</strong>: <a href="https://discord.gg/ckNstZc2nF" style="font-family:monospace">discord.gg/ckNstZc2nF</a></li>
<li><strong>Email</strong>: <span style="font-family:monospace">alexbarry.dev2 [ at ] gmail.com</span></li>
<li><strong>Matrix</strong>: <a href="https://matrix.to/#/#alexcalc:matrix.org" style="font-family:monospace">#alexcalc:matrix.org</a></li>
Expand All @@ -651,6 +650,7 @@ <h2 style="text-align:center;margin-top:0">About AlexCalc</h2>
<ul class="footer_items">
<li><a id="open_about_popup_link" href="#">About</a></li>
<li><a href="help.html">Help</a></li>
<li><a href="https://github.com/alexbarry/AlexCalc">Source</a></li>
<li><a class="licenses" href="licenses.html">Licenses</a></li>
</ul>
</div>
Expand Down
Loading

0 comments on commit ebea245

Please sign in to comment.