I am wondering what is faster? A single TextView with set Spannable.Factory (which applies two styles to text) or two simple TextViews with plain text?
As this is inside of a list item (so re-rendered on scroll) it may be not so unsignificant as it may seem.
            Asked
            
        
        
            Active
            
        
            Viewed 604 times
        
    0
            
            
         
    
    
        Tomasz Gawel
        
- 8,379
- 4
- 36
- 61
- 
                    Thanks guys for both comments, I mark them both +1, but they're ...exclusive ;), Thanks for your intuitive guesses. Nontheless, more answers especially with some explanation are still welcome. – Tomasz Gawel Jul 11 '12 at 08:46
- 
                    1In the case at this website it seems two textviews would be faster: http://www.pushing-pixels.org/2013/09/17/android-performance-bits-and-pieces-part-i-measure-everything.html – Frank Jan 27 '15 at 09:29
2 Answers
1
            
            
        Citing Zsolt Vasvari via Google Groups:
"My guess, all else being equal, is that a View is a much "heavier" object than a Spannable. But which one is better is impossible to say because it requires to know what you want for and how you want to use the text lines for. "
 
    
    
        karllindmark
        
- 6,031
- 1
- 26
- 41
1
            
            
        Mind you, this is only a guess. My feeling is that the expense you want to avoid is object creation, and that two simple Views are better than one Spannable, provided the Views are recycled.
 
    
    
        Sparky
        
- 8,437
- 1
- 29
- 41