add base-apps with manifests, layout system, and testing documentation

- Rename test-apps to base-apps with proper manifest.json for each app
- Add is_system_app flag to app discovery and Lua API
- Fix icon path resolution for /system/icons/ paths
- Add layout.lua and layout.rcss for reusable UI components
- Update home screen to dynamically load all apps from manifests
- Update all app RML files to use layout components
- Comprehensive testing framework documentation with JSON action format
- Add tests/ directory structure for automated UI testing
This commit is contained in:
2026-01-20 09:14:05 +01:00
parent 5de087e8e0
commit 1f91d7508e
101 changed files with 13103 additions and 966 deletions

View File

@@ -0,0 +1,368 @@
<rml>
<head>
<link type="text/rcss" href="../../ui/html.rcss"/>
<link type="text/rcss" href="../../ui/theme.rcss"/>
<link type="text/rcss" href="../../ui/components.rcss"/>
<link type="text/rcss" href="../../ui/layout.rcss"/>
<script src="../../scripts/navigation.lua"></script>
<script src="../../scripts/layout.lua"></script>
<title>Camera</title>
<style>
.camera-screen {
background-color: #000000;
}
/* Top Controls */
.camera-top-bar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px;
position: absolute;
top: 36px;
left: 0;
right: 0;
z-index: 10;
}
.camera-btn {
width: 48px;
height: 48px;
border-radius: 24px;
background-color: rgba(0, 0, 0, 0.4);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.camera-btn:hover {
background-color: rgba(255, 255, 255, 0.2);
}
.camera-btn img {
width: 28px;
height: 28px;
}
/* Viewfinder */
.viewfinder-container {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.viewfinder {
width: 100%;
height: 100%;
background-color: #1a1a1a;
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.viewfinder-placeholder {
color: #666666;
font-size: 18px;
text-align: center;
}
.viewfinder-placeholder-icon {
font-size: 64px;
margin-bottom: 16px;
color: #444444;
}
/* Grid Overlay */
.grid-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
pointer-events: none;
}
.grid-line-h, .grid-line-v {
position: absolute;
background-color: rgba(255, 255, 255, 0.2);
}
.grid-line-h {
height: 1px;
left: 0;
right: 0;
}
.grid-line-h.h1 { top: 33.33%; }
.grid-line-h.h2 { top: 66.66%; }
.grid-line-v {
width: 1px;
top: 0;
bottom: 0;
}
.grid-line-v.v1 { left: 33.33%; }
.grid-line-v.v2 { left: 66.66%; }
/* Focus indicator */
.focus-indicator {
position: absolute;
width: 80px;
height: 80px;
border: 2px solid #FFFFFF;
border-radius: 8px;
top: 50%;
left: 50%;
margin-top: -40px;
margin-left: -40px;
pointer-events: none;
opacity: 0.8;
}
/* Camera Modes */
.camera-modes {
display: flex;
justify-content: center;
padding: 16px 0;
gap: 24px;
}
.camera-mode {
font-size: 16px;
color: #B3B3B3;
cursor: pointer;
padding: 8px;
}
.camera-mode.active {
color: #FFD700;
font-weight: 600;
}
.camera-mode:hover {
color: #FFFFFF;
}
/* Bottom Controls */
.camera-bottom-bar {
display: flex;
justify-content: space-around;
align-items: center;
padding: 20px 32px;
background-color: rgba(0, 0, 0, 0.6);
}
.gallery-preview {
width: 48px;
height: 48px;
border-radius: 8px;
background-color: #333333;
border: 2px solid #FFFFFF;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}
.gallery-preview img {
width: 28px;
height: 28px;
opacity: 0.7;
}
.capture-btn {
width: 72px;
height: 72px;
border-radius: 36px;
background-color: #FFFFFF;
border: 4px solid rgba(255, 255, 255, 0.3);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}
.capture-btn:hover {
transform: scale(1.05);
}
.capture-btn:active {
transform: scale(0.95);
background-color: #E0E0E0;
}
.capture-btn-inner {
width: 60px;
height: 60px;
border-radius: 30px;
background-color: #FFFFFF;
}
.switch-camera-btn {
width: 48px;
height: 48px;
border-radius: 24px;
background-color: rgba(255, 255, 255, 0.2);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}
.switch-camera-btn:hover {
background-color: rgba(255, 255, 255, 0.3);
}
.switch-camera-btn img {
width: 28px;
height: 28px;
}
/* Indicators */
.flash-indicator {
position: absolute;
top: 100px;
left: 16px;
background-color: rgba(0, 0, 0, 0.4);
padding: 6px 12px;
border-radius: 12px;
font-size: 14px;
color: #FFFFFF;
}
.timer-indicator {
position: absolute;
top: 100px;
right: 16px;
background-color: rgba(0, 0, 0, 0.4);
padding: 6px 12px;
border-radius: 12px;
font-size: 14px;
color: #FFFFFF;
}
/* Zoom control */
.zoom-control {
position: absolute;
bottom: 200px;
left: 50%;
transform: translateX(-50%);
display: flex;
align-items: center;
gap: 12px;
}
.zoom-btn {
width: 40px;
height: 40px;
border-radius: 20px;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
color: #FFFFFF;
cursor: pointer;
}
.zoom-level {
font-size: 16px;
color: #FFD700;
font-weight: 600;
min-width: 48px;
text-align: center;
}
</style>
</head>
<body class="app-screen camera-screen" onload="initLayout(document)">
<!-- System Status Bar (transparent) -->
<div class="system-status-bar" style="background-color: transparent; position: absolute; top: 0; left: 0; right: 0; z-index: 20;">
<span id="status-time" class="system-status-time">12:30</span>
<div class="system-status-icons">
<img src="../../icons/wifi.tga"/>
<img src="../../icons/signal.tga"/>
<img src="../../icons/battery.tga"/>
</div>
</div>
<!-- Top Bar -->
<div class="camera-top-bar">
<div class="camera-btn" onclick="goBack()">
<img src="../../icons/close.tga"/>
</div>
<div style="display: flex; gap: 12px;">
<div class="camera-btn">
<img src="../../icons/flash.tga"/>
</div>
<div class="camera-btn">
<img src="../../icons/timer.tga"/>
</div>
<div class="camera-btn">
<img src="../../icons/settings.tga"/>
</div>
</div>
</div>
<!-- Viewfinder Area -->
<div class="viewfinder-container">
<div class="viewfinder" id="camera-viewfinder">
<div class="viewfinder-placeholder">
<div class="viewfinder-placeholder-icon">C</div>
<div>Camera Preview</div>
<div style="font-size: 14px; margin-top: 8px; color: #555555;">
Tap to focus
</div>
</div>
<!-- Grid Overlay -->
<div class="grid-overlay">
<div class="grid-line-h h1"></div>
<div class="grid-line-h h2"></div>
<div class="grid-line-v v1"></div>
<div class="grid-line-v v2"></div>
</div>
<!-- Focus Indicator -->
<div class="focus-indicator"></div>
</div>
<!-- Indicators -->
<div class="flash-indicator">Flash: Auto</div>
<div class="timer-indicator">Timer: Off</div>
<!-- Zoom Control -->
<div class="zoom-control">
<div class="zoom-btn">-</div>
<span class="zoom-level">1.0x</span>
<div class="zoom-btn">+</div>
</div>
</div>
<!-- Camera Modes -->
<div class="camera-modes">
<span class="camera-mode">Night</span>
<span class="camera-mode">Portrait</span>
<span class="camera-mode active">Photo</span>
<span class="camera-mode">Video</span>
<span class="camera-mode">More</span>
</div>
<!-- Bottom Bar -->
<div class="camera-bottom-bar">
<div class="gallery-preview">
<img src="../../icons/gallery.tga"/>
</div>
<div class="capture-btn" id="capture-button">
<div class="capture-btn-inner"></div>
</div>
<div class="switch-camera-btn">
<img src="../../icons/switch-camera.tga"/>
</div>
</div>
</body>
</rml>

View File

@@ -0,0 +1,19 @@
{
"id": "com.mosis.camera",
"name": "Camera",
"version": "1.0.0",
"version_code": 1,
"entry": "camera.rml",
"icon": "/system/icons/camera.tga",
"description": "Camera and photo capture",
"developer": {
"name": "Mosis Team",
"email": "dev@mosis.dev"
},
"is_system_app": true,
"permissions": [
"camera",
"storage"
],
"min_api_version": 1
}