@Override protected synchronized void onSizeChanged(int w, int h, int oldw, int oldh) { // update pixel conversion values PixelUtils.init(getContext()); // disable hardware acceleration if it's not explicitly supported // by the current Plot implementation. this check only applies to // honeycomb and later environments. if (Build.VERSION.SDK_INT >= 11) { if (!isHwAccelerationSupported() && isHardwareAccelerated()) { setLayerType(View.LAYER_TYPE_SOFTWARE, null); } } // pingPong is only used in background rendering mode. if (renderMode == RenderMode.USE_BACKGROUND_THREAD) { pingPong.resize(h, w); } RectF cRect = new RectF(0, 0, w, h); RectF mRect = boxModel.getMarginatedRect(cRect); RectF pRect = boxModel.getPaddedRect(mRect); layout(new DisplayDimensions(cRect, mRect, pRect)); super.onSizeChanged(w, h, oldw, oldh); if (renderThread != null && !renderThread.isAlive()) { renderThread.start(); } }
@Override public void setMargins(float left, float top, float right, float bottom) { boxModel.setMargins(left, top, right, bottom); }
public float getPlotPaddingRight() { return boxModel.getPaddingRight(); }
public void setPlotPaddingBottom(float plotPaddingBottom) { boxModel.setPaddingBottom(plotPaddingBottom); }
public void setPlotPaddingTop(float plotPaddingTop) { boxModel.setPaddingTop(plotPaddingTop); }
public void setPlotMarginRight(float plotMarginRight) { boxModel.setMarginRight(plotMarginRight); }
public void setPlotMarginLeft(float plotMarginLeft) { boxModel.setMarginLeft(plotMarginLeft); }
public float getPlotMarginBottom() { return boxModel.getMarginBottom(); }
@Override public float getPaddingRight() { return boxModel.getPaddingRight(); }
@Override public void setPaddingTop(float paddingTop) { boxModel.setPaddingTop(paddingTop); }
@Override public void setPaddingLeft(float paddingLeft) { boxModel.setPaddingLeft(paddingLeft); }
@Override public float getMarginBottom() { return boxModel.getMarginBottom(); }
@Override public void setMarginTop(float marginTop) { boxModel.setMarginTop(marginTop); }
@Override public float getMarginTop() { return boxModel.getMarginTop(); }
@Override public void setPadding(float left, float top, float right, float bottom) { boxModel.setPadding(left, top, right, bottom); }
public float getPlotMarginTop() { return boxModel.getMarginTop(); }
public void setPlotMarginTop(float plotMarginTop) { boxModel.setMarginTop(plotMarginTop); }
@Override public void setPaddingRight(float paddingRight) { boxModel.setPaddingRight(paddingRight); }
public void setPlotMarginBottom(float plotMarginBottom) { boxModel.setMarginBottom(plotMarginBottom); }
@Override public float getPaddingBottom() { return boxModel.getPaddingBottom(); }
public float getPlotMarginRight() { return boxModel.getMarginRight(); }
@Override public void setPaddingBottom(float paddingBottom) { boxModel.setPaddingBottom(paddingBottom); }
public float getPlotPaddingTop() { return boxModel.getPaddingTop(); }
@Override @SuppressWarnings("SameParameterValue") public void setMarginBottom(float marginBottom) { boxModel.setMarginBottom(marginBottom); }
public float getPlotPaddingBottom() { return boxModel.getPaddingBottom(); }
@Override public void setMarginLeft(float marginLeft) { boxModel.setMarginLeft(marginLeft); }
public void setPlotPaddingLeft(float plotPaddingLeft) { boxModel.setPaddingLeft(plotPaddingLeft); }
@Override public float getMarginRight() { return boxModel.getMarginRight(); }
public void setPlotPaddingRight(float plotPaddingRight) { boxModel.setPaddingRight(plotPaddingRight); }
@Override public void setMarginRight(float marginRight) { boxModel.setMarginRight(marginRight); }