mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-17 18:41:37 +01:00
Modification calcul de la couleur du fond de la cellule
This commit is contained in:
parent
a06cf1a474
commit
801d9e1049
2 changed files with 5 additions and 5 deletions
|
@ -3,9 +3,8 @@
|
|||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="distributionType" value="LOCAL" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-2.10" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
|
|
|
@ -183,11 +183,12 @@ public class MedicamentListActivity extends AppCompatActivity {
|
|||
if (mValues.get(position).getPrise() == 0) {
|
||||
holder.mView.setBackgroundResource(R.drawable.gradient_bg);
|
||||
} else {
|
||||
if (mValues.get(position).getStock() <= mValues.get(position).getAlertThreshold()) {
|
||||
int remainingStock = (int) Math.floor(mValues.get(position).getStock()/mValues.get(position).getPrise());
|
||||
if (remainingStock <= mValues.get(position).getAlertThreshold()) {
|
||||
holder.mView.setBackgroundResource(R.drawable.gradient_bg_alert);
|
||||
holder.mIconView.setImageResource(R.drawable.stock_alert);
|
||||
} else if ((mValues.get(position).getStock() > mValues.get(position).getAlertThreshold()) &&
|
||||
(mValues.get(position).getStock() <= (mValues.get(position).getWarnThreshold() * mValues.get(position).getPrise()))) {
|
||||
} else if ((remainingStock > mValues.get(position).getAlertThreshold()) &&
|
||||
(remainingStock <= (mValues.get(position).getWarnThreshold()))) {
|
||||
holder.mView.setBackgroundResource(R.drawable.gradient_bg_warning);
|
||||
holder.mIconView.setImageResource(R.drawable.stock_warn);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue