Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mvarnagiris committed Dec 20, 2014
1 parent bd4d57c commit aa14329
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
###Version: 0.15.6
- ```fix``` Transaction edit working again.
- ```fix``` Alphabetical tag ordering works better with upper and lowercase letters.
- ```fix``` Note auto-complete will not show suggestions from deleted transactions and from transactions of different type.

###Version: 0.15.5
- ```new``` Note field in new transaction screen now has auto complete.
- ```new``` Note field works as template.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static void startMultiSelect(Activity activity, int requestCode, List<Tag
}

@Override protected CursorLoader getModelsCursorLoader() {
return Tables.Tags.getQuery().sortOrder(Tables.Tags.TITLE.getName()).asCursorLoader(this, TagsProvider.uriTags());
return Tables.Tags.getQuery().sortOrder("lower(" + Tables.Tags.TITLE + ")").asCursorLoader(this, TagsProvider.uriTags());
}

@Override protected Model modelFrom(Cursor cursor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import android.widget.ImageView;

import com.code44.finance.R;
import com.code44.finance.common.model.ModelState;
import com.code44.finance.common.model.TransactionType;
import com.code44.finance.common.utils.Strings;
import com.code44.finance.data.Query;
import com.code44.finance.data.db.Tables;
Expand All @@ -31,6 +33,7 @@ public class NoteViewController extends ViewController implements LoaderManager.
private final ImageView noteImageView;
private final AutoCompleteTextView noteAutoCompleteTextView;
private final Callbacks callbacks;
private TransactionType transactionType = TransactionType.Expense;

public NoteViewController(BaseActivity activity, View.OnClickListener clickListener, Callbacks callbacks) {
this.callbacks = callbacks;
Expand All @@ -57,6 +60,8 @@ public NoteViewController(BaseActivity activity, View.OnClickListener clickListe
.projectionLocalId(Tables.Transactions.LOCAL_ID)
.projection(Tables.Transactions.NOTE.getName())
.selection(Tables.Transactions.DATE + ">?", String.valueOf(fromDate))
.selection(" and " + Tables.Transactions.TYPE + "=?", transactionType.asString())
.selection(" and " + Tables.Transactions.MODEL_STATE + "=?", ModelState.Normal.asString())
.groupBy(Tables.Transactions.NOTE.getName());

if (!Strings.isEmpty(filter)) {
Expand Down Expand Up @@ -84,11 +89,11 @@ public NoteViewController(BaseActivity activity, View.OnClickListener clickListe
}

@Override public void onTextChanged(CharSequence s, int start, int before, int count) {
((BaseActivity) this.noteAutoCompleteTextView.getContext()).getSupportLoaderManager().restartLoader(LOADER_NOTES, null, this);
callbacks.onNoteUpdated(getNote());
}

@Override public void afterTextChanged(Editable s) {
((BaseActivity) this.noteAutoCompleteTextView.getContext()).getSupportLoaderManager().restartLoader(LOADER_NOTES, null, this);
callbacks.onNoteUpdated(getNote());
}

@Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Expand Down Expand Up @@ -121,6 +126,11 @@ public void setIsSetByUser(boolean isSetByUser) {
noteImageView.setImageAlpha(isSetByUser ? 255 : 64);
}

public void setTransactionType(TransactionType transactionType) {
this.transactionType = transactionType;
((BaseActivity) this.noteAutoCompleteTextView.getContext()).getSupportLoaderManager().restartLoader(LOADER_NOTES, null, this);
}

public boolean hasFocus() {
return noteAutoCompleteTextView.hasFocus();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ private void updateTransactionType(TransactionType transactionType) {
amountViewController.setTransactionType(transactionType);
accountsViewController.setTransactionType(transactionType);
categoryViewController.setTransactionType(transactionType);
noteViewController.setTransactionType(transactionType);
}

private void updateAmount(long amount) {
Expand Down

0 comments on commit aa14329

Please sign in to comment.