Skip to content

Commit

Permalink
Several UI fixes b 238
Browse files Browse the repository at this point in the history
  • Loading branch information
MIPPL committed Oct 24, 2019
1 parent 31185b7 commit 05afdf8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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++;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -297,10 +298,18 @@ public List<TxUiHolder> 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<EventTxUiHolder> 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<BetEntity> bettxs = BetTxDataStore.getInstance(app).getAllTransactions(app,ISO);
Expand Down

0 comments on commit 05afdf8

Please sign in to comment.