summaryrefslogtreecommitdiff
path: root/java/src
diff options
context:
space:
mode:
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/intentresolver/grid/ChooserGridAdapter.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/java/src/com/android/intentresolver/grid/ChooserGridAdapter.java b/java/src/com/android/intentresolver/grid/ChooserGridAdapter.java
index 77ae20f5..fadea934 100644
--- a/java/src/com/android/intentresolver/grid/ChooserGridAdapter.java
+++ b/java/src/com/android/intentresolver/grid/ChooserGridAdapter.java
@@ -164,8 +164,10 @@ public final class ChooserGridAdapter extends RecyclerView.Adapter<RecyclerView.
return false;
}
- // Limit width to the maximum width of the chooser activity
- width = Math.min(mChooserWidthPixels, width);
+ // Limit width to the maximum width of the chooser activity, if the maximum width is set
+ if (mChooserWidthPixels >= 0) {
+ width = Math.min(mChooserWidthPixels, width);
+ }
int newWidth = width / mMaxTargetsPerRow;
if (newWidth != mChooserTargetWidth) {