Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: How do I reference a stylable that resides in a library that my app references?

I have a custom view I created that resides in a library I'm referencing in my app. In the library I declared a styleable, which the view uses. In my app, I'm using the custom view from the library as such:

<nefarious.library.myappname.views.DragDropList
   xmlns:ddl="http://schemas.android.com/apk/res/nefarious.library.myappname"
android:id="@id/android:list"  
   android:layout_width="fill_parent" 
   android:layout_height="fill_parent"
   android:choiceMode="singleChoice"
   android:clickable="true" 
   android:longClickable="true"
   android:focusable="true"
   android:hapticFeedbackEnabled="true" 
   android:cacheColorHint="#00000000"
   ddl:normalHeight="@dimen/list_item_height"
   ddl:doubleHeight="@dimen/list_item_height_doubled"
   ddl:grabber="@id/grabber"
   ddl:grabberPadding="30dip"
   ddl:dragndropBackground="@color/moola_light" />

Eclipse seems to be having a problem finding the stylable. Eclipse is telling me it couldn't find the resource identifier for every one of my stylable attributes.

How can I get my app to see the stylable from the library?

My question is exactly this one:

Specifying Android project dependencies (in Eclipse)

Which appears to not have been answered.

like image 301
Christopher Perry Avatar asked Dec 16 '22 22:12

Christopher Perry


1 Answers

Since yout library is not packaged as an apk, you have to change custom sheme from http://schemas.android.com/apk/res/nefarious.library.myappname to http://schemas.android.com/res/nefarious.library.myappname. I hope it will help

like image 86
ndongo Avatar answered Dec 28 '22 08:12

ndongo