RecyclerView não se desloca paira o background

Eu segui as diretrizes do recyclerview e criei um paira o aplicativo que estou fazendo, mas não se desloca paira o background por algum motivo. Eu o compairei com os fragments de código do google, bem como outros snippets de código on-line e não consigo view a diferença. Posicionei uma foto e o código que estou usando. Estou usando abas, portanto, o relatório de recyclerview é preenchido em um fragment.

Como o aplicativo pairece:

  • Existe um método que funciona como começair o fragment de resultado?
  • Problema de memory de bitmap do Android - Erro: falta de memory em uma alocação de bytes 8294416
  • Gerenciando a atividade do DialogFragment
  • Qual é a alternativa paira getActionView () antes do nível de API11 no Android?
  • Appcompat v7 não é puxado paira o projeto
  • Atualize a position inicial do MediaPlayer quando for pausada
  • http://imgur.com/H5uOLFR

    a class do adaptador

    public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> { private List<Group> groups; // Provide a reference to the views for each data item // Complex data items may need more than one view per item, and // you provide access to all the views for a data item in a view holder public class ViewHolder extends RecyclerView.ViewHolder { // each data item is just a string in this case public TextView groupName; public TextView groupDate; public TextView groupLocation; public TextView className; public ViewHolder(View v) { super(v); groupName = (TextView) v.findViewById(R.id.groupName); groupDate = (TextView) v.findViewById(R.id.groupDate); groupLocation = (TextView) v.findViewById(R.id.groupLocation); className = (TextView) v.findViewById(R.id.className); } } /* * TODO: finish this method */ public void add(int position, String item) { notifyItemInserted(position); } public void remove(String item) { int position = groups.indexOf(item); groups.remove(position); notifyItemRemoved(position); } // Provide a suitable constructor (depends on the kind of dataset) public MyAdapter(List<Group> groupsList) { groups = groupsList; Log.d("TEST", "Number of Groups: " + Integer.toString(groups.size())); } // Create new views (invoked by the layout manager) @Oviewride public MyAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { // create a new view View v = LayoutInflater.from(pairent.getContext()).inflate(R.layout.group_view, pairent, false); // set the view's size, mairgins, paddings and layout pairameters ViewHolder vh = new ViewHolder(v); return vh; } // Replace the contents of a view (invoked by the layout manager) @Oviewride public void onBindViewHolder(ViewHolder holder, int position) { // - get element from your dataset at this position // - replace the contents of the view with that element final Group group = groups.get(position); // holder.groupName.setText(group.getName()); holder.groupName.setText(group.getName()); holder.groupDate.setText(group.getFormattedDate()); holder.groupLocation.setText(group.getLocation()); holder.className.setText(group.getPairent().getName()); } // Return the size of your dataset (invoked by the layout manager) @Oviewride public int getItemCount() { return groups.size(); } } 

    A class Fragment:

     public class groupsFragment extends Fragment implements GroupLeaview, GroupRetrieview { private RecyclerView rv; private List<Group> groups; private ProgressDialog progressDialog; @Oviewride public void onCreate(Bundle savedInstance){ super.onCreate(savedInstance); Log.d("TEST", "Entered onCreate"); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { AppMain.getController().retrieveGroups(groupsFragment.this); Log.d("TEST", "Entered onCreateView"); View rootView = inflater.inflate(R.layout.groups_fragment, container, false); rv = (RecyclerView) rootView.findViewById(R.id.recyclerView); rv.setLayoutManager(new LineairLayoutManager(getActivity())); Log.d("TEST", "Size of LIST: " + Integer.toString(groups.size())); MyAdapter adapter = new MyAdapter(groups); rv.setAdapter(adapter); return rootView; } @Oviewride public void onMyGroupsFound(List<Group> groups) { Log.d("TEST", "Entered onMyGroupsFound"); Logg.info(this.getClass(), "Found %d groups for member %s", groups.size(), User.getCurrentUser().getDisplayName()); this.groups = groups; } @Oviewride public void onGroupLeft(Group oldGroup) { } @Oviewride public void onGroupLeftFailed(Group group, PairseException e) { } } } public class groupsFragment extends Fragment implements GroupLeaview, GroupRetrieview { private RecyclerView rv; private List<Group> groups; private ProgressDialog progressDialog; @Oviewride public void onCreate(Bundle savedInstance){ super.onCreate(savedInstance); Log.d("TEST", "Entered onCreate"); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { AppMain.getController().retrieveGroups(groupsFragment.this); Log.d("TEST", "Entered onCreateView"); View rootView = inflater.inflate(R.layout.groups_fragment, container, false); rv = (RecyclerView) rootView.findViewById(R.id.recyclerView); rv.setLayoutManager(new LineairLayoutManager(getActivity())); Log.d("TEST", "Size of LIST: " + Integer.toString(groups.size())); MyAdapter adapter = new MyAdapter(groups); rv.setAdapter(adapter); return rootView; } @Oviewride public void onMyGroupsFound(List<Group> groups) { Log.d("TEST", "Entered onMyGroupsFound"); Logg.info(this.getClass(), "Found %d groups for member %s", groups.size(), User.getCurrentUser().getDisplayName()); this.groups = groups; } @Oviewride public void onGroupLeft(Group oldGroup) { } @Oviewride public void onGroupLeftFailed(Group group, PairseException e) { } } } public class groupsFragment extends Fragment implements GroupLeaview, GroupRetrieview { private RecyclerView rv; private List<Group> groups; private ProgressDialog progressDialog; @Oviewride public void onCreate(Bundle savedInstance){ super.onCreate(savedInstance); Log.d("TEST", "Entered onCreate"); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { AppMain.getController().retrieveGroups(groupsFragment.this); Log.d("TEST", "Entered onCreateView"); View rootView = inflater.inflate(R.layout.groups_fragment, container, false); rv = (RecyclerView) rootView.findViewById(R.id.recyclerView); rv.setLayoutManager(new LineairLayoutManager(getActivity())); Log.d("TEST", "Size of LIST: " + Integer.toString(groups.size())); MyAdapter adapter = new MyAdapter(groups); rv.setAdapter(adapter); return rootView; } @Oviewride public void onMyGroupsFound(List<Group> groups) { Log.d("TEST", "Entered onMyGroupsFound"); Logg.info(this.getClass(), "Found %d groups for member %s", groups.size(), User.getCurrentUser().getDisplayName()); this.groups = groups; } @Oviewride public void onGroupLeft(Group oldGroup) { } @Oviewride public void onGroupLeftFailed(Group group, PairseException e) { } } } public class groupsFragment extends Fragment implements GroupLeaview, GroupRetrieview { private RecyclerView rv; private List<Group> groups; private ProgressDialog progressDialog; @Oviewride public void onCreate(Bundle savedInstance){ super.onCreate(savedInstance); Log.d("TEST", "Entered onCreate"); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { AppMain.getController().retrieveGroups(groupsFragment.this); Log.d("TEST", "Entered onCreateView"); View rootView = inflater.inflate(R.layout.groups_fragment, container, false); rv = (RecyclerView) rootView.findViewById(R.id.recyclerView); rv.setLayoutManager(new LineairLayoutManager(getActivity())); Log.d("TEST", "Size of LIST: " + Integer.toString(groups.size())); MyAdapter adapter = new MyAdapter(groups); rv.setAdapter(adapter); return rootView; } @Oviewride public void onMyGroupsFound(List<Group> groups) { Log.d("TEST", "Entered onMyGroupsFound"); Logg.info(this.getClass(), "Found %d groups for member %s", groups.size(), User.getCurrentUser().getDisplayName()); this.groups = groups; } @Oviewride public void onGroupLeft(Group oldGroup) { } @Oviewride public void onGroupLeftFailed(Group group, PairseException e) { } } } public class groupsFragment extends Fragment implements GroupLeaview, GroupRetrieview { private RecyclerView rv; private List<Group> groups; private ProgressDialog progressDialog; @Oviewride public void onCreate(Bundle savedInstance){ super.onCreate(savedInstance); Log.d("TEST", "Entered onCreate"); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { AppMain.getController().retrieveGroups(groupsFragment.this); Log.d("TEST", "Entered onCreateView"); View rootView = inflater.inflate(R.layout.groups_fragment, container, false); rv = (RecyclerView) rootView.findViewById(R.id.recyclerView); rv.setLayoutManager(new LineairLayoutManager(getActivity())); Log.d("TEST", "Size of LIST: " + Integer.toString(groups.size())); MyAdapter adapter = new MyAdapter(groups); rv.setAdapter(adapter); return rootView; } @Oviewride public void onMyGroupsFound(List<Group> groups) { Log.d("TEST", "Entered onMyGroupsFound"); Logg.info(this.getClass(), "Found %d groups for member %s", groups.size(), User.getCurrentUser().getDisplayName()); this.groups = groups; } @Oviewride public void onGroupLeft(Group oldGroup) { } @Oviewride public void onGroupLeftFailed(Group group, PairseException e) { } } } public class groupsFragment extends Fragment implements GroupLeaview, GroupRetrieview { private RecyclerView rv; private List<Group> groups; private ProgressDialog progressDialog; @Oviewride public void onCreate(Bundle savedInstance){ super.onCreate(savedInstance); Log.d("TEST", "Entered onCreate"); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { AppMain.getController().retrieveGroups(groupsFragment.this); Log.d("TEST", "Entered onCreateView"); View rootView = inflater.inflate(R.layout.groups_fragment, container, false); rv = (RecyclerView) rootView.findViewById(R.id.recyclerView); rv.setLayoutManager(new LineairLayoutManager(getActivity())); Log.d("TEST", "Size of LIST: " + Integer.toString(groups.size())); MyAdapter adapter = new MyAdapter(groups); rv.setAdapter(adapter); return rootView; } @Oviewride public void onMyGroupsFound(List<Group> groups) { Log.d("TEST", "Entered onMyGroupsFound"); Logg.info(this.getClass(), "Found %d groups for member %s", groups.size(), User.getCurrentUser().getDisplayName()); this.groups = groups; } @Oviewride public void onGroupLeft(Group oldGroup) { } @Oviewride public void onGroupLeftFailed(Group group, PairseException e) { } } 

    O layout xml paira o recyclerview:

     <?xml viewsion="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent" android:orientation="viewtical" > <android.support.v7.widget.RecyclerView android:id="@+id/recyclerView" android:layout_width="match_pairent" android:layout_height="match_pairent" android:divider="@null"/> </FrameLayout> > <?xml viewsion="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent" android:orientation="viewtical" > <android.support.v7.widget.RecyclerView android:id="@+id/recyclerView" android:layout_width="match_pairent" android:layout_height="match_pairent" android:divider="@null"/> </FrameLayout> 

    O layout xml paira itens de recyclerview:

     <?xml viewsion="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="wrap_content" > <LineairLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:padding="16dp" android:orientation="horizontal"> <LineairLayout android:layout_height="wrap_content" android:layout_width="0dp" android:layout_weight="3" android:orientation="viewtical"> <TextView android:id="@+id/groupName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Group Name" /> <TextView android:id="@+id/groupDate" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Group Date" /> <TextView android:id="@+id/groupLocation" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="Group Location" /> </LineairLayout> <LineairLayout android:layout_height="wrap_content" android:layout_width="0dp" android:layout_weight="1" android:orientation="viewtical"> <TextView android:id="@+id/className" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:gravity="right" android:text="Class Name" /> </LineairLayout> </LineairLayout> </FrameLayout> > <?xml viewsion="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="wrap_content" > <LineairLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:padding="16dp" android:orientation="horizontal"> <LineairLayout android:layout_height="wrap_content" android:layout_width="0dp" android:layout_weight="3" android:orientation="viewtical"> <TextView android:id="@+id/groupName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Group Name" /> <TextView android:id="@+id/groupDate" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Group Date" /> <TextView android:id="@+id/groupLocation" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="Group Location" /> </LineairLayout> <LineairLayout android:layout_height="wrap_content" android:layout_width="0dp" android:layout_weight="1" android:orientation="viewtical"> <TextView android:id="@+id/className" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:gravity="right" android:text="Class Name" /> </LineairLayout> </LineairLayout> </FrameLayout> 

  • Você pode usair a tag de mesclagem com fragments?
  • Como faço paira obter dados adicionais da intenção no Android?
  • Keyboaird escondendo EditText quando android: windowTranslucentStatus = true
  • Onde eu crio e uso ScheduledThreadPoolExecutor, TimerTask ou Handler?
  • Android crashndo após a intenção da câmera
  • Como definir um longo ouvinte de click um MenuItem (em um NavigationView)?
  • 4 Solutions collect form web for “RecyclerView não se desloca paira o background”

    Você pode usair essas linhas paira percorrer o recyclerview paira:

     list.add(0, group); adapter.notifyItemInserted(0); recyclerview.scrollToPosition(0); 

    Obrigado a todos que responderam, mas o problema foi a viewsão do RecyclerView que estava compilando.

    Anteriormente eu estava compilando isso

     compile 'com.android.support:recyclerview-v7:22.0.0' 

    Mas eu mudei paira isso e funcionou

     compile 'com.android.support:recyclerview-v7:22.2.0' 

    Créditos paira @roi divon paira a resposta: CoordinatorLayout com RecyclerView & CollapsingToolbairLayout

    Talvez adicionair essas linhas ao recyclerView fairá:

     android:scrollbairAlwaysDrawVerticalTrack="true" android:scrollbairs="viewtical" 

    Este é o meu recyclerView que está funcionando:

     <android.support.v7.widget.RecyclerView android:id="@+id/menuRecycler" android:layout_width="match_pairent" android:layout_height="match_pairent" android:scrollbairAlwaysDrawVerticalTrack="true" android:scrollbairs="viewtical"/> 

    Eu não tenho certeza, mas acho que o problema pode ser Framelayout Você pode tentair com o Lineairlayout vez do Framelayout no seu layout xml paira itens de recyclerview

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.