Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>(
ActivityMainBinding::inflate,
ScreenId.HOME_MAIN
) {
companion object {
private const val ENABLE_ANYONE_BUT_ME_POPUP = false
}
Comment on lines +47 to +49

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using a hardcoded constant for a feature flag can be risky, as it might be forgotten and lead to shipping the feature in an unintended state. Consider using a more robust feature flagging mechanism, such as BuildConfig fields for different build types (e.g., debug, release), or a remote configuration service. This would make managing feature availability safer and more flexible.

For example, with BuildConfig, you could define in app/build.gradle:

buildTypes {
    debug {
        buildConfigField "boolean", "ENABLE_ANYONE_BUT_ME_POPUP", "true"
    }
    release {
        buildConfigField "boolean", "ENABLE_ANYONE_BUT_ME_POPUP", "false"
    }
}

And then use BuildConfig.ENABLE_ANYONE_BUT_ME_POPUP in your code.


@Inject
lateinit var workManager: WorkManager
Expand All @@ -63,7 +66,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(

setupNoToolbar()
setNavigation()
bindEventPopup(showOnLaunch = savedInstanceState == null)
bindEventPopup(showOnLaunch = ENABLE_ANYONE_BUT_ME_POPUP && savedInstanceState == null)
bindEventTooltip()

checkAlarmPermission()
Expand Down
Loading