Loading res/values/dimens.xml +1 −0 Original line number Diff line number Diff line Loading @@ -300,6 +300,7 @@ <dimen name="snackbar_elevation">3dp</dimen> <dimen name="snackbar_min_text_size">12sp</dimen> <dimen name="snackbar_max_text_size">14sp</dimen> <dimen name="snackbar_max_width">504dp</dimen> <!-- Developer Options --> <dimen name="developer_options_filter_margins">10dp</dimen> Loading src/com/android/launcher3/views/Snackbar.java +7 −2 Original line number Diff line number Diff line Loading @@ -88,9 +88,14 @@ public class Snackbar extends AbstractFloatingView { int maxMarginLeftRight = res.getDimensionPixelSize(R.dimen.snackbar_max_margin_left_right); int minMarginLeftRight = res.getDimensionPixelSize(R.dimen.snackbar_min_margin_left_right); int marginBottom = res.getDimensionPixelSize(R.dimen.snackbar_margin_bottom); int absoluteMaxWidth = res.getDimensionPixelSize(R.dimen.snackbar_max_width); Rect insets = activity.getDeviceProfile().getInsets(); int maxWidth = dragLayer.getWidth() - minMarginLeftRight * 2 - insets.left - insets.right; int minWidth = dragLayer.getWidth() - maxMarginLeftRight * 2 - insets.left - insets.right; int maxWidth = Math.min( dragLayer.getWidth() - minMarginLeftRight * 2 - insets.left - insets.right, absoluteMaxWidth); int minWidth = Math.min( dragLayer.getWidth() - maxMarginLeftRight * 2 - insets.left - insets.right, absoluteMaxWidth); params.width = minWidth; params.setMargins(0, 0, 0, marginBottom + insets.bottom); Loading Loading
res/values/dimens.xml +1 −0 Original line number Diff line number Diff line Loading @@ -300,6 +300,7 @@ <dimen name="snackbar_elevation">3dp</dimen> <dimen name="snackbar_min_text_size">12sp</dimen> <dimen name="snackbar_max_text_size">14sp</dimen> <dimen name="snackbar_max_width">504dp</dimen> <!-- Developer Options --> <dimen name="developer_options_filter_margins">10dp</dimen> Loading
src/com/android/launcher3/views/Snackbar.java +7 −2 Original line number Diff line number Diff line Loading @@ -88,9 +88,14 @@ public class Snackbar extends AbstractFloatingView { int maxMarginLeftRight = res.getDimensionPixelSize(R.dimen.snackbar_max_margin_left_right); int minMarginLeftRight = res.getDimensionPixelSize(R.dimen.snackbar_min_margin_left_right); int marginBottom = res.getDimensionPixelSize(R.dimen.snackbar_margin_bottom); int absoluteMaxWidth = res.getDimensionPixelSize(R.dimen.snackbar_max_width); Rect insets = activity.getDeviceProfile().getInsets(); int maxWidth = dragLayer.getWidth() - minMarginLeftRight * 2 - insets.left - insets.right; int minWidth = dragLayer.getWidth() - maxMarginLeftRight * 2 - insets.left - insets.right; int maxWidth = Math.min( dragLayer.getWidth() - minMarginLeftRight * 2 - insets.left - insets.right, absoluteMaxWidth); int minWidth = Math.min( dragLayer.getWidth() - maxMarginLeftRight * 2 - insets.left - insets.right, absoluteMaxWidth); params.width = minWidth; params.setMargins(0, 0, 0, marginBottom + insets.bottom); Loading