You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Just a heads up that we are in the middle of transitioning to androidx-main instead of androidx-master-dev, so you may want to base your PR on top of there instead as I'll be disabling PR mirroring to androidx-master-dev this week.
The reason will be displayed to describe this comment to others. Learn more.
Please move this code to androidx.activity.ComponentActivity and write a test for this (at the very least, our internal CI runs on API 19 devices and will help serve as a regression test that this method doesn't crash).
The reason will be displayed to describe this comment to others. Learn more.
Note that this should be guarded with a Build.VERSION.SDK_INT >= 19 so that reportFullyDrawn() can be called on all API levels.
That means it may be more appropriate to re-arrange this method to be something more like:
if (Build.VERSION.SDK_INT >= 20) {
super.reportFullyDrawn();
} else if (Build.VERSION.SDK_INT == 19 && ContextCompat...) {
// Your current code and comment re: the specific behavior of API 19
}
Sorry for the churn - do you mind actually basing your PR on top of androidx-master-dev, looks like it's still a couple days out before we fully switch
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.
Proposed Changes
Activity.reportFullyDrawn()
I'm not quite sure if this class is the right place for this workaround, the code could also live in other places, e.g.:
androidx.core.app.ComponentActivity
androidx.activity.ComponentActivity
androidx.appcompat.app.AppCompatActivity
Testing
Test: Manually tested. If your test harness is also executed on devices with API 19, I could write an automated test for this change if you want.
Issues Fixed
Fixes: 163239764