Skip to content

Commit

Permalink
Release 0.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikko Syrjä committed Sep 17, 2018
1 parent 5c8b763 commit f0337fb
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 17 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 0.5.0 (2018-08-04)
## 0.1 (2018-09-17)

- Initial port
- Initial version

19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ unit conversions, radix systems, complex numbers and user defined variables.

Android port of [SpeedCrunch](http://speedcrunch.org) calculator.

User interface based on the original Sailfish port by @qwazix.
User interface is based on the original Sailfish port by @qwazix. Current sailfish version is
available in [openrepos.net](https://openrepos.net/content/syrja/speedcrunch)

Features:
- Calculations with up to 50 digits of precision
Expand Down Expand Up @@ -33,20 +34,20 @@ user defined items. Topmost filter list selection can be used to show only built
units, constants or user defined variables and functions. Search field below it performs additional
filtering by name.

Pointing list item inserts it to the expression editing field and activates the main calculator
page. Long press opens context menu with options. First context menu item displays list item
Long press on list item opens context menu with options. First menu item displays list item
content. For functions it is usage with parameter names. For constants and variables it is value
and for units it is just unit name. Selecting first item performs same inserting as list item
pointing.
and for units it is just unit name. Selecting it inserts item to the expression editing field and
activates the main calculator page.

Used items are collected to recent item stack and displayed at the top of the list with bold font.
Newly created user variables and functions are automatically considered recently used. Other items
come after them in alphabetical order. Recent item stack size is not currently limited, but recent
menu items has additional context menu item for removing them from the recent stack. Also, user
defined functions and variables have context menu item for deleting them.

Rightmost page contains some settings. These are same as desktop version settings and mostly
self-explanatory. Note that user defined variables and functions are saved with the history list.
Rightmost page contains some settings. These are mostly same as desktop version settings and more
or less self-explanatory. Note that user defined variables and functions are saved with the history
list.

#### Expression editing and history list

Expand All @@ -55,8 +56,8 @@ results are stored there. Pointing history list line inserts result to the expre
Pointing and holding history line recalls the whole expression for editing.

Below the history list is expression editing field. It can be edited either by calculator key panes
or normal virtual keyboard. Popup message above edit field displays current result or possible
error message.
or normal virtual keyboard. Popup message above edit field displays current result or error
message.

#### Keyboard and pulley menu

Expand Down
3 changes: 2 additions & 1 deletion android-speedcrunch.pro
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ DISTFILES += \
android/res/values/libs.xml \
android/build.gradle \
android/gradle/wrapper/gradle-wrapper.properties \
android/gradlew.bat
android/gradlew.bat \
qml/Landscape.qml

RESOURCES += qml.qrc

Expand Down
6 changes: 3 additions & 3 deletions android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<manifest package="org.syrja.speedcrunch" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto">
<manifest package="org.syrja.speedcrunch" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.1" android:versionCode="1" android:installLocation="auto">
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="SpeedCrunch" android:icon="@drawable/icon">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="SpeedCrunch" android:screenOrientation="unspecified" android:launchMode="singleTop">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="SpeedCrunch" android:screenOrientation="unspecified" android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down Expand Up @@ -65,7 +65,7 @@

</application>

<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="16"/>
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="19"/>
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>

<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
Expand Down
1 change: 1 addition & 0 deletions qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<file>qml/Calculator.qml</file>
<file>qml/Functions.qml</file>
<file>qml/Keyboard.qml</file>
<file>qml/Landscape.qml</file>
<file>qml/Settings.qml</file>
<file>qml/back.png</file>
<file>qml/clear.png</file>
Expand Down
12 changes: 10 additions & 2 deletions qml/Calculator.qml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import QtQuick.Controls 2.3

Page
{
property int keyboardheight: parent.height * (landscape ? 60 : 45) / 100
property int keyboardheight: parent.height * (landscape ? 50 : 45) / 100
property string notification: ""

property alias history: historyview
Expand Down Expand Up @@ -152,7 +152,7 @@ Page
MouseArea
{
id: cleararea
anchors { fill: parent }
anchors.fill: parent
onClicked: { textfield.text = "" }
}
}
Expand All @@ -171,6 +171,14 @@ Page
id: keyboard
width: parent.width; height: keyboardheight
}
/*
Rectangle
{
width: parent.width; height: keyboardheight
Keyboard { id: keyboard; anchors.fill: parent }
// Landscape { id: keyboard; anchors.fill: parent }
}
*/
Component.onCompleted: { historyviewtimer.start() }
}
}
Expand Down
99 changes: 99 additions & 0 deletions qml/Landscape.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import QtQuick 2.9
import QtQuick.Controls 2.3

Rectangle
{
/*
property int buttonwidth: button1.width
property int buttonheight: button1.height
property int swipecount: 1
property int swipeindex: 0
clip: true
// color: backgroundcolor
Grid
{
anchors { fill: parent; margins: itemspacing }
columns: buttoncols
spacing: itemspacing
CalcButton { id: button1; text: "1"; value: "1"; secondary: "A" }
CalcButton { id: button2; text: "2"; value: "2"; secondary: "B" }
CalcButton { id: button3; text: "3"; value: "3"; secondary: "C" }
CalcButton { id: button4; text: "4"; value: "4"; secondary: "D" }
CalcButton { id: button5; text: "5"; value: "5"; secondary: "E" }
CalcButton { id: button6; text: "6"; value: "6"; secondary: "F" }
CalcButton { id: button7; text: "7" }
CalcButton { id: button8; text: "8" }
CalcButton { id: button9; text: "9"; value: "9"; secondary: "j" }
CalcButton { text: "0" }
CalcButton { text: "/" }
CalcButton { text: "×"; value: "×" }
CalcButton { text: "-" }
CalcButton { text: "+" }
CalcButton { text: "." }
CalcButton { text: ";" }
CalcButton { text: "x²"; value: "^2" }
CalcButton { text: "√"; value: "sqrt()" }
CalcButton { text: "1/x"; value: "1/" }
CalcButton { id: buttonbase; text: "0x"; value: "0x"; secondary: "0b" }
CalcButton { text: "sin"; value: "sin()" }
CalcButton { text: "cos"; value: "cos()" }
CalcButton { text: "tan"; value: "tan()" }
CalcButton { text: "ln"; value: "ln()" }
CalcButton { text: "Xⁿ"; value:"^" }
CalcButton { text: "asin"; value: "arcsin()" }
CalcButton { text: "acos"; value: "arccos()" }
CalcButton { text: "atan"; value: "arctan()" }
CalcButton { text: "exp"; value: "exp()" }
CalcButton { image: "cuberoot.png"; value:"cbrt()" }
CalcButton { text: "π"; value: "pi" }
CalcButton { text: "e" }
CalcButton { text: "x"; secondary: "y" }
CalcButton { text: "X="; value: "="; secondary: "(x)=" }
CalcButton { text: "!" }
CalcButton { text: "&&" }
CalcButton { text: "|" }
CalcButton { text: "<<" }
CalcButton { text: ">>" }
CalcButton { text: "➔"; value: "->" }
CalcButton { text: "(" } CalcButton { text: ")" }
CalcButton { text: "←"; special: true; onRunFunction: { textfield.cursorPosition-- } }
CalcButton { text: "→"; special: true; onRunFunction: { textfield.cursorPosition++ } }
BackSpace { }
}
function setButtonLabels()
{
var format = manager.getResultFormat()
if ( format === "h" )
{
button1.text = "1 A"; button2.text = "2 B"; button3.text = "3 C"
button4.text = "4 D"; button5.text = "5 E"; button6.text = "6 F"
}
else
{
button1.text = "1"; button2.text = "2"; button3.text = "3"
button4.text = "4"; button5.text = "5"; button6.text = "6"
}
if ( format === "h" || format === "b" || format === "o" )
buttonbase.text = "0x 0b"
else
buttonbase.text = "0x"
if ( manager.getComplexNumber() !== "d" )
button9.text = "9 j"
else
button9.text = "9"
}
*/
}
3 changes: 3 additions & 0 deletions qml/android-speedcrunch.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ ApplicationWindow
property int lineheight: fontsizelist * 1.5
property int menuheight: fontsizemenu * 2

// property int buttoncols: landscape ? 10 : 5
// property int buttonrows: landscape ? 4 : 5
property int buttoncols: 5
property int buttonrows: 5
property int cornerradius: width / buttoncols / 15
Expand Down Expand Up @@ -91,6 +93,7 @@ ApplicationWindow
{
id: menu
width: window.width / 2
x: window.width / 2
y: menuButton.height - itemspacing
closePolicy : Popup.NoAutoClose | Popup.CloseOnPressOutsideParent

Expand Down

0 comments on commit f0337fb

Please sign in to comment.