mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-21 20:19:23 +01:00
Optimizations
This commit is contained in:
parent
024b97751b
commit
e42626fbfa
1 changed files with 4 additions and 7 deletions
|
@ -489,7 +489,7 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
prescriptionList.remove(position);
|
||||
mAdapter.notifyItemRemoved(position);
|
||||
// Remove item form database
|
||||
PrescriptionsDAO prescriptionsDAO = prescriptions.getPrescriptionsDAO();;
|
||||
PrescriptionsDAO prescriptionsDAO = prescriptions.getPrescriptionsDAO();
|
||||
prescriptionsDAO.delete(prescription);
|
||||
} else {
|
||||
// Call DetailView
|
||||
|
@ -539,11 +539,9 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
int xMarkRight = itemView.getLeft() + xMarkMargin + intrinsicWidth;
|
||||
int xMarkTop = itemView.getTop() + (itemHeight - intrinsicHeight) / 2;
|
||||
int xMarkBottom = xMarkTop + intrinsicHeight;// +xMarkTop;
|
||||
assert icon != null;
|
||||
icon.setBounds(xMarkLeft, xMarkTop, xMarkRight, xMarkBottom);
|
||||
|
||||
icon.draw(c);
|
||||
|
||||
// TODO : goto edit details
|
||||
} else {
|
||||
p.setColor(getColor(R.color.bg_screen4));
|
||||
// Draw Rect with varying left side, equal to the item's right side plus negative displacement dX
|
||||
|
@ -557,9 +555,8 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
int xMarkBottom = xMarkTop + intrinsicHeight;
|
||||
icon.setBounds(xMarkLeft, xMarkTop, xMarkRight, xMarkBottom);
|
||||
|
||||
icon.draw(c);
|
||||
// TODO : remove prescription from database
|
||||
}
|
||||
}
|
||||
icon.draw(c);
|
||||
|
||||
super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue