android.support.v4.app.NotificationCompat$Builder - Java
文章推薦指數: 80 %
setCustomContentView(notRemoteView) .setCustomBigContentView(bigNotRemoteView);
HowtousesetCustomBigContentViewmethodinandroid.support.v4.app.NotificationCompat$BuilderBestJavacodesnippetsusingandroid.support.v4.app.NotificationCompat$Builder.setCustomBigContentView(Showingtop8resultsoutof315)privateNotificationCompat.BuildercreateNotification(){
notRemoteView=newRemoteViews(BuildConfig.APPLICATION_ID,R.layout.player_notification);
bigNotRemoteView=newRemoteViews(BuildConfig.APPLICATION_ID,R.layout.player_notification_expanded);
setupNotification(notRemoteView);
setupNotification(bigNotRemoteView);
NotificationCompat.Builderbuilder=newNotificationCompat.Builder(this,getString(R.string.notification_channel_id))
.setOngoing(true)
.setSmallIcon(R.drawable.ic_newpipe_triangle_white)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setCustomContentView(notRemoteView)
.setCustomBigContentView(bigNotRemoteView);
if(android.os.Build.VERSION.SDK_INT>=android.os.Build.VERSION_CODES.JELLY_BEAN){
builder.setPriority(NotificationCompat.PRIORITY_MAX);
}
returnbuilder;
}
.addAction(notificationConfig.resDiscardButtonIcon(),notificationConfig.discardButtonText(),discardIntent)
.setCustomContentView(getSmallView(context,notificationConfig,sendIntent,discardIntent))
.setCustomBigContentView(bigView)
.setCustomHeadsUpContentView(bigView)
.setStyle(newNotificationCompat.DecoratedCustomViewStyle());
.setContentTitle("vkMusic")
.setContent(notificationViewSmall)
.setCustomBigContentView(notificationViewLarge)
.build();
notification.flags|=Notification.FLAG_NO_CLEAR;
builder.setCustomBigContentView(
buildBaseView(
context,
backgroundColor,mainColor,subColor));
}else{
builder.setCustomBigContentView(
buildBigView(
context,
.setSmallIcon(notificationIcon)
.setCustomContentView(remoteViews)
.setCustomBigContentView(remoteViewsExpanded)
.setVibrate(isVibrateEnabled(context))
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setVisibility(Notification.VISIBILITY_PUBLIC)
.setCustomContentView(smallContentView)
.setCustomBigContentView(expandedContentView)
.setContentIntent(PendingIntent.getActivity(context,0,notificationIntent,0))
.setPriority(NotificationCompat.PRIORITY_LOW).build();
notificationBuilder.setCustomBigContentView(mBigRemoteView);
publicSimpleNotificationBuildersetCustomBigContentView(RemoteViewscontentView){
mBuilder.setCustomBigContentView(contentView);
returnthis;
}
android.support.v4.appNotificationCompat$BuildersetCustomBigContentViewPopularmethodsofNotificationCompat$BuildersetSmallIconAvariantof#setSmallIcon(int)thattakesanadditionallevelparameterfor
whentheiconisaandrsetContentTitleSetthetitle(firstrow)ofthenotification,inastandardnotification.build
延伸文章資訊
- 1Notification.Builder.SetCustomBigContentView(RemoteViews ...
Learn more about the Android.App.Notification.Builder.SetCustomBigContentView in the Android.App ...
- 2android.support.v4.app.NotificationCompat$Builder - Java
setCustomContentView(notRemoteView) .setCustomBigContentView(bigNotRemoteView);
- 3Create custom big notification inflate - android - Stack Overflow
setCustomBigContentView(remoteViews) doesn't working? And why I cant use my custom TextView ? thi...
- 4How to create custom push notifications on Android 12
Provide custom view layouts with the setCustomContentView() and setCustomBigContentView() methods...
- 5RemoteViews在项目中遇到的问题 - 简书
setCustomBigContentView(remoteViews);// 默认高度256 超出则显示不全. 其中RemoteViews的布局最外层是这样,当我设置layout_height...