xfumihiro / DataInspector

Data Inspection Toolbar for Android Development
Apache License 2.0
92 stars 7 forks source link

Ability to hide/disable the toolbar #4

Open autovalue opened 8 years ago

autovalue commented 8 years ago

It would be nice to have the option to hide/show the toolbar dynamically from the code, or via a gradle DSL field.

xfumihiro commented 8 years ago

I don't see the point of hiding the toolbar without being able to control the logging features. To disable the toolbar, comment out or remove the plugin line would be the best approach.

autovalue commented 8 years ago

I understand that, I'm just saying people have different use cases for how they use their debug apps, and I think libraries/plugins should allow as much flexibility as possible.

My issue with it is that the colourful toolbar is ALWAYS on regardless of if the app is active on the screen or not, which gets kinda annoying pretty quickly.

It would be nice for the client to have some kind of control on when it shows up. My particular use case is that I already have a right-hand side debug drawer which enables or disables features (similar to the u2020 app), and I would like to be able to show the toolbar overlay only when I need it.

You could probably make use of a static enable/disable method, shared preference or a broadcast listener to enable or disable the feature.

I hope all that makes sense?

xfumihiro commented 8 years ago

the colourful toolbar is ALWAYS on regardless of if the app is active on the screen or not

The toolbar's visibility is set with the life-cycle of your app. As long as you've overwritten the onResume, onPause and onDestory methods (I don't think a concrete app will leave those method unoverwritten), the toolbar should take care itself without annoying anybody.

Maybe I should work on the "How it's done" part of the README.