Skip to content

Too strict attribute definitions #43

@MarcinOrlowski

Description

@MarcinOrlowski

Some attributes like i.e. barThickness are not accepting dimentions ("dp") values, just raw values. This is bad and unnecesary, and can be easily corrected by fixing faulty definition of the attributes. Instead of

<attr name="barThickness" format="integer"/>

it should rather be

<attr name="barThickness" format="dimension"/>

or even better

<attr name="barThickness" format="dimension|reference"/>

The same for majority of other attributes. All of then should be extended by adding |reference. As this is small change I do not bother doing PR, but imho attr.xml should be looking like this:

<resources>

    <declare-styleable name="MaterialScrollBar">
        <attr name="recyclerView" format="reference"/>
        <attr name="lightOnTouch" format="boolean|reference"/>
        <attr name="handleColour" format="color|reference"/>
        <attr name="barColour" format="color|reference"/>
        <attr name="handleOffColour" format="color|reference"/>
        <attr name="textColour" format="color|reference"/>
        <attr name="barThickness" format="dimension|reference"/>
    </declare-styleable>

    <declare-styleable name="TouchScrollBar">
        <attr name="hideDelayInMilliseconds" format="integer|reference"/>
        <attr name="autoHide" format="boolean|reference"/>
    </declare-styleable>

</resources>

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions