从 Lollipop 源代码中我可以看到图像大小为 128dp,参见 notification_template_material_big_media.xml on GitHub:
<!-- Layout to be used with only max 3 actions. It has a much larger picture at the left side-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/status_bar_latest_event_content"
android:layout_width="match_parent"
android:layout_height="128dp"
android:background="#00000000"
android:tag="bigMediaNarrow"
>
<ImageView android:id="@+id/icon"
android:layout_width="128dp"
android:layout_height="128dp"
android:scaleType="centerCrop"
/>
<!-- ...Nothing interesting for us futher... -->
</RelativeLayout>
这适用于带有 3 个或更少操作按钮的扩展布局。期待Notification.MediaStyle.getBigLayoutResource(int) on GrepCode,如果有更多按钮,似乎使用notification_template_material_big_media.xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/status_bar_latest_event_content"
android:layout_width="match_parent"
android:layout_height="128dp"
android:background="#00000000"
android:tag="bigMedia"
>
<include layout="@layout/notification_template_icon_group"
android:layout_width="@dimen/notification_large_icon_width"
android:layout_height="@dimen/notification_large_icon_height"
/>
<!-- ...Nothing interesting for us futher... -->
</RelativeLayout>
而notification_template_icon_group.xml 看起来像这样:
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:internal="http://schemas.android.com/apk/prv/res/android"
android:layout_width="@dimen/notification_large_icon_width"
android:layout_height="@dimen/notification_large_icon_height"
android:id="@+id/icon_group"
>
<ImageView android:id="@+id/icon"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:scaleType="centerInside"
/>
<ImageView android:id="@+id/right_icon"
android:layout_width="16dp"
android:layout_height="16dp"
android:padding="3dp"
android:layout_gravity="end|bottom"
android:scaleType="centerInside"
android:visibility="gone"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
/>
</FrameLayout>
您可以在.../res/values/dimens.xml中找到notification_large_icon_width和notification_large_icon_height:
<!-- The width of the big icons in notifications. -->
<dimen name="notification_large_icon_width">64dp</dimen>
<!-- The width of the big icons in notifications. -->
<dimen name="notification_large_icon_height">64dp</dimen>
所以最终的答案 - 128dp 用于扩展布局,带有 3 个或更少的操作按钮,如果超过 3 个,则为 64dp。