У меня есть RecycleView, при нажатии отображает Fragment которы при даже закрашивание фоне все действия делает вот так, что делать ?
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_people, container, false);
RecyclerView recyclerView = view.findViewById(R.id.allPeople);
FriendsRecyclerViewAdapter adapter = new FriendsRecyclerViewAdapter(implemets(users), new FriendsRecyclerViewAdapter.ItemClickListener() {
@Override
public void onClick(int index) {
// Toast.makeText(getActivity(), list.get(index).getName(),Toast.LENGTH_SHORT).show();
// Toast.makeText(getActivity(), "ghbdtn", Toast.LENGTH_SHORT).show();
DetailFriendFragment detailFriendFragment = new DetailFriendFragment();
Bundle bundle = new Bundle();
bundle.putString(DetailFriendFragment.KEY_DETAIL, list.get(index).getName());
detailFriendFragment.setArguments(bundle);
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.drawer_layout, detailFriendFragment, DETAIL_FRIENDS_FRAGMENT);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
}
});
recyclerView.setAdapter(adapter);
mLayoutManager = new LinearLayoutManager(getActivity());
recyclerView.setLayoutManager(mLayoutManager);
FloatingActionButton fab = view.findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(getActivity(), SearchActivity.class));
}
});
recyclerView.addItemDecoration(new DividerItemDecoration(getActivity(),
DividerItemDecoration.VERTICAL));
return view;
}