remove cip13 in DrugListActivityist

This commit is contained in:
jacques 2021-09-17 14:42:16 +02:00
parent ad5c798857
commit 60792d1b4b
2 changed files with 9 additions and 7 deletions

View file

@ -66,7 +66,7 @@ public class DrugDetailActivity extends AppCompatActivity {
// Show the Up button in the action bar.
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(false);
actionBar.setTitle(drug.getName());
}

View file

@ -426,10 +426,10 @@ public class DrugListActivity extends AppCompatActivity {
/**
* SimpleItemRecyclerViewAdapter
*/
public class SimpleItemRecyclerViewAdapter
extends RecyclerView.Adapter<SimpleItemRecyclerViewAdapter.ViewHolder> {
public class SimpleItemRecyclerViewAdapter extends RecyclerView.Adapter<SimpleItemRecyclerViewAdapter.ViewHolder> {
private final List<Drug> mValues;
private int position;
SimpleItemRecyclerViewAdapter(List<Drug> items) {
mValues = items;
@ -454,7 +454,8 @@ public class DrugListActivity extends AppCompatActivity {
}
@Override
public void onBindViewHolder(final ViewHolder holder, final int position) {
public void onBindViewHolder(final ViewHolder holder, int dummy) {
final int position = holder.getBindingAdapterPosition();
SimpleDateFormat dateFormat = new SimpleDateFormat("EEEE d MMMM yyyy", Locale.getDefault());
String dateEndOfStock = date2String(mValues.get(position).getDateEndOfStock(), dateFormat);
@ -466,10 +467,11 @@ public class DrugListActivity extends AppCompatActivity {
Log.d(TAG, "alert == " + mValues.get(position).getAlertThreshold());
holder.mItem = mValues.get(position);
holder.mIDView.setText(mValues.get(position).getCip13());
// holder.mIDView.setText(mValues.get(position).getCip13());
holder.mContentView.setText(mValues.get(position).getName());
holder.mEndOfStock.setText(dateEndOfStock);
// Test to change background programmatically
if (mValues.get(position).getTake() == 0) {
holder.mView.setBackgroundResource(R.drawable.gradient_bg);
@ -510,7 +512,7 @@ public class DrugListActivity extends AppCompatActivity {
class ViewHolder extends RecyclerView.ViewHolder {
final View mView;
final TextView mIDView;
// final TextView mIDView;
final TextView mContentView;
final TextView mEndOfStock;
final ImageView mIconView;
@ -520,7 +522,7 @@ public class DrugListActivity extends AppCompatActivity {
ViewHolder(View view) {
super(view);
mView = view;
mIDView = view.findViewById(R.id.cip13);
// mIDView = view.findViewById(R.id.cip13);
mContentView = view.findViewById(R.id.value);
mEndOfStock = view.findViewById(R.id.endOfStock);
mIconView = view.findViewById(R.id.list_image);