Conversation
TheLastProject
left a comment
There was a problem hiding this comment.
Haven't tested it yet, but noticing multiple issues already.
| public static final String LAST_USED = "lastused"; | ||
| public static final String ZOOM_LEVEL = "zoomlevel"; | ||
| public static final String ARCHIVE_STATUS = "archive"; | ||
| public static final String USAGE_NUMBER = "usagenumber"; |
There was a problem hiding this comment.
I think I'd much prefer this to be named USAGE_COUNT and usagecount. To me that is more logical.
|
|
||
| UsageNumber |
There was a problem hiding this comment.
| UsageNumber | |
| UsageCount |
| LoyaltyCardDbIds.HEADER_COLOR + " INTEGER," + | ||
| LoyaltyCardDbIds.CARD_ID + " TEXT not null," + | ||
| LoyaltyCardDbIds.BARCODE_ID + " TEXT," + | ||
| LoyaltyCardDbIds.USAGE_NUMBER + " INTEGER DEFAULT '0', " + |
There was a problem hiding this comment.
This is wrong, this will only be executed when users are on database version 9. So existing installations won't get the usage column. This should be removed (there should be an extra upgrade at the end and the DATABASE_VERSION variable needs to be increased).
| LoyaltyCardDbIds.HEADER_COLOR + " ," + | ||
| LoyaltyCardDbIds.CARD_ID + " ," + | ||
| LoyaltyCardDbIds.BARCODE_ID + " ," + | ||
| LoyaltyCardDbIds.USAGE_NUMBER + " , " + |
| LoyaltyCardDbIds.HEADER_COLOR + " ," + | ||
| LoyaltyCardDbIds.CARD_ID + " ," + | ||
| LoyaltyCardDbIds.BARCODE_ID + " ," + | ||
| LoyaltyCardDbIds.USAGE_NUMBER + " , " + |
| DBHelper.updateLoyaltyCardUsageNumber(database, loyaltyCardId); | ||
|
|
There was a problem hiding this comment.
Would be nice to put this either near the top or all the way at the bottom for clarity.
There was a problem hiding this comment.
Hi, i don't know where to put this function, i think it going to be null :/
| //this.database | ||
|
|
There was a problem hiding this comment.
Unnecessary debug comment.
| //this.database |
|
|
||
| @Override | ||
| protected void onCreate(Bundle savedInstanceState) { | ||
|
|
There was a problem hiding this comment.
Unnecessary whitespace change.
| iconImage.setClipBounds(new Rect(left, top, right, bottom)); | ||
| } | ||
| }); | ||
|
|
There was a problem hiding this comment.
Unnecessary whitespace change.
| protected String mFilter = ""; | ||
| protected Object mGroup = null; | ||
| protected DBHelper.LoyaltyCardOrder mOrder = DBHelper.LoyaltyCardOrder.Alpha; | ||
| protected DBHelper.LoyaltyCardOrder mOrder = DBHelper.LoyaltyCardOrder.UsageNumber; |
There was a problem hiding this comment.
Please don't change the default sorting style.
Modification of the database to add a column which corresponds to the number of uses.
Added a method to update the value on each use.
To enable sorting by this value :)