Skip to content

Commit

Permalink
Merge pull request #13023 from brave/android_swap_update
Browse files Browse the repository at this point in the history
Fixes an endless Market price field update on Android Swap
  • Loading branch information
SergeyZhukovsky authored Apr 14, 2022
2 parents 2aa072e + e2736b7 commit 0623ecb
Showing 1 changed file with 10 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1123,27 +1123,20 @@ public void onBackPressed() {
}

private TextWatcher getTextWatcherFromToValueText(boolean from) {
return new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (mFromValueText.hasFocus()) {
getSendSwapQuota(from, false);
}
}
return new FilterTextFromToValueText(from);
}

@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
private class FilterTextFromToValueText implements TextWatcher {
boolean mFrom;

@Override
public void afterTextChanged(Editable s) {}
};
}
public FilterTextFromToValueText(boolean from) {
mFrom = from;
}

private TextWatcher filterTextWatcherFrom = new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (mFromValueText.hasFocus()) {
getSendSwapQuota(true, false);
if (mFrom ? mFromValueText.hasFocus() : mToValueText.hasFocus()) {
getSendSwapQuota(mFrom, false);
}
}

Expand All @@ -1152,7 +1145,7 @@ public void beforeTextChanged(CharSequence s, int start, int count, int after) {

@Override
public void afterTextChanged(Editable s) {}
};
}

private class FilterTextWatcherSendToAddr implements TextWatcher {
Validations.SendToAccountAddress mValidator;
Expand Down

0 comments on commit 0623ecb

Please sign in to comment.