Questions tagged [attrs.xml]
18 questions
1
vote
1 answer
View with Custom StateListDrawable not rendering
I want to dynamically select a Drawable based upon selected state for the view. I have used boolean states instead of string because string is not supported as per this post. Here are code details:
attrs.xml
…

NightFury
- 13,436
- 6
- 71
- 120
1
vote
2 answers
Odoo - Multiple Conditions with OR in attrs
I am trying to create multiple condition in attrs to make a field invisible based on selection of another field

Ancient
- 3,007
- 14
- 55
- 104
1
vote
1 answer
ODOO : Set specific value of an attribute in attrs
I am trying to display attachment in the form view. Based on the type of attachment I want to change the value of widget. If attachment is an image then widget="image".
My doubt is if we write something like this:
attrs="{'invisible' : [('state',…

ashwin mahajan
- 1,654
- 5
- 27
- 50
1
vote
2 answers
How to get the value of a custom attribute (attrs.xml)?
I have this attribute declared on attrs.xml:
I need to get it's value, which should be "#076B07", but instead I'm getting an integer: "2130771968"
I'm…

NullPointerException
- 36,107
- 79
- 222
- 382
0
votes
0 answers
error: expected enum but got (raw string) single_capture
I'm trying to use custom attributes to make an audio wave form. I used enum only once in this project. First it was working perfect, then this error below appears. I tried to modify it or delete it, but nothing changed. If anyone can help me with…

Mahmoud Nabil
- 3
- 3
0
votes
0 answers
how to set endIconMode in a custom TextInputLayout?
I'm trying to figure out how to set the endIconMode in a custom text input layout. I am trying to set this in the attrs.xml, not programmatically (this is how I'm asked to do it at work)
here's what it looks like:
attrs.xml

aj mitchell
- 1
- 3
0
votes
2 answers
When to use attrs.xml, when dimens.xml?
I like to integrate ads with AppLovin into my Android App.
In their documentation they say:
Declare the base banner height of 50dp in res/values/attrs.xml:

S. Gissel
- 1,788
- 2
- 15
- 32
0
votes
0 answers
Can I use enum from code in android custom enum attribute?
I have an enum in my Kotlin app:
enum class MeasurementUnits(val displayString: String) {
KILOGRAM("kg"),
POUND("lbs"),
KILOMETER("km"),
MILE("mi"),
}
I'd like to use this enum in a custom attribute in a compound View I'm writing,…

Yossi Vainshtein
- 3,845
- 4
- 23
- 39
0
votes
1 answer
How To Hide Validate Button in odoo stock.picking form based on boolean field with states
i'm trying To Hide Validation button on stock.picking form, I'm searching about the button on stock.view_picking_form and found tow button with name button_validate.
0
votes
0 answers
How to make the declare-styleable flag programmatically?
I have the following code in the attrs.xml to use it for custom view but I want to convert it programmatically and use it in java. How will I do it? I would love to hear from you!

Nancy
- 129
- 2
- 13
0
votes
2 answers
Unable to solve incompatible with attribute error in android
I have a following error andI have no clue why this is happening.All I did was add the flag
called "mon" and tried to add it to the custom view in the xml. flags other than "mon" works
well. What is the meaning of this error? I would love to hear…

Nancy
- 129
- 2
- 13
0
votes
0 answers
No resource identifier found for attribute in my Custom View
If I keep and use only the attributes that start with 'android:',everything is working well. When I add the custom name for an attribute (in this case is ) nothing in the view works anymore. The following things…

Teo Mihaila
- 134
- 1
- 2
- 18
0
votes
1 answer
Part of value inside of 'style' attrs to become variable in python bs4
Let's assume we have code:

PerfectionQuest
- 5
- 2
0
votes
1 answer
How can you add a reference to another view through attributes in android?
I am trying to create a custom edittext that shows a progress icon (like typing....) while the user is typing
my layout is like this:
…

Cruces
- 3,029
- 1
- 26
- 55
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