Kotlin Block Event Click Activity (KBECA)

Hi guys, this time I want to share my experience when facing a case related to the landscape and portrait printing process struck / report to the thermal printer.

This case is quite complex, because the format requested by the client is not a standard thermal printer style, so it requires me to use a special trick so that all of this can be achieved.

Finally, I decided to display the report on the user's cellphone screen dimensions, then I carried out the screen scanning mechanism to produce a report image which I will later print via a thermal printer.

The problem is that this scanning process takes time, and there should be no interaction with the user, therefore I need to block this Scanning Activity from various forms of user clicks, and we can do it in this way.

getWindow() . setFlags(WindowManager . LayoutParams . FLAG_NOT_TOUCHABLE,
WindowManager . LayoutParams . FLAG_NOT_TOUCHABLE);

Then to activate the interaction again use this method.

getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);

Post a Comment

Previous Next

نموذج الاتصال