Merge pull request 'feat. Timer Done Alert (Issue #3)' (#4) from dev-issue-3 into main
All checks were successful
Build App / build-android (push) Successful in 7m17s
Build App / build-web (push) Successful in 30s
Build App / release (push) Successful in 11s

This commit was merged in pull request #4.
This commit is contained in:
2026-03-30 20:50:56 +02:00
6 changed files with 103 additions and 12 deletions

View File

@@ -1,7 +1,7 @@
name: Pull Request Check
name: Dev Branch Check
on:
pull_request:
branches:
push:
branches-ignore:
- main
jobs:

View File

@@ -0,0 +1,57 @@
name: Manual APK Build
on:
workflow_dispatch:
jobs:
build-android:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v2
- name: 🏗 Setup Node
uses: actions/setup-node@v2
with:
node-version: 22
- name: 🏗 Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- name: 🏗 Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: 🏗 Setup Android SDK
uses: android-actions/setup-android@v3
- name: 🏗 Setup Expo and EAS
uses: expo/expo-github-action@v8
with:
token: ${{ secrets.EXPO_TOKEN }}
eas-version: latest
packager: pnpm
- name: 📦 Install dependencies
run: pnpm install
- name: 👷 Build app
run: |
eas build --local \
--non-interactive \
--output=./app-build \
--platform=android \
--profile=preview
- name: 📝 Rename build to APK
run: mv app-build time-until-manual.apk
- name: 📤 Upload build artifact
uses: actions/upload-artifact@v3
with:
name: manual-apk-build
path: time-until-manual.apk
if-no-files-found: error

24
App.js
View File

@@ -3,6 +3,7 @@ import { BackHandler, Platform, StatusBar, Modal, View, Image, StyleSheet, Butto
import * as ScreenOrientation from 'expo-screen-orientation';
import * as SplashScreen from 'expo-splash-screen';
import { Accelerometer } from 'expo-sensors';
import { Audio } from 'expo-av';
import FocusScreen from './src/screens/FocusScreen';
import HomeScreen from './src/screens/HomeScreen';
import TimeUntilScreen from './src/screens/TimeUntilScreen';
@@ -194,6 +195,29 @@ export default function App() {
const timerSec = timerRemaining % 60;
const tuCountdown = getTuCountdown();
const playSound = async () => {
try {
const { sound } = await Audio.Sound.createAsync(
require('./assets/alert.mp3'),
{ shouldPlay: true, volume: 1.0 }
);
sound.setOnPlaybackStatusUpdate((status) => {
if (status.didJustFinish) {
sound.unloadAsync();
}
});
} catch (error) {
console.log('Error playing sound:', error);
}
};
useEffect(() => {
if (timerDone || tuIsOver) {
playSound();
}
}, [timerDone, tuIsOver]);
if (focusMode) {
return (
<FocusScreen

BIN
assets/alert.mp3 Normal file

Binary file not shown.

27
package-lock.json generated
View File

@@ -9,6 +9,7 @@
"version": "1.0.0",
"dependencies": {
"expo": "~54.0.33",
"expo-av": "^16.0.8",
"expo-screen-orientation": "~9.0.8",
"expo-sensors": "^55.0.8",
"expo-splash-screen": "^55.0.10",
@@ -56,7 +57,6 @@
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz",
"integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==",
"license": "MIT",
"peer": true,
"dependencies": {
"@babel/code-frame": "^7.29.0",
"@babel/generator": "^7.29.0",
@@ -1411,7 +1411,6 @@
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.6.tgz",
"integrity": "sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==",
"license": "MIT",
"peer": true,
"engines": {
"node": ">=6.9.0"
}
@@ -3824,7 +3823,6 @@
}
],
"license": "MIT",
"peer": true,
"dependencies": {
"baseline-browser-mapping": "^2.9.0",
"caniuse-lite": "^1.0.30001759",
@@ -4432,7 +4430,6 @@
"resolved": "https://registry.npmjs.org/expo/-/expo-54.0.33.tgz",
"integrity": "sha512-3yOEfAKqo+gqHcV8vKcnq0uA5zxlohnhA3fu4G43likN8ct5ZZ3LjAh9wDdKteEkoad3tFPvwxmXW711S5OHUw==",
"license": "MIT",
"peer": true,
"dependencies": {
"@babel/runtime": "^7.20.0",
"@expo/cli": "54.0.23",
@@ -4480,6 +4477,23 @@
}
}
},
"node_modules/expo-av": {
"version": "16.0.8",
"resolved": "https://registry.npmjs.org/expo-av/-/expo-av-16.0.8.tgz",
"integrity": "sha512-cmVPftGR/ca7XBgs7R6ky36lF3OC0/MM/lpgX/yXqfv0jASTsh7AYX9JxHCwFmF+Z6JEB1vne9FDx4GiLcGreQ==",
"license": "MIT",
"peerDependencies": {
"expo": "*",
"react": "*",
"react-native": "*",
"react-native-web": "*"
},
"peerDependenciesMeta": {
"react-native-web": {
"optional": true
}
}
},
"node_modules/expo-modules-autolinking": {
"version": "3.0.24",
"resolved": "https://registry.npmjs.org/expo-modules-autolinking/-/expo-modules-autolinking-3.0.24.tgz",
@@ -4957,7 +4971,6 @@
"resolved": "https://registry.npmjs.org/expo-font/-/expo-font-14.0.11.tgz",
"integrity": "sha512-ga0q61ny4s/kr4k8JX9hVH69exVSIfcIc19+qZ7gt71Mqtm7xy2c6kwsPTCyhBW2Ro5yXTT8EaZOpuRi35rHbg==",
"license": "MIT",
"peer": true,
"dependencies": {
"fontfaceobserver": "^2.1.0"
},
@@ -7526,7 +7539,6 @@
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.0.tgz",
"integrity": "sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==",
"license": "MIT",
"peer": true,
"dependencies": {
"scheduler": "^0.26.0"
},
@@ -7545,7 +7557,6 @@
"resolved": "https://registry.npmjs.org/react-native/-/react-native-0.81.5.tgz",
"integrity": "sha512-1w+/oSjEXZjMqsIvmkCRsOc8UBYv163bTWKTI8+1mxztvQPhCRYGTvZ/PL1w16xXHneIj/SLGfxWg2GWN2uexw==",
"license": "MIT",
"peer": true,
"dependencies": {
"@jest/create-cache-key-function": "^29.7.0",
"@react-native/assets-registry": "0.81.5",
@@ -7729,7 +7740,6 @@
"resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz",
"integrity": "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==",
"license": "MIT",
"peer": true,
"engines": {
"node": ">=0.10.0"
}
@@ -8607,7 +8617,6 @@
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
"license": "MIT",
"peer": true,
"engines": {
"node": ">=12"
},

View File

@@ -10,6 +10,7 @@
},
"dependencies": {
"expo": "~54.0.33",
"expo-av": "^16.0.8",
"expo-screen-orientation": "~9.0.8",
"expo-sensors": "^55.0.8",
"expo-splash-screen": "^55.0.10",