Transaction Sets List Activity Workflow - nagasudhirpulla/Debtonator GitHub Wiki

Summary

  • This activity displays the list of transaction sets

Workflow

Setting up loader and transaction set names array

  • First check if the current transaction set id is null. If not null, open the Home activity.
  • Fetch the transaction sets list cursor and attach it to the list view. The query fetches the transaction sets details, total transaction set contribution, transaction set date range. We are using setViewBinder to the cursor adapter to format the date and transaction set worth text views
  • Update get the transaction sets names ArrayList from cursor queried from content provider in an async task

Transaction Set List Item Rename Button Listener

  • Show alertDialog to ask the rename string and trim it. Use this string to rename the transaction set in the database. Reject rename if empty string is entered. Reload the transaction set list cursor and refetch the transaction names ArrayList.

Transaction Set List Item Load Button Listener

  • Find the list Item row id. Set the shared Preference of current loaded transaction set to the list item rowId. Load the Home Activity.

Transaction Set List Item TextView Click Listener

  • Same as Transaction Set List Item Load Button Listener

Transaction Set List Item Delete Button Listener

  • Find the list Item row id. Delete the transaction set from database. Reload the transaction set list cursor and refetch the transaction names ArrayList.

Create Transaction Set button Listener

  • Show alertDialog to ask the new Transaction Set name string and trim it. If empty, use the default String. Create non conflicting new name using the transaction sets names list. Use this name to rename the transaction set in the database. Reload the transaction set list cursor and refetch the transaction names ArrayList.

Todos

  • Fetch total transaction set contribution, transaction set date range in the cursor -- done
  • Duplicate Transaction set button