Back to project page FastBudget3.
The source code is released under:
GNU General Public License
If you think the Android project FastBudget3 listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package de.splitstudio.fastbudget3.db; /* www . ja v a 2 s . c om*/ import static de.splitstudio.utils.DateUtils.formatAsShortDate; import static de.splitstudio.utils.NumberUtils.formatAsCurrency; import java.util.List; import android.app.Activity; import android.view.LayoutInflater; import android.view.View; import android.widget.TextView; import de.splitstudio.fastbudget3.R; import de.splitstudio.utils.db.ObjectListAdapter; public class ExpenseListAdapter extends ObjectListAdapter<Expense> { private final Activity activity; public ExpenseListAdapter(Activity activity, List<Expense> objects) { super(LayoutInflater.from(activity), R.layout.expense_row, objects); this.activity = activity; } @Override public void bindView(View view, Expense expense) { activity.registerForContextMenu(view.findViewById(R.id.button_move)); view.findViewById(R.id.button_edit).setTag(expense.uuid); view.findViewById(R.id.button_move).setTag(expense.uuid); view.findViewById(R.id.button_delete).setTag(expense.uuid); ((TextView) view.findViewById(R.id.description)).setText(expense.description); ((TextView) view.findViewById(R.id.amount)).setText(formatAsCurrency(expense.amount)); ((TextView) view.findViewById(R.id.date_field)).setText(formatAsShortDate(expense.date)); } @Override public void update(List<Expense> expenses) { objects.clear(); objects.addAll(expenses); notifyDataSetChanged(); } }