DebugOverlay-Android
DebugOverlay-Android copied to clipboard
Many debug message with your library
When I use your library I have a lot of messages of this type (about 20 per second!)
D/TextView: setTypeface with style : 0
I also have a suggestion for you: add an option for hide the logs by default
Android Nougat 7.0 - Samsung Galaxy S7 Edge
Thanks for your comments.
Did you mean the log messages of the following type are only logged when you integrated this library, correct?
D/TextView: setTypeface with style : 0
Also, did you install this library with default options? For example,
public class ExampleApplication extends Application {
@Override public void onCreate() {
super.onCreate();
DebugOverlay.with(this).install();
// Normal app init code...
}
}
The issue is new to me since I didn't see that type of log message at all when testing this library with a couple of Xperia and Nexus devices. After I get your response, I will try to re-produce it on Galaxy devices.
Yes I have these logs only when I integrate your library. If I comment the integration nothing more. I get the impression that I have a message like this every time a line is displayed on the overlay (which makes an infinite loop as these lines are also displayed)
No I use customize options here they are :
new DebugOverlay.Builder(this)
.modules(new LogcatModule(LogcatModule.DEFAULT_MAX_LINES,
new LogcatLineFilter.SimpleLogcatLineFilter(LogcatLine.Priority.DEBUG)))
.position(Position.BOTTOM_START)
.bgColor(Color.parseColor("#60000000"))
.textColor(Color.MAGENTA)
.textSize(14f)
.textAlpha(.8f)
.allowSystemLayer(true)
.notification(true, MainMenu.class.getName())
.build()
.install();
Here is an example of the number of logs I have (look at the time each time!)

PS : i don't have this problem on emulator
Thanks for your quick response!
I tried to re-produce this issue on my old Galaxy S3 and Note 2, but the attempt was unsuccessful. I probably try Firebase TestLab later where I can use Samsung Galaxy S7 for testing. What's weird is that I could not find any code in TextView's implementation available through AOSP which prints out the log message you observed. Not sure if a vendor would add such extra log messages in the TextView. Hmm.
Anyway, you can do something like below meanwhile to avoid seeing the infinite TextView's logs.
new DebugOverlay.Builder(this)
.modules(new LogcatModule(LogcatModule.DEFAULT_MAX_LINES,
new LogcatLineFilter() {
@Override
public boolean shouldFilterOut(LogcatLine.Priority priority, @NonNull String tag) {
return priority.getIntValue() < LogcatLine.Priority.DEBUG.getIntValue() || ("TextView".equals(tag) &&
priority == LogcatLine.Priority.DEBUG);
}
}))
.position(Position.BOTTOM_START)
.bgColor(Color.parseColor("#60000000"))
.textColor(Color.MAGENTA)
.textSize(14f)
.textAlpha(.8f)
.allowSystemLayer(true)
.notification(true, MainMenu.class.getName())
.build()
.install();
Please let me know if this does not work and I will let you know once I find a better way to avoid this issue.
Thank you for your answer, I tried your proposal and it works. It's good for me, if you need more info on the bug or a test don't hesitate!
This comes from calls to
view.setTypeface(Typeface.DEFAULT,0) or view.setTypeface(Typeface.DEFAULT,Typeface.NORMAL)
I believe you can safely change the calls to (omit the second parameter)
view.setTypeface(Typeface.DEFAULT)
(view being a TextView)
Galaxy 7 DUOS (SM-G920FD), Android 7.0