SwipeLayout - не удается разрешить символ drag_edge внутри attr.xml

Я пытаюсь понять, что я упустил. У меня есть реализация класса SwipeLayout со следующими строками внутри конструктора:

public SwipeLayout(Context context, AttributeSet attrs, int defStyle) {
    ...
    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SwipeLayout);
    int dragEdgeChoices = a.getInt(R.styleable.SwipeLayout_drag_edge, DRAG_RIGHT);
    mEdgeSwipesOffset[DragEdge.Left.ordinal()] = a.getDimension(R.styleable.SwipeLayout_leftEdgeSwipeOffset, 0);
    mEdgeSwipesOffset[DragEdge.Right.ordinal()] = a.getDimension(R.styleable.SwipeLayout_rightEdgeSwipeOffset, 0);
    mEdgeSwipesOffset[DragEdge.Top.ordinal()] = a.getDimension(R.styleable.SwipeLayout_topEdgeSwipeOffset, 0);
    mEdgeSwipesOffset[DragEdge.Bottom.ordinal()] = a.getDimension(R.styleable.SwipeLayout_bottomEdgeSwipeOffset, 0);
    setClickToClose(a.getBoolean(R.styleable.SwipeLayout_clickToClose, mClickToClose));
    ...
}

и иметь файл attr.xml со стилями:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="SwipeLayout">
    <attr name="drag_edge">
        <flag name="left" value="1" />
        <flag name="right" value="2" />
        <flag name="top" value="4" />
        <flag name="bottom" value="8" />
    </attr>
    <attr name="leftEdgeSwipeOffset" format="dimension" />
    <attr name="rightEdgeSwipeOffset" format="dimension" />
    <attr name="topEdgeSwipeOffset" format="dimension" />
    <attr name="bottomEdgeSwipeOffset" format="dimension" />
    <attr name="show_mode" format="enum">
        <enum name="lay_down" value="0" />
        <enum name="pull_out" value="1" />
    </attr>
    <attr name="clickToClose" format="boolean" />
</declare-styleable>
</resources>

Но это ошибка внутри xml, которая говорит мне, что имена вроде "drag_edge", "leftEdgeSwipeOffset", "rightEdgeSwipeOffset" и другие не найдены. Может быть, я пропустил какие-то библиотеки поддержки или дизайна?

0 ответов

Другие вопросы по тегам