Add a separate line at the bottom of list area in output switcher

-Bottom divider is not showed when there are more than 7 devices exist in output switcher
-Check panel type in isDividerAllowedBelow()
-Hide the Slice bottom divider of Output switcher panel
-Show divider in panel layout only for output switcher panel

Bug: 159177275
Test: make -j42 RunSettingsRoboTests

Change-Id: I49396a0ee0543b494a2b3d714ec248ebab08e7ba
This commit is contained in:
Tim Peng
2020-06-18 12:00:32 +08:00
committed by tim peng
parent 45a953b56c
commit aeabfc3050
5 changed files with 116 additions and 3 deletions

View File

@@ -96,6 +96,7 @@ public class PanelFragment extends Fragment {
private TextView mHeaderTitle;
private TextView mHeaderSubtitle;
private int mMaxHeight;
private View mFooterDivider;
private final Map<Uri, LiveData<Slice>> mSliceLiveData = new LinkedHashMap<>();
@@ -187,6 +188,7 @@ public class PanelFragment extends Fragment {
mTitleIcon = mLayoutView.findViewById(R.id.title_icon);
mHeaderTitle = mLayoutView.findViewById(R.id.header_title);
mHeaderSubtitle = mLayoutView.findViewById(R.id.header_subtitle);
mFooterDivider = mLayoutView.findViewById(R.id.footer_divider);
// Make the panel layout gone here, to avoid janky animation when updating from old panel.
// We will make it visible once the panel is ready to load.
@@ -241,6 +243,13 @@ public class PanelFragment extends Fragment {
mTitleIcon.setLayoutParams(new LinearLayout.LayoutParams(size, size));
}
}
if (mPanel.getViewType() == PanelContent.VIEW_TYPE_SLIDER_LARGE_ICON) {
mFooterDivider.setVisibility(View.VISIBLE);
} else {
mFooterDivider.setVisibility(View.GONE);
}
mSeeMoreButton.setOnClickListener(getSeeMoreListener());
mDoneButton.setOnClickListener(getCloseListener());