Skip to content

Commit

Permalink
Merge pull request #9 from imaNNeoFighT/dev-remove-all-numbers-on-lon…
Browse files Browse the repository at this point in the history
…g-click

remove all chars when long clicked on remove button (fixed issue #8)
  • Loading branch information
hanks-zyh committed Oct 25, 2018
2 parents 373b601 + 9d5ff6b commit 06825a9
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ public void onClick(View v) {
deleteChar();
}
});
numberB.setOnLongClickListener(new OnLongClickListener() {
@Override public boolean onLongClick(View view) {
deleteAllChars();
return true;
}
});
numberOK.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Expand Down Expand Up @@ -402,6 +408,14 @@ private void deleteChar() {
layout_psd.removeViewAt(childCount - 1);
}

private void deleteAllChars() {
int childCount = layout_psd.getChildCount();
if (childCount <= 0) {
return;
}
layout_psd.removeAllViews();
}

public void runTipTextAnimation() {
shakeAnimator(tv_input_tip).start();
}
Expand Down

0 comments on commit 06825a9

Please sign in to comment.