Questions tagged [declare-styleable]

56 questions
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
1 answer

Is there a way to use declare-styleable to open the choose a resource dialog that lets you select a color or a drawable in Android Studio?

Having the custom view TestView and declaring the following custom attribute: upon trying to open the resource selection dialog from the…
0
votes
1 answer

Add Custom View dinamically

I've got a problem while adding custom view dynamically. Below are my current codes. attrs.xml
wdev733
  • 114
  • 2
  • 12
0
votes
0 answers

Custom styleable for custom view inside a style

I have a CustomTextView extends TextView and I've added styleable for it as follows
dykzei eleeot
  • 169
  • 2
  • 6
0
votes
1 answer

How to obtain typeface for RobotoTextView from reference styleable attribute

I have a custom view which contains several RobotoTextViews and I want to set typefaces for them. So, I use declare-styleable item like this:
nullpexx
  • 127
  • 4
  • 11
0
votes
0 answers

How can I make the color of an EditText styleable with a custom attribute (like an error)?

I'd like to make an EditText whose text turns red when an "error" condition is met. I'm aware that TextInputLayout has a built-in error state, but I don't want to have text beneath the input area, and I don't want to include the support design…
0
votes
1 answer

How to get all possible values of enum custom attribute?

Assuming I have a custom attribute my_custom_enum for my views:
Bartek Lipinski
  • 30,698
  • 10
  • 94
  • 132
0
votes
1 answer

Layout editor does not pass styleable attribute to custom View class

I am creating a FixedAspectImageView to solve the problem in Android of making an ImageView set its view bounds to match the aspect ratio of the image contained within, and also fill an arbitrarily wide (or tall) available area and stretch the image…
Andrew Wyld
  • 7,133
  • 7
  • 54
  • 96
-1
votes
1 answer

Allow usage of values like ‘wrap_content’ in attrs.xml

How can I allow usage of values like wrap_content or match_parent in attrs.xml resource file on Android? My attrs.xml. I want the foo_dimen…
-1
votes
2 answers

get stylable enum name from value

This is NOT the question asked a million times about enums. I define the enums as part of styleable attribute (for a custom widget)
ilomambo
  • 8,290
  • 12
  • 57
  • 106
1 2 3
4