summaryrefslogtreecommitdiffstats
path: root/core/java/android/app
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/app')
-rw-r--r--core/java/android/app/SuggestionsAdapter.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/java/android/app/SuggestionsAdapter.java b/core/java/android/app/SuggestionsAdapter.java
index 593b7b7..4cd35a4 100644
--- a/core/java/android/app/SuggestionsAdapter.java
+++ b/core/java/android/app/SuggestionsAdapter.java
@@ -27,6 +27,7 @@ import android.content.res.Resources;
import android.database.Cursor;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
+import android.graphics.drawable.DrawableContainer;
import android.graphics.drawable.StateListDrawable;
import android.net.Uri;
import android.os.Bundle;
@@ -359,6 +360,10 @@ class SuggestionsAdapter extends ResourceCursorAdapter {
newBg.addState(new int[]{android.R.attr.state_selected}, transparent);
newBg.addState(new int[]{android.R.attr.state_pressed}, transparent);
newBg.addState(new int[]{}, background);
+ // Workaround for the fact that StateListDrawable.getPadding(Rect) always returns
+ // true, and thus sets the padding of any view that has it as a background.
+ ((DrawableContainer.DrawableContainerState) newBg.getConstantState())
+ .setVariablePadding(true);
mBackgroundsCache.put(backgroundColor, newBg.getConstantState());
return newBg;
}