OkCupid Aug 28, 2020

Improved Localization with Custom TextView Effects

Article Summary

Anton Begeima from OkCupid's engineering team turned a localization nightmare into an elegant solution. Instead of managing separate images for every language, his team built a custom TextView that handles text effects programmatically.

OkCupid faced a common internationalization challenge: text with visual effects (like extrude/3D styling) was baked into images, making translation impossible. Custom fonts failed because they don't support all character sets across languages. The solution? A custom Android TextView that draws the effect dynamically.

Key Takeaways

Critical Insight

By overriding onDraw() and manipulating the canvas, OkCupid replaced static images with a reusable component that works across all languages while maintaining full design control.

The article includes the complete implementation with custom attributes for extrude depth, color, and stroke width that you can drop into any Android project.

Recent from OkCupid

Related Articles