Skip to content

Commit

Permalink
added warning when capping max bet, b252
Browse files Browse the repository at this point in the history
  • Loading branch information
MIPPL committed Dec 2, 2019
1 parent 1007f8b commit 29abb89
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
Binary file modified .idea/caches/gradle_models.ser
Binary file not shown.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId = 'com.wagerrwallet'
minSdkVersion 23
targetSdkVersion 28
versionCode 251
versionName "251"
versionCode 252
versionName "252"
multiDexEnabled true

// Similar to other properties in the defaultConfig block,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,22 @@ public void onFocusChange(View v, boolean hasFocus) {
int value = minvalue;
int balance = (int)(walletManager.getWallet().getBalance()/UNIT_MULTIPLIER);
int maxvalue = Math.min(getContext().getResources().getInteger(R.integer.max_bet_amount), balance );

if (!hasFocus) {
try {
value = Integer.parseInt(mTxAmount.getText().toString());
if ( value < minvalue ) value = minvalue;
if ( value > maxvalue ) value = maxvalue;
if ( value > maxvalue ) {
value = maxvalue;
// add message
BRDialog.showCustomDialog(getContext(), "Warning", String.format("Transaction reduced to maximum of %d WGR", maxvalue), getContext().getString(R.string.Button_ok), null, new BRDialogView.BROnClickListener() {
@Override
public void onClick(BRDialogView brDialogView) {
brDialogView.dismiss();
}
}, null, null, 0);

}
mTxAmount.setText(String.valueOf(value));
}
catch (NumberFormatException e) {
Expand Down

0 comments on commit 29abb89

Please sign in to comment.