Recyclerview Line Limit

Asked

Viewed 151 times

0

I got a problem, I got a RecyclerView, and you’re bringing the information perfectly. It is basic only lists below each other, only it is not bringing all the records, do the query by another environment and returns all the data.

I realized there’s always some record missing at the end, like there’s a limit.

Xml code of RecyclerView.

android:id="@+id/idRecycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"

Above the RecyclerView have EditText and Button.

My onCreateViewHolder

View vista = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.lista_horarios, viewGroup, false);
        RecyclerView.LayoutParams layoutParams =
                new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);

        vista.setLayoutParams(layoutParams);
        return new HorariosHolder(vista);

My onBindViewHolder

horariosHolder.txtHorario.setText(listaHorarios.get(i).getHorario().toString());
        horariosHolder.txtLinha.setText(listaHorarios.get(i).getLinha().toString());
        horariosHolder.txtTarifa.setText(listaHorarios.get(i).getTarifa().toString());

My Horariosholder

TextView txtHorario, txtLinha, txtTarifa;//, txtSaida, txtChegada;

        public HorariosHolder(@NonNull View itemView) {
            super(itemView);

            txtHorario = (TextView) itemView.findViewById(R.id.txtHorario);
            txtLinha = (TextView) itemView.findViewById(R.id.txtLinha);
            txtTarifa = (TextView) itemView.findViewById(R.id.txtTarifa);
        }

Fragment onCreateView

View vista = inflater.inflate(R.layout.fragment_consultar_horarios, container, false);
recyclerHorarios = (RecyclerView) vista.findViewById(R.id.idRecycler);
        recyclerHorarios.setLayoutManager(new LinearLayoutManager(this.getContext()));
        recyclerHorarios.setHasFixedSize(true);
  • Good morning! Post the rest of the code (Adapter, where you add the items to the Adapter and create recyclerview, the layout code)

  • I’m sorry if I wasn’t clear enough. Edit your question and include the code there. Click here for that reason

  • Hello, I got it sorted, I put this line on RecycleView. app:layout_constraintBottom_toBottomOf="parent"

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.