Merge "Reduce margin for DropTargetBar to avoid buttons to be truncated." into sc-dev

This commit is contained in:
Alina Zaidi 2021-07-01 11:10:26 +00:00 committed by Android (Google) Code Review
commit eefccccb19
4 changed files with 5 additions and 4 deletions

View File

@ -19,6 +19,5 @@
<!-- Drag padding to add to the bottom of drop targets -->
<dimen name="drop_target_drag_padding">20dp</dimen>
<dimen name="drop_target_text_size">16sp</dimen>
</resources>

View File

@ -189,8 +189,9 @@
<!-- Dragging -->
<!-- Drag padding to add to the bottom of drop targets -->
<dimen name="drop_target_drag_padding">14dp</dimen>
<dimen name="drop_target_text_size">20sp</dimen>
<dimen name="drop_target_text_size">16sp</dimen>
<dimen name="drop_target_shadow_elevation">2dp</dimen>
<dimen name="drop_target_bar_margin_horizontal">4dp</dimen>
<!-- the distance an icon must be dragged before button drop targets accept it -->
<dimen name="drag_distanceThreshold">30dp</dimen>

View File

@ -258,7 +258,7 @@
<!-- Drop targets -->
<style name="DropTargetButtonBase" parent="@android:style/TextAppearance.DeviceDefault">
<item name="android:drawablePadding">8dp</item>
<item name="android:padding">16dp</item>
<item name="android:padding">14dp</item>
<item name="android:textColor">@color/drop_target_text</item>
<item name="android:textSize">@dimen/drop_target_text_size</item>
<item name="android:singleLine">true</item>

View File

@ -105,7 +105,8 @@ public class DropTargetBar extends FrameLayout
/ (2 * (grid.inv.numColumns + 1)))
+ grid.edgeMarginPx;
} else {
gap = grid.desiredWorkspaceLeftRightMarginPx - grid.inv.defaultWidgetPadding.right;
gap = getContext().getResources()
.getDimensionPixelSize(R.dimen.drop_target_bar_margin_horizontal);
}
lp.width = grid.availableWidthPx - 2 * gap;