Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. public class PatientDialogFragment extends DialogFragment {
  2.  
  3.  
  4. @Nullable
  5. @Override
  6. public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
  7. View root = inflater.inflate(R.layout.dialog_fragment, container, false);
  8.  
  9. final RecyclerView recyclerView = (RecyclerView) root.findViewById(R.id.recyclerViewPatientsDialog);
  10. recyclerView.setLayoutManager(new LinearLayoutManager(this.getActivity()));
  11. recyclerView.setHasFixedSize(true);
  12. final PatientsAdapter adapter = new PatientsAdapter();
  13. recyclerView.setAdapter(adapter);
  14.  
  15. AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
  16. builder.setView(inflater.inflate(R.layout.dialog_fragment, null));
  17. builder.setTitle("Choose patient");
  18. builder.setPositiveButton("ok", new DialogInterface.OnClickListener() {
  19. @Override
  20. public void onClick(DialogInterface dialog, int which) {
  21. }
  22. });
  23. builder.create();
  24.  
  25. return root;
  26. }
  27.  
  28. @Override
  29. public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
  30.  
  31.  
  32. super.onViewCreated(view, savedInstanceState);
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement