Merge "Output switcher panel requires large title icon for Slice slider style" into rvc-dev am: c21406a0a2

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/11818502

Change-Id: Id609ee38c9b5230def2c8d1cffb7aac8e209e4e6
This commit is contained in:
tim peng
2020-06-12 05:10:33 +00:00
committed by Automerger Merge Worker
10 changed files with 74 additions and 2 deletions

View File

@@ -72,4 +72,9 @@ public class MediaOutputGroupPanelTest {
public void getSeeMoreIntent_isNull() {
assertThat(mPanel.getSeeMoreIntent()).isNull();
}
@Test
public void getViewType_checkType() {
assertThat(mPanel.getViewType()).isEqualTo(PanelContent.VIEW_TYPE_SLIDER_LARGE_ICON);
}
}

View File

@@ -312,4 +312,9 @@ public class MediaOutputPanelTest {
verify(mCallback).forceClose();
}
@Test
public void getViewType_checkType() {
assertThat(mPanel.getViewType()).isEqualTo(PanelContent.VIEW_TYPE_SLIDER_LARGE_ICON);
}
}

View File

@@ -17,6 +17,7 @@
package com.android.settings.panel;
import static com.android.settings.panel.PanelContent.VIEW_TYPE_SLIDER;
import static com.android.settings.panel.PanelContent.VIEW_TYPE_SLIDER_LARGE_ICON;
import static com.android.settings.panel.PanelSlicesAdapter.MAX_NUM_OF_SLICES;
import static com.android.settings.slices.CustomSliceRegistry.MEDIA_OUTPUT_GROUP_SLICE_URI;
import static com.android.settings.slices.CustomSliceRegistry.MEDIA_OUTPUT_INDICATOR_SLICE_URI;
@@ -206,6 +207,19 @@ public class PanelSlicesAdapterTest {
assertThat(intArgumentCaptor.getValue()).isEqualTo(R.layout.panel_slice_slider_row);
}
@Test
public void onCreateViewHolder_viewTypeSliderLargeIcon_verifyLayout() {
final PanelSlicesAdapter adapter = new PanelSlicesAdapter(mPanelFragment, mData, 0);
final ViewGroup view = new FrameLayout(mContext);
final ArgumentCaptor<Integer> intArgumentCaptor = ArgumentCaptor.forClass(Integer.class);
adapter.onCreateViewHolder(view, VIEW_TYPE_SLIDER_LARGE_ICON);
verify(sLayoutInflater).inflate(intArgumentCaptor.capture(), eq(view), eq(false));
assertThat(intArgumentCaptor.getValue()).isEqualTo(
R.layout.panel_slice_slider_row_large_icon);
}
@Test
public void onCreateViewHolder_viewTypeDefault_verifyLayout() {
final PanelSlicesAdapter adapter =

View File

@@ -70,4 +70,9 @@ public class VolumePanelTest {
public void getSeeMoreIntent_notNull() {
assertThat(mPanel.getSeeMoreIntent()).isNotNull();
}
@Test
public void getViewType_checkType() {
assertThat(mPanel.getViewType()).isEqualTo(PanelContent.VIEW_TYPE_SLIDER);
}
}