迁移Android示例至Jetpack Compose并升级构建工具链#15
Open
shdmfire wants to merge 6 commits into
Open
Conversation
…mpose + upgrade build tools
=== Core: Android App Migration to Jetpack Compose ===
- Remove legacy View-based UI components:
- Delete 6 Java Fragments (BaseCreateFragment, Brand, Category, City, Index, Main)
- Delete 3 Activities (ControlActivity, CreateActivity, MainActivity)
- Delete 6 Adapters (Brand, Category, City, Index, Operator, RemoteControl)
- Delete PullToRefreshListView custom widget
- Delete MessageUtils utility class
- Delete all 18 XML layout files, animator, drawable, menu, and mipmap resources
- Add Jetpack Compose UI (Kotlin):
- Add navigation layer: Navigation.kt, Routes.kt (Navigation3)
- Add Screen composables: HomeScreen, ControlScreen, IndexScreen, BrandScreen,
CategoryScreen, CityScreen, OperatorScreen, ProvinceScreen, TestScreen
- Add ViewModel + State: ControlViewModel, ControlUiState, ControlEvent
- Add reusable composables: ComposeItemViews, ItemIndexText, ItemSingleText
- Add WebApiHelper for async API calls
- Add Compose theme: Color.kt, Theme.kt
- Rewrite MainActivity.kt with Compose entry point
- Add RemoteController.kt controller
- Add ControlCommand static constants for common remote keys (POWER, UP, DOWN, etc.)
=== Build System Upgrade ===
- Upgrade AGP from 8.12.0 to 9.0.1
- Upgrade Gradle wrapper from 8.14.3 to 9.1.0
- Upgrade Kotlin to 2.3.21 with Compose & Serialization plugins
- Rewrite project build.gradle to use plugins {} block
- Rewrite settings.gradle with pluginManagement & dependencyResolutionManagement
- Add Jetpack Compose BOM 2026.05.00, Material3, Navigation3, Lifecycle Compose
- Add Kotlin Coroutines, Kotlin Serialization, Activity Compose dependencies
- Update proguard-rules.pro for new toolchain
- Disable Jetifier, enable AndroidX, simplify gradle.properties
=== Configuration Changes ===
- Simplify AndroidManifest.xml: remove old Activity declarations
- Remove WRITE_EXTERNAL_STORAGE / READ_EXTERNAL_STORAGE permissions
- Update irext_app_key and irext_app_secret values
- Switch theme from AppCompat to Material Light NoActionBar
- Update network_security_config.xml
=== Housekeeping ===
- Normalize line endings (CRLF -> LF) across all sub-projects:
android-example, arduino-example, java-example, win32-example
- Update .gitignore and README files across all example projects
- Update Gradle wrapper scripts (gradlew, gradlew.bat)
# Conflicts: # android-example/app/src/main/java/net/irext/ircontrol/IRApplication.java
- .github/workflows/android-example-release.yml: build release APK on push/PR to examples/android-example, upload artifacts, auto-publish to GitHub Release on v* tags - .github/dependabot.yml: weekly checks for GitHub Actions and Gradle dependency updates
The repo is named 'examples', so android-example dir is at the root level, not under 'examples/'. Fixed all path references: - Path triggers: examples/android-example/** -> android-example/** - Working directory: examples/android-example -> ./android-example - Upload artifact paths: examples/android-example/**/build/... -> android-example/**/build/...
Author
|
我还加了Github Action的自动打包并签名apk-release文件功能, 在fork项目里, 还没提交pr, 不知道现在有没有必要搞 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
主要改动
1. UI 架构迁移到 Jetpack Compose
移除原有 View/Fragment 体系:
PullToRefreshListViewMessageUtils工具类新增 Compose UI 实现:
HomeScreen、ControlScreen、IndexScreen、BrandScreen、CategoryScreen、CityScreen、OperatorScreen、ProvinceScreen、TestScreenNavigation.kt、Routes.ktMainActivity.kt,作为 Compose 应用入口RemoteController.kt遥控器控制逻辑3. 构建系统升级
9.0.19.1.02.3.21build.gradle与settings.gradleproguard-rules.progradle.properties4. 配置调整
AndroidManifest.xml,移除旧 Activity 声明irext_app_key与irext_app_secretnetwork_security_config.xml5. 工程清理
.gitignore