Skip to content

Commit

Permalink
1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
yizems committed Jan 17, 2017
1 parent 5e156e6 commit 43a85fb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ allprojects {

## 5更新日志

### 1.5版本

- 添加设置不可滑动的方法

### 1.4版本

- 修改版本号
Expand Down
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 25
versionCode 3
versionName "1.2"
versionCode 5
versionName "1.5"


}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ public class RulerView extends View {

protected List<String> data;


/**
* 是否可以滑动
*/
protected boolean scrollEnable = true;
/**
* 速率计算器
*/
Expand Down Expand Up @@ -456,6 +459,12 @@ protected void initLineHeight(int i) {

@Override
public boolean onTouchEvent(MotionEvent event) {

//不可滑动就不再处理滑动事件
if (!scrollEnable) {
return true;
}

switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
scroller.forceFinished(true);
Expand Down Expand Up @@ -733,4 +742,12 @@ public void setMidLineCount(int midLineCount) {
this.midLineCount = midLineCount;
computeYPostion();
}

public boolean isScrollEnable() {
return scrollEnable;
}

public void setScrollEnable(boolean scrollEnable) {
this.scrollEnable = scrollEnable;
}
}

0 comments on commit 43a85fb

Please sign in to comment.