You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I knew that setting empty text array is not allowed. But, what if we want to set it during runtime only, instead of initially setting it with app:texts="@array/my_texts"?
We can show an empty text if the array is empty. Throwing IllegalArgumentException directly is not a good action.
The text was updated successfully, but these errors were encountered:
To avoid crashing i have added a static array from string resource in xml and then add dynamic array from java file. I know it's not smart solution but for my case it's working fine.
The issue with this proposal is that it would be problematic if no static array would be chosen, what would the textview show until you set the text dynamically?
In most cases, the view will render before you get a chance to set the text, what should the default behavior be in this situation? Presenting an empty textview? that could be reasonable if not for the fading animation loop.
If you have an idea for the default behavior for an empty static string array let me know
There is now a FTV.placeholder built into the library string arrays.
If you want to leave the FTV empty until you update it at runtime you can use FTV.placeholder.
If users don't provide any string array, the app will crash with a proper error message
I knew that setting empty text array is not allowed. But, what if we want to set it during runtime only, instead of initially setting it with
app:texts="@array/my_texts"
?We can show an empty text if the array is empty. Throwing
IllegalArgumentException
directly is not a good action.The text was updated successfully, but these errors were encountered: