changes
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(PATH=\"$HOME/.cargo/bin:$PATH\" wasm-pack build --target web)",
|
||||
"Read(//Users/ferencsagi/.nvm/versions/node/v18.17.0/bin/**)",
|
||||
"Read(//Users/ferencsagi/**)",
|
||||
"Bash(/opt/homebrew/bin/npm create:*)",
|
||||
"Bash(/opt/homebrew/bin/node --version)",
|
||||
"Bash(PATH=\"/opt/homebrew/bin:$PATH\" npm create vite@latest frontend -- --template react)",
|
||||
"Bash(wasm-pack build:*)"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
# Miscellaneous
|
||||
*.class
|
||||
*.log
|
||||
*.pyc
|
||||
*.swp
|
||||
.DS_Store
|
||||
.atom/
|
||||
.build/
|
||||
.buildlog/
|
||||
.history
|
||||
.svn/
|
||||
.swiftpm/
|
||||
migrate_working_dir/
|
||||
|
||||
# IntelliJ related
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
.idea/
|
||||
|
||||
# The .vscode folder contains launch configuration and tasks you configure in
|
||||
# VS Code which you may wish to be included in version control, so this line
|
||||
# is commented out by default.
|
||||
#.vscode/
|
||||
|
||||
# Flutter/Dart/Pub related
|
||||
**/doc/api/
|
||||
**/ios/Flutter/.last_build_id
|
||||
.dart_tool/
|
||||
.flutter-plugins-dependencies
|
||||
.pub-cache/
|
||||
.pub/
|
||||
/build/
|
||||
/coverage/
|
||||
|
||||
# Symbolication related
|
||||
app.*.symbols
|
||||
|
||||
# Obfuscation related
|
||||
app.*.map.json
|
||||
|
||||
# Android Studio will place build artifacts here
|
||||
/android/app/debug
|
||||
/android/app/profile
|
||||
/android/app/release
|
||||
|
||||
# Rust / WASM build artifacts
|
||||
wasm/target/
|
||||
wasm/pkg/
|
||||
wasm/cert.pem
|
||||
wasm/key.pem
|
||||
wasm/frontend/node_modules/
|
||||
wasm/frontend/dist/
|
||||
|
||||
# Rust
|
||||
/core/target/
|
||||
@@ -0,0 +1,45 @@
|
||||
# This file tracks properties of this Flutter project.
|
||||
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
||||
#
|
||||
# This file should be version controlled and should not be manually edited.
|
||||
|
||||
version:
|
||||
revision: "ff37bef603469fb030f2b72995ab929ccfc227f0"
|
||||
channel: "stable"
|
||||
|
||||
project_type: app
|
||||
|
||||
# Tracks metadata for the flutter migrate command
|
||||
migration:
|
||||
platforms:
|
||||
- platform: root
|
||||
create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
|
||||
base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
|
||||
- platform: android
|
||||
create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
|
||||
base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
|
||||
- platform: ios
|
||||
create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
|
||||
base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
|
||||
- platform: linux
|
||||
create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
|
||||
base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
|
||||
- platform: macos
|
||||
create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
|
||||
base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
|
||||
- platform: web
|
||||
create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
|
||||
base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
|
||||
- platform: windows
|
||||
create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
|
||||
base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
|
||||
|
||||
# User provided section
|
||||
|
||||
# List of Local paths (relative to this file) that should be
|
||||
# ignored by the migrate tool.
|
||||
#
|
||||
# Files that are not part of the templates will be ignored by default.
|
||||
unmanaged_files:
|
||||
- 'lib/main.dart'
|
||||
- 'ios/Runner.xcodeproj/project.pbxproj'
|
||||
@@ -0,0 +1,49 @@
|
||||
# CLAUDE.md
|
||||
|
||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||
|
||||
## Project Overview
|
||||
|
||||
This is "SkyContour" (project/code name: sfzenith), a Flutter application targeting iOS, Android, macOS, Linux, Windows, and web platforms. It is a horizon-profiling tool for astrophotography: the user pans the phone camera around the horizon to record azimuth→altitude points and exports them for N.I.N.A. (.hrz) and Stellarium (360° panorama landscape). The authoritative spec is the designer handoff in **docs/** — read docs/README.md first (then SPEC.md, ARCHITECTURE.md, FORMATS.md, design/tokens.json). **docs/SPECIFICATION.md** tracks project-level decisions, current status and the roadmap. The functional prototype is the pure Rust core (`core/`), the wasm-bindgen adapter (`wasm/src/lib.rs`) and the React frontend (`wasm/frontend/`); the Flutter app is a thin native shell that runs the web build in a WebView. App ID on both platforms: `com.sagifer.skycontour` (never change it once published); the visible name comes from `wasm/frontend/src/lib/app.js` (APP_NAME), iOS Info.plist CFBundleDisplayName and Android android:label.
|
||||
|
||||
## Common Commands
|
||||
|
||||
```bash
|
||||
# Run the app
|
||||
flutter run
|
||||
|
||||
# Run tests
|
||||
flutter test
|
||||
|
||||
# Run a single test file
|
||||
flutter test test/widget_test.dart
|
||||
|
||||
# Analyze code (lint)
|
||||
flutter analyze
|
||||
|
||||
# Get dependencies
|
||||
flutter pub get
|
||||
|
||||
# Build the Rust WASM engine (from wasm/)
|
||||
wasm-pack build --target web
|
||||
|
||||
# Run Rust core tests incl. golden tests against docs/examples (from core/)
|
||||
cargo test
|
||||
|
||||
# Build web bundle into assets/web/ for the Flutter shell
|
||||
./scripts/build_web.sh
|
||||
|
||||
# Run the web prototype (from wasm/frontend/)
|
||||
npm run dev
|
||||
```
|
||||
|
||||
## Architecture
|
||||
|
||||
- **core/** (`sfzenith-core`): pure Rust, no I/O, no web-sys — profile, projection, fov, hrz, stellarium, zip, session. All math and file generation belongs here.
|
||||
- **wasm/**: thin wasm-bindgen adapter (camera, canvas, orientation glue) + JS-facing wrappers of the core exporters. Profiles cross the boundary as a 360-value Float64Array (index = azimuth degree, measured frame); exporters apply the north offset.
|
||||
- **wasm/frontend/**: Vite + React UI — `src/screens/` (Sites, Setup, Capture, Review, Export, Settings, Calibrate), `src/lib/` (wasm loader, store = localStorage + IndexedDB strips, camera/sensors, survey = capture session + cached wasm `HorizonSurvey`, files = save/share incl. Flutter handlers). Desktop testing: open with `?sim` for a keyboard-driven fake compass (arrow keys), `?skipWelcome` to skip the first-run screen.
|
||||
- **i18n** (`wasm/frontend/src/i18n/`): every UI string goes through `t('key', params)`; English (`locales/en.js`) is the source and fallback; es, ar (RTL), de, hu, pl, fr, it, sk follow the system language, overridable in Settings. Plurals are objects keyed by Intl.PluralRules category. Add a key to **all** locale files and run `npm run i18n:check` (from wasm/frontend/). Native shell strings: tab labels come from the web app; iOS permission prompts live in `ios/Runner/<lang>.lproj/InfoPlist.strings`. Exported files (.hrz, landscape.ini) stay English.
|
||||
- **lib/main.dart**: Flutter Android shell — serves `assets/web/` on localhost:8080 in an InAppWebView, grants camera, saves PNGs to the gallery
|
||||
- **test/**: Widget tests using `flutter_test` package
|
||||
- Uses `flutter_lints` for static analysis (configured in `analysis_options.yaml`)
|
||||
- SDK requirement: Dart ^3.11.1
|
||||
@@ -1,4 +1,6 @@
|
||||
# sfzenith
|
||||
# SkyContour
|
||||
|
||||
*(projekt- és kódnév: sfzenith)*
|
||||
|
||||
Horizont-felmérő alkalmazás asztrofotósoknak: a telefon kamerájával körbeforogva azimut → altitude pontokból kirajzolja a megfigyelőhely helyi horizontját, és exportot készít távcsővezérlő szoftverek számára — **N.I.N.A.** horizont-fájlt (`.hrz`) és **Stellarium** landscape-et (360°-os panoráma PNG + `landscape.ini`).
|
||||
|
||||
@@ -43,10 +45,10 @@ A natív app a webes buildet futtatja WebView-ban; előtte mindig: `./scripts/bu
|
||||
./scripts/install_ios.sh # web build + iOS build + telepítés a csatlakoztatott iPhone-ra
|
||||
```
|
||||
|
||||
- Aláírás: Personal Team (`FT7JEH2UPE`), bundle ID `com.ferencsagi.sfzenith`. Más fióknál: Xcode › Runner › Signing & Capabilities › Team.
|
||||
- Aláírás: Personal Team (`FT7JEH2UPE`), app-azonosító mindkét platformon `com.sagifer.skycontour`. Más fióknál: Xcode › Runner › Signing & Capabilities › Team.
|
||||
- Első indítás előtt a telefonon: Beállítások › Általános › VPN és eszközkezelés › a fejlesztői profil › Megbízom. iOS 16-tól a Developer Mode is kell (Beállítások › Adatvédelem és biztonság).
|
||||
- Ingyenes fióknál az app 7 nap után lejár: futtasd újra a szkriptet.
|
||||
- Mentett exportok: Fájlok app › Az iPhone-on › sfzenith.
|
||||
- Mentett exportok: Fájlok app › Az iPhone-on › SkyContour.
|
||||
|
||||
### Fejlesztői kapcsolók
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
# This file configures the analyzer, which statically analyzes Dart code to
|
||||
# check for errors, warnings, and lints.
|
||||
#
|
||||
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
|
||||
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
|
||||
# invoked from the command line by running `flutter analyze`.
|
||||
|
||||
# The following line activates a set of recommended lints for Flutter apps,
|
||||
# packages, and plugins designed to encourage good coding practices.
|
||||
include: package:flutter_lints/flutter.yaml
|
||||
|
||||
linter:
|
||||
# The lint rules applied to this project can be customized in the
|
||||
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
|
||||
# included above or to enable additional rules. A list of all available lints
|
||||
# and their documentation is published at https://dart.dev/lints.
|
||||
#
|
||||
# Instead of disabling a lint rule for the entire project in the
|
||||
# section below, it can also be suppressed for a single line of code
|
||||
# or a specific dart file by using the `// ignore: name_of_lint` and
|
||||
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
|
||||
# producing the lint.
|
||||
rules:
|
||||
# avoid_print: false # Uncomment to disable the `avoid_print` rule
|
||||
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
|
||||
|
||||
# Additional information about this file can be found at
|
||||
# https://dart.dev/guides/language/analysis-options
|
||||
@@ -0,0 +1,14 @@
|
||||
gradle-wrapper.jar
|
||||
/.gradle
|
||||
/captures/
|
||||
/gradlew
|
||||
/gradlew.bat
|
||||
/local.properties
|
||||
GeneratedPluginRegistrant.java
|
||||
.cxx/
|
||||
|
||||
# Remember to never publicly share your keystore.
|
||||
# See https://flutter.dev/to/reference-keystore
|
||||
key.properties
|
||||
**/*.keystore
|
||||
**/*.jks
|
||||
@@ -0,0 +1,43 @@
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("kotlin-android")
|
||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.example.sfzenith"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
ndkVersion = flutter.ndkVersion
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_17.toString()
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.sagifer.skycontour"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
||||
minSdk = flutter.minSdkVersion
|
||||
targetSdk = flutter.targetSdkVersion
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source = "../.."
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- The INTERNET permission is required for development. Specifically,
|
||||
the Flutter tool needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
</manifest>
|
||||
@@ -0,0 +1,64 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- Camera for horizon capture; INTERNET for the in-app localhost WebView server. -->
|
||||
<uses-permission
|
||||
android:name="android.permission.CAMERA"/>
|
||||
<uses-permission
|
||||
android:name="android.permission.INTERNET"/>
|
||||
<!-- Site location for the Stellarium landscape (WebView geolocation). -->
|
||||
<uses-permission
|
||||
android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
||||
<uses-permission
|
||||
android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||
<!-- Saving to the gallery/Downloads; only needed on Android 9 and older. -->
|
||||
<uses-permission
|
||||
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
||||
android:maxSdkVersion="28"/>
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false"/>
|
||||
<application
|
||||
android:label="SkyContour"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:usesCleartextTraffic="true">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTop"
|
||||
android:taskAffinity=""
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:hardwareAccelerated="true"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<!-- Specifies an Android theme to apply to this Activity as soon as
|
||||
the Android process has started. This theme is visible to the user
|
||||
while the Flutter UI initializes. After that, this theme continues
|
||||
to determine the Window background behind the Flutter UI. -->
|
||||
<meta-data
|
||||
android:name="io.flutter.embedding.android.NormalTheme"
|
||||
android:resource="@style/NormalTheme"/>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<!-- Don't delete the meta-data below.
|
||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||
<meta-data
|
||||
android:name="flutterEmbedding"
|
||||
android:value="2"/>
|
||||
</application>
|
||||
<!-- Required to query activities that can process text, see:
|
||||
https://developer.android.com/training/package-visibility and
|
||||
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
|
||||
|
||||
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
|
||||
<queries>
|
||||
<intent>
|
||||
<action
|
||||
android:name="android.intent.action.PROCESS_TEXT"/>
|
||||
<data
|
||||
android:mimeType="text/plain"/>
|
||||
</intent>
|
||||
</queries>
|
||||
</manifest>
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.example.sfzenith
|
||||
|
||||
import android.content.ContentValues
|
||||
import android.os.Build
|
||||
import android.os.Environment
|
||||
import android.provider.MediaStore
|
||||
import android.webkit.MimeTypeMap
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
import io.flutter.embedding.engine.FlutterEngine
|
||||
import io.flutter.plugin.common.MethodChannel
|
||||
import java.io.File
|
||||
|
||||
class MainActivity : FlutterActivity() {
|
||||
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
|
||||
super.configureFlutterEngine(flutterEngine)
|
||||
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, "sfzenith/files")
|
||||
.setMethodCallHandler { call, result ->
|
||||
if (call.method != "saveToDownloads") {
|
||||
result.notImplemented()
|
||||
return@setMethodCallHandler
|
||||
}
|
||||
try {
|
||||
val name = call.argument<String>("name") ?: "horizon.bin"
|
||||
val mime = call.argument<String>("mime") ?: "application/octet-stream"
|
||||
val bytes = call.argument<ByteArray>("bytes") ?: ByteArray(0)
|
||||
result.success(saveToDownloads(name, mime, bytes))
|
||||
} catch (e: Exception) {
|
||||
result.error("save_failed", e.message, null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Writes into the public Downloads folder; returns the shown location. */
|
||||
private fun saveToDownloads(name: String, mime: String, bytes: ByteArray): String {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
// MediaStore appends an extension that matches the MIME type ("x.hrz" with
|
||||
// text/plain becomes "x.hrz.txt"), so derive the type from the file name.
|
||||
val ext = name.substringAfterLast('.', "").lowercase()
|
||||
val storeMime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(ext)
|
||||
?: "application/octet-stream"
|
||||
val values = ContentValues().apply {
|
||||
put(MediaStore.MediaColumns.DISPLAY_NAME, name)
|
||||
put(MediaStore.MediaColumns.MIME_TYPE, storeMime)
|
||||
put(MediaStore.MediaColumns.RELATIVE_PATH, Environment.DIRECTORY_DOWNLOADS)
|
||||
}
|
||||
val uri = contentResolver.insert(MediaStore.Downloads.EXTERNAL_CONTENT_URI, values)
|
||||
?: throw IllegalStateException("Downloads is not available")
|
||||
contentResolver.openOutputStream(uri)?.use { it.write(bytes) }
|
||||
?: throw IllegalStateException("Cannot write $name")
|
||||
return "Downloads/$name"
|
||||
}
|
||||
@Suppress("DEPRECATION")
|
||||
val dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
|
||||
dir.mkdirs()
|
||||
val file = File(dir, name)
|
||||
file.writeBytes(bytes)
|
||||
return file.absolutePath
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 69 B |
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<bitmap android:gravity="fill" android:src="@drawable/background"/>
|
||||
</item>
|
||||
<item>
|
||||
<bitmap android:gravity="center" android:src="@drawable/splash"/>
|
||||
</item>
|
||||
</layer-list>
|
||||
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 9.1 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 69 B |
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<bitmap android:gravity="fill" android:src="@drawable/background"/>
|
||||
</item>
|
||||
<item>
|
||||
<bitmap android:gravity="center" android:src="@drawable/splash"/>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground>
|
||||
<inset
|
||||
android:drawable="@drawable/ic_launcher_foreground"
|
||||
android:inset="16%" />
|
||||
</foreground>
|
||||
</adaptive-icon>
|
||||
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<item name="android:forceDarkAllowed">false</item>
|
||||
<item name="android:windowFullscreen">false</item>
|
||||
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
|
||||
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
|
||||
<item name="android:windowSplashScreenBackground">#04060B</item>
|
||||
<item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item>
|
||||
</style>
|
||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||
This theme determines the color of the Android Window while your
|
||||
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||
running.
|
||||
|
||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<!-- Show a splash screen on the activity. Automatically removed when
|
||||
the Flutter engine draws its first frame -->
|
||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||
<item name="android:forceDarkAllowed">false</item>
|
||||
<item name="android:windowFullscreen">false</item>
|
||||
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
|
||||
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
|
||||
</style>
|
||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||
This theme determines the color of the Android Window while your
|
||||
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||
running.
|
||||
|
||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<item name="android:forceDarkAllowed">false</item>
|
||||
<item name="android:windowFullscreen">false</item>
|
||||
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
|
||||
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
|
||||
<item name="android:windowSplashScreenBackground">#04060B</item>
|
||||
<item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item>
|
||||
</style>
|
||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||
This theme determines the color of the Android Window while your
|
||||
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||
running.
|
||||
|
||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#0E1424</color>
|
||||
</resources>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<!-- Show a splash screen on the activity. Automatically removed when
|
||||
the Flutter engine draws its first frame -->
|
||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||
<item name="android:forceDarkAllowed">false</item>
|
||||
<item name="android:windowFullscreen">false</item>
|
||||
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
|
||||
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
|
||||
</style>
|
||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||
This theme determines the color of the Android Window while your
|
||||
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||
running.
|
||||
|
||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -0,0 +1,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- The INTERNET permission is required for development. Specifically,
|
||||
the Flutter tool needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
</manifest>
|
||||
@@ -0,0 +1,24 @@
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
val newBuildDir: Directory =
|
||||
rootProject.layout.buildDirectory
|
||||
.dir("../../build")
|
||||
.get()
|
||||
rootProject.layout.buildDirectory.value(newBuildDir)
|
||||
|
||||
subprojects {
|
||||
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
|
||||
project.layout.buildDirectory.value(newSubprojectBuildDir)
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(":app")
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.layout.buildDirectory)
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
|
||||
android.useAndroidX=true
|
||||
@@ -0,0 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
|
||||
@@ -0,0 +1,26 @@
|
||||
pluginManagement {
|
||||
val flutterSdkPath =
|
||||
run {
|
||||
val properties = java.util.Properties()
|
||||
file("local.properties").inputStream().use { properties.load(it) }
|
||||
val flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
|
||||
flutterSdkPath
|
||||
}
|
||||
|
||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
||||
id("com.android.application") version "8.11.1" apply false
|
||||
id("org.jetbrains.kotlin.android") version "2.2.20" apply false
|
||||
}
|
||||
|
||||
include(":app")
|
||||
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 23 KiB |
@@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-25 -25 150 150">
|
||||
<circle cx="48" cy="30" r="2.6" fill="#E8ECF2"/><circle cx="24" cy="22" r="1.5" fill="#C9D2DE"/><circle cx="74" cy="20" r="1.3" fill="#C9D2DE"/><circle cx="88" cy="30" r="1.1" fill="#93A0B4"/>
|
||||
<path d="M-26 126 L-26 70 L0 70 L8 70 L8 56 L21 44 L27 49.5 L27 43 L30.5 43 L30.5 52.8 L34 56 L34 70 L46 70 L50 66 L59 56 L54 56 L62 44 L58 44 L66 28 L74 44 L70 44 L78 56 L73 56 L82 66 L85 66 L89 58 L87 58 L92 48 L97 58 L95 58 L100 63 L126 63 L126 126 Z" fill="#070A12"/>
|
||||
<rect x="16" y="58" width="6" height="6" fill="#F5B544" fill-opacity="0.9"/>
|
||||
<path d="M-26 70 L0 70 L8 70 L8 56 L21 44 L27 49.5 L27 43 L30.5 43 L30.5 52.8 L34 56 L34 70 L46 70 L50 66 L59 56 L54 56 L62 44 L58 44 L66 28 L74 44 L70 44 L78 56 L73 56 L82 66 L85 66 L89 58 L87 58 L92 48 L97 58 L95 58 L100 63 L126 63" fill="none" stroke="#F5B544" stroke-width="4" stroke-linejoin="round" stroke-linecap="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 954 B |
@@ -0,0 +1,7 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
|
||||
<rect width="100" height="100" fill="#0E1424"/>
|
||||
<circle cx="48" cy="30" r="2.6" fill="#E8ECF2"/><circle cx="24" cy="22" r="1.5" fill="#C9D2DE"/><circle cx="74" cy="20" r="1.3" fill="#C9D2DE"/><circle cx="88" cy="30" r="1.1" fill="#93A0B4"/>
|
||||
<path d="M0 100 L0 70 L8 70 L8 56 L21 44 L27 49.5 L27 43 L30.5 43 L30.5 52.8 L34 56 L34 70 L46 70 L50 66 L59 56 L54 56 L62 44 L58 44 L66 28 L74 44 L70 44 L78 56 L73 56 L82 66 L85 66 L89 58 L87 58 L92 48 L97 58 L95 58 L100 63 L100 100 Z" fill="#070A12"/>
|
||||
<rect x="16" y="58" width="6" height="6" fill="#F5B544" fill-opacity="0.9"/>
|
||||
<path d="M-4 70 L0 70 L8 70 L8 56 L21 44 L27 49.5 L27 43 L30.5 43 L30.5 52.8 L34 56 L34 70 L46 70 L50 66 L59 56 L54 56 L62 44 L58 44 L66 28 L74 44 L70 44 L78 56 L73 56 L82 66 L85 66 L89 58 L87 58 L92 48 L97 58 L95 58 L100 63 L104 63" fill="none" stroke="#F5B544" stroke-width="4" stroke-linejoin="round" stroke-linecap="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 981 B |
@@ -0,0 +1,7 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
|
||||
<rect width="100" height="100" rx="22.5" fill="#0E1424"/>
|
||||
<circle cx="48" cy="30" r="2.6" fill="#E8ECF2"/><circle cx="24" cy="22" r="1.5" fill="#C9D2DE"/><circle cx="74" cy="20" r="1.3" fill="#C9D2DE"/><circle cx="88" cy="30" r="1.1" fill="#93A0B4"/>
|
||||
<path d="M0 77.5 L0 70 L8 70 L8 56 L21 44 L27 49.5 L27 43 L30.5 43 L30.5 52.8 L34 56 L34 70 L46 70 L50 66 L59 56 L54 56 L62 44 L58 44 L66 28 L74 44 L70 44 L78 56 L73 56 L82 66 L85 66 L89 58 L87 58 L92 48 L97 58 L95 58 L100 63 L100 77.5 A22.5 22.5 0 0 1 77.5 100 L22.5 100 A22.5 22.5 0 0 1 0 77.5 Z" fill="#070A12"/>
|
||||
<rect x="16" y="58" width="6" height="6" fill="#F5B544" fill-opacity="0.9"/>
|
||||
<path d="M2 70 L8 70 L8 56 L21 44 L27 49.5 L27 43 L30.5 43 L30.5 52.8 L34 56 L34 70 L46 70 L50 66 L59 56 L54 56 L62 44 L58 44 L66 28 L74 44 L70 44 L78 56 L73 56 L82 66 L85 66 L89 58 L87 58 L92 48 L97 58 L95 58 L98 63" fill="none" stroke="#F5B544" stroke-width="4" stroke-linejoin="round" stroke-linecap="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1,91 @@
|
||||
"""Regenerate every app icon / splash asset from one definition.
|
||||
|
||||
Source: the "A · Skyline" concept on the claude.ai design canvas (Icons.dc.html).
|
||||
After changing the shapes below, run (from the repo root):
|
||||
|
||||
python3 assets/branding/make_icons.py
|
||||
dart run flutter_launcher_icons
|
||||
dart run flutter_native_splash:create
|
||||
|
||||
The web UI draws the same icon in wasm/frontend/src/components/AppIcon.jsx;
|
||||
keep EDGE / WINDOW there in sync.
|
||||
"""
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||
ROOT = os.path.dirname(os.path.dirname(HERE))
|
||||
CHROME = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
|
||||
|
||||
# Horizon line between the left run-in (y = 70) and the right run-out (y = 63):
|
||||
# house roof with chimney, then a tall and a small fir tree.
|
||||
EDGE = ('L8 70 L8 56 L21 44 L27 49.5 L27 43 L30.5 43 L30.5 52.8 L34 56 L34 70 L46 70 '
|
||||
'L50 66 L59 56 L54 56 L62 44 L58 44 L66 28 L74 44 L70 44 L78 56 L73 56 L82 66 '
|
||||
'L85 66 L89 58 L87 58 L92 48 L97 58 L95 58')
|
||||
LEFT_Y, RIGHT_Y = 70, 63
|
||||
STARS = ('<circle cx="48" cy="30" r="2.6" fill="#E8ECF2"/><circle cx="24" cy="22" r="1.5" fill="#C9D2DE"/>'
|
||||
'<circle cx="74" cy="20" r="1.3" fill="#C9D2DE"/><circle cx="88" cy="30" r="1.1" fill="#93A0B4"/>')
|
||||
WINDOW = '<rect x="16" y="58" width="6" height="6" fill="#F5B544" fill-opacity="0.9"/>'
|
||||
LINE = 'fill="none" stroke="#F5B544" stroke-width="4" stroke-linejoin="round" stroke-linecap="round"'
|
||||
|
||||
|
||||
def rounded():
|
||||
"""Rounded tile: web favicon, splash, in-app icon."""
|
||||
return (f'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">\n'
|
||||
f' <rect width="100" height="100" rx="22.5" fill="#0E1424"/>\n {STARS}\n'
|
||||
f' <path d="M0 77.5 L0 {LEFT_Y} {EDGE} L100 {RIGHT_Y} L100 77.5 A22.5 22.5 0 0 1 77.5 100 '
|
||||
f'L22.5 100 A22.5 22.5 0 0 1 0 77.5 Z" fill="#070A12"/>\n {WINDOW}\n'
|
||||
f' <path d="M2 {LEFT_Y} {EDGE} L98 {RIGHT_Y}" {LINE}/>\n</svg>\n')
|
||||
|
||||
|
||||
def square():
|
||||
"""Full-bleed square for iOS / store icons (the OS applies the corner mask)."""
|
||||
return (f'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">\n'
|
||||
f' <rect width="100" height="100" fill="#0E1424"/>\n {STARS}\n'
|
||||
f' <path d="M0 100 L0 {LEFT_Y} {EDGE} L100 {RIGHT_Y} L100 100 Z" fill="#070A12"/>\n {WINDOW}\n'
|
||||
f' <path d="M-4 {LEFT_Y} L0 {LEFT_Y} {EDGE} L100 {RIGHT_Y} L104 {RIGHT_Y}" {LINE}/>\n</svg>\n')
|
||||
|
||||
|
||||
def foreground():
|
||||
"""Android adaptive foreground (background #0E1424): artwork in the middle 2/3 so
|
||||
round launcher masks keep the house; ground and line run out to the border."""
|
||||
return (f'<svg xmlns="http://www.w3.org/2000/svg" viewBox="-25 -25 150 150">\n {STARS}\n'
|
||||
f' <path d="M-26 126 L-26 {LEFT_Y} L0 {LEFT_Y} {EDGE} L100 {RIGHT_Y} L126 {RIGHT_Y} L126 126 Z" fill="#070A12"/>\n'
|
||||
f' {WINDOW}\n <path d="M-26 {LEFT_Y} L0 {LEFT_Y} {EDGE} L100 {RIGHT_Y} L126 {RIGHT_Y}" {LINE}/>\n</svg>\n')
|
||||
|
||||
|
||||
def splash12(size=1152, icon=520):
|
||||
"""Android 12+ splash: the rounded icon inside the 768 px safe circle."""
|
||||
inner = re.search(r'<svg[^>]*>(.*)</svg>', rounded(), re.S).group(1)
|
||||
off = (size - icon) / 2
|
||||
return (f'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 {size} {size}">\n'
|
||||
f' <svg x="{off}" y="{off}" width="{icon}" height="{icon}" viewBox="0 0 100 100">{inner}</svg>\n</svg>\n')
|
||||
|
||||
|
||||
def write(name, text):
|
||||
with open(os.path.join(HERE, name), 'w') as f:
|
||||
f.write(text)
|
||||
|
||||
|
||||
def render(svg, px, png):
|
||||
subprocess.run([CHROME, '--headless=new', '--disable-gpu', '--hide-scrollbars',
|
||||
'--default-background-color=00000000', f'--window-size={px},{px}',
|
||||
f'--screenshot={os.path.join(HERE, png)}', 'file://' + os.path.join(HERE, svg)],
|
||||
check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
|
||||
|
||||
write('icon.svg', rounded())
|
||||
write('icon-square.svg', square())
|
||||
write('icon-foreground.svg', foreground())
|
||||
write('splash-android12.svg', splash12())
|
||||
render('icon-square.svg', 1024, 'icon-1024.png')
|
||||
render('icon-foreground.svg', 1024, 'icon-foreground-1024.png')
|
||||
render('icon.svg', 384, 'splash-logo.png')
|
||||
render('splash-android12.svg', 1152, 'splash-android12.png')
|
||||
|
||||
public = os.path.join(ROOT, 'wasm', 'frontend', 'public')
|
||||
write(os.path.join(public, 'favicon.svg'), rounded())
|
||||
subprocess.run(['sips', '-Z', '180', os.path.join(HERE, 'icon-1024.png'),
|
||||
'--out', os.path.join(public, 'apple-touch-icon.png')], check=True, stdout=subprocess.DEVNULL)
|
||||
print('icons written to', HERE, 'and', public)
|
||||
|
After Width: | Height: | Size: 26 KiB |
@@ -0,0 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1152 1152">
|
||||
<svg x="316.0" y="316.0" width="520" height="520" viewBox="0 0 100 100">
|
||||
<rect width="100" height="100" rx="22.5" fill="#0E1424"/>
|
||||
<circle cx="48" cy="30" r="2.6" fill="#E8ECF2"/><circle cx="24" cy="22" r="1.5" fill="#C9D2DE"/><circle cx="74" cy="20" r="1.3" fill="#C9D2DE"/><circle cx="88" cy="30" r="1.1" fill="#93A0B4"/>
|
||||
<path d="M0 77.5 L0 70 L8 70 L8 56 L21 44 L27 49.5 L27 43 L30.5 43 L30.5 52.8 L34 56 L34 70 L46 70 L50 66 L59 56 L54 56 L62 44 L58 44 L66 28 L74 44 L70 44 L78 56 L73 56 L82 66 L85 66 L89 58 L87 58 L92 48 L97 58 L95 58 L100 63 L100 77.5 A22.5 22.5 0 0 1 77.5 100 L22.5 100 A22.5 22.5 0 0 1 0 77.5 Z" fill="#070A12"/>
|
||||
<rect x="16" y="58" width="6" height="6" fill="#F5B544" fill-opacity="0.9"/>
|
||||
<path d="M2 70 L8 70 L8 56 L21 44 L27 49.5 L27 43 L30.5 43 L30.5 52.8 L34 56 L34 70 L46 70 L50 66 L59 56 L54 56 L62 44 L58 44 L66 28 L74 44 L70 44 L78 56 L73 56 L82 66 L85 66 L89 58 L87 58 L92 48 L97 58 L95 58 L98 63" fill="none" stroke="#F5B544" stroke-width="4" stroke-linejoin="round" stroke-linecap="round"/>
|
||||
</svg>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 8.4 KiB |