Skip to content

Commit

Permalink
修改返回参数类型.
Browse files Browse the repository at this point in the history
  • Loading branch information
liujiayu5566 committed Dec 7, 2017
1 parent 18f9446 commit 250a1b5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,4 @@ dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.3.1'
testCompile 'junit:junit:4.12'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.jakewharton:butterknife:5.1.1'
// compile 'com.android.support:recyclerview-v7:22.0.0'
}
2 changes: 1 addition & 1 deletion app/src/main/java/com/liujiayu/view/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected void onCreate(Bundle savedInstanceState) {
mCv.setDefault(27, 22); //添加默认数据--注:不能超出范围
mCv.setTxtFinishListener(new CirqueView.txtFinishListener() {
@Override
public void onFinish(String temperature, String time) {
public void onFinish(int temperature, int time) {
Util.showToast(MainActivity.this, temperature + "//" + time);
}
});
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/com/liujiayu/view/cirque/CirqueView.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ protected void onDraw(Canvas canvas) {
canvas.drawLine(getWidth() / 2 - radius - defaultValue - DensityUtil.dip2px(context, 1), getHeight() / 2 + DensityUtil.dip2px(context, 1), getWidth() / 2 - radius * 3 / 4, getHeight() / 2, timeLinePaint);

if (txtFinishListener != null) { //监听
txtFinishListener.onFinish(text, timeText);
txtFinishListener.onFinish(Integer.parseInt(text.replace("℃", "")),
Integer.parseInt(timeText.replace("min", "")));
}
}

Expand Down Expand Up @@ -390,7 +391,7 @@ public Bitmap conversionBitmap(Bitmap bitmap, int newWidth, int newHeight) {

public interface txtFinishListener {

void onFinish(String temperature, String time);
void onFinish(int temperature, int time);

}

Expand Down

0 comments on commit 250a1b5

Please sign in to comment.