diff --git a/app/src/main/java/com/wagerrwallet/presenter/fragments/FragmentEventDetails.java b/app/src/main/java/com/wagerrwallet/presenter/fragments/FragmentEventDetails.java index ceb924293..788211c42 100644 --- a/app/src/main/java/com/wagerrwallet/presenter/fragments/FragmentEventDetails.java +++ b/app/src/main/java/com/wagerrwallet/presenter/fragments/FragmentEventDetails.java @@ -187,6 +187,11 @@ public void onClick(View v) { final BaseWalletManager walletManager = WalletsMaster.getInstance(getActivity()).getCurrentWallet(getActivity()); seekBar = rootView.findViewById(R.id.bet_seekBar); + int min = getContext().getResources().getInteger(R.integer.min_bet_amount); + int max = Math.min( (int)(walletManager.getWallet().getBalance()/UNIT_MULTIPLIER), + getContext().getResources().getInteger(R.integer.max_bet_amount)); + seekBar.setMax(max-min); + updateSeekBar(getContext().getResources().getInteger(R.integer.min_bet_amount), 0); seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override @@ -252,6 +257,7 @@ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { mTxAmount.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { + if (mCurrentSelectedBetOption==null) return; String oddTx = ((BRText)mCurrentSelectedBetOption).getText().toString(); float odds = 0; int value = getContext().getResources().getInteger(R.integer.min_bet_amount); @@ -405,6 +411,7 @@ protected void setRewardAmount(long stake, float odds) { } protected void AcceptBet() { + mTxAmount.clearFocus(); int min = getContext().getResources().getInteger(R.integer.min_bet_amount); BetEntity.BetTxType betType = (mTransaction.getType()== BetEventEntity.BetTxType.PEERLESS)? BetEntity.BetTxType.PEERLESS:BetEntity.BetTxType.CHAIN_LOTTO; long amount = (seekBar.getProgress() + min) * UNIT_MULTIPLIER; @@ -431,6 +438,7 @@ public void onClick(BRDialogView brDialogView) { } protected void CancelBet() { + mTxAmount.clearFocus(); BRText txPrev = (mCurrentSelectedBetOption!=null)?(BRText) mCurrentSelectedBetOption:null; if (txPrev!=null) { txPrev.setTextSize(NORMAL_SIZE); diff --git a/app/src/main/java/com/wagerrwallet/tools/adapter/TransactionListAdapter.java b/app/src/main/java/com/wagerrwallet/tools/adapter/TransactionListAdapter.java index 52df182c3..660845d7b 100644 --- a/app/src/main/java/com/wagerrwallet/tools/adapter/TransactionListAdapter.java +++ b/app/src/main/java/com/wagerrwallet/tools/adapter/TransactionListAdapter.java @@ -387,8 +387,9 @@ private void filter(final String query, final boolean[] switches) { long start = System.currentTimeMillis(); String lowerQuery = query.toLowerCase().trim(); - if (Utils.isNullOrEmpty(lowerQuery) && !switches[0] && !switches[1] && !switches[2] && !switches[3]) - return; + // undesired behavior: no filter = rebuild whole list instead return + //if (Utils.isNullOrEmpty(lowerQuery) && !switches[0] && !switches[1] && !switches[2] && !switches[3]) + // return; int switchesON = 0; for (boolean i : switches) if (i) switchesON++; diff --git a/app/src/main/java/com/wagerrwallet/wallet/wallets/wagerr/WalletWagerrManager.java b/app/src/main/java/com/wagerrwallet/wallet/wallets/wagerr/WalletWagerrManager.java index 6d43c56ff..1d11c8e19 100644 --- a/app/src/main/java/com/wagerrwallet/wallet/wallets/wagerr/WalletWagerrManager.java +++ b/app/src/main/java/com/wagerrwallet/wallet/wallets/wagerr/WalletWagerrManager.java @@ -29,6 +29,7 @@ import com.wagerrwallet.presenter.entities.BRTransactionEntity; import com.wagerrwallet.presenter.entities.BetEntity; import com.wagerrwallet.presenter.entities.BetEventEntity; +import com.wagerrwallet.presenter.entities.BetMappingEntity; import com.wagerrwallet.presenter.entities.BetResultEntity; import com.wagerrwallet.presenter.entities.BlockEntity; import com.wagerrwallet.presenter.entities.CurrencyEntity; @@ -297,10 +298,18 @@ public List getTxUiHolders() { return uiTxs; } + protected void CleanChainBugs(Context app) { + // fake team mappings for ID 187. + BetMappingTxDataStore.getInstance(app).deleteTxByHash(app,"wgr", "cc89779e8e57d49e5e6d3e16ad57e648b19d86fb8f4714bc7df5abd3f92daa1d"); + BetMappingTxDataStore.getInstance(app).deleteTxByHash(app,"wgr", "d8e1e8389bbcffe1c79cf11e2206281377e54b99219ec6ccec296c2adb8ad65f"); + BetMappingTxDataStore.getInstance(app).deleteTxByHash(app,"wgr", "929972a7b2fdf55f6da7488ccaf7312fd5d22c4bca003ca089293c93f1c32917"); + } + @Override public List getEventTxUiHolders(Context app) { Date date = new Date(); long timeStamp = (date.getTime()/1000) + BET_CUTTOFF_SECONDS; + CleanChainBugs(app); //BetEventTxDataStore.getInstance(app).deleteTxByEventTimestamp (app,ISO, timeStamp ); //BetResultTxDataStore.getInstance(app).deleteResultsOldEvents(app, ISO, timeStamp); //List bettxs = BetTxDataStore.getInstance(app).getAllTransactions(app,ISO);