How to make the declare-styleable flag programmatically?

470 Views Asked by At

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!

<declare-styleable name="BookView">
    <attr name="date_type" format="flags">
        <flag name="nen" value="0x01"/>
        <flag name="year_month" value="0x02"/>
        <flag name="year" value="0x04"/>
        <flag name="month" value="0x08"/>
    </attr>
</declare-styleable>



mCalType = attributes.getInteger(R.styleable.BookView_date_type, CALENDAR_TYPE);
0

There are 0 best solutions below