Skip to content

Fix NonObservableLocale lint error in refresh log screens - #300

Merged
hossain-khan merged 2 commits into
mainfrom
fix-lint-non-observable-locale
Aug 11, 2026
Merged

Fix NonObservableLocale lint error in refresh log screens#300
hossain-khan merged 2 commits into
mainfrom
fix-lint-non-observable-locale

Conversation

@hossain-khan

@hossain-khan hossain-khan commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes the Android Lint NonObservableLocale failure in DisplayRefreshLogScreen and HttpResponseDetailsBottomSheet.

Rationale & Solution

Calling Locale.getDefault() directly inside @Composable functions reads system locale state in a non-observable way. If a user changes system locale settings at runtime, composables will not re-compose automatically.

Rather than relying on array indexing like locales[0], this PR uses Compose's idiomatic, type-safe androidx.compose.ui.text.intl.Locale.current.platformLocale API.

Key Changes

  • DisplayRefreshLogScreen.kt: Updated date formatting to use ComposeLocale.current.platformLocale with remember(locale).
  • HttpResponseDetailsBottomSheet.kt: Updated timestamp formatting to use ComposeLocale.current.platformLocale with remember(locale).
  • Clean Imports: Added import androidx.compose.ui.text.intl.Locale as ComposeLocale import alias at top of files instead of inline package paths.

Verification

  • ./gradlew lintDebugBUILD SUCCESSFUL (0 lint errors).
  • ./gradlew formatKotlin — Passed.
  • ./gradlew lintKotlin — Passed.
  • ./gradlew testDebugUnitTest — Passed (216 tests passed).
  • ./gradlew assembleDebugBUILD SUCCESSFUL.

@hossain-khan hossain-khan self-assigned this Aug 11, 2026
@hossain-khan
hossain-khan enabled auto-merge August 11, 2026 16:21
@hossain-khan
hossain-khan merged commit 8872968 into main Aug 11, 2026
1 check passed
@hossain-khan
hossain-khan deleted the fix-lint-non-observable-locale branch August 11, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant