Merge "Center drop target icons in landscape mode." into sc-dev am: 3287dd9fa7
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14980961 Change-Id: Id3f175c250acc0a40b9662c20c28c73c9fd35c13
This commit is contained in:
commit
d417d36615
3 files changed
+7
-16
No files matched your search
@@ -48,7 +48,7 @@
|
|||||||
<dimen name="workspace_page_indicator_overlap_workspace">0dp</dimen>
|
<dimen name="workspace_page_indicator_overlap_workspace">0dp</dimen>
|
||||||
|
|
||||||
<!-- Drop target bar -->
|
<!-- Drop target bar -->
|
||||||
<dimen name="dynamic_grid_drop_target_size">48dp</dimen>
|
<dimen name="dynamic_grid_drop_target_size">52dp</dimen>
|
||||||
<dimen name="drop_target_vertical_gap">20dp</dimen>
|
<dimen name="drop_target_vertical_gap">20dp</dimen>
|
||||||
|
|
||||||
<!-- App Widget resize frame -->
|
<!-- App Widget resize frame -->
|
||||||
|
|||||||
@@ -266,9 +266,8 @@
|
|||||||
|
|
||||||
<!-- Drop targets -->
|
<!-- Drop targets -->
|
||||||
<style name="DropTargetButtonBase" parent="@android:style/TextAppearance.DeviceDefault">
|
<style name="DropTargetButtonBase" parent="@android:style/TextAppearance.DeviceDefault">
|
||||||
<item name="android:drawablePadding">7.5dp</item>
|
<item name="android:drawablePadding">8dp</item>
|
||||||
<item name="android:paddingLeft">16dp</item>
|
<item name="android:padding">16dp</item>
|
||||||
<item name="android:paddingRight">16dp</item>
|
|
||||||
<item name="android:textColor">?android:attr/textColorPrimary</item>
|
<item name="android:textColor">?android:attr/textColorPrimary</item>
|
||||||
<item name="android:textSize">@dimen/drop_target_text_size</item>
|
<item name="android:textSize">@dimen/drop_target_text_size</item>
|
||||||
<item name="android:singleLine">true</item>
|
<item name="android:singleLine">true</item>
|
||||||
|
|||||||
@@ -121,19 +121,11 @@ public abstract class ButtonDropTarget extends TextView
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void setDrawable(int resId) {
|
protected void setDrawable(int resId) {
|
||||||
mDrawable = getContext().getDrawable(resId).mutate();
|
|
||||||
mDrawable.setBounds(0, 0, mDrawableSize, mDrawableSize);
|
|
||||||
setDrawable(mDrawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setDrawable(Drawable drawable) {
|
|
||||||
// We do not set the drawable in the xml as that inflates two drawables corresponding to
|
// We do not set the drawable in the xml as that inflates two drawables corresponding to
|
||||||
// drawableLeft and drawableStart.
|
// drawableLeft and drawableStart.
|
||||||
if (mTextVisible) {
|
mDrawable = getContext().getDrawable(resId).mutate();
|
||||||
setCompoundDrawablesRelative(drawable, null, null, null);
|
mDrawable.setBounds(0, 0, mDrawableSize, mDrawableSize);
|
||||||
} else {
|
setCompoundDrawablesRelative(mDrawable, null, null, null);
|
||||||
setCompoundDrawablesRelative(null, drawable, null, null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDropTargetBar(DropTargetBar dropTargetBar) {
|
public void setDropTargetBar(DropTargetBar dropTargetBar) {
|
||||||
@@ -331,7 +323,7 @@ public abstract class ButtonDropTarget extends TextView
|
|||||||
if (mTextVisible != isVisible || !TextUtils.equals(newText, getText())) {
|
if (mTextVisible != isVisible || !TextUtils.equals(newText, getText())) {
|
||||||
mTextVisible = isVisible;
|
mTextVisible = isVisible;
|
||||||
setText(newText);
|
setText(newText);
|
||||||
setDrawable(mDrawable);
|
setCompoundDrawablesRelative(mDrawable, null, null, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user