Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ToggleButtonLib/src/com/zcw/togglebutton/ToggleButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ protected void onLayout(boolean changed, int left, int top, int right,
spotMaxX = endX - borderWidth;
spotSize = height - 4 * borderWidth;
spotX = toggleOn ? spotMaxX : spotMinX;
offLineWidth = 0;
// fix:这里应该初始化为spotSize而不是0。否则会导致初始显示默认为off时,填充颜色为offBorderColor,
// 第一次点击时中间区域突变为白色(offColor),然后才随着spot右移范围变小
offLineWidth = spotSize;
}


Expand Down