Skip to content

Commit

Permalink
disable list refresh when in search bar, don't show zero odds events,…
Browse files Browse the repository at this point in the history
… other UI fixes, b 241
  • Loading branch information
MIPPL committed Oct 29, 2019
1 parent 9cec1a6 commit b4353d2
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 10 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 240
versionName "240"
versionCode 241
versionName "241"
multiDexEnabled true

// Similar to other properties in the defaultConfig block,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@ public void onClick(View v) {

}

public boolean isSearchActive() {
return searchBar.isShown();
}

@Override
protected void onDestroy() {
super.onDestroy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ public void onClick(View v) {

}

public boolean isSearchActive() {
return searchBar.isShown();
}

@Override
protected void onDestroy() {
super.onDestroy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ private void setListeners() {
searchEdit.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (!hasFocus) {
/*if (!hasFocus) {
if (breadActivity.barFlipper != null) {
breadActivity.barFlipper.setDisplayedChild(0);
clearSwitches();
}
}
}*/
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public void resetFilter() {
public void filter(final long[] switches, boolean bNotify, String query) {
long start = System.currentTimeMillis();
int switchesON = 0;
for (long i : switches) if (i>0) switchesON++;
for (long i : switches) if (i>=0) switchesON++;

final List<EventTxUiHolder> filteredList = new ArrayList<>();
String lowerQuery = query.toLowerCase().trim();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public synchronized void updateTxList(final Context app) {
long took = (System.currentTimeMillis() - start);
if (took > 500)
Log.e(TAG, "updateEventList: took: " + took);
if (adapter != null) {
if (adapter != null && !((EventsActivity)app).isSearchActive()) {
((Activity) app).runOnUiThread(new Runnable() {
@Override
public void run() {
Expand Down
10 changes: 7 additions & 3 deletions app/src/main/java/com/wagerrwallet/tools/manager/TxManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,13 @@ public void init(final WalletActivity app) {
txList, new RecyclerItemClickListener.OnItemClickListener() {
@Override
public void onItemClick(View view, int position, float x, float y) {
try {
TxUiHolder item = adapter.getItems().get(position);
BRAnimator.showTransactionDetails(app, item, position);
}
catch (ArrayIndexOutOfBoundsException e) {

TxUiHolder item = adapter.getItems().get(position);
BRAnimator.showTransactionDetails(app, item, position);
}
}

@Override
Expand Down Expand Up @@ -104,7 +108,7 @@ public synchronized void updateTxList(final Context app) {
long took = (System.currentTimeMillis() - start);
if (took > 500)
Log.e(TAG, "updateTxList: took: " + took);
if (adapter != null) {
if (adapter != null && !((WalletActivity)app).isSearchActive() ) {
((WalletActivity) app).runOnUiThread(new Runnable() {
@Override
public void run() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,9 @@ public List<EventTxUiHolder> getAllTransactions(Context app, String iso, long ev
cursor.moveToFirst();
while (!cursor.isAfterLast()) {
EventTxUiHolder transactionEntity = cursorToUIEvent(app, iso.toUpperCase(), cursor);
transactions.add(transactionEntity);
if (transactionEntity.getHomeOdds()>0 || transactionEntity.getDrawOdds()>0 || transactionEntity.getAwayOdds()>0) {
transactions.add(transactionEntity);
}
cursor.moveToNext();
}
} finally {
Expand Down

0 comments on commit b4353d2

Please sign in to comment.