From 37e010c0b84683ca6e793544691c143261bb1d9f Mon Sep 17 00:00:00 2001 From: huangyanbin <873825232@qq.com> Date: Sun, 11 Mar 2018 21:07:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bin/david/form/core/SmartTable.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/form/src/main/java/com/bin/david/form/core/SmartTable.java b/form/src/main/java/com/bin/david/form/core/SmartTable.java index 352a523..f5ee3e4 100644 --- a/form/src/main/java/com/bin/david/form/core/SmartTable.java +++ b/form/src/main/java/com/bin/david/form/core/SmartTable.java @@ -54,6 +54,7 @@ public class SmartTable extends View implements OnTableChangeListener{ private final Object lockObject = new Object(); private boolean isExactly = true; //是否是测量精准模式 private boolean isNotifying = false; //是否正在更新数据 + private boolean isYSequenceRight; public SmartTable(Context context) { super(context); @@ -126,14 +127,28 @@ protected void onDraw(Canvas canvas) { drawGridBackground(canvas, showRect, scaleRect); if (config.isShowYSequence()) { yAxis.onMeasure(scaleRect, showRect, config); + if(isYSequenceRight){ + canvas.save(); + canvas.translate(showRect.width(),0); + } yAxis.onDraw(canvas, showRect, tableData, config); + if(isYSequenceRight){ + canvas.restore(); + } } if (config.isShowXSequence()) { xAxis.onMeasure(scaleRect, showRect, config); xAxis.onDraw(canvas, showRect, tableData, config); } + if(isYSequenceRight){ + canvas.save(); + canvas.translate(-yAxis.getWidth(),0); + } provider.onDraw(canvas, scaleRect, showRect, tableData, config); + if(isYSequenceRight){ + canvas.restore(); + } } } } @@ -585,5 +600,13 @@ private void release(){ xAxis = null; yAxis = null; } + + public boolean isYSequenceRight() { + return isYSequenceRight; + } + + public void setYSequenceRight(boolean YSequenceRight) { + isYSequenceRight = YSequenceRight; + } }