Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Mirror a TextView

Part of my application requires it to be compatible if somebody was looking at the screen via mirror. Does anybody know a way where I can mirror all of the text on screen? I have tried mirrorText.setLayoutDirection(View.LAYOUT_DIRECTION_RTL); but it hasn't worked. Thank you

like image 242
Ethan Avatar asked Dec 08 '22 23:12

Ethan


1 Answers

This is very simple to accomplish. The code I used was:
Text.setScaleX(-1); Text.setScaleY(1); Text.setTranslationX(1); //To place everything back where it was originally. Hope this helps!

like image 128
Ethan Avatar answered Jan 05 '23 23:01

Ethan