Questions tagged [styleable]

17 questions
89
votes
2 answers

Declaring styleable attributes in Android

There's precious little documentation about the declare-styleable tag by which we can declare custom styles for components. I did find this list of valid values for the format attribute of the attr tag. While that's nice as far as it goes, it…
Ted Hopp
  • 232,168
  • 48
  • 399
  • 521
35
votes
4 answers

How to declare several stylable attributes with the same name for different tags?

I want both my ViewA and ViewB to have the "title" tag. But I can't put this in attrs.xml:
Andreas
  • 7,470
  • 10
  • 51
  • 73
5
votes
2 answers

Styleable cannot be resolved

Here is the code I am using: public ASSwitch(Context context, AttributeSet attrs) { super(context, attrs); TypedArray sharedTypedArray = context.getTheme().obtainStyledAttributes( attrs, R.styleable.ASSwitch, …
1
vote
1 answer

Android: doesn't not recognize styleable in some case

I have added some attributes into file attr.xml. Here its code:
hqt
  • 29,632
  • 51
  • 171
  • 250
1
vote
2 answers

Working with styleable

I wanted to make a view containing a progress view and a button. Through the view's xml I wanted to add fields that define button and porgress bar style. What I've done so far but it does not work:
1
vote
2 answers

javafx - override root css attributes

I know it is possible to override dynamically css attributes defined for a node using StyleableObjectProperty. I'm asking now how can i change root properties declared in ".root" class in css stylesheet so all node will inherit this change. I would…
1
vote
1 answer

getTheme().resolveAttribute() alternative on pre-lollipop

I have been struggling to obtain the styled attributes with the pre-lollipop API. With lollipop, I use final TypedValue statusBarColor = new TypedValue(); getTheme().resolveAttribute(android.R.attr.colorPrimaryDark, statusBarColor,…
tim687
  • 2,256
  • 2
  • 17
  • 28
0
votes
1 answer

Android HelloGallery Example

im working on a HelloGallery example for an Android app i'm developing. I need to display two pictures from my res/drawable-hdpi and I'm doing this via the HelloGallery examples on the web. I tried using the HelloViews (…
John Dough
  • 125
  • 2
  • 12
0
votes
0 answers

SwipeLayout - cannot resolve symbol 'drag_edge' inside attr.xml

I'm trying to understand what i missed. I have the implementation of SwipeLayout class with the next lines inside constructor: public SwipeLayout(Context context, AttributeSet attrs, int defStyle) { ... TypedArray a =…
Eugene V.
  • 90
  • 11
0
votes
0 answers

JavaFX CornerRadiiConverter - Where is it?

I'm trying to create a styleable property of type CornerRadii, which requires a StyleConverter to create the CssMetaData. It would be great if the StyleablePropertyFactory provided support for CornerRadii in the same way as for Paint, Insets, etc.,…
jfr
  • 397
  • 2
  • 17
0
votes
1 answer

How to change value of an R.styleable

So I'm using a TimePickerDialog in my app but it defaults to the clock style which I do not want to use. I want to use the spinner style. If you look here: https://developer.android.com/reference/android/R.styleable.html#TimePicker_timePickerMode…
Aidan Rosswood
  • 1,212
  • 1
  • 10
  • 21
0
votes
1 answer

When Generate Signed APK :Error:(131) Error: Expected resource of type styleable [ResourceType]

Error occure in this /* // UserProfile navDrawerItems.add(new NavDrawerItem(navMenuTitles[1], navMenuIcons.getResourceId(1, -1)));*/ // Payment navDrawerItems.add(new NavDrawerItem(navMenuTitles[1],…
Tousif Irshad
  • 37
  • 2
  • 12
0
votes
2 answers

Implement read-only style in JavaFX?

I would like to have entity (control or property) which has different states, which are possible to be colored by CSS. For example, regard TextField, which can contain two sort of values, normal and erroneous. Once it contain erroneous value, it…
Suzan Cioc
  • 29,281
  • 63
  • 213
  • 385
0
votes
1 answer

Get value from attribute value from XML

I have a custom class which is extened from Textview now I need to get the values in the xml for the layout. I tried public FontTextView(Context context, AttributeSet attrs) { super(context, attrs); setIncludeFontPadding(false); int…
null pointer
  • 5,874
  • 4
  • 36
  • 66
0
votes
1 answer

Android Libraries and custom xml attributes

I want to use a library to make drag and drop list view. It's named "drag-sort-list-view" After download this lib project,I created a project and I exported de libray folder in .jar, including the .classes and the xml dslv_attrs, containing the…
Skartt
  • 551
  • 2
  • 7
  • 19
1
2