Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: set up JDK 11
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
cache: gradle

Expand Down
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ plugins {

android {
namespace 'ua.naiksoftware.aritymod'
compileSdk 34
compileSdk 36

defaultConfig {
applicationId "ua.naiksoftware.aritymod"
minSdk 21
targetSdk 34
versionCode 37
targetSdk 36
versionCode 39
versionName "1.45"
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<application
android:allowBackup="true"
android:icon="@drawable/icon"
android:label="ArityMOD"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
Expand Down
39 changes: 28 additions & 11 deletions app/src/main/java/ua/naiksoftware/aritymod/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.text.Editable;
Expand All @@ -14,7 +13,6 @@
import android.view.KeyEvent;
import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.ListView;
Expand All @@ -23,6 +21,11 @@
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.appcompat.widget.Toolbar;
import androidx.core.graphics.Insets;
import androidx.core.view.OnApplyWindowInsetsListener;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowCompat;
import androidx.core.view.WindowInsetsCompat;
import org.javia.arity.Complex;
import org.javia.arity.Function;
import org.javia.arity.FunctionAndName;
Expand Down Expand Up @@ -131,33 +134,47 @@ private void internalConfigChange(Configuration config) {
input.addTextChangedListener(this);
input.setEditableFactory(new CalculatorEditable.Factory());

if (Build.VERSION.SDK_INT > 10) {// for greater 4.x
input.setTextIsSelectable(true);
} else { // hide keyboard for less 4.x
input.setInputType(0);
}
input.setTextIsSelectable(true);
input.setShowSoftInputOnFocus(false);

changeInput(history.getText());
if (oldText != null) {
input.setText(oldText);
}
input.requestFocus();
InputMethodManager inputManager
= (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.hideSoftInputFromWindow(
this.getCurrentFocus().getWindowToken(), InputMethodManager.RESULT_UNCHANGED_HIDDEN);
graphView.setOnClickListener(this);
graph3dView.setOnClickListener(this);
if (historyView != null) {
historyView.setAdapter(adapter);
historyView.setOnItemClickListener(this);
}
applyKeyboardInsets();
}

private void applyKeyboardInsets() {
final View keyboardContainer = findViewById(R.id.keyboard_container);
if (keyboardContainer == null) return;
final int xmlLeft = keyboardContainer.getPaddingLeft();
final int xmlRight = keyboardContainer.getPaddingRight();
final int xmlBottom = keyboardContainer.getPaddingBottom();
ViewCompat.setOnApplyWindowInsetsListener(keyboardContainer, new OnApplyWindowInsetsListener() {
@Override
public WindowInsetsCompat onApplyWindowInsets(View v, WindowInsetsCompat insets) {
Insets bars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
int bottomPad = Math.max(bars.bottom, xmlBottom);
v.setPadding(xmlLeft, 0, xmlRight, bottomPad);
return insets;
}
});
ViewCompat.requestApplyInsets(keyboardContainer);
}

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

WindowCompat.setDecorFitsSystemWindows(getWindow(), true);

history = new History(this);
adapter = new HistoryAdapter(this, history);
internalConfigChange(getResources().getConfiguration());
Expand Down
19 changes: 14 additions & 5 deletions app/src/main/res/layout-land/keyboard.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<ua.naiksoftware.aritymod.KeyboardView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/digits"
android:layout_width="fill_parent"
android:layout_height="100dip"
/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/keyboard_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="vertical"
android:paddingBottom="16dp">

<ua.naiksoftware.aritymod.KeyboardView
android:id="@+id/digits"
android:layout_width="match_parent"
android:layout_height="100dip" />
</LinearLayout>
13 changes: 11 additions & 2 deletions app/src/main/res/layout-port/keyboard.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/keyboard_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="vertical"
android:paddingBottom="48dp">

<ua.naiksoftware.aritymod.KeyboardView
android:id="@+id/alpha"
android:layout_width="match_parent"
android:layout_height="192dp" />

<ua.naiksoftware.aritymod.KeyboardView
android:id="@+id/digits"
android:layout_width="match_parent"
android:layout_height="224dp" />
</merge>
</LinearLayout>
12 changes: 8 additions & 4 deletions app/src/main/res/layout/history_line.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="56dp"
android:background="?attr/selectableItemBackground"
android:gravity="center_vertical"
android:paddingHorizontal="12dp"
android:paddingVertical="8dp">
android:minHeight="56dp"
android:orientation="horizontal"
android:paddingHorizontal="16dp"
android:paddingVertical="12dp">

<TextView
android:id="@+id/input"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:singleLine="true"
android:textAppearance="?attr/textAppearanceBodyLarge"
android:textColor="?attr/colorOnSurface" />
Expand All @@ -20,7 +23,7 @@
android:id="@+id/equals_separator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="8dp"
android:paddingHorizontal="6dp"
android:singleLine="true"
android:text=" = "
android:textAppearance="?attr/textAppearanceBodyMedium"
Expand All @@ -30,6 +33,7 @@
android:id="@+id/result"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
android:textAppearance="?attr/textAppearanceBodyLarge"
android:textColor="?attr/colorPrimary"
Expand Down
13 changes: 11 additions & 2 deletions app/src/main/res/layout/keyboard.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/keyboard_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="vertical"
android:paddingBottom="48dp">

<ua.naiksoftware.aritymod.KeyboardView
android:id="@+id/alpha"
android:layout_width="match_parent"
android:layout_height="192dp" />

<ua.naiksoftware.aritymod.KeyboardView
android:id="@+id/digits"
android:layout_width="match_parent"
android:layout_height="224dp" />
</merge>
</LinearLayout>
5 changes: 2 additions & 3 deletions app/src/main/res/layout/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@
android:layout_height="0dip"
android:layout_weight="1"
android:choiceMode="singleChoice"
android:divider="@null"
android:dividerHeight="0dp"
android:paddingHorizontal="8dp"
android:divider="@color/md_divider_subtle"
android:dividerHeight="1dp"
android:scrollbarStyle="outsideInset"
android:scrollbars="none" />

Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/toolbar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:logo="@drawable/icon"
app:title="@string/app_name"
tools:context=".MainActivity" />

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,6 @@
<color name="md_inverse_on_surface">#303034</color>
<color name="md_inverse_primary">#355CA8</color>
<color name="md_scrim">#000000</color>

<color name="md_divider_subtle">#1FFFFFFF</color>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="app_name">ArityMOD</string>
<string name="app_name">Arity Calculator</string>
<string name="user_defs">Переменные</string>
<string name="help">Помощь</string>
<string name="settings">Настройки</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-uk/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="app_name">ArityMOD</string>
<string name="app_name">Arity Calculator</string>
<string name="user_defs">Змінні</string>
<string name="help">Допомога</string>
<string name="settings">Налаштування</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,6 @@
<color name="md_inverse_on_surface">#F2EFF4</color>
<color name="md_inverse_primary">#B3C5FF</color>
<color name="md_scrim">#000000</color>

<color name="md_divider_subtle">#14000000</color>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<resources>

<string name="app_name">ArityMOD</string>
<string name="app_name">Arity Calculator</string>
<string name="user_defs">User definitions</string>
<string name="help">Help</string>
<string name="settings">Settings</string>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:8.7.3'
classpath 'com.android.tools.build:gradle:8.9.3'
}
}
allprojects {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Dec 30 18:51:09 EET 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading