Merge "Address the Smartspace UI templates APIs review comments."
This commit is contained in:
committed by
Android (Google) Code Review
commit
bc86efa344
@@ -2174,23 +2174,41 @@ package android.app.smartspace {
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.app.smartspace.SmartspaceTarget> CREATOR;
|
||||
field public static final int FEATURE_ALARM = 7; // 0x7
|
||||
field public static final int FEATURE_BEDTIME_ROUTINE = 16; // 0x10
|
||||
field public static final int FEATURE_BLAZE_BUILD_PROGRESS = 40; // 0x28
|
||||
field public static final int FEATURE_CALENDAR = 2; // 0x2
|
||||
field public static final int FEATURE_COMMUTE_TIME = 3; // 0x3
|
||||
field public static final int FEATURE_CONSENT = 11; // 0xb
|
||||
field public static final int FEATURE_CROSS_DEVICE_TIMER = 32; // 0x20
|
||||
field public static final int FEATURE_DOORBELL = 30; // 0x1e
|
||||
field public static final int FEATURE_DRIVING_MODE = 26; // 0x1a
|
||||
field public static final int FEATURE_EARTHQUAKE_ALERT = 38; // 0x26
|
||||
field public static final int FEATURE_EARTHQUAKE_OCCURRED = 41; // 0x29
|
||||
field public static final int FEATURE_ETA_MONITORING = 18; // 0x12
|
||||
field public static final int FEATURE_FITNESS_TRACKING = 17; // 0x11
|
||||
field public static final int FEATURE_FLASHLIGHT = 28; // 0x1c
|
||||
field public static final int FEATURE_FLIGHT = 4; // 0x4
|
||||
field public static final int FEATURE_GAS_STATION_PAYMENT = 24; // 0x18
|
||||
field public static final int FEATURE_HOLIDAY_ALARM = 34; // 0x22
|
||||
field public static final int FEATURE_LOYALTY_CARD = 14; // 0xe
|
||||
field public static final int FEATURE_MEDIA = 15; // 0xf
|
||||
field public static final int FEATURE_MEDIA_HEADS_UP = 36; // 0x24
|
||||
field public static final int FEATURE_MEDIA_RESUME = 31; // 0x1f
|
||||
field public static final int FEATURE_MISSED_CALL = 19; // 0x13
|
||||
field public static final int FEATURE_ONBOARDING = 8; // 0x8
|
||||
field public static final int FEATURE_PACKAGE_TRACKING = 20; // 0x14
|
||||
field public static final int FEATURE_PAIRED_DEVICE_STATE = 25; // 0x19
|
||||
field public static final int FEATURE_REMINDER = 6; // 0x6
|
||||
field public static final int FEATURE_SAFETY_CHECK = 35; // 0x23
|
||||
field public static final int FEATURE_SEVERE_WEATHER_ALERT = 33; // 0x21
|
||||
field public static final int FEATURE_SHOPPING_LIST = 13; // 0xd
|
||||
field public static final int FEATURE_SLEEP_SUMMARY = 27; // 0x1b
|
||||
field public static final int FEATURE_SPORTS = 9; // 0x9
|
||||
field public static final int FEATURE_STEP_COUNTING = 37; // 0x25
|
||||
field public static final int FEATURE_STEP_DATE = 39; // 0x27
|
||||
field public static final int FEATURE_STOCK_PRICE_CHANGE = 12; // 0xc
|
||||
field public static final int FEATURE_STOPWATCH = 22; // 0x16
|
||||
field public static final int FEATURE_TIMER = 21; // 0x15
|
||||
field public static final int FEATURE_TIME_TO_LEAVE = 29; // 0x1d
|
||||
field public static final int FEATURE_TIPS = 5; // 0x5
|
||||
field public static final int FEATURE_UNDEFINED = 0; // 0x0
|
||||
field public static final int FEATURE_UPCOMING_ALARM = 23; // 0x17
|
||||
@@ -2256,22 +2274,12 @@ package android.app.smartspace.uitemplatedata {
|
||||
public class BaseTemplateData implements android.os.Parcelable {
|
||||
method public int describeContents();
|
||||
method public int getLayoutWeight();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemLoggingInfo getPrimaryLoggingInfo();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.TapAction getPrimaryTapAction();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.Icon getSubtitleIcon();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.Text getSubtitleText();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.Text getSupplementalAlarmText();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.Icon getSupplementalIcon();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemLoggingInfo getSupplementalLoggingInfo();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.Icon getSupplementalSubtitleIcon();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemLoggingInfo getSupplementalSubtitleLoggingInfo();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.TapAction getSupplementalSubtitleTapAction();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.Text getSupplementalSubtitleText();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.TapAction getSupplementalTapAction();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.Text getSupplementalText();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo getPrimaryItem();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo getSubtitleItem();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo getSubtitleSupplementalItem();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo getSupplementalAlarmItem();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo getSupplementalLineItem();
|
||||
method public int getTemplateType();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.Icon getTitleIcon();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.Text getTitleText();
|
||||
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.app.smartspace.uitemplatedata.BaseTemplateData> CREATOR;
|
||||
}
|
||||
@@ -2280,27 +2288,37 @@ package android.app.smartspace.uitemplatedata {
|
||||
ctor public BaseTemplateData.Builder(int);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData build();
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setLayoutWeight(int);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setPrimaryLoggingInfo(@NonNull android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemLoggingInfo);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setPrimaryTapAction(@NonNull android.app.smartspace.uitemplatedata.TapAction);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSubtitleIcon(@NonNull android.app.smartspace.uitemplatedata.Icon);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSubtitleText(@NonNull android.app.smartspace.uitemplatedata.Text);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSupplementalAlarmText(@NonNull android.app.smartspace.uitemplatedata.Text);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSupplementalIcon(@NonNull android.app.smartspace.uitemplatedata.Icon);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSupplementalLoggingInfo(@NonNull android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemLoggingInfo);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSupplementalSubtitleIcon(@NonNull android.app.smartspace.uitemplatedata.Icon);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSupplementalSubtitleLoggingInfo(@NonNull android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemLoggingInfo);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSupplementalSubtitleTapAction(@NonNull android.app.smartspace.uitemplatedata.TapAction);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSupplementalSubtitleText(@NonNull android.app.smartspace.uitemplatedata.Text);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSupplementalTapAction(@NonNull android.app.smartspace.uitemplatedata.TapAction);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSupplementalText(@NonNull android.app.smartspace.uitemplatedata.Text);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setTitleIcon(@NonNull android.app.smartspace.uitemplatedata.Icon);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setTitleText(@NonNull android.app.smartspace.uitemplatedata.Text);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setPrimaryItem(@NonNull android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSubtitleItem(@NonNull android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSubtitleSupplementalItem(@NonNull android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSupplementalAlarmItem(@NonNull android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSupplementalLineItem(@NonNull android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo);
|
||||
}
|
||||
|
||||
public static final class BaseTemplateData.SubItemInfo implements android.os.Parcelable {
|
||||
method public int describeContents();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.Icon getIcon();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemLoggingInfo getLoggingInfo();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.TapAction getTapAction();
|
||||
method @Nullable public android.app.smartspace.uitemplatedata.Text getText();
|
||||
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo> CREATOR;
|
||||
}
|
||||
|
||||
public static final class BaseTemplateData.SubItemInfo.Builder {
|
||||
ctor public BaseTemplateData.SubItemInfo.Builder();
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo build();
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo.Builder setIcon(@NonNull android.app.smartspace.uitemplatedata.Icon);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo.Builder setLoggingInfo(@NonNull android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemLoggingInfo);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo.Builder setTapAction(@NonNull android.app.smartspace.uitemplatedata.TapAction);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo.Builder setText(@NonNull android.app.smartspace.uitemplatedata.Text);
|
||||
}
|
||||
|
||||
public static final class BaseTemplateData.SubItemLoggingInfo implements android.os.Parcelable {
|
||||
method public int describeContents();
|
||||
method public int getFeatureType();
|
||||
method public int getInstanceId();
|
||||
method @Nullable public CharSequence getPackageName();
|
||||
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemLoggingInfo> CREATOR;
|
||||
}
|
||||
@@ -2308,6 +2326,7 @@ package android.app.smartspace.uitemplatedata {
|
||||
public static final class BaseTemplateData.SubItemLoggingInfo.Builder {
|
||||
ctor public BaseTemplateData.SubItemLoggingInfo.Builder(int, int);
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemLoggingInfo build();
|
||||
method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemLoggingInfo.Builder setPackageName(@NonNull CharSequence);
|
||||
}
|
||||
|
||||
public final class CarouselTemplateData extends android.app.smartspace.uitemplatedata.BaseTemplateData {
|
||||
|
||||
@@ -159,6 +159,24 @@ public final class SmartspaceTarget implements Parcelable {
|
||||
public static final int FEATURE_TIMER = 21;
|
||||
public static final int FEATURE_STOPWATCH = 22;
|
||||
public static final int FEATURE_UPCOMING_ALARM = 23;
|
||||
public static final int FEATURE_GAS_STATION_PAYMENT = 24;
|
||||
public static final int FEATURE_PAIRED_DEVICE_STATE = 25;
|
||||
public static final int FEATURE_DRIVING_MODE = 26;
|
||||
public static final int FEATURE_SLEEP_SUMMARY = 27;
|
||||
public static final int FEATURE_FLASHLIGHT = 28;
|
||||
public static final int FEATURE_TIME_TO_LEAVE = 29;
|
||||
public static final int FEATURE_DOORBELL = 30;
|
||||
public static final int FEATURE_MEDIA_RESUME = 31;
|
||||
public static final int FEATURE_CROSS_DEVICE_TIMER = 32;
|
||||
public static final int FEATURE_SEVERE_WEATHER_ALERT = 33;
|
||||
public static final int FEATURE_HOLIDAY_ALARM = 34;
|
||||
public static final int FEATURE_SAFETY_CHECK = 35;
|
||||
public static final int FEATURE_MEDIA_HEADS_UP = 36;
|
||||
public static final int FEATURE_STEP_COUNTING = 37;
|
||||
public static final int FEATURE_EARTHQUAKE_ALERT = 38;
|
||||
public static final int FEATURE_STEP_DATE = 39;
|
||||
public static final int FEATURE_BLAZE_BUILD_PROGRESS = 40;
|
||||
public static final int FEATURE_EARTHQUAKE_OCCURRED = 41;
|
||||
|
||||
/**
|
||||
* @hide
|
||||
@@ -187,7 +205,25 @@ public final class SmartspaceTarget implements Parcelable {
|
||||
FEATURE_PACKAGE_TRACKING,
|
||||
FEATURE_TIMER,
|
||||
FEATURE_STOPWATCH,
|
||||
FEATURE_UPCOMING_ALARM
|
||||
FEATURE_UPCOMING_ALARM,
|
||||
FEATURE_GAS_STATION_PAYMENT,
|
||||
FEATURE_PAIRED_DEVICE_STATE,
|
||||
FEATURE_DRIVING_MODE,
|
||||
FEATURE_SLEEP_SUMMARY,
|
||||
FEATURE_FLASHLIGHT,
|
||||
FEATURE_TIME_TO_LEAVE,
|
||||
FEATURE_DOORBELL,
|
||||
FEATURE_MEDIA_RESUME,
|
||||
FEATURE_CROSS_DEVICE_TIMER,
|
||||
FEATURE_SEVERE_WEATHER_ALERT,
|
||||
FEATURE_HOLIDAY_ALARM,
|
||||
FEATURE_SAFETY_CHECK,
|
||||
FEATURE_MEDIA_HEADS_UP,
|
||||
FEATURE_STEP_COUNTING,
|
||||
FEATURE_EARTHQUAKE_ALERT,
|
||||
FEATURE_STEP_DATE,
|
||||
FEATURE_BLAZE_BUILD_PROGRESS,
|
||||
FEATURE_EARTHQUAKE_OCCURRED
|
||||
})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface FeatureType {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -56,31 +56,16 @@ public final class CarouselTemplateData extends BaseTemplateData {
|
||||
}
|
||||
|
||||
private CarouselTemplateData(@SmartspaceTarget.UiTemplateType int templateType,
|
||||
@Nullable Text titleText,
|
||||
@Nullable Icon titleIcon,
|
||||
@Nullable Text subtitleText,
|
||||
@Nullable Icon subtitleIcon,
|
||||
@Nullable TapAction primaryTapAction,
|
||||
@Nullable SubItemLoggingInfo primaryLoggingInfo,
|
||||
@Nullable Text supplementalSubtitleText,
|
||||
@Nullable Icon supplementalSubtitleIcon,
|
||||
@Nullable TapAction supplementalSubtitleTapAction,
|
||||
@Nullable SubItemLoggingInfo supplementalSubtitleLoggingInfo,
|
||||
@Nullable Text supplementalText,
|
||||
@Nullable Icon supplementalIcon,
|
||||
@Nullable TapAction supplementalTapAction,
|
||||
@Nullable SubItemLoggingInfo supplementalLoggingInfo,
|
||||
@Nullable Text supplementalAlarmText,
|
||||
@Nullable SubItemInfo primaryItem,
|
||||
@Nullable SubItemInfo subtitleItem,
|
||||
@Nullable SubItemInfo subtitleSupplementalItem,
|
||||
@Nullable SubItemInfo supplementalLineItem,
|
||||
@Nullable SubItemInfo supplementalAlarmItem,
|
||||
int layoutWeight,
|
||||
@NonNull List<CarouselItem> carouselItems,
|
||||
@Nullable TapAction carouselAction) {
|
||||
super(templateType, titleText, titleIcon, subtitleText, subtitleIcon,
|
||||
primaryTapAction, primaryLoggingInfo,
|
||||
supplementalSubtitleText, supplementalSubtitleIcon,
|
||||
supplementalSubtitleTapAction, supplementalSubtitleLoggingInfo,
|
||||
supplementalText, supplementalIcon,
|
||||
supplementalTapAction, supplementalLoggingInfo,
|
||||
supplementalAlarmText, layoutWeight);
|
||||
super(templateType, primaryItem, subtitleItem, subtitleSupplementalItem,
|
||||
supplementalLineItem, supplementalAlarmItem, layoutWeight);
|
||||
|
||||
mCarouselItems = carouselItems;
|
||||
mCarouselAction = carouselAction;
|
||||
@@ -190,14 +175,9 @@ public final class CarouselTemplateData extends BaseTemplateData {
|
||||
throw new IllegalStateException("Carousel data is empty");
|
||||
}
|
||||
|
||||
return new CarouselTemplateData(getTemplateType(), getTitleText(),
|
||||
getTitleIcon(), getSubtitleText(), getSubtitleIcon(),
|
||||
getPrimaryTapAction(), getPrimaryLoggingInfo(),
|
||||
getSupplementalSubtitleText(), getSupplementalSubtitleIcon(),
|
||||
getSupplementalSubtitleTapAction(), getSupplementalSubtitleLoggingInfo(),
|
||||
getSupplementalText(), getSupplementalIcon(),
|
||||
getSupplementalTapAction(), getSupplementalLoggingInfo(),
|
||||
getSupplementalAlarmText(), getLayoutWeight(),
|
||||
return new CarouselTemplateData(getTemplateType(), getPrimaryItem(),
|
||||
getSubtitleItem(), getSubtitleSupplemtnalItem(),
|
||||
getSupplementalLineItem(), getSupplementalAlarmItem(), getLayoutWeight(),
|
||||
mCarouselItems, mCarouselAction);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,30 +51,16 @@ public final class CombinedCardsTemplateData extends BaseTemplateData {
|
||||
}
|
||||
|
||||
private CombinedCardsTemplateData(@SmartspaceTarget.UiTemplateType int templateType,
|
||||
@Nullable Text titleText,
|
||||
@Nullable Icon titleIcon,
|
||||
@Nullable Text subtitleText,
|
||||
@Nullable Icon subtitleIcon,
|
||||
@Nullable TapAction primaryTapAction,
|
||||
@Nullable SubItemLoggingInfo primaryLoggingInfo,
|
||||
@Nullable Text supplementalSubtitleText,
|
||||
@Nullable Icon supplementalSubtitleIcon,
|
||||
@Nullable TapAction supplementalSubtitleTapAction,
|
||||
@Nullable SubItemLoggingInfo supplementalSubtitleLoggingInfo,
|
||||
@Nullable Text supplementalText,
|
||||
@Nullable Icon supplementalIcon,
|
||||
@Nullable TapAction supplementalTapAction,
|
||||
@Nullable SubItemLoggingInfo supplementalLoggingInfo,
|
||||
@Nullable Text supplementalAlarmText,
|
||||
@Nullable SubItemInfo primaryItem,
|
||||
@Nullable SubItemInfo subtitleItem,
|
||||
@Nullable SubItemInfo subtitleSupplementalItem,
|
||||
@Nullable SubItemInfo supplementalLineItem,
|
||||
@Nullable SubItemInfo supplementalAlarmItem,
|
||||
int layoutWeight,
|
||||
@NonNull List<BaseTemplateData> combinedCardDataList) {
|
||||
super(templateType, titleText, titleIcon, subtitleText, subtitleIcon,
|
||||
primaryTapAction, primaryLoggingInfo,
|
||||
supplementalSubtitleText, supplementalSubtitleIcon,
|
||||
supplementalSubtitleTapAction, supplementalSubtitleLoggingInfo,
|
||||
supplementalText, supplementalIcon,
|
||||
supplementalTapAction, supplementalLoggingInfo,
|
||||
supplementalAlarmText, layoutWeight);
|
||||
super(templateType, primaryItem, subtitleItem, subtitleSupplementalItem,
|
||||
supplementalLineItem, supplementalAlarmItem, layoutWeight);
|
||||
|
||||
mCombinedCardDataList = combinedCardDataList;
|
||||
}
|
||||
|
||||
@@ -161,14 +147,9 @@ public final class CombinedCardsTemplateData extends BaseTemplateData {
|
||||
if (mCombinedCardDataList == null) {
|
||||
throw new IllegalStateException("Please assign a value to all @NonNull args.");
|
||||
}
|
||||
return new CombinedCardsTemplateData(getTemplateType(), getTitleText(),
|
||||
getTitleIcon(), getSubtitleText(), getSubtitleIcon(),
|
||||
getPrimaryTapAction(), getPrimaryLoggingInfo(),
|
||||
getSupplementalSubtitleText(), getSupplementalSubtitleIcon(),
|
||||
getSupplementalSubtitleTapAction(), getSupplementalSubtitleLoggingInfo(),
|
||||
getSupplementalText(), getSupplementalIcon(),
|
||||
getSupplementalTapAction(), getSupplementalLoggingInfo(),
|
||||
getSupplementalAlarmText(), getLayoutWeight(),
|
||||
return new CombinedCardsTemplateData(getTemplateType(), getPrimaryItem(),
|
||||
getSubtitleItem(), getSubtitleSupplemtnalItem(),
|
||||
getSupplementalLineItem(), getSupplementalAlarmItem(), getLayoutWeight(),
|
||||
mCombinedCardDataList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,21 +66,11 @@ public final class HeadToHeadTemplateData extends BaseTemplateData {
|
||||
}
|
||||
|
||||
private HeadToHeadTemplateData(@SmartspaceTarget.UiTemplateType int templateType,
|
||||
@Nullable Text titleText,
|
||||
@Nullable Icon titleIcon,
|
||||
@Nullable Text subtitleText,
|
||||
@Nullable Icon subtitleIcon,
|
||||
@Nullable TapAction primaryTapAction,
|
||||
@Nullable SubItemLoggingInfo primaryLoggingInfo,
|
||||
@Nullable Text supplementalSubtitleText,
|
||||
@Nullable Icon supplementalSubtitleIcon,
|
||||
@Nullable TapAction supplementalSubtitleTapAction,
|
||||
@Nullable SubItemLoggingInfo supplementalSubtitleLoggingInfo,
|
||||
@Nullable Text supplementalText,
|
||||
@Nullable Icon supplementalIcon,
|
||||
@Nullable TapAction supplementalTapAction,
|
||||
@Nullable SubItemLoggingInfo supplementalLoggingInfo,
|
||||
@Nullable Text supplementalAlarmText,
|
||||
@Nullable SubItemInfo primaryItem,
|
||||
@Nullable SubItemInfo subtitleItem,
|
||||
@Nullable SubItemInfo subtitleSupplementalItem,
|
||||
@Nullable SubItemInfo supplementalLineItem,
|
||||
@Nullable SubItemInfo supplementalAlarmItem,
|
||||
int layoutWeight,
|
||||
@Nullable Text headToHeadTitle,
|
||||
@Nullable Icon headToHeadFirstCompetitorIcon,
|
||||
@@ -88,13 +78,8 @@ public final class HeadToHeadTemplateData extends BaseTemplateData {
|
||||
@Nullable Text headToHeadFirstCompetitorText,
|
||||
@Nullable Text headToHeadSecondCompetitorText,
|
||||
@Nullable TapAction headToHeadAction) {
|
||||
super(templateType, titleText, titleIcon, subtitleText, subtitleIcon,
|
||||
primaryTapAction, primaryLoggingInfo,
|
||||
supplementalSubtitleText, supplementalSubtitleIcon,
|
||||
supplementalSubtitleTapAction, supplementalSubtitleLoggingInfo,
|
||||
supplementalText, supplementalIcon,
|
||||
supplementalTapAction, supplementalLoggingInfo,
|
||||
supplementalAlarmText, layoutWeight);
|
||||
super(templateType, primaryItem, subtitleItem, subtitleSupplementalItem,
|
||||
supplementalLineItem, supplementalAlarmItem, layoutWeight);
|
||||
|
||||
mHeadToHeadTitle = headToHeadTitle;
|
||||
mHeadToHeadFirstCompetitorIcon = headToHeadFirstCompetitorIcon;
|
||||
@@ -296,14 +281,9 @@ public final class HeadToHeadTemplateData extends BaseTemplateData {
|
||||
*/
|
||||
@NonNull
|
||||
public HeadToHeadTemplateData build() {
|
||||
return new HeadToHeadTemplateData(getTemplateType(), getTitleText(),
|
||||
getTitleIcon(), getSubtitleText(), getSubtitleIcon(),
|
||||
getPrimaryTapAction(), getPrimaryLoggingInfo(),
|
||||
getSupplementalSubtitleText(), getSupplementalSubtitleIcon(),
|
||||
getSupplementalSubtitleTapAction(), getSupplementalSubtitleLoggingInfo(),
|
||||
getSupplementalText(), getSupplementalIcon(),
|
||||
getSupplementalTapAction(), getSupplementalLoggingInfo(),
|
||||
getSupplementalAlarmText(), getLayoutWeight(),
|
||||
return new HeadToHeadTemplateData(getTemplateType(), getPrimaryItem(),
|
||||
getSubtitleItem(), getSubtitleSupplemtnalItem(),
|
||||
getSupplementalLineItem(), getSupplementalAlarmItem(), getLayoutWeight(),
|
||||
mHeadToHeadTitle,
|
||||
mHeadToHeadFirstCompetitorIcon,
|
||||
mHeadToHeadSecondCompetitorIcon, mHeadToHeadFirstCompetitorText,
|
||||
|
||||
@@ -59,32 +59,17 @@ public final class SubCardTemplateData extends BaseTemplateData {
|
||||
}
|
||||
|
||||
private SubCardTemplateData(int templateType,
|
||||
@Nullable Text titleText,
|
||||
@Nullable Icon titleIcon,
|
||||
@Nullable Text subtitleText,
|
||||
@Nullable Icon subtitleIcon,
|
||||
@Nullable TapAction primaryTapAction,
|
||||
@Nullable SubItemLoggingInfo primaryLoggingInfo,
|
||||
@Nullable Text supplementalSubtitleText,
|
||||
@Nullable Icon supplementalSubtitleIcon,
|
||||
@Nullable TapAction supplementalSubtitleTapAction,
|
||||
@Nullable SubItemLoggingInfo supplementalSubtitleLoggingInfo,
|
||||
@Nullable Text supplementalText,
|
||||
@Nullable Icon supplementalIcon,
|
||||
@Nullable TapAction supplementalTapAction,
|
||||
@Nullable SubItemLoggingInfo supplementalLoggingInfo,
|
||||
@Nullable Text supplementalAlarmText,
|
||||
@Nullable SubItemInfo primaryItem,
|
||||
@Nullable SubItemInfo subtitleItem,
|
||||
@Nullable SubItemInfo subtitleSupplementalItem,
|
||||
@Nullable SubItemInfo supplementalLineItem,
|
||||
@Nullable SubItemInfo supplementalAlarmItem,
|
||||
int layoutWeight,
|
||||
@NonNull Icon subCardIcon,
|
||||
@Nullable Text subCardText,
|
||||
@Nullable TapAction subCardAction) {
|
||||
super(templateType, titleText, titleIcon, subtitleText, subtitleIcon,
|
||||
primaryTapAction, primaryLoggingInfo,
|
||||
supplementalSubtitleText, supplementalSubtitleIcon,
|
||||
supplementalSubtitleTapAction, supplementalSubtitleLoggingInfo,
|
||||
supplementalText, supplementalIcon,
|
||||
supplementalTapAction, supplementalLoggingInfo,
|
||||
supplementalAlarmText, layoutWeight);
|
||||
super(templateType, primaryItem, subtitleItem, subtitleSupplementalItem,
|
||||
supplementalLineItem, supplementalAlarmItem, layoutWeight);
|
||||
|
||||
mSubCardIcon = subCardIcon;
|
||||
mSubCardText = subCardText;
|
||||
@@ -207,14 +192,9 @@ public final class SubCardTemplateData extends BaseTemplateData {
|
||||
*/
|
||||
@NonNull
|
||||
public SubCardTemplateData build() {
|
||||
return new SubCardTemplateData(getTemplateType(), getTitleText(),
|
||||
getTitleIcon(), getSubtitleText(), getSubtitleIcon(),
|
||||
getPrimaryTapAction(), getPrimaryLoggingInfo(),
|
||||
getSupplementalSubtitleText(), getSupplementalSubtitleIcon(),
|
||||
getSupplementalSubtitleTapAction(), getSupplementalSubtitleLoggingInfo(),
|
||||
getSupplementalText(), getSupplementalIcon(),
|
||||
getSupplementalTapAction(), getSupplementalLoggingInfo(),
|
||||
getSupplementalAlarmText(), getLayoutWeight(),
|
||||
return new SubCardTemplateData(getTemplateType(), getPrimaryItem(),
|
||||
getSubtitleItem(), getSubtitleSupplemtnalItem(),
|
||||
getSupplementalLineItem(), getSupplementalAlarmItem(), getLayoutWeight(),
|
||||
mSubCardIcon,
|
||||
mSubCardText,
|
||||
mSubCardAction);
|
||||
|
||||
@@ -60,32 +60,17 @@ public final class SubImageTemplateData extends BaseTemplateData {
|
||||
}
|
||||
|
||||
private SubImageTemplateData(@SmartspaceTarget.UiTemplateType int templateType,
|
||||
@Nullable Text titleText,
|
||||
@Nullable Icon titleIcon,
|
||||
@Nullable Text subtitleText,
|
||||
@Nullable Icon subtitleIcon,
|
||||
@Nullable TapAction primaryTapAction,
|
||||
@Nullable SubItemLoggingInfo primaryLoggingInfo,
|
||||
@Nullable Text supplementalSubtitleText,
|
||||
@Nullable Icon supplementalSubtitleIcon,
|
||||
@Nullable TapAction supplementalSubtitleTapAction,
|
||||
@Nullable SubItemLoggingInfo supplementalSubtitleLoggingInfo,
|
||||
@Nullable Text supplementalText,
|
||||
@Nullable Icon supplementalIcon,
|
||||
@Nullable TapAction supplementalTapAction,
|
||||
@Nullable SubItemLoggingInfo supplementalLoggingInfo,
|
||||
@Nullable Text supplementalAlarmText,
|
||||
@Nullable SubItemInfo primaryItem,
|
||||
@Nullable SubItemInfo subtitleItem,
|
||||
@Nullable SubItemInfo subtitleSupplementalItem,
|
||||
@Nullable SubItemInfo supplementalLineItem,
|
||||
@Nullable SubItemInfo supplementalAlarmItem,
|
||||
int layoutWeight,
|
||||
@NonNull List<Text> subImageTexts,
|
||||
@NonNull List<Icon> subImages,
|
||||
@Nullable TapAction subImageAction) {
|
||||
super(templateType, titleText, titleIcon, subtitleText, subtitleIcon,
|
||||
primaryTapAction, primaryLoggingInfo,
|
||||
supplementalSubtitleText, supplementalSubtitleIcon,
|
||||
supplementalSubtitleTapAction, supplementalSubtitleLoggingInfo,
|
||||
supplementalText, supplementalIcon,
|
||||
supplementalTapAction, supplementalLoggingInfo,
|
||||
supplementalAlarmText, layoutWeight);
|
||||
super(templateType, primaryItem, subtitleItem, subtitleSupplementalItem,
|
||||
supplementalLineItem, supplementalAlarmItem, layoutWeight);
|
||||
|
||||
mSubImageTexts = subImageTexts;
|
||||
mSubImages = subImages;
|
||||
@@ -204,14 +189,9 @@ public final class SubImageTemplateData extends BaseTemplateData {
|
||||
*/
|
||||
@NonNull
|
||||
public SubImageTemplateData build() {
|
||||
return new SubImageTemplateData(getTemplateType(), getTitleText(),
|
||||
getTitleIcon(), getSubtitleText(), getSubtitleIcon(),
|
||||
getPrimaryTapAction(), getPrimaryLoggingInfo(),
|
||||
getSupplementalSubtitleText(), getSupplementalSubtitleIcon(),
|
||||
getSupplementalSubtitleTapAction(), getSupplementalSubtitleLoggingInfo(),
|
||||
getSupplementalText(), getSupplementalIcon(),
|
||||
getSupplementalTapAction(), getSupplementalLoggingInfo(),
|
||||
getSupplementalAlarmText(), getLayoutWeight(),
|
||||
return new SubImageTemplateData(getTemplateType(), getPrimaryItem(),
|
||||
getSubtitleItem(), getSubtitleSupplemtnalItem(),
|
||||
getSupplementalLineItem(), getSupplementalAlarmItem(), getLayoutWeight(),
|
||||
mSubImageTexts,
|
||||
mSubImages,
|
||||
mSubImageAction);
|
||||
|
||||
@@ -59,32 +59,17 @@ public final class SubListTemplateData extends BaseTemplateData {
|
||||
}
|
||||
|
||||
private SubListTemplateData(@SmartspaceTarget.UiTemplateType int templateType,
|
||||
@Nullable Text titleText,
|
||||
@Nullable Icon titleIcon,
|
||||
@Nullable Text subtitleText,
|
||||
@Nullable Icon subtitleIcon,
|
||||
@Nullable TapAction primaryTapAction,
|
||||
@Nullable SubItemLoggingInfo primaryLoggingInfo,
|
||||
@Nullable Text supplementalSubtitleText,
|
||||
@Nullable Icon supplementalSubtitleIcon,
|
||||
@Nullable TapAction supplementalSubtitleTapAction,
|
||||
@Nullable SubItemLoggingInfo supplementalSubtitleLoggingInfo,
|
||||
@Nullable Text supplementalText,
|
||||
@Nullable Icon supplementalIcon,
|
||||
@Nullable TapAction supplementalTapAction,
|
||||
@Nullable SubItemLoggingInfo supplementalLoggingInfo,
|
||||
@Nullable Text supplementalAlarmText,
|
||||
@Nullable SubItemInfo primaryItem,
|
||||
@Nullable SubItemInfo subtitleItem,
|
||||
@Nullable SubItemInfo subtitleSupplementalItem,
|
||||
@Nullable SubItemInfo supplementalLineItem,
|
||||
@Nullable SubItemInfo supplementalAlarmItem,
|
||||
int layoutWeight,
|
||||
@Nullable Icon subListIcon,
|
||||
@NonNull List<Text> subListTexts,
|
||||
@Nullable TapAction subListAction) {
|
||||
super(templateType, titleText, titleIcon, subtitleText, subtitleIcon,
|
||||
primaryTapAction, primaryLoggingInfo,
|
||||
supplementalSubtitleText, supplementalSubtitleIcon,
|
||||
supplementalSubtitleTapAction, supplementalSubtitleLoggingInfo,
|
||||
supplementalText, supplementalIcon,
|
||||
supplementalTapAction, supplementalLoggingInfo,
|
||||
supplementalAlarmText, layoutWeight);
|
||||
super(templateType, primaryItem, subtitleItem, subtitleSupplementalItem,
|
||||
supplementalLineItem, supplementalAlarmItem, layoutWeight);
|
||||
|
||||
mSubListIcon = subListIcon;
|
||||
mSubListTexts = subListTexts;
|
||||
@@ -207,14 +192,9 @@ public final class SubListTemplateData extends BaseTemplateData {
|
||||
*/
|
||||
@NonNull
|
||||
public SubListTemplateData build() {
|
||||
return new SubListTemplateData(getTemplateType(), getTitleText(),
|
||||
getTitleIcon(), getSubtitleText(), getSubtitleIcon(),
|
||||
getPrimaryTapAction(), getPrimaryLoggingInfo(),
|
||||
getSupplementalSubtitleText(), getSupplementalSubtitleIcon(),
|
||||
getSupplementalSubtitleTapAction(), getSupplementalSubtitleLoggingInfo(),
|
||||
getSupplementalText(), getSupplementalIcon(),
|
||||
getSupplementalTapAction(), getSupplementalLoggingInfo(),
|
||||
getSupplementalAlarmText(), getLayoutWeight(),
|
||||
return new SubListTemplateData(getTemplateType(), getPrimaryItem(),
|
||||
getSubtitleItem(), getSubtitleSupplemtnalItem(),
|
||||
getSupplementalLineItem(), getSupplementalAlarmItem(), getLayoutWeight(),
|
||||
mSubListIcon,
|
||||
mSubListTexts,
|
||||
mSubListAction);
|
||||
|
||||
@@ -109,6 +109,15 @@ public final class Text implements Parcelable {
|
||||
out.writeInt(mMaxLines);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Text{"
|
||||
+ "mText=" + mText
|
||||
+ ", mTruncateAtType=" + mTruncateAtType
|
||||
+ ", mMaxLines=" + mMaxLines
|
||||
+ '}';
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder for {@link Text} object.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user