Skip to content

Commit

Permalink
Eliminado el parametro combustibles del metodo rellenaListaCombustibl…
Browse files Browse the repository at this point in the history
…e de al clase Utils
  • Loading branch information
HERRERA99 committed Nov 19, 2024
1 parent 0d0abbe commit af743d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,7 @@ protected void onCreate(Bundle savedInstanceState) {
tvDireccion.setText(gasolinera.getDireccion());
tvHorario.setText(gasolinera.getHorario());

//Set Lista Combustibles
List<GasolineraCombustible> combustibles = new ArrayList<>();

CombustibleArrayAdapter adapter = new CombustibleArrayAdapter(this, rellenaListaCombustibles(combustibles, gasolinera));
CombustibleArrayAdapter adapter = new CombustibleArrayAdapter(this, rellenaListaCombustibles(gasolinera));
list.setAdapter(adapter);
setListViewHeightBasedOnItemCount(list);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.lang.reflect.Type;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.ArrayList;
import java.util.List;

import es.unican.gasolineras.model.Gasolinera;
Expand Down Expand Up @@ -64,11 +65,12 @@ public static List<Gasolinera> parseGasolineras(Context context, int jsonId) {

/**
* Rellena una lista de los combustibles disponibles y su precio de la gasolinera
* @param combustibles lista a rellenar
* @param gasolinera gasolionera de obtener los combustibles
* @return
*/
public static List<GasolineraCombustible> rellenaListaCombustibles(List<GasolineraCombustible> combustibles, Gasolinera gasolinera) {
public static List<GasolineraCombustible> rellenaListaCombustibles(Gasolinera gasolinera) {
List<GasolineraCombustible> combustibles = new ArrayList<>();

if (gasolinera.getBiodiesel() != 0) {
combustibles.add(new GasolineraCombustible(BIODIESEL, gasolinera.getBiodiesel()));
}
Expand Down

0 comments on commit af743d3

Please sign in to comment.