Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b455d58c authored by Tsung-Mao Fang's avatar Tsung-Mao Fang
Browse files

Only add divider in recyclerView once

Only add divider in recyclerView once or more and more dividers
will be set in recyclerView.

Change-Id: I765ed888d460be221341dafe3521a849b8dd3889
Fix: 139452947
Test: Show panel many times and see the divider.
parent 68b772bb
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -276,12 +276,14 @@ public class PanelFragment extends Fragment {
                    .addOnGlobalLayoutListener(mOnGlobalLayoutListener);
            mPanelSlices.setVisibility(View.VISIBLE);

            DividerItemDecoration itemDecoration = new DividerItemDecoration(getActivity());
            final DividerItemDecoration itemDecoration = new DividerItemDecoration(getActivity());
            itemDecoration
                    .setDividerCondition(DividerItemDecoration.DIVIDER_CONDITION_BOTH);
            if (mPanelSlices.getItemDecorationCount() == 0) {
                mPanelSlices.addItemDecoration(itemDecoration);
            }
        }
    }

    /**
     * Animate a Panel onto the screen.