When I did the test it failed with a nullpointer. So I guessed that
getTextArray() didn't have an implementation in the ShadowResources.
Well it doesn't have it but there is a getStringArray().
The only difference between the is that:
* getTextArray returns CharSequence[]
* getStringArray return String[]
I would make getTextArray call getStringArray.
What do you think?
Second thing
Something is broken in both:
If you define your array as something
<string-array name="search_options">
<item>@string/search_by_property_type</item>
<item>@string/search_by_operation_type</item>
<item>@string/search_by_location</item>
<item>@string/search_by_price_range_from</item>
<item>@string/search_by_price_range_to</item>
<item>@string/search_by_currency</item>
</string-array>
When you get the String[] it doesn't do the conversion. so you get
"@string/search_by_property_type".
How should we fix this?
Thanks!
PS: This is my last new thread. I promise! :D
k
> For question 2:
> We ran into the same issue when dealing with colors.
> Check out ColorResourceLoader as an implemenation example. It seems like
> there's a refactoring to be made to pull out that logic for all
> the occurrences similar to this.
>
I don't know what you are willing to pull out.
Creating some sort of class that gets id as strings starting with @
and returns the id of it?
From what I have read in ColorResourceLoader something like this
should be added to processNode @ StringArrayResourceLoader:
String value = childNode.getTextContent();
if ( value.startsWith("@string") ) {
// get StringResourceLoader
StringResourceLoader srl;
value = srl.getValue(value.substring(1));
}
But I don't know how I can get a StringResourceLoader instance :(
> Let us know if you're in the process of implementing shadows for these. In
> the mean time we'll add stories to our tracker project for us to implement.
I can work on this but let's decide which is the best way of implementing it.
I don't like the fact that I need to send an instance of
StringResourceLoader in the constructor :(