Search in sources :

Example 1 with WXComponentProp

use of com.taobao.weex.ui.component.WXComponentProp in project weex-example by KalicyZhou.

the class RichText method setTelLink.

@WXComponentProp(name = "tel")
public void setTelLink(String tel) {
    SpannableString spannable = new SpannableString(tel);
    spannable.setSpan(new URLSpan("tel:" + tel), 0, tel.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
    ((TextView) getHostView()).setText(spannable);
}
Also used : SpannableString(android.text.SpannableString) TextView(android.widget.TextView) URLSpan(android.text.style.URLSpan) WXComponentProp(com.taobao.weex.ui.component.WXComponentProp)

Example 2 with WXComponentProp

use of com.taobao.weex.ui.component.WXComponentProp in project weex-example by KalicyZhou.

the class BasicListComponent method setScrollable.

@WXComponentProp(name = Constants.Name.SCROLLABLE)
public void setScrollable(boolean scrollable) {
    this.isScrollable = scrollable;
    WXRecyclerView inner = getHostView().getInnerView();
    if (inner != null) {
        inner.setScrollable(scrollable);
    }
}
Also used : WXRecyclerView(com.taobao.weex.ui.view.listview.WXRecyclerView) WXComponentProp(com.taobao.weex.ui.component.WXComponentProp)

Example 3 with WXComponentProp

use of com.taobao.weex.ui.component.WXComponentProp in project incubator-weex by apache.

the class WXRecyclerTemplateList method setColumnWidth.

@WXComponentProp(name = Constants.Name.COLUMN_WIDTH)
public void setColumnWidth(int columnCount) {
    if (mDomObject.getColumnWidth() != mColumnWidth) {
        updateRecyclerAttr();
        WXRecyclerView wxRecyclerView = getHostView().getInnerView();
        wxRecyclerView.initView(getContext(), mLayoutType, mColumnCount, mColumnGap, getOrientation());
    }
}
Also used : WXRecyclerView(com.taobao.weex.ui.view.listview.WXRecyclerView) WXComponentProp(com.taobao.weex.ui.component.WXComponentProp)

Example 4 with WXComponentProp

use of com.taobao.weex.ui.component.WXComponentProp in project incubator-weex by apache.

the class WXRecyclerTemplateList method setColumnCount.

@WXComponentProp(name = Constants.Name.COLUMN_COUNT)
public void setColumnCount(int columnCount) {
    if (mDomObject.getColumnCount() != mColumnCount) {
        updateRecyclerAttr();
        WXRecyclerView wxRecyclerView = getHostView().getInnerView();
        wxRecyclerView.initView(getContext(), mLayoutType, mColumnCount, mColumnGap, getOrientation());
    }
}
Also used : WXRecyclerView(com.taobao.weex.ui.view.listview.WXRecyclerView) WXComponentProp(com.taobao.weex.ui.component.WXComponentProp)

Example 5 with WXComponentProp

use of com.taobao.weex.ui.component.WXComponentProp in project incubator-weex by apache.

the class WXRecyclerTemplateList method setScrollDirection.

@WXComponentProp(name = Constants.Name.SCROLL_DIRECTION)
public void setScrollDirection(String direction) {
    if (orientation != mDomObject.getOrientation()) {
        orientation = mDomObject.getOrientation();
        updateRecyclerAttr();
        WXRecyclerView wxRecyclerView = getHostView().getInnerView();
        wxRecyclerView.initView(getContext(), mLayoutType, mColumnCount, mColumnGap, getOrientation());
    }
}
Also used : WXRecyclerView(com.taobao.weex.ui.view.listview.WXRecyclerView) WXComponentProp(com.taobao.weex.ui.component.WXComponentProp)

Aggregations

WXComponentProp (com.taobao.weex.ui.component.WXComponentProp)19 WXRecyclerView (com.taobao.weex.ui.view.listview.WXRecyclerView)13 SpannableString (android.text.SpannableString)2 URLSpan (android.text.style.URLSpan)2 Pair (android.util.Pair)2 TextView (android.widget.TextView)2 JSMethod (com.taobao.weex.annotation.JSMethod)2 Invoker (com.taobao.weex.bridge.Invoker)2 MethodInvoker (com.taobao.weex.bridge.MethodInvoker)2 Annotation (java.lang.annotation.Annotation)2 Method (java.lang.reflect.Method)2 Calendar (java.util.Calendar)2 HashMap (java.util.HashMap)2