Comment

Comment by fngjdflmdflg

Yes, the Android SDK has to be one of the worst software packages to ever have been written. Just look at the sourcecode for TextView[0] if you want to see for yourself. 8,700 lines of code to show text on the screen? Well actually, TextView is actually a full blown text editor with the editing functionality turned off as a flag. EditText just wraps TextView and sets the `ediable` field to true. What genius software design! Ever wonder how those selection handles appear when you long press on text in a TextView? I wonder what component that is? Trick question – its built right in to TextView as well! It uses a popup window the displays the handles in global coordinates which it gets using a mixture of `getLocationInWindow` and `getLocationOnScreen`.[1] Another stroke of genius form the Android SDK! Want to change any of this functionality slightly? Now you have to make your own TextView starting from StaticLayout.

[0] https://android.googlesource.com/platform/frameworks/base/+/...

[1] https://cs.android.com/android/platform/superproject/main/+/...

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton