Repository navigation
iOS/watchOS版ウィジェットと同じ体裁のホーム画面ウィジェットをAndroidに追加 - #6569
Conversation
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XHQB1iKjHbZLmPDKysVpnt
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 36 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAndroidホーム画面ウィジェットを追加しました。乗車状態を保存し、サイズ別に表示します。React Nativeのライブアクティビティ開始・更新・終了に合わせて、ウィジェットを更新または消去します。 ChangesAndroid乗車ウィジェット
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@android/app/src/main/res/values-en/strings.xml`:
- Line 8: Update the English text for the widget_description string to use
natural wording that describes the line and destination information shown while
riding, rather than implying the destination itself is being ridden.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 89ba0149-4e18-40de-b142-82f0caabb95c
📒 Files selected for processing (22)
android/app/src/main/AndroidManifest.xmlandroid/app/src/main/java/me/tinykitten/trainlcd/RideWidgetProvider.ktandroid/app/src/main/java/me/tinykitten/trainlcd/TrainLCDPackage.ktandroid/app/src/main/java/me/tinykitten/trainlcd/WidgetModule.ktandroid/app/src/main/java/me/tinykitten/trainlcd/WidgetStateStore.ktandroid/app/src/main/res/drawable/widget_background.xmlandroid/app/src/main/res/drawable/widget_background_circle.xmlandroid/app/src/main/res/drawable/widget_line_bar.xmlandroid/app/src/main/res/drawable/widget_numbering_circle.xmlandroid/app/src/main/res/layout/widget_ride_circular.xmlandroid/app/src/main/res/layout/widget_ride_inline.xmlandroid/app/src/main/res/layout/widget_ride_rectangular.xmlandroid/app/src/main/res/values-en/strings.xmlandroid/app/src/main/res/values-night/colors.xmlandroid/app/src/main/res/values-v31/dimens.xmlandroid/app/src/main/res/values/colors.xmlandroid/app/src/main/res/values/dimens.xmlandroid/app/src/main/res/values/strings.xmlandroid/app/src/main/res/xml/ride_widget_info.xmlsrc/hooks/useUpdateLiveActivities.tssrc/utils/native/android/widgetModule.test.tssrc/utils/native/android/widgetModule.ts
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XHQB1iKjHbZLmPDKysVpnt
概要
iOS のロック画面ウィジェット(
LockScreenWidget)と watchOS のコンプリケーション(WatchWidget)に相当するホーム画面ウィジェットを Android に追加しました。表示内容・レイアウトは iOS/watchOS 版を踏襲し、ウィジェットのサイズに応じて iOS の 3 つの accessory family 相当のレイアウトを出し分けます。widget_ride_circularaccessoryCircularwidget_ride_inlineaccessoryInlinewidget_ride_rectangularaccessoryRectangular未乗車時のプレースホルダー(
路線が未設定です/方面が未設定です/ 記号?/ 色#277BC0)と、路線記号を持たない路線で路線名の先頭 1 文字を代替表示する挙動も iOS 版に合わせています。データ経路は iOS と異なります。iOS は
LiveActivityModuleがライブアクティビティ更新のついでに App Group のUserDefaultsへ書き込んでいますが、Android のライブアップデート(LiveUpdateModule)は Android 16 (API 36) 以降専用のため、それより前の OS でもウィジェットが動くよう更新経路を独立させています。変更の種類
変更内容
RideWidgetProvider:AppWidgetProvider実装。onUpdate/onAppWidgetOptionsChangedでウィジェットの実サイズ(OPTION_APPWIDGET_MIN_WIDTH/MIN_HEIGHT)を見て円形・1 行・横長のレイアウトを選択し、タップでアプリを起動するPendingIntentとcontentDescriptionを設定WidgetStateStore: 表示内容を SharedPreferences へ保存。アプリのプロセスが落ちていてもAppWidgetProviderから読めるようにするため。差分がある場合のみ保存+再描画を行い、無変化の更新でブロードキャストを投げない(iOS 版のlastWidgetStateと同じ考え方)WidgetModule: JS から表示内容を更新する React Native ブリッジ。TrainLCDPackageへ登録values/values-nightでライト/ダーク両対応、角丸は Android 12 以降でランチャー既定値(system_app_widget_background_radius)へ追従AndroidManifest.xmlにRideWidgetProviderの receiver と@xml/ride_widget_infoを追加widget_description/widget_line_not_set/widget_destination_not_set/widget_riding_on)を日本語(values)・英語(values-en)で追加。iOS のLocalizable.stringsと同一文言src/utils/native/android/widgetModule.ts: ネイティブモジュールのラッパー(Android 以外では no-op)と、その単体テストを追加useUpdateLiveActivities: 乗車開始時・更新時にupdateWidget、降車時にclearWidgetを呼ぶよう追加テスト
npm run lint/npm test/npm run typecheckをローカルで実行し、いずれも成功しています(npm test: 208 suites / 2195 tests passed)。加えて、Android SDK 36 + JDK 17 を用意して
./gradlew :app:compileDevDebugKotlinを実行し BUILD SUCCESSFUL を確認しました。processDevDebugResourcesを通過しているため、追加したレイアウト・drawable・manifest の receiver 定義もリソース処理レベルで検証済みです。npm run lintが通ることnpm testが通ることnpm run typecheckが通ること関連Issue
スクリーンショット(任意)
作業環境にエミュレータ/実機がないため未取得です。マージ前に実機(例: Pixel 8)で 1x1・2x1・4x1 の各サイズとライト/ダークテーマの見た目確認をお願いします。
Generated by Claude Code
Summary by CodeRabbit
新機能
テスト