-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[screengrab] Let users set clean status bar #15284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[screengrab] Let users set clean status bar #15284
Conversation
Thanks for tackling this @rickclephas! If you don't want to put the options description into the
Sounds valid, and I am sure you know more about this right now - so I trust your judgement to decide how to do this. |
Yeah that is probably best since there are 25 configuration options.
Alright I will see if moving it to the |
I honestly can't answer that as I don't know enough about that functionality. If I understood everything correctly: In general it feels like configuring the screenshots should maybe not be in the tests, but in the screenshot taking configuration - so lane/action options. |
So I have now moved all the configuration to the To use the feature users will need to add the following lines to their <uses-feature android:name="tools.fastlane.screengrab.cleanstatusbar"/>
<uses-permission android:name="android.permission.DUMP" tools:ignore="ProtectedPermissions" /> The Then in the test class you can enable and disable the clean status bar at any moment. @BeforeClass
public static void beforeAll() {
Screengrab.setDefaultScreenshotStrategy(new UiAutomatorScreenshotStrategy());
CleanStatusBar.enableWithDefaults();
}
@AfterClass
public static void afterAll() {
CleanStatusBar.disable();
} You can also use a custom configuration. new CleanStatusBar()
.setMobileNetworkDataType(MobileDataType.LTE)
.setBluetoothState(BluetoothState.DISCONNECTED)
.enable(); With the configuration in the test class it would also be possible to have a different status bar for different screenshots. If we move the configuration to the lane/actions options we have to pass all the configurations to the test via the |
Documentation has been updated. |
eae9c44
to
3ff92f0
Compare
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is sooooo 💯 Thanks so much for all the time you spent on this 😊 I rebased from master and fixed it to add support for AndroidX. Really appreciate the contribution ❤️
Hey @rickclephas 👋 Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉 Please let us know if this change requires an immediate release by adding a comment here 👍 |
Congratulations! 🎉 This was released as part of fastlane 2.136.0 🚀 |
Checklist
bundle exec rspec
from the root directory to see all new and existing tests passbundle exec rubocop -a
to ensure the code style is validMotivation and Context
The goal is to automatically enable and disable the clean status bar so that you don't have to do this manually with for example the QuickDemo app.
Description
I have added the options
clean_status_bar
andclean_status_bar_config
toscreengrab
.With
clean_status_bar
the clean status bar can be enabled.Use the
clean_status_bar_config
option to customise the appearance of the clean status bar.The configuration options are based on the commands described here:
https://android.googlesource.com/platform/frameworks/base/+/master/packages/SystemUI/docs/demo_mode.md
ToDos
screengrab-lib
so that it can set the clean status bar after every local change?@janpio any thoughts?