36 public View
onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
37 if (getArguments() !=
null) {
38 fecha = getArguments().getString(
"fecha",
"-");
39 nroPedido = getArguments().getString(
"nroPedido",
"-");
40 metodoPago = getArguments().getString(
"metodoPago",
"-");
41 total = getArguments().getString(
"total",
"-");
42 productos = getArguments().getString(
"productos",
"-");
44 LinearLayout layout =
new LinearLayout(requireContext());
45 layout.setOrientation(LinearLayout.VERTICAL);
46 layout.setPadding(64, 64, 64, 64);
47 layout.setBackgroundColor(android.graphics.Color.WHITE);
48 layout.setMinimumWidth(900);
49 layout.setMinimumHeight(900);
51 TextView title =
new TextView(requireContext());
52 title.setText(
"Detalles del Ticket");
53 title.setTextSize(24);
54 title.setTypeface(
null, android.graphics.Typeface.BOLD);
55 title.setTextColor(android.graphics.Color.BLACK);
56 layout.addView(title);
58 TextView tvFecha =
new TextView(requireContext());
59 tvFecha.setText(
"Fecha: " + fecha);
60 layout.addView(tvFecha);
62 TextView tvNro =
new TextView(requireContext());
63 tvNro.setText(
"N° Pedido: " + nroPedido);
64 layout.addView(tvNro);
66 TextView tvPago =
new TextView(requireContext());
67 tvPago.setText(
"Método de pago: " + metodoPago);
68 layout.addView(tvPago);
70 TextView tvTotal =
new TextView(requireContext());
71 tvTotal.setText(
"Total: $ " + total);
72 layout.addView(tvTotal);
75 TextView tvProductos =
new TextView(requireContext());
76 tvProductos.setText(
"Productos:\n" + productos);
77 layout.addView(tvProductos);
79 TextView tvGracias =
new TextView(requireContext());
80 tvGracias.setText(
"¡Gracias por tu compra!");
81 tvGracias.setTextColor(android.graphics.Color.parseColor(
"#388E3C"));
82 tvGracias.setTextSize(18);
83 tvGracias.setPadding(0, 24, 0, 0);
84 layout.addView(tvGracias);