mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-02-01 10:42:01 -05:00
Fix no results sometimes not correctly displayed
This commit is contained in:
@@ -685,9 +685,13 @@ public class DBHelper extends SQLiteOpenHelper
|
||||
*/
|
||||
public int getLoyaltyCardCount(String filter)
|
||||
{
|
||||
if (filter.isEmpty()) {
|
||||
return getLoyaltyCardCount();
|
||||
}
|
||||
|
||||
SQLiteDatabase db = getReadableDatabase();
|
||||
return (int) DatabaseUtils.queryNumEntries(db, LoyaltyCardDbFTS.TABLE,
|
||||
LoyaltyCardDbIds.TABLE + " MATCH ? ", withArgs(filter + '*'));
|
||||
LoyaltyCardDbFTS.TABLE + " MATCH ? ", withArgs(filter + '*'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -398,16 +398,17 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
// We want the cardList to be visible regardless of the filtered match count
|
||||
// to ensure that the noMatchingCardsText doesn't end up being shown below
|
||||
// the keyboard
|
||||
mCardList.setVisibility(View.VISIBLE);
|
||||
mHelpText.setVisibility(View.GONE);
|
||||
mNoGroupCardsText.setVisibility(View.GONE);
|
||||
if(mAdapter.getItemCount() > 0)
|
||||
{
|
||||
mCardList.setVisibility(View.VISIBLE);
|
||||
mNoMatchingCardsText.setVisibility(View.GONE);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!mFilter.isEmpty()) {
|
||||
mCardList.setVisibility(View.GONE);
|
||||
if (!mFilter.isEmpty()) {
|
||||
// Actual Empty Search Result
|
||||
mNoMatchingCardsText.setVisibility(View.VISIBLE);
|
||||
mNoGroupCardsText.setVisibility(View.GONE);
|
||||
|
||||
Reference in New Issue
Block a user