Skip to content

Commit f71f849

Browse files
authored
Merge pull request #1 from Myzel394/first-improvements
First improvements
2 parents 4a499b8 + 5a53d57 commit f71f849

File tree

450 files changed

+9129
-10361
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

450 files changed

+9129
-10361
lines changed

.editorconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://editorconfig.org/
2+
# This configuration is used by ktlint when spotless invokes it
3+
4+
[*.{kt,kts}]
5+
ij_kotlin_allow_trailing_comma=true
6+
ij_kotlin_allow_trailing_comma_on_call_site=true
7+
ktlint_function_naming_ignore_when_annotated_with=Composable, Test
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Prepare KeyStore
2+
description: Write the KeyStore file and properties to disk
3+
4+
inputs:
5+
signingStorePassword:
6+
description: 'The password for the KeyStore'
7+
required: true
8+
signingKeyPassword:
9+
description: 'The password for the Key'
10+
required: true
11+
signingKeyAlias:
12+
description: 'The alias for the Key'
13+
required: true
14+
keyStoreBase64:
15+
description: 'The KeyStore file encoded as base64'
16+
required: true
17+
18+
runs:
19+
using: composite
20+
steps:
21+
- name: Write Keystore file 🗄️
22+
id: android_keystore
23+
uses: timheuer/base64-to-file@v1.0.3
24+
with:
25+
fileName: key.jks
26+
encodedString: ${{ inputs.keyStoreBase64 }}
27+
28+
- name: Write Keystore properties 🗝️
29+
shell: bash
30+
run: |
31+
echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > key.properties
32+
echo "storePassword=${{ inputs.signingStorePassword }}" >> key.properties
33+
echo "keyPassword=${{ inputs.signingKeyPassword }}" >> key.properties
34+
echo "keyAlias=${{ inputs.signingKeyAlias }}" >> key.properties
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build and push debug app
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
debug-builds:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- uses: gradle/wrapper-validation-action@v2
13+
14+
- name: Set up JDK
15+
uses: actions/setup-java@v4
16+
with:
17+
distribution: "adopt"
18+
java-version: 21
19+
cache: "gradle"
20+
21+
- name: Run tests
22+
run: ./gradlew test
23+
24+
- name: Compile
25+
run: ./gradlew assembleDebug
26+
27+
- name: Upload APK
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: numberhub-app-debug-apks
31+
path: app/build/outputs/apk/fdroid/debug/app-*-debug.apk
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Build and publish app
2+
3+
on:
4+
release:
5+
types: [ published ]
6+
7+
jobs:
8+
release-app-github:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- uses: gradle/wrapper-validation-action@v2
16+
17+
- name: Write KeyStore 🗝️
18+
uses: ./.github/actions/prepare-keystore
19+
with:
20+
signingStorePassword: ${{ secrets.SIGNING_STORE_PASSWORD }}
21+
signingKeyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }}
22+
signingKeyAlias: ${{ secrets.SIGNING_KEY_ALIAS }}
23+
keyStoreBase64: ${{ secrets.KEYSTORE }}
24+
25+
- name: Setup Java
26+
uses: actions/setup-java@v4
27+
with:
28+
distribution: 'adopt'
29+
java-version: 21
30+
cache: 'gradle'
31+
32+
- name: Build APKs 📱
33+
run: ./gradlew assembleRelease
34+
35+
- name: Build AABs 📱
36+
run: ./gradlew bundleRelease
37+
38+
- name: Upload APKs 🚀
39+
uses: softprops/action-gh-release@v1
40+
if: startsWith(github.ref, 'refs/tags/')
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
43+
with:
44+
files: app/build/outputs/apk/fdroid/release/*.apk
45+
46+
- name: Upload APKs bundles 🚀
47+
uses: softprops/action-gh-release@v1
48+
if: startsWith(github.ref, 'refs/tags/')
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
51+
with:
52+
files: app/build/outputs/bundle/fdroidRelease/*.aab

.run/spotlessApply.run.xml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!--
2+
~ Unitto is a calculator for Android
3+
~ Copyright (c) 2024 Elshan Agaev
4+
~
5+
~ This program is free software: you can redistribute it and/or modify
6+
~ it under the terms of the GNU General Public License as published by
7+
~ the Free Software Foundation, either version 3 of the License, or
8+
~ (at your option) any later version.
9+
~
10+
~ This program is distributed in the hope that it will be useful,
11+
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
~ GNU General Public License for more details.
14+
~
15+
~ You should have received a copy of the GNU General Public License
16+
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
-->
18+
19+
<component name="ProjectRunConfigurationManager">
20+
<configuration default="false" name="spotlessApply" type="GradleRunConfiguration" factoryName="Gradle">
21+
<ExternalSystemSettings>
22+
<option name="executionName" />
23+
<option name="externalProjectPath" value="$PROJECT_DIR$" />
24+
<option name="externalSystemIdString" value="GRADLE" />
25+
<option name="scriptParameters" value="--init-script gradle/init.gradle.kts --no-configuration-cache" />
26+
<option name="taskDescriptions">
27+
<list />
28+
</option>
29+
<option name="taskNames">
30+
<list>
31+
<option value="spotlessApply" />
32+
</list>
33+
</option>
34+
<option name="vmOptions" />
35+
</ExternalSystemSettings>
36+
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
37+
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
38+
<DebugAllEnabled>false</DebugAllEnabled>
39+
<ForceTestExec>false</ForceTestExec>
40+
<method v="2" />
41+
</configuration>
42+
</component>

.run/spotlessCheck.run.xml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!--
2+
~ Unitto is a calculator for Android
3+
~ Copyright (c) 2024 Elshan Agaev
4+
~
5+
~ This program is free software: you can redistribute it and/or modify
6+
~ it under the terms of the GNU General Public License as published by
7+
~ the Free Software Foundation, either version 3 of the License, or
8+
~ (at your option) any later version.
9+
~
10+
~ This program is distributed in the hope that it will be useful,
11+
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
~ GNU General Public License for more details.
14+
~
15+
~ You should have received a copy of the GNU General Public License
16+
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
-->
18+
19+
<component name="ProjectRunConfigurationManager">
20+
<configuration default="false" name="spotlessCheck" type="GradleRunConfiguration" factoryName="Gradle">
21+
<ExternalSystemSettings>
22+
<option name="executionName" />
23+
<option name="externalProjectPath" value="$PROJECT_DIR$" />
24+
<option name="externalSystemIdString" value="GRADLE" />
25+
<option name="scriptParameters" value="--init-script gradle/init.gradle.kts --no-configuration-cache" />
26+
<option name="taskDescriptions">
27+
<list />
28+
</option>
29+
<option name="taskNames">
30+
<list>
31+
<option value="spotlessCheck" />
32+
</list>
33+
</option>
34+
<option name="vmOptions" />
35+
</ExternalSystemSettings>
36+
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
37+
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
38+
<DebugAllEnabled>false</DebugAllEnabled>
39+
<ForceTestExec>false</ForceTestExec>
40+
<method v="2" />
41+
</configuration>
42+
</component>

README.md

Lines changed: 9 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -7,63 +7,14 @@
77
<img src="./fastlane/metadata/android/en-US/images/phoneScreenshots/slide5.png" width="19%" />
88
</p>
99

10-
# 📲 Download
10+
## Notice
1111

12-
<p align="middle">
13-
<a href="https://play.google.com/store/apps/details?id=com.sadellie.unitto"><img alt="Google Play" src="./content/gplay.svg" height="60"></a>
14-
<a href="https://f-droid.org/packages/com.sadellie.unitto"><img alt="F-Droid" src="./content/fdroid.svg" height="60"/></a>
15-
<a href="https://github.com/sadellie/unitto/releases/latest"><img alt="GitHub" src="./content/github.svg" height="60"/></a>
16-
</p>
17-
18-
Prefer _Google Play_
19-
20-
# 💁‍♀️ Contribute
21-
<p align="middle">
22-
<img src="./content/based.png" width="97%" />
23-
</p>
24-
25-
<p align="middle">
26-
<a href="https://poeditor.com/join/project/T4zjmoq8dx"><img alt="Translate" src="./content/translate.svg" height="60"/></a>
27-
<a href="https://github.com/sadellie/unitto/issues/new"><img alt="Issues" src="./content/issue.svg" height="60"/></a>
28-
<a href="https://github.com/sadellie/unitto/discussions/new/choose"><img alt="Discussions" src="./content/discussion.svg" height="60"/></a>
29-
</p>
30-
31-
## 👩‍💻 Do NOT contribute code
32-
1. I do **NOT** need any help in code.
33-
2. Hard forks and alterations of Unitto are **NOT** welcomed. Use a _Fork_ button so that commits' author is not lost.
34-
35-
# ⚠ Security
36-
Read [this](https://github.com/sadellie/unitto/wiki/Security).
37-
38-
<sup>TL;DR: the app is legit, no cap fr fr</sup>
39-
40-
## 🤖 Custom ROM developers
41-
Leave.
42-
43-
## 🤓 Nerds
44-
45-
<details>
46-
<summary>Benchmarks and Baseline profile</summary>
47-
48-
```
49-
Pixel 8 - 14
50-
51-
StartupBenchmark_startupPrecompiledWithBaselineProfile
52-
timeToInitialDisplayMs min 183.5, median 219.9, max 247.3
53-
54-
StartupBenchmark_startupWithoutPreCompilation
55-
timeToInitialDisplayMs min 223.6, median 328.0, max 663.8
56-
57-
StartupBenchmark_startupWithPartialCompilationAndDisabledBaselineProfile
58-
timeToInitialDisplayMs min 264.8, median 308.0, max 376.1
59-
StartupBenchmark_startupFullyPrecompiled
60-
timeToInitialDisplayMs min 314.4, median 336.9, max 388.3
61-
```
62-
</details>
63-
64-
## 🔎 Additional
65-
Terms and Conditions: https://sadellie.github.io/unitto/terms
66-
67-
Privacy Policy: https://sadellie.github.io/unitto/privacy
12+
This app was originally created by [sadellie](https://github.com/sadellie).
13+
Unfortunately, it has been archived on March 1st, 2024 (https://github.com/sadellie/unitto)
14+
without any notice or explanation.
15+
Since there has been no activity from sadellie on GitHub since then, I guess
16+
they are not actively working on projects anymore.
6817

69-
FAQ: https://sadellie.github.io/unitto/faq
18+
I will maintain this app, but I do not plan to add new features.
19+
I don't have enough time to do that, but you are welcome to contribute.
20+
I will review and merge your pull requests.

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ plugins {
2828
}
2929

3030
android {
31-
namespace = "com.sadellie.unitto"
31+
namespace = "app.myzel394.numberhub"
3232
compileSdk = 34
3333

3434
defaultConfig {
35-
applicationId = "com.sadellie.unitto"
35+
applicationId = "app.myzel394.numberhub"
3636
minSdk = 21
3737
targetSdk = 34
3838
versionCode = libs.versions.versionCode.get().toInt()

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<category android:name="android.intent.category.BROWSABLE" />
5151

5252
<data
53-
android:host="com.sadellie.unitto"
53+
android:host="app.myzel394.numberhub"
5454
android:scheme="app" />
5555
</intent-filter>
5656
</activity>

app/src/main/java/com/sadellie/unitto/App.kt renamed to app/src/main/java/app/myzel394/numberhub/App.kt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1717
*/
1818

19-
package com.sadellie.unitto
19+
package app.myzel394.numberhub
2020

2121
import androidx.activity.ComponentActivity
2222
import androidx.activity.SystemBarStyle
@@ -37,14 +37,14 @@ import androidx.compose.ui.platform.LocalContext
3737
import androidx.navigation.NavGraph.Companion.findStartDestination
3838
import androidx.navigation.compose.currentBackStackEntryAsState
3939
import androidx.navigation.compose.rememberNavController
40-
import com.sadellie.unitto.core.ui.common.NavigationDrawer
41-
import com.sadellie.unitto.core.ui.common.rememberDrawerState
42-
import com.sadellie.unitto.core.ui.model.DrawerItem
43-
import com.sadellie.unitto.core.ui.pushDynamicShortcut
44-
import com.sadellie.unitto.core.ui.theme.DarkThemeColors
45-
import com.sadellie.unitto.core.ui.theme.LightThemeColors
46-
import com.sadellie.unitto.core.ui.theme.TypographySystem
47-
import com.sadellie.unitto.data.model.userprefs.AppPreferences
40+
import app.myzel394.numberhub.core.ui.common.NavigationDrawer
41+
import app.myzel394.numberhub.core.ui.common.rememberDrawerState
42+
import app.myzel394.numberhub.core.ui.model.DrawerItem
43+
import app.myzel394.numberhub.core.ui.pushDynamicShortcut
44+
import app.myzel394.numberhub.core.ui.theme.DarkThemeColors
45+
import app.myzel394.numberhub.core.ui.theme.LightThemeColors
46+
import app.myzel394.numberhub.core.ui.theme.TypographySystem
47+
import app.myzel394.numberhub.data.model.userprefs.AppPreferences
4848
import io.github.sadellie.themmo.Themmo
4949
import io.github.sadellie.themmo.ThemmoController
5050
import kotlinx.coroutines.launch
@@ -76,14 +76,14 @@ internal fun ComponentActivity.App(prefs: AppPreferences?) {
7676
dynamicThemeEnabled = prefs.enableDynamicTheme,
7777
amoledThemeEnabled = prefs.enableAmoledTheme,
7878
customColor = prefs.customColor.toColor(),
79-
monetMode = prefs.monetMode
79+
monetMode = prefs.monetMode,
8080
)
8181
}
8282

8383
Themmo(
8484
themmoController = themmoController,
8585
typography = TypographySystem,
86-
animationSpec = tween(250)
86+
animationSpec = tween(250),
8787
) {
8888
val backgroundColor = MaterialTheme.colorScheme.background
8989
val isDarkThemeEnabled = remember(backgroundColor) { backgroundColor.luminance() < 0.5f }
@@ -92,7 +92,8 @@ internal fun ComponentActivity.App(prefs: AppPreferences?) {
9292
modifier = Modifier,
9393
state = drawerState,
9494
gesturesEnabled = gesturesEnabled,
95-
tabs = DrawerItem.main,
95+
mainTabs = DrawerItem.main,
96+
additionalTabs = DrawerItem.additional,
9697
currentDestination = navBackStackEntry?.destination?.route,
9798
onItemClick = { destination ->
9899
drawerScope.launch { drawerState.close() }
@@ -112,10 +113,9 @@ internal fun ComponentActivity.App(prefs: AppPreferences?) {
112113
navController = navController,
113114
themmoController = it,
114115
startDestination = prefs.startingScreen,
115-
rpnMode = prefs.rpnMode,
116-
openDrawer = { drawerScope.launch { drawerState.open() } }
116+
openDrawer = { drawerScope.launch { drawerState.open() } },
117117
)
118-
}
118+
},
119119
)
120120

121121
DisposableEffect(isDarkThemeEnabled) {

0 commit comments

Comments
 (0)