示例#1
0
 /** Initialize Transformer with a scalable or change width/height implementation. */
 private void initializeTransformer(TypedArray attributes) {
   topViewResize =
       attributes.getBoolean(R.styleable.draggable_view_top_view_resize, DEFAULT_TOP_VIEW_RESIZE);
   TransformerFactory transformerFactory = new TransformerFactory();
   transformer = transformerFactory.getTransformer(topViewResize, dragView, this);
   transformer.setViewHeight(
       attributes.getDimensionPixelSize(
           R.styleable.draggable_view_top_view_height, DEFAULT_TOP_VIEW_HEIGHT));
   transformer.setXScaleFactor(
       attributes.getFloat(
           R.styleable.draggable_view_top_view_x_scale_factor, DEFAULT_SCALE_FACTOR));
   transformer.setYScaleFactor(
       attributes.getFloat(
           R.styleable.draggable_view_top_view_y_scale_factor, DEFAULT_SCALE_FACTOR));
   transformer.setMarginRight(
       attributes.getDimensionPixelSize(
           R.styleable.draggable_view_top_view_margin_right, DEFAULT_TOP_VIEW_MARGIN));
   transformer.setMarginBottom(
       attributes.getDimensionPixelSize(
           R.styleable.draggable_view_top_view_margin_bottom, DEFAULT_TOP_VIEW_MARGIN));
 }
示例#2
0
 /**
  * Configure the vertical scale factor applied when the view is dragged to the bottom of the
  * custom view.
  */
 public void setYTopViewScaleFactor(float yScaleFactor) {
   transformer.setYScaleFactor(yScaleFactor);
 }