Merge "Remove "See more" from wifi/bluetooth slices"
This commit is contained in:
committed by
Android (Google) Code Review
commit
0af2ade371
@@ -24,9 +24,9 @@
|
||||
<androidx.slice.widget.SliceView
|
||||
android:id="@+id/slice_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/homepage_slice_card_max_height"
|
||||
android:layout_marginBottom="@dimen/homepage_card_bottom_margin"
|
||||
android:layout_marginTop="@dimen/homepage_card_top_margin"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/homepage_card_vertical_margin"
|
||||
android:layout_marginTop="@dimen/homepage_card_vertical_margin"
|
||||
android:paddingStart="@dimen/homepage_card_padding_start"
|
||||
android:paddingEnd="@dimen/homepage_card_padding_end"/>
|
||||
|
||||
|
@@ -327,17 +327,10 @@
|
||||
<!-- Homepage cards size and padding -->
|
||||
<dimen name="homepage_card_corner_radius">8dp</dimen>
|
||||
<dimen name="homepage_card_elevation">2dp</dimen>
|
||||
<dimen name="homepage_card_top_margin">6dp</dimen>
|
||||
<dimen name="homepage_card_bottom_margin">6dp</dimen>
|
||||
<dimen name="homepage_card_vertical_margin">6dp</dimen>
|
||||
<dimen name="homepage_card_side_margin">16dp</dimen>
|
||||
<dimen name="homepage_card_padding_start">16dp</dimen>
|
||||
<dimen name="homepage_card_padding_end">16dp</dimen>
|
||||
<dimen name="homepage_card_padding_top">6dp</dimen>
|
||||
<dimen name="homepage_card_padding_bottom">6dp</dimen>
|
||||
|
||||
<!-- Slice cards maximum height (4 rows + show more)
|
||||
MODE_LARGE height(3 rows + show more) 240dp + two lines text(1 row) 60dp = 300dp -->
|
||||
<dimen name="homepage_slice_card_max_height">300dp</dimen>
|
||||
|
||||
<!-- Signal icon in NetworkSelectSetting -->
|
||||
<dimen name="signal_strength_icon_size">24dp</dimen>
|
||||
|
@@ -455,8 +455,8 @@
|
||||
</style>
|
||||
|
||||
<style name="ContextualCardStyle">
|
||||
<item name="android:layout_marginTop">@dimen/homepage_card_top_margin</item>
|
||||
<item name="android:layout_marginBottom">@dimen/homepage_card_bottom_margin</item>
|
||||
<item name="android:layout_marginTop">@dimen/homepage_card_vertical_margin</item>
|
||||
<item name="android:layout_marginBottom">@dimen/homepage_card_vertical_margin</item>
|
||||
<item name="android:layout_marginStart">@dimen/homepage_card_side_margin</item>
|
||||
<item name="android:layout_marginEnd">@dimen/homepage_card_side_margin</item>
|
||||
<item name="cardCornerRadius">@dimen/homepage_card_corner_radius</item>
|
||||
|
@@ -95,8 +95,6 @@ public class ConnectedDeviceSlice implements CustomSliceable {
|
||||
private static final Comparator<CachedBluetoothDevice> COMPARATOR
|
||||
= Comparator.naturalOrder();
|
||||
|
||||
private static final int DEFAULT_EXPANDED_ROW_COUNT = 4;
|
||||
|
||||
private static final String TAG = "ConnectedDeviceSlice";
|
||||
|
||||
private final Context mContext;
|
||||
@@ -162,13 +160,6 @@ public class ConnectedDeviceSlice implements CustomSliceable {
|
||||
for (ListBuilder.RowBuilder rowBuilder : rows) {
|
||||
listBuilder.addRow(rowBuilder);
|
||||
}
|
||||
|
||||
// Only show "see more" button when the number of data row is more than or equal to 4.
|
||||
// TODO(b/118465996): SHOW MORE button won't work properly when having two data rows
|
||||
if (rows.size() >= DEFAULT_EXPANDED_ROW_COUNT) {
|
||||
listBuilder.setSeeMoreAction(primaryActionIntent);
|
||||
}
|
||||
|
||||
return listBuilder.build();
|
||||
}
|
||||
|
||||
|
@@ -71,7 +71,7 @@ public class WifiSlice implements CustomSliceable {
|
||||
.build();
|
||||
|
||||
@VisibleForTesting
|
||||
static final int DEFAULT_EXPANDED_ROW_COUNT = 4;
|
||||
static final int DEFAULT_EXPANDED_ROW_COUNT = 3;
|
||||
|
||||
private final Context mContext;
|
||||
|
||||
@@ -137,10 +137,7 @@ public class WifiSlice implements CustomSliceable {
|
||||
.setSubtitle(placeholder));
|
||||
}
|
||||
}
|
||||
// Add more button
|
||||
return listBuilder
|
||||
.setSeeMoreAction(primaryAction)
|
||||
.build();
|
||||
return listBuilder.build();
|
||||
}
|
||||
|
||||
private RowBuilder getAccessPointRow(AccessPoint accessPoint) {
|
||||
|
@@ -88,9 +88,8 @@ public class WifiSliceTest {
|
||||
|
||||
int rows = SliceQuery.findAll(wifiSlice, FORMAT_SLICE, HINT_LIST_ITEM,
|
||||
null /* nonHints */).size();
|
||||
// All AP rows + title row + see more row
|
||||
// (see more row will drop the last AP row, thus -1)
|
||||
assertThat(rows).isEqualTo(DEFAULT_EXPANDED_ROW_COUNT - 1 + 2);
|
||||
// All AP rows + title row
|
||||
assertThat(rows).isEqualTo(DEFAULT_EXPANDED_ROW_COUNT + 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user