当前位置: 首页>>代码示例>>Java>>正文


Java WXComponent.getParentScroller方法代码示例

本文整理汇总了Java中com.taobao.weex.ui.component.WXComponent.getParentScroller方法的典型用法代码示例。如果您正苦于以下问题:Java WXComponent.getParentScroller方法的具体用法?Java WXComponent.getParentScroller怎么用?Java WXComponent.getParentScroller使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.taobao.weex.ui.component.WXComponent的用法示例。


在下文中一共展示了WXComponent.getParentScroller方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: scrollTo

import com.taobao.weex.ui.component.WXComponent; //导入方法依赖的package包/类
/**
 * @see com.taobao.weex.dom.WXDomStatement#scrollToDom(String, JSONObject)
 */
void scrollTo(String ref, Map<String, Object> options) {
  WXComponent component = mRegistry.get(ref);
  if (component == null) {
    return;
  }

  float offsetFloat = 0;
  if (options != null) {
    String offset = options.get("offset") == null ? "0" : options.get("offset").toString();
    if (offset != null) {
      try {
        offsetFloat = WXViewUtils.getRealPxByWidth(Float.parseFloat(offset));
      }catch (Exception e ){
         WXLogUtils.e("Float parseFloat error :"+e.getMessage());
      }
    }
  }

  Scrollable scroller = component.getParentScroller();
  if (scroller == null) {
    return;
  }
  scroller.scrollTo(component,(int)offsetFloat);
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:28,代码来源:WXRenderStatement.java

示例2: bindStickStyle

import com.taobao.weex.ui.component.WXComponent; //导入方法依赖的package包/类
public void bindStickStyle(WXComponent component, Map<String, HashMap<String, WXComponent>> mStickyMap) {
    Scrollable scroller = component.getParentScroller();
    if (scroller == null) {
        return;
    }
    HashMap<String, WXComponent> stickyMap = mStickyMap.get(scroller
            .getRef());
    if (stickyMap == null) {
        stickyMap = new HashMap<>();
    }
    if (stickyMap.containsKey(component.getRef())) {
        return;
    }
    stickyMap.put(component.getRef(), component);
    mStickyMap.put(scroller.getRef(), stickyMap);
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:17,代码来源:WXStickyHelper.java

示例3: bindStickStyle

import com.taobao.weex.ui.component.WXComponent; //导入方法依赖的package包/类
public void bindStickStyle(WXComponent component, Map<String, Map<String, WXComponent>> mStickyMap) {
    Scrollable scroller = component.getParentScroller();
    if (scroller == null) {
        return;
    }
    Map<String, WXComponent> stickyMap = mStickyMap.get(scroller
            .getRef());
    if (stickyMap == null) {
        stickyMap = new ConcurrentHashMap<>();
    }
    if (stickyMap.containsKey(component.getRef())) {
        return;
    }
    stickyMap.put(component.getRef(), component);
    mStickyMap.put(scroller.getRef(), stickyMap);
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:17,代码来源:WXStickyHelper.java

示例4: scrollTo

import com.taobao.weex.ui.component.WXComponent; //导入方法依赖的package包/类
/**
 * @see com.taobao.weex.dom.WXDomStatement#scrollToDom(String, JSONObject)
 */
void scrollTo(String ref, Map<String, Object> options) {
  WXComponent component = mRegistry.get(ref);
  if (component == null) {
    return;
  }

  float offsetFloat = 0;
  if (options != null) {
    String offset = options.get("offset") == null ? "0" : options.get("offset").toString();
    if (offset != null) {
      try {
        offsetFloat = WXViewUtils.getRealPxByWidth(Float.parseFloat(offset),mWXSDKInstance.getViewPortWidth());
      }catch (Exception e ){
         WXLogUtils.e("Float parseFloat error :"+e.getMessage());
      }
    }
  }

  Scrollable scroller = component.getParentScroller();
  if (scroller == null) {
    return;
  }
  scroller.scrollTo(component,(int)offsetFloat);
}
 
开发者ID:erguotou520,项目名称:weex-uikit,代码行数:28,代码来源:WXRenderStatement.java

示例5: unbindStickStyle

import com.taobao.weex.ui.component.WXComponent; //导入方法依赖的package包/类
public void unbindStickStyle(WXComponent component, Map<String, HashMap<String, WXComponent>> mStickyMap) {
    Scrollable scroller = component.getParentScroller();
    if (scroller == null) {
        return;
    }
    HashMap<String, WXComponent> stickyMap = mStickyMap.get(scroller
            .getRef());
    if (stickyMap == null) {
        return;
    }
    stickyMap.remove(component.getRef());
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:13,代码来源:WXStickyHelper.java

示例6: executeRender

import com.taobao.weex.ui.component.WXComponent; //导入方法依赖的package包/类
@Override
public void executeRender(RenderActionContext context) {
  WXComponent component = context.getComponent(mRef);
  if (component == null) {
    return;
  }

  Scrollable scroller = component.getParentScroller();
  if (scroller == null) {
    return;
  }
  scroller.scrollTo(component,mOptions);
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:14,代码来源:ScrollToElementAction.java

示例7: WXGesture

import com.taobao.weex.ui.component.WXComponent; //导入方法依赖的package包/类
public WXGesture(WXComponent wxComponent, Context context) {
  this.component = wxComponent;
  globalRect = new Rect();
  globalOffset = new Point();
  globalEventOffset = new Point();
  locEventOffset = new PointF();
  locLeftTop = new PointF();
  mGestureDetector = new GestureDetector(context, this, new GestureHandler());
  Scrollable parentScrollable = wxComponent.getParentScroller();
  if(parentScrollable != null) {
    mParentOrientation = parentScrollable.getOrientation();
  }
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:14,代码来源:WXGesture.java

示例8: unbindStickStyle

import com.taobao.weex.ui.component.WXComponent; //导入方法依赖的package包/类
public void unbindStickStyle(WXComponent component, Map<String, Map<String, WXComponent>> mStickyMap) {
    Scrollable scroller = component.getParentScroller();
    if (scroller == null) {
        return;
    }
    Map<String, WXComponent> stickyMap = mStickyMap.get(scroller
            .getRef());
    if (stickyMap == null) {
        return;
    }
    stickyMap.remove(component.getRef());
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:13,代码来源:WXStickyHelper.java


注:本文中的com.taobao.weex.ui.component.WXComponent.getParentScroller方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。