ghahramani / viewpager

Google Play Music Tabs and View Pager
Apache License 2.0
47 stars 41 forks source link

dividerPadding and textAllCaps #5

Closed ricardoalcocer closed 10 years ago

ricardoalcocer commented 10 years ago

I'm getting a packaging error when trying to compile an app using Titanium 3.3.0.RC.

[ERROR] Failed to package application: [ERROR] [ERROR] /Users/ralcocer/Dropbox/Work/Manning/2014/code/ch4/TiConference/build/android/res/values/attrs.xml:9: error: Attribute "dividerPadding" has already been defined [ERROR] /Users/ralcocer/Dropbox/Work/Manning/2014/code/ch4/TiConference/build/android/res/values/attrs.xml:14: error: Attribute "textAllCaps" has already been defined

Any ideas?

ghahramani commented 10 years ago

You should define attributes only once. Please look at your code and if you define textAllCaps and deviderPadding more than once remove it then try again.

ricardoalcocer commented 10 years ago

Yeah, that's the thing, I'm not defining anything like that. Could it be related to the fact that Titanium 3.3.0 now uses AppCompat?

ghahramani commented 10 years ago

I don't think so. Can you paste here your compiled attrs.xml?

ricardoalcocer commented 10 years ago

Sure. Here:

<?xml version="1.0" encoding="UTF-8"?>
<resources>
    <declare-styleable name="PagerSlidingTabStrip">
        <attr name="indicatorColor" format="color"/>
        <attr name="underlineColor" format="color"/>
        <attr name="dividerColor" format="color"/>
        <attr name="indicatorHeight" format="dimension"/>
        <attr name="underlineHeight" format="dimension"/>
        <attr name="dividerPadding" format="dimension"/>
        <attr name="tabPaddingLeftRight" format="dimension"/>
        <attr name="scrollOffset" format="dimension"/>
        <attr name="tabBackground" format="reference"/>
        <attr name="shouldExpand" format="boolean"/>
        <attr name="textAllCaps" format="boolean"/>
    </declare-styleable>
</resources>
ricardoalcocer commented 10 years ago

I was able to pack the app properly with 3.2.0.GA, so it appears to be something with 3.3.0.RC.

ricardoalcocer commented 10 years ago

Does this here means that AppCompat is already defining those values?

ghahramani commented 10 years ago

Maybe, I didn't use AppCompact with this library. And I didn't try this with even 3.2.0.GA. I used 3.1.3.GA. Can you remove these attributes from attrs.xml and compile again and see if you can compile successfully?

ricardoalcocer commented 10 years ago

I don't think I can remove them...the attr.xml is auto-generated at build time, AFAIK. Do you know of a way?

On Thu, Jul 17, 2014 at 8:01 PM, dreamlearn notifications@github.com wrote:

Maybe, I didn't use AppCompact with this library. And I didn't try this with even 3.2.0.GA. I used 3.1.3.GA. Can you remove these attributes from attrs.xml and compile again and see if you can compile successfully?

— Reply to this email directly or view it on GitHub https://github.com/dreamlearn/viewpager/issues/5#issuecomment-49390936.

ghahramani commented 10 years ago

Yes, You can. You have to remove the attributes from viewpager in follow path: platform->android->res->values->attrs.xml

this file is in follow url in my repository: https://github.com/dreamlearn/viewpager/blob/master/platform/android/res/values/attrs.xml

Let me know if it works.

ricardoalcocer commented 10 years ago

Hi. I can confirm that it works with Titanium 3.3.0 by changing the modules attr.xml like this:

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <declare-styleable name="PagerSlidingTabStrip">
        <attr name="indicatorColor" format="color" />
        <attr name="underlineColor" format="color" />
        <attr name="dividerColor" format="color" />
        <attr name="indicatorHeight" format="dimension" />
        <attr name="underlineHeight" format="dimension" />
        <!--<attr name="dividerPadding" format="dimension" />-->
        <attr name="tabPaddingLeftRight" format="dimension" />
        <attr name="scrollOffset" format="dimension" />
        <attr name="tabBackground" format="reference" />
        <attr name="shouldExpand" format="boolean" />
        <!--<attr name="textAllCaps" format="boolean" />-->
    </declare-styleable>

</resources>

Naturally the values can be removed altogether.

ghahramani commented 10 years ago

I glad to hear that. I want to close this issue so did your issue solve?

ricardoalcocer commented 10 years ago

Yeah, fixed and closing. Thanks.

ricardoalcocer commented 10 years ago

When you have a chance, write me an email to alco [at] ricardoalcocer . com . Have something to share with you about this module.