android / android/architecture-samples
HiltTestActivity missing setTheme()
- Dominant language
- Kotlin
- Stars
- 45.8k
- Forks
- 11.9k
- PR merge metrics
- No merged PRs in 30d
Description
I was looking at `HiltTestActivity` comparing to `EmptyTestActivity` it is missing `setTheme()` during `onCreate()` method.
```kotlin
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setTheme(
intent.getIntExtra(
"androidx.fragment.app.testing.FragmentScenario.EmptyFragmentActivity.THEME_EXTRAS_BUNDLE_KEY",
R.style.FragmentScenarioEmptyFragmentActivityTheme
)
)
}
```
This ignores the theme passed to `launchFragmentInHiltContainer` method
Contributor guide
Research direction
Search for HiltTestActivity and launchFragmentInHiltContainer, then inspect HiltTestActivity.onCreate and compare it with EmptyTestActivity. Confirm how the theme extra is passed, and verify that the activity applies the supplied theme when launching a fragment in the Hilt test container.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile-dev, testing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100