SimplicityApks / ReminderDatePicker

A Google Keep-like Date and Time Picker for reminders
Apache License 2.0
74 stars 26 forks source link

Parse from XML isn't working anymore #36

Closed chrisonline closed 7 years ago

chrisonline commented 7 years ago

Hi, it's me again ;-)

I have just now upgrade to Android Studio and latest Gradle version. Now I have the problem that the DateSpinner only shows @2131689789, @213546756 and so on. Instead of the @string/date_today strings.

I have debuged a little bit and it seems that

parser.getAttributeValue(i);

inside parseItemFromXmlTag() will send back the @2131689789 instead of "string/date_today"!

case XML_ATTR_TEXT:
                    text = parser.getAttributeValue(i);
                    if(text != null && text.startsWith("@string/"))
                        textResource = res.getIdentifier(text, "string", packageName);
                    break;

Can you please check this? Have tried it on Android 7 and 8 and on both the same result. So it seems the problem is on the new Gradle version?!

SimplicityApks commented 7 years ago

There's your fix, if this works for you I'll try to do a release to maven if I have the time. Turns out I was using the wrong method and latest build tools changed the way resource ids are stored in xml ;)

chrisonline commented 7 years ago

Thanks this works. Can you do please a release to maven? Thanks again for your really quick fix.