Answer the question
In order to leave comments, you need to log in
When clicking RecycleView FragmentTransparation doesn't open correctly why?
I have a RecycleView, when pressed, it displays a Fragment which, even when the background is painted over, does all the actions like this, what should I do?
@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;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question