コード例 #1
0
  public TiUIScrollableView(ScrollableViewProxy proxy, TiBaseActivity activity) {
    super(proxy);
    //		activity.addConfigurationChangedListener(this);

    mViews = new ArrayList<TiViewProxy>();
    viewsLock = new Object();
    buildViewPager(activity);
    TiCompositeLayout.LayoutParams params = new LayoutParams();
    params.optionWidth = new TiDimension("100%", TiDimension.TYPE_WIDTH);
    params.optionHeight = new TiDimension("100%", TiDimension.TYPE_HEIGHT);
    mPager.setLayoutParams(params);
    mContainer =
        new TiViewPagerLayout(activity) {
          @Override
          public boolean dispatchTouchEvent(MotionEvent event) {
            if (touchPassThrough == true) return false;
            return super.dispatchTouchEvent(event);
          }
        };
    mContainer.addView((View) mPager, params);
    mPagingControl = buildPagingControl(activity);
    mContainer.addView(mPagingControl, buildFillLayoutParams());

    setNativeView(mContainer);
  }
コード例 #2
0
 private void setPageOffset(Object value) {
   if (verticalLayout) {
     TiCompositeLayout.LayoutParams params = (LayoutParams) mPager.getLayoutParams();
     params.optionHeight =
         TiConvert.toTiDimension(TiConvert.toString(value), TiDimension.TYPE_TOP);
     mPager.setLayoutParams(params);
   } else {
     TiCompositeLayout.LayoutParams params = (LayoutParams) mPager.getLayoutParams();
     params.optionWidth =
         TiConvert.toTiDimension(TiConvert.toString(value), TiDimension.TYPE_LEFT);
     mPager.setLayoutParams(params);
   }
 }
コード例 #3
0
  private void setPageWidth(Object value) {
    if (verticalLayout) {
      TiCompositeLayout.LayoutParams params = (LayoutParams) mPager.getLayoutParams();
      params.optionHeight =
          TiConvert.toTiDimension(TiConvert.toString(value), TiDimension.TYPE_HEIGHT);
      mPager.setLayoutParams(params);
    } else {
      TiCompositeLayout.LayoutParams params = (LayoutParams) mPager.getLayoutParams();
      params.optionWidth =
          TiConvert.toTiDimension(TiConvert.toString(value), TiDimension.TYPE_WIDTH);
      mPager.setLayoutParams(params);
    }
    ((ViewGroup) nativeView).setClipChildren(false);

    hardwaredDisabled = true;
    disableHWAcceleration(nativeView); // we ll reenable it later because of a glitch
  }