mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-22 04:29:22 +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);
|
prescriptionList.remove(position);
|
||||||
mAdapter.notifyItemRemoved(position);
|
mAdapter.notifyItemRemoved(position);
|
||||||
// Remove item form database
|
// Remove item form database
|
||||||
PrescriptionsDAO prescriptionsDAO = prescriptions.getPrescriptionsDAO();;
|
PrescriptionsDAO prescriptionsDAO = prescriptions.getPrescriptionsDAO();
|
||||||
prescriptionsDAO.delete(prescription);
|
prescriptionsDAO.delete(prescription);
|
||||||
} else {
|
} else {
|
||||||
// Call DetailView
|
// Call DetailView
|
||||||
|
@ -539,11 +539,9 @@ public class DrugListActivity extends AppCompatActivity {
|
||||||
int xMarkRight = itemView.getLeft() + xMarkMargin + intrinsicWidth;
|
int xMarkRight = itemView.getLeft() + xMarkMargin + intrinsicWidth;
|
||||||
int xMarkTop = itemView.getTop() + (itemHeight - intrinsicHeight) / 2;
|
int xMarkTop = itemView.getTop() + (itemHeight - intrinsicHeight) / 2;
|
||||||
int xMarkBottom = xMarkTop + intrinsicHeight;// +xMarkTop;
|
int xMarkBottom = xMarkTop + intrinsicHeight;// +xMarkTop;
|
||||||
|
assert icon != null;
|
||||||
icon.setBounds(xMarkLeft, xMarkTop, xMarkRight, xMarkBottom);
|
icon.setBounds(xMarkLeft, xMarkTop, xMarkRight, xMarkBottom);
|
||||||
|
|
||||||
icon.draw(c);
|
|
||||||
|
|
||||||
// TODO : goto edit details
|
|
||||||
} else {
|
} else {
|
||||||
p.setColor(getColor(R.color.bg_screen4));
|
p.setColor(getColor(R.color.bg_screen4));
|
||||||
// Draw Rect with varying left side, equal to the item's right side plus negative displacement dX
|
// 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;
|
int xMarkBottom = xMarkTop + intrinsicHeight;
|
||||||
icon.setBounds(xMarkLeft, xMarkTop, xMarkRight, xMarkBottom);
|
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);
|
super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue