Add notion of image sizes to grid builder
* Adds new API that take image mode for sizing
* Updates samples to include an IMAGE_ICON size sample
The renders for IMAGE_ICON samples look bad right now
this is fixed by view side of this CL (ag/3643127)
Test: ./gradlew slices-view:connectedCheck
Bug: 68378561
Change-Id: Ifd4d733557eec1ed52f5a201b6dad0664adee4e1
diff --git a/samples/SupportSliceDemos/src/main/java/com/example/androidx/slice/demos/SampleSliceProvider.java b/samples/SupportSliceDemos/src/main/java/com/example/androidx/slice/demos/SampleSliceProvider.java
index de764a1..d845b72 100644
--- a/samples/SupportSliceDemos/src/main/java/com/example/androidx/slice/demos/SampleSliceProvider.java
+++ b/samples/SupportSliceDemos/src/main/java/com/example/androidx/slice/demos/SampleSliceProvider.java
@@ -58,7 +58,7 @@
public static final String[] URI_PATHS = {"message", "wifi", "note", "ride", "toggle",
"toggle2", "contact", "gallery", "weather", "reservation", "loadlist", "loadlist2",
- "loadgrid", "loadgrid2", "inputrange", "range"};
+ "loadgrid", "loadgrid2", "inputrange", "range", "contact2"};
/**
* @return Uri with the provided path
@@ -101,6 +101,8 @@
return createTwoCustomToggleSlices(sliceUri);
case "/contact":
return createContact(sliceUri);
+ case "/contact2":
+ return createContact2(sliceUri);
case "/gallery":
return createGallery(sliceUri);
case "/weather":
@@ -130,23 +132,28 @@
return new ListBuilder(getContext(), sliceUri).addGrid(gb -> gb
.setPrimaryAction(primaryAction)
.addCell(cb -> cb
- .addLargeImage(Icon.createWithResource(getContext(), R.drawable.weather_1))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.weather_1),
+ GridBuilder.SMALL_IMAGE)
.addText("MON")
.addTitleText("69\u00B0"))
.addCell(cb -> cb
- .addLargeImage(Icon.createWithResource(getContext(), R.drawable.weather_2))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.weather_2),
+ GridBuilder.SMALL_IMAGE)
.addText("TUE")
.addTitleText("71\u00B0"))
.addCell(cb -> cb
- .addLargeImage(Icon.createWithResource(getContext(), R.drawable.weather_3))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.weather_3),
+ GridBuilder.SMALL_IMAGE)
.addText("WED")
.addTitleText("76\u00B0"))
.addCell(cb -> cb
- .addLargeImage(Icon.createWithResource(getContext(), R.drawable.weather_4))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.weather_4),
+ GridBuilder.SMALL_IMAGE)
.addText("THU")
.addTitleText("72\u00B0"))
.addCell(cb -> cb
- .addLargeImage(Icon.createWithResource(getContext(), R.drawable.weather_1))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.weather_1),
+ GridBuilder.SMALL_IMAGE)
.addText("FRI")
.addTitleText("68\u00B0")))
.build();
@@ -168,13 +175,60 @@
"Share photo album"))
.addGrid(b -> b
.addCell(cb -> cb
- .addLargeImage(Icon.createWithResource(getContext(), R.drawable.slices_1)))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.slices_1),
+ GridBuilder.LARGE_IMAGE))
.addCell(cb -> cb
- .addLargeImage(Icon.createWithResource(getContext(), R.drawable.slices_2)))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.slices_2),
+ GridBuilder.LARGE_IMAGE))
.addCell(cb -> cb
- .addLargeImage(Icon.createWithResource(getContext(), R.drawable.slices_3)))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.slices_3),
+ GridBuilder.LARGE_IMAGE))
.addCell(cb -> cb
- .addLargeImage(Icon.createWithResource(getContext(), R.drawable.slices_4))))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.slices_4),
+ GridBuilder.LARGE_IMAGE))
+ .addCell(cb -> cb
+ .addImage(Icon.createWithResource(getContext(), R.drawable.slices_2),
+ GridBuilder.LARGE_IMAGE))
+ .addCell(cb -> cb
+ .addImage(Icon.createWithResource(getContext(), R.drawable.slices_3),
+ GridBuilder.LARGE_IMAGE))
+ .addCell(cb -> cb
+ .addImage(Icon.createWithResource(getContext(), R.drawable.slices_4),
+ GridBuilder.LARGE_IMAGE)))
+ .build();
+ }
+
+
+ private Slice createContact2(Uri sliceUri) {
+ ListBuilder b = new ListBuilder(getContext(), sliceUri);
+ ListBuilder.RowBuilder rb = new ListBuilder.RowBuilder(b);
+ GridBuilder gb = new GridBuilder(b);
+ return b.setColor(0xff3949ab)
+ .addRow(rb
+ .setTitle("Mady Pitza")
+ .setSubtitle("Frequently contacted contact")
+ .addEndItem(Icon.createWithResource(getContext(), R.drawable.mady)))
+ .addGrid(gb
+ .addCell(new GridBuilder.CellBuilder(gb)
+ .addImage(Icon.createWithResource(getContext(), R.drawable.ic_call),
+ GridBuilder.ICON_IMAGE)
+ .addText("Call")
+ .setContentIntent(getBroadcastIntent(ACTION_TOAST, "call")))
+ .addCell(new GridBuilder.CellBuilder(gb)
+ .addImage(Icon.createWithResource(getContext(), R.drawable.ic_text),
+ GridBuilder.ICON_IMAGE)
+ .addText("Text")
+ .setContentIntent(getBroadcastIntent(ACTION_TOAST, "text")))
+ .addCell(new GridBuilder.CellBuilder(gb)
+ .addImage(Icon.createWithResource(getContext(),
+ R.drawable.ic_video), GridBuilder.ICON_IMAGE)
+ .setContentIntent(getBroadcastIntent(ACTION_TOAST, "video"))
+ .addText("Video"))
+ .addCell(new GridBuilder.CellBuilder(gb)
+ .addImage(Icon.createWithResource(getContext(),
+ R.drawable.ic_email), GridBuilder.ICON_IMAGE)
+ .addText("Email")
+ .setContentIntent(getBroadcastIntent(ACTION_TOAST, "email"))))
.build();
}
@@ -264,8 +318,8 @@
"Contact host"))
.addGrid(b -> b
.addCell(cb -> cb
- .addLargeImage(
- Icon.createWithResource(getContext(), R.drawable.reservation))))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.reservation),
+ GridBuilder.LARGE_IMAGE)))
.addGrid(b -> b
.addCell(cb -> cb
.addTitleText("Check In")
@@ -479,7 +533,8 @@
private GridBuilder.CellBuilder createCell(GridBuilder.CellBuilder cb, String text1,
String text2, Icon icon, boolean isLoading) {
- return cb.addText(text1, isLoading).addText(text2, isLoading).addImage(icon, isLoading);
+ return cb.addText(text1, isLoading).addText(text2, isLoading).addImage(icon,
+ GridBuilder.SMALL_IMAGE, isLoading);
}
private PendingIntent getIntent(String action) {
diff --git a/slices/builders/api/current.txt b/slices/builders/api/current.txt
index 15b248b..ccfc07f 100644
--- a/slices/builders/api/current.txt
+++ b/slices/builders/api/current.txt
@@ -8,15 +8,20 @@
method public androidx.app.slice.builders.GridBuilder addSeeMoreCell(androidx.app.slice.builders.GridBuilder.CellBuilder);
method public androidx.app.slice.builders.GridBuilder addSeeMoreCell(java.util.function.Consumer<androidx.app.slice.builders.GridBuilder.CellBuilder>);
method public androidx.app.slice.builders.GridBuilder setPrimaryAction(androidx.app.slice.builders.SliceAction);
+ field public static final int ICON_IMAGE = 0; // 0x0
+ field public static final int LARGE_IMAGE = 2; // 0x2
+ field public static final int SMALL_IMAGE = 1; // 0x1
}
public static final class GridBuilder.CellBuilder extends androidx.app.slice.builders.TemplateSliceBuilder {
ctor public GridBuilder.CellBuilder(androidx.app.slice.builders.GridBuilder);
ctor public GridBuilder.CellBuilder(androidx.app.slice.builders.GridBuilder, android.net.Uri);
- method public androidx.app.slice.builders.GridBuilder.CellBuilder addImage(android.graphics.drawable.Icon);
- method public androidx.app.slice.builders.GridBuilder.CellBuilder addImage(android.graphics.drawable.Icon, boolean);
- method public androidx.app.slice.builders.GridBuilder.CellBuilder addLargeImage(android.graphics.drawable.Icon);
- method public androidx.app.slice.builders.GridBuilder.CellBuilder addLargeImage(android.graphics.drawable.Icon, boolean);
+ method public deprecated androidx.app.slice.builders.GridBuilder.CellBuilder addImage(android.graphics.drawable.Icon);
+ method public deprecated androidx.app.slice.builders.GridBuilder.CellBuilder addImage(android.graphics.drawable.Icon, boolean);
+ method public androidx.app.slice.builders.GridBuilder.CellBuilder addImage(android.graphics.drawable.Icon, int);
+ method public androidx.app.slice.builders.GridBuilder.CellBuilder addImage(android.graphics.drawable.Icon, int, boolean);
+ method public deprecated androidx.app.slice.builders.GridBuilder.CellBuilder addLargeImage(android.graphics.drawable.Icon);
+ method public deprecated androidx.app.slice.builders.GridBuilder.CellBuilder addLargeImage(android.graphics.drawable.Icon, boolean);
method public androidx.app.slice.builders.GridBuilder.CellBuilder addText(java.lang.CharSequence);
method public androidx.app.slice.builders.GridBuilder.CellBuilder addText(java.lang.CharSequence, boolean);
method public androidx.app.slice.builders.GridBuilder.CellBuilder addTitleText(java.lang.CharSequence);
diff --git a/slices/builders/src/main/java/androidx/app/slice/builders/GridBuilder.java b/slices/builders/src/main/java/androidx/app/slice/builders/GridBuilder.java
index 07089bf..8d34f57 100644
--- a/slices/builders/src/main/java/androidx/app/slice/builders/GridBuilder.java
+++ b/slices/builders/src/main/java/androidx/app/slice/builders/GridBuilder.java
@@ -22,6 +22,7 @@
import android.graphics.drawable.Icon;
import android.net.Uri;
import android.os.Build;
+import android.support.annotation.IntDef;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
@@ -45,6 +46,28 @@
private boolean mHasSeeMore;
/**
+ * @hide
+ */
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
+ @IntDef({
+ LARGE_IMAGE, SMALL_IMAGE, ICON_IMAGE
+ })
+ public @interface ImageMode{}
+
+ /**
+ * Indicates that an image presented in the grid is a icon and it can be tinted.
+ */
+ public static final int ICON_IMAGE = 0;
+ /**
+ * Indicates that an image presented in the grid should be displayed in a small format.
+ */
+ public static final int SMALL_IMAGE = 1;
+ /**
+ * Indicates that an image presented in the grid should be displayed in a large format.
+ */
+ public static final int LARGE_IMAGE = 2;
+
+ /**
* Create a builder which will construct a slice displayed in a grid format.
* @param parent The builder constructing the parent slice.
*/
@@ -263,8 +286,9 @@
* @param image the image to display in the cell.
*/
@NonNull
+ @Deprecated
public CellBuilder addLargeImage(@NonNull Icon image) {
- return addLargeImage(image, false /* isLoading */);
+ return addImage(image, LARGE_IMAGE, false /* isLoading */);
}
/**
@@ -278,9 +302,9 @@
* background or not.
*/
@NonNull
+ @Deprecated
public CellBuilder addLargeImage(@Nullable Icon image, boolean isLoading) {
- mImpl.addLargeImage(image, isLoading);
- return this;
+ return addImage(image, LARGE_IMAGE, isLoading);
}
/**
@@ -290,8 +314,9 @@
* @param image the image to display in the cell.
*/
@NonNull
+ @Deprecated
public CellBuilder addImage(@NonNull Icon image) {
- return addImage(image, false /* isLoading */);
+ return addImage(image, SMALL_IMAGE, false /* isLoading */);
}
/**
@@ -305,8 +330,47 @@
* background or not.
*/
@NonNull
+ @Deprecated
public CellBuilder addImage(@Nullable Icon image, boolean isLoading) {
- mImpl.addImage(image, isLoading);
+ return addImage(image, SMALL_IMAGE, isLoading);
+ }
+
+ /**
+ * Adds an image to the cell. There can be at most one image, the first one added will be
+ * used, others will be ignored.
+ *
+ * @param image the image to display in the cell.
+ * @param imageMode the mode that image should be displayed in.
+ *
+ * @see #ICON_IMAGE
+ * @see #SMALL_IMAGE
+ * @see #LARGE_IMAGE
+ */
+ @NonNull
+ public CellBuilder addImage(@NonNull Icon image, @ImageMode int imageMode) {
+ return addImage(image, imageMode, false /* isLoading */);
+ }
+
+ /**
+ * Adds an image to the cell. There can be at most one image, the first one added will be
+ * used, others will be ignored.
+ * <p>
+ * Use this method to specify content that will appear in the template once it's been
+ * loaded.
+ * </p>
+ * @param image the image to display in the cell.
+ * @param imageMode the mode that image should be displayed in.
+ * @param isLoading indicates whether the app is doing work to load the added content in the
+ * background or not.
+ *
+ * @see #ICON_IMAGE
+ * @see #SMALL_IMAGE
+ * @see #LARGE_IMAGE
+ */
+ @NonNull
+ public CellBuilder addImage(@Nullable Icon image, @ImageMode int imageMode,
+ boolean isLoading) {
+ mImpl.addImage(image, imageMode, isLoading);
return this;
}
diff --git a/slices/builders/src/main/java/androidx/app/slice/builders/impl/GridBuilder.java b/slices/builders/src/main/java/androidx/app/slice/builders/impl/GridBuilder.java
index 066304c..dfca415 100644
--- a/slices/builders/src/main/java/androidx/app/slice/builders/impl/GridBuilder.java
+++ b/slices/builders/src/main/java/androidx/app/slice/builders/impl/GridBuilder.java
@@ -116,33 +116,14 @@
void addTitleText(@Nullable CharSequence text, boolean isLoading);
/**
- * Adds an image to the cell that should be displayed as large as the cell allows.
- * There can be at most one image, the first one added will be used, others will be ignored.
- *
- * @param image the image to display in the cell.
- */
- @NonNull
- void addLargeImage(@NonNull Icon image);
-
- /**
- * Adds an image to the cell that should be displayed as large as the cell allows.
- * There can be at most one image, the first one added will be used, others will be ignored.
- * <p>
- * When set to true, the parameter {@code isLoading} indicates that the app is doing work
- * to load this content in the background, in this case the template displays a placeholder
- * until updated.
- */
- @NonNull
- void addLargeImage(@Nullable Icon image, boolean isLoading);
-
- /**
* Adds an image to the cell. There can be at most one image, the first one added
* will be used, others will be ignored.
*
* @param image the image to display in the cell.
+ * @param imageMode the mode that image should be displayed in.
*/
@NonNull
- void addImage(@NonNull Icon image);
+ void addImage(@NonNull Icon image, int imageMode);
/**
* Adds an image to the cell. There can be at most one image, the first one added
@@ -153,7 +134,7 @@
* until updated.l.
*/
@NonNull
- void addImage(@NonNull Icon image, boolean isLoading);
+ void addImage(@NonNull Icon image, int imageMode, boolean isLoading);
/**
* Sets the action to be invoked if the user taps on this cell in the row.
diff --git a/slices/builders/src/main/java/androidx/app/slice/builders/impl/GridBuilderBasicImpl.java b/slices/builders/src/main/java/androidx/app/slice/builders/impl/GridBuilderBasicImpl.java
index f0cb570..1b49050 100644
--- a/slices/builders/src/main/java/androidx/app/slice/builders/impl/GridBuilderBasicImpl.java
+++ b/slices/builders/src/main/java/androidx/app/slice/builders/impl/GridBuilderBasicImpl.java
@@ -135,28 +135,14 @@
*/
@NonNull
@Override
- public void addLargeImage(@NonNull Icon image) {
+ public void addImage(@NonNull Icon image, int imageMode) {
}
/**
*/
@NonNull
@Override
- public void addLargeImage(@Nullable Icon image, boolean isLoading) {
- }
-
- /**
- */
- @NonNull
- @Override
- public void addImage(@NonNull Icon image) {
- }
-
- /**
- */
- @NonNull
- @Override
- public void addImage(@Nullable Icon image, boolean isLoading) {
+ public void addImage(@Nullable Icon image, int imageMode, boolean isLoading) {
}
/**
diff --git a/slices/builders/src/main/java/androidx/app/slice/builders/impl/GridBuilderListV1Impl.java b/slices/builders/src/main/java/androidx/app/slice/builders/impl/GridBuilderListV1Impl.java
index 2856b9f..e116e08 100644
--- a/slices/builders/src/main/java/androidx/app/slice/builders/impl/GridBuilderListV1Impl.java
+++ b/slices/builders/src/main/java/androidx/app/slice/builders/impl/GridBuilderListV1Impl.java
@@ -19,12 +19,16 @@
import static android.app.slice.Slice.HINT_HORIZONTAL;
import static android.app.slice.Slice.HINT_LARGE;
import static android.app.slice.Slice.HINT_LIST_ITEM;
+import static android.app.slice.Slice.HINT_NO_TINT;
import static android.app.slice.Slice.HINT_PARTIAL;
import static android.app.slice.Slice.HINT_SEE_MORE;
import static android.app.slice.Slice.HINT_SHORTCUT;
import static android.app.slice.Slice.HINT_TITLE;
import static android.support.annotation.RestrictTo.Scope.LIBRARY;
+import static androidx.app.slice.builders.GridBuilder.ICON_IMAGE;
+import static androidx.app.slice.builders.GridBuilder.LARGE_IMAGE;
+
import android.app.PendingIntent;
import android.graphics.drawable.Icon;
import android.net.Uri;
@@ -32,6 +36,8 @@
import android.support.annotation.Nullable;
import android.support.annotation.RestrictTo;
+import java.util.ArrayList;
+
import androidx.app.slice.Slice;
import androidx.app.slice.builders.SliceAction;
@@ -179,37 +185,25 @@
*/
@NonNull
@Override
- public void addLargeImage(@NonNull Icon image) {
- addLargeImage(image, false /* isLoading */);
+ public void addImage(@NonNull Icon image, int imageMode) {
+ addImage(image, imageMode, false /* isLoading */);
}
/**
*/
@NonNull
@Override
- public void addLargeImage(@Nullable Icon image, boolean isLoading) {
- @Slice.SliceHint String[] hints = isLoading
- ? new String[] {HINT_PARTIAL, HINT_LARGE}
- : new String[] {HINT_LARGE};
- getBuilder().addIcon(image, null, hints);
- }
-
- /**
- */
- @NonNull
- @Override
- public void addImage(@NonNull Icon image) {
- addImage(image, false /* isLoading */);
- }
-
- /**
- */
- @NonNull
- @Override
- public void addImage(@Nullable Icon image, boolean isLoading) {
- @Slice.SliceHint String[] hints = isLoading
- ? new String[] {HINT_PARTIAL}
- : new String[0];
+ public void addImage(@Nullable Icon image, int imageMode, boolean isLoading) {
+ ArrayList<String> hints = new ArrayList<>();
+ if (imageMode != ICON_IMAGE) {
+ hints.add(HINT_NO_TINT);
+ }
+ if (imageMode == LARGE_IMAGE) {
+ hints.add(HINT_LARGE);
+ }
+ if (isLoading) {
+ hints.add(HINT_PARTIAL);
+ }
getBuilder().addIcon(image, null, hints);
}
diff --git a/slices/view/src/androidTest/java/androidx/app/slice/render/SliceCreator.java b/slices/view/src/androidTest/java/androidx/app/slice/render/SliceCreator.java
index a252b7f..546f1e3 100644
--- a/slices/view/src/androidTest/java/androidx/app/slice/render/SliceCreator.java
+++ b/slices/view/src/androidTest/java/androidx/app/slice/render/SliceCreator.java
@@ -105,23 +105,28 @@
GridBuilder gb = new GridBuilder(b);
gb.setPrimaryAction(primaryAction);
gb.addCell(new GridBuilder.CellBuilder(gb)
- .addLargeImage(Icon.createWithResource(getContext(), R.drawable.weather_1))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.weather_1),
+ GridBuilder.SMALL_IMAGE)
.addText("MON")
.addTitleText("69\u00B0"))
.addCell(new GridBuilder.CellBuilder(gb)
- .addLargeImage(Icon.createWithResource(getContext(), R.drawable.weather_2))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.weather_2),
+ GridBuilder.SMALL_IMAGE)
.addText("TUE")
.addTitleText("71\u00B0"))
.addCell(new GridBuilder.CellBuilder(gb)
- .addLargeImage(Icon.createWithResource(getContext(), R.drawable.weather_3))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.weather_3),
+ GridBuilder.SMALL_IMAGE)
.addText("WED")
.addTitleText("76\u00B0"))
.addCell(new GridBuilder.CellBuilder(gb)
- .addLargeImage(Icon.createWithResource(getContext(), R.drawable.weather_4))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.weather_4),
+ GridBuilder.SMALL_IMAGE)
.addText("THU")
.addTitleText("72\u00B0"))
.addCell(new GridBuilder.CellBuilder(gb)
- .addLargeImage(Icon.createWithResource(getContext(), R.drawable.weather_1))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.weather_1),
+ GridBuilder.SMALL_IMAGE)
.addText("FRI")
.addTitleText("68\u00B0"));
return b.addGrid(gb).build();
@@ -131,13 +136,17 @@
ListBuilder b = new ListBuilder(getContext(), sliceUri);
GridBuilder gb = new GridBuilder(b);
return gb.addCell(new GridBuilder.CellBuilder(gb)
- .addLargeImage(Icon.createWithResource(getContext(), R.drawable.slices_1)))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.slices_1),
+ GridBuilder.LARGE_IMAGE))
.addCell(new GridBuilder.CellBuilder(gb)
- .addLargeImage(Icon.createWithResource(getContext(), R.drawable.slices_2)))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.slices_2),
+ GridBuilder.LARGE_IMAGE))
.addCell(new GridBuilder.CellBuilder(gb)
- .addLargeImage(Icon.createWithResource(getContext(), R.drawable.slices_3)))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.slices_3),
+ GridBuilder.LARGE_IMAGE))
.addCell(new GridBuilder.CellBuilder(gb)
- .addLargeImage(Icon.createWithResource(getContext(), R.drawable.slices_4)))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.slices_4),
+ GridBuilder.LARGE_IMAGE))
.build();
}
@@ -152,19 +161,23 @@
.addEndItem(Icon.createWithResource(getContext(), R.drawable.mady)))
.addGrid(gb
.addCell(new GridBuilder.CellBuilder(gb)
- .addImage(Icon.createWithResource(getContext(), R.drawable.ic_call))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.ic_call),
+ GridBuilder.ICON_IMAGE)
.addText("Call")
.setContentIntent(getBroadcastIntent(ACTION_TOAST, "call")))
.addCell(new GridBuilder.CellBuilder(gb)
- .addImage(Icon.createWithResource(getContext(), R.drawable.ic_text))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.ic_text),
+ GridBuilder.ICON_IMAGE)
.addText("Text")
.setContentIntent(getBroadcastIntent(ACTION_TOAST, "text")))
.addCell(new GridBuilder.CellBuilder(gb)
- .addImage(Icon.createWithResource(getContext(), R.drawable.ic_video))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.ic_video),
+ GridBuilder.ICON_IMAGE)
.setContentIntent(getBroadcastIntent(ACTION_TOAST, "video"))
.addText("Video"))
.addCell(new GridBuilder.CellBuilder(gb)
- .addImage(Icon.createWithResource(getContext(), R.drawable.ic_email))
+ .addImage(Icon.createWithResource(getContext(), R.drawable.ic_email),
+ GridBuilder.ICON_IMAGE)
.addText("Email")
.setContentIntent(getBroadcastIntent(ACTION_TOAST, "email"))))
.build();