Skip to content
Open
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
20 changes: 20 additions & 0 deletions .easignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# EAS Build ignore
.git
.claude
.codex-tools
.dual-graph
.expo
.gradle-user-home
.superpowers
.vscode
.github
android/.gradle
android/.idea
android/app/build
android/app/build_old_*
android/app/.cxx
android/wear/build
android/wear/.cxx
ios/Pods
*.apk
*.aab
156 changes: 156 additions & 0 deletions .github/workflows/build-apk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
name: Build APK & Release

on:
workflow_dispatch:
inputs:
release_tag:
description: 'Release tag (e.g. v1.2.0)'
required: false
default: ''
push:
branches:
- main
paths:
- 'app.json'
- 'src/**'
- 'App.tsx'
- 'package.json'
- 'android/**'

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest

outputs:
version: ${{ steps.meta.outputs.version }}
tag: ${{ steps.meta.outputs.tag }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21

- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ hashFiles('android/**/*.gradle*', 'android/gradle.properties') }}
restore-keys: gradle-

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Install SDK components
run: |
echo "y" | sdkmanager \
"ndk;27.1.12297006" \
"build-tools;36.0.0" \
"platforms;android-36" \
"cmake;3.22.1"

- name: Install dependencies
run: npm install --legacy-peer-deps

- name: Fix expo-modules-core Gradle bugs
run: |
FILE="node_modules/expo-modules-core/android/build.gradle"
sed -i "s|apply plugin: 'com.android.library'|// Fix: project-level re-declaration\ndef _coreFeatures = project.findProperty(\"coreFeatures\") ?: []\next.shouldIncludeCompose = _coreFeatures.contains(\"compose\")\n\napply plugin: 'com.android.library'|" "$FILE"
sed -i 's/^\s*compose shouldIncludeCompose\s*$/ compose = shouldIncludeCompose/' "$FILE"

- name: Read version & compute tag
id: meta
run: |
VERSION=$(node -p "require('./app.json').expo.version")
TAG="${{ github.event.inputs.release_tag }}"
if [ -z "$TAG" ]; then
TAG="v${VERSION}"
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "Building AeroStaff Pro $VERSION (tag: $TAG)"

- name: Make gradlew executable
run: chmod +x android/gradlew

- name: Restore signing keystore from repository secret
run: |
mkdir -p android/app "$HOME/.android"
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > android/app/debug.keystore
cp android/app/debug.keystore "$HOME/.android/debug.keystore"

- name: Build release APK (standalone, JS bundle embedded)
run: |
cd android
./gradlew :app:assembleRelease \
--no-daemon \
-Pandroid.overridePathCheck=true
env:
ANDROID_HOME: ${{ env.ANDROID_SDK_ROOT }}
GRADLE_OPTS: "-Xmx4g -XX:MaxMetaspaceSize=512m"

- name: Find & rename APK
id: apk
run: |
APK=$(find android/app/build/outputs/apk/release -name "*.apk" -type f | head -1)
echo "Found: $APK"
VERSION=${{ steps.meta.outputs.version }}
DEST="AeroStaffPro-v${VERSION}.apk"
mkdir -p artifacts
cp "$APK" "artifacts/$DEST"
echo "apk_path=artifacts/$DEST" >> "$GITHUB_OUTPUT"
echo "apk_name=$DEST" >> "$GITHUB_OUTPUT"
ls -lh artifacts/

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: AeroStaffPro-v${{ steps.meta.outputs.version }}
path: ${{ steps.apk.outputs.apk_path }}

release:
needs: build
runs-on: ubuntu-latest

steps:
- name: Download APK artifact
uses: actions/download-artifact@v4
with:
name: AeroStaffPro-v${{ needs.build.outputs.version }}
path: artifacts/

- name: Create or update GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.build.outputs.tag }}
target_commitish: ${{ github.sha }}
name: "AeroStaff Pro ${{ needs.build.outputs.version }}"
body: |
## AeroStaff Pro ${{ needs.build.outputs.version }}

APK Android generato automaticamente da GitHub Actions.

### Contenuto
- Bundle JavaScript incorporato
- Build release firmata con la keystore del repository
- APK pronto da installare

### Download
Installa `AeroStaffPro-v${{ needs.build.outputs.version }}.apk` sul tuo dispositivo Android.
prerelease: false
files: artifacts/*.apk
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# dependencies
node_modules/

# Old build artifacts
android/app/build_old_*/

# Expo
.expo/
dist/
Expand Down Expand Up @@ -33,6 +36,7 @@ yarn-error.*

# local env files
.env*.local
android/keystore.properties

# typescript
*.tsbuildinfo
Expand Down
77 changes: 53 additions & 24 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { BlurView } from 'expo-blur';
import * as Haptics from 'expo-haptics';
import { MaterialIcons } from '@expo/vector-icons';
import { ThemeProvider, useAppTheme } from './src/context/ThemeContext';
import { LanguageProvider, useLanguage } from './src/context/LanguageContext';
import { AirportProvider } from './src/context/AirportContext';
import HomeScreen from './src/screens/HomeScreen';
import TraveldocScreen from './src/screens/TraveldocScreen';
Expand Down Expand Up @@ -77,17 +78,26 @@ function GlassTab({ icon, label, focused, activeColor, inactiveColor, onPress }:
// ─── Inner app (inside ThemeProvider) ────────────────────────────────────────
function AppInner() {
const { colors, mode } = useAppTheme();
const { t } = useLanguage();
const [activeTab, setActiveTab] = useState<Tab>('Shifts');
const [drawerOpen, setDrawerOpen] = useState(false);
const [overlay, setOverlay] = useState<OverlayScreen>(null);

const tabLabels: Record<Tab, string> = {
Shifts: t('tabHome'), Calendar: t('tabShifts'), Flights: t('tabFlights'), TravelDoc: t('tabTravelDoc'),
};
const overlayTitles: Record<NonNullable<OverlayScreen>, string> = {
Notepad: t('overlayNotepad'), Phonebook: t('overlayPhonebook'),
Passwords: t('overlayPasswords'), Manuals: t('overlayManuals'), Settings: t('overlaySettings'),
};

const handleDrawerSelect = (id: string) => setOverlay(id as OverlayScreen);
const handleBack = () => setOverlay(null);

// ─── Auto-schedule flight notifications on startup ─────────────────────────
useEffect(() => {
autoScheduleNotifications().then(count => {
if (count > 0) console.log(`Auto-scheduled ${count} notifications`);
if (count > 0 && __DEV__) console.log(`Auto-scheduled ${count} notifications`);
}).catch(() => {});
}, []);

Expand Down Expand Up @@ -165,7 +175,7 @@ function AppInner() {
};


const appBarTitle = overlay ? OVERLAY_TITLES[overlay] : 'AeroStaff Pro';
const appBarTitle = overlay ? overlayTitles[overlay] : 'AeroStaff Pro';
const isWeather = mode === 'weather' && !!colors.gradient;

return (
Expand All @@ -175,8 +185,13 @@ function AppInner() {
backgroundColor={colors.appBar}
/>

{/* Top App Bar */}
<View style={[styles.appBar, { backgroundColor: colors.appBar, borderBottomColor: colors.border }]}>
{/* Top App Bar — liquid glass */}
<BlurView
intensity={colors.isDark ? 60 : 50}
tint={colors.isDark ? 'dark' : 'light'}
style={[styles.appBar, { borderBottomColor: colors.glassBorder }]}
>
<View style={[StyleSheet.absoluteFill, { backgroundColor: colors.appBar }]} />
{overlay ? (
<TouchableOpacity onPress={handleBack} style={styles.iconBtn}>
<MaterialIcons name="arrow-back" size={22} color={colors.primaryDark} />
Expand All @@ -187,15 +202,20 @@ function AppInner() {
</TouchableOpacity>
)}
<View style={styles.titleRow}>
<Text style={[styles.appBarTitle, { color: colors.primaryDark }]}>{appBarTitle}</Text>
<Text style={[styles.appBarTitle, { color: colors.text }]}>{appBarTitle}</Text>
{isWeather && (
<Text style={styles.weatherChip}>{colors.weatherIcon} {colors.weatherLabel}</Text>
)}
</View>
<View style={[styles.avatar, { backgroundColor: colors.primaryLight }]}>
<Text style={[styles.avatarText, { color: colors.primaryDark }]}>MR</Text>
</View>
</View>
<LinearGradient
colors={[colors.primaryLight, colors.primary]}
start={{ x: 0, y: 0 }}
end={{ x: 1, y: 1 }}
style={styles.avatar}
>
<Text style={styles.avatarText}>MR</Text>
</LinearGradient>
</BlurView>

{/* Screen Content */}
{isWeather ? (
Expand Down Expand Up @@ -235,10 +255,10 @@ function AppInner() {
<GlassTab
key={tab.id}
icon={tab.icon}
label={tab.label}
label={tabLabels[tab.id]}
focused={active}
activeColor={colors.primary}
inactiveColor={colors.isDark ? '#94A3B8' : '#64748B'}
activeColor={colors.tabIconActive}
inactiveColor={colors.tabIconInactive}
onPress={() => {
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
goToTab(TABS.findIndex(t => t.id === tab.id));
Expand All @@ -265,7 +285,9 @@ export default function App() {
return (
<ThemeProvider>
<AirportProvider>
<AppInner />
<LanguageProvider>
<AppInner />
</LanguageProvider>
</AirportProvider>
</ThemeProvider>
);
Expand All @@ -282,10 +304,11 @@ const styles = StyleSheet.create({
paddingHorizontal: 12,
paddingVertical: 10,
borderBottomWidth: 1,
overflow: 'hidden',
},
iconBtn: { padding: 6, borderRadius: 8, marginRight: 6 },
titleRow: { flex: 1, flexDirection: 'row', alignItems: 'center', gap: 8 },
appBarTitle: { fontSize: 18, fontWeight: 'bold', letterSpacing: 0.3 },
appBarTitle: { fontSize: 18, fontWeight: '700', letterSpacing: 0.3 },
weatherChip: {
fontSize: 11, color: 'rgba(255,255,255,0.8)',
backgroundColor: 'rgba(255,255,255,0.15)',
Expand All @@ -295,8 +318,9 @@ const styles = StyleSheet.create({
avatar: {
width: 34, height: 34, borderRadius: 17,
justifyContent: 'center', alignItems: 'center',
overflow: 'hidden',
},
avatarText: { fontSize: 12, fontWeight: 'bold' },
avatarText: { fontSize: 12, fontWeight: '700', color: '#FFFFFF' },
content: { flex: 1 },
// ─── Glassmorphic floating tab bar ───
tabBarWrapper: {
Expand All @@ -307,19 +331,19 @@ const styles = StyleSheet.create({
},
tabBarBlur: {
flexDirection: 'row',
height: 64,
borderRadius: 32,
height: 66,
borderRadius: 33,
justifyContent: 'space-around',
alignItems: 'center',
overflow: 'hidden',
borderWidth: 1,
borderColor: 'rgba(255,255,255,0.15)',
borderWidth: 0.75,
borderColor: 'rgba(0,0,0,0.08)',
},
glassTab: {
alignItems: 'center',
justifyContent: 'center',
width: 64,
height: 54,
width: 74,
height: 56,
},
glassLabel: {
fontSize: 10,
Expand All @@ -329,9 +353,14 @@ const styles = StyleSheet.create({
},
glassIndicator: {
position: 'absolute',
bottom: 0,
width: 20,
height: 3,
bottom: 4,
width: 22,
height: 3.5,
borderRadius: 999,
shadowColor: '#F47B16',
shadowOpacity: 0.5,
shadowRadius: 6,
shadowOffset: { width: 0, height: 0 },
elevation: 4,
},
});
Loading
Loading