mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-22 04:29:22 +01:00
Change SimpleItemRecyclerView into RecyclerView
This commit is contained in:
parent
54a79b2514
commit
d78c4f13ef
1 changed files with 6 additions and 5 deletions
|
@ -22,6 +22,7 @@ import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.ListView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
@ -73,7 +74,7 @@ public class DrugListActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private List<Prescription> prescriptionList; // used for prescriptions
|
private List<Prescription> prescriptionList; // used for prescriptions
|
||||||
|
|
||||||
private SimpleItemRecyclerViewAdapter mAdapter;
|
private RecyclerViewAdapter mAdapter;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
|
@ -463,19 +464,19 @@ public class DrugListActivity extends AppCompatActivity {
|
||||||
*/
|
*/
|
||||||
private void setupRecyclerView(@NonNull RecyclerView recyclerView) {
|
private void setupRecyclerView(@NonNull RecyclerView recyclerView) {
|
||||||
recyclerView.addItemDecoration(new SimpleDividerItemDecoration(getApplicationContext()));
|
recyclerView.addItemDecoration(new SimpleDividerItemDecoration(getApplicationContext()));
|
||||||
mAdapter = new SimpleItemRecyclerViewAdapter(prescriptionList);
|
mAdapter = new RecyclerViewAdapter(prescriptionList);
|
||||||
recyclerView.setAdapter(mAdapter);
|
recyclerView.setAdapter(mAdapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SimpleItemRecyclerViewAdapter
|
* SimpleItemRecyclerViewAdapter
|
||||||
*/
|
*/
|
||||||
public class SimpleItemRecyclerViewAdapter extends
|
public class RecyclerViewAdapter extends
|
||||||
RecyclerView.Adapter<SimpleItemRecyclerViewAdapter.ViewHolder> {
|
RecyclerView.Adapter<RecyclerViewAdapter.ViewHolder> {
|
||||||
|
|
||||||
private final List<Prescription> mValues;
|
private final List<Prescription> mValues;
|
||||||
|
|
||||||
SimpleItemRecyclerViewAdapter(List<Prescription> items) {
|
RecyclerViewAdapter(List<Prescription> items) {
|
||||||
mValues = items;
|
mValues = items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue