@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.f_schedule_download_settings, container, false); LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity()); layoutManager.setAutoMeasureEnabled(true); RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.list); recyclerView.setNestedScrollingEnabled(false); recyclerView.setHasFixedSize(false); recyclerView.setLayoutManager(layoutManager); recyclerView.setAdapter(adapter); noDownloadsScreen = view.findViewById(R.id.no_downloads); if (adapter.getItemCount() == 0) noDownloadsScreen.setVisibility(View.VISIBLE); view.findViewById(R.id.button_sections).setOnClickListener(onAddAction); return view; }