Skip to content

Initialize Multitoolbox Android app (Kotlin/Compose)#2

Open
love19870821 wants to merge 1 commit into
masterfrom
codex/create-android-app-in-kotlin
Open

Initialize Multitoolbox Android app (Kotlin/Compose)#2
love19870821 wants to merge 1 commit into
masterfrom
codex/create-android-app-in-kotlin

Conversation

@love19870821
Copy link
Copy Markdown
Owner

Motivation

  • 建立一個可直接在乾淨專案中開發的 Android 10+(API 29+)多功能工具箱骨架,滿足圖像/影片本機處理與多種實用小工具需求。
  • 採用 Kotlin + Jetpack Compose 並以 MVVM + UseCase、Hilt、Room、Retrofit/OkHttp、ML Kit、OpenCV、Media3 為核心技術以利後續擴充與測試。
  • 所有 UI 文案使用繁體中文並限制功能範圍以確保合規(例如僅允許直連 URL 下載,不做平台解析)。

Description

  • 新增整個 Android 專案骨架與 Gradle 設定(settings.gradle.ktsbuild.gradle.ktsapp/build.gradle.kts、wrapper 腳本等)並設定 Java/Kotlin 目標版本與 Compose。
  • 新增 DI 與網路層:di/AppModule.kt(Hilt、OkHttp + Retrofit + Moshi、快取策略、匯率 API baseUrl),以及 data/networkdata/repository 的匯率/設定/歷史倉儲實作。
  • 新增 Room 實體/DAO/Database(CalculatorHistoryEntity/DaoSettingsEntity/DaoCurrencyRateEntity/DaoAppDatabase)與 repository。
  • 實作 UI 與 ViewModel:首頁導航 (NavigationRoot/HomeScreen)、圖片工具箱(OCR、文字/圖片浮水印、清晰化、拼貼、繁中早安圖)與 ImageToolboxViewModel,影片工具箱(本機裁剪使用 Media3 Transformer + 直連 URL 下載器)與 VideoToolboxViewModel,小工具(計算機、幣值/單位換算)與 UtilitiesViewModel,設定頁與 SettingsViewModel
  • 實作圖片處理工具與合成(ImageProcessing.kt 使用 OpenCV、ImageComposition.kt)、Bitmap 載入/儲存工具(BitmapUtils.kt)、計算與換算 UseCase(CalculateExpressionUseCaseUnitConversionUseCaseCurrencyConversionUseCase)。
  • 新增繁體中文 UI 文案、12 套早安背景範本與 50 條早安文案、README(包含 ./gradlew assembleDebug / installDebug / assembleRelease 指令與權限說明),以及基本單元測試檔案 UtilitiesUseCaseTest.kt(計算與單位換算)。

Testing

  • 新增了基本單元測試 app/src/test/java/com/toolbox/multitool/UtilitiesUseCaseTest.kt 覆蓋計算(百分比處理)、長度與溫度換算用例,但這些測試尚未在 CI/本地以 Gradle 執行。
  • 無法執行完整自動化建置/測試,因環境中無法下載 Gradle distribution JAR(wrapper 下載在此環境遭遇網路限制),所以未執行 ./gradlew test./gradlew assembleDebug
  • 手動驗證:已在 repository 中建立並提交所有檔案與程式碼,README 包含後續 build/run 指令供在可用網路/開發環境中執行。

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant