S
S
sanke462018-01-16 17:04:18
Python
sanke46, 2018-01-16 17:04:18

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;
    }

5a5e05610eb4d650656484.gif

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Denis Zagaevsky, 2018-01-16
@sanke46

Do replace instead of add. And post the code.

D
davidnum95, 2018-01-16
@davidnum95

what to do ?

Post code.

E
Eugene, 2018-01-16
@klim76

I bet on the fact that the pager uses support fragments, and in the above code the usual

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question