android.support.v4.app.NotificationCompat$Builder - Java

文章推薦指數: 80 %
投票人數:10人

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.buildsetContentTextSetthetext(secondrow)ofthenotification,inastandardnotification.setContentIntentSupplyaPendingIntenttosendwhenthenotificationisclicked.Ifyoudonot supplyanintent,yousetAutoCancelSettingthisflagwillmakeitsothenotificationisautomaticallycanceled whentheuserclicksitsetOngoingSetwhetherthisisanongoingnotification.Ongoingnotificationsdifferfrom regularnotificationssetPrioritySettherelativepriorityforthisnotification.Priorityisanindicationof howmuchoftheuser'saddActionsetTickerSetthetextthatisdisplayedinthestatusbarwhenthenotificationfirst arrives,andalsoaRemsetLargeIconSetthelargeiconthatisshowninthetickerandnotification.setTicker,setLargeIcon,setStyle,setWhen,setColor,setDefaults,setProgress,setSound,setVisibility,setVibratePopularinJavaMakinghttprequestsusingokhttpgetApplicationContext(Context)getResourceAsStream(ClassLoader)onCreateOptionsMenu(Activity)Locale(java.util)Localerepresentsalanguage/country/variantcombination.Localesareusedto alterthepresentatioResourceBundle(java.util)ResourceBundleisanabstractclasswhichisthesuperclassofclasseswhich provideLocale-specifiTimer(java.util)Timersscheduleone-shotorrecurringTimerTaskforexecution.Prefer java.util.concurrent.ScheduledAtomicInteger(java.util.concurrent.atomic)Anintvaluethatmaybeupdatedatomically.Seethejava.util.concurrent.atomic packagespecificatiIOUtils(org.apache.commons.io)GeneralIOstreammanipulationutilities.Thisclassprovidesstaticutility methodsforinput/outpuScheduler(org.quartz)ThisisthemaininterfaceofaQuartzScheduler.ASchedulermaintainsaregistryoforg.quartz.JobCodeWhispereralternativesProductsSearchforJavacodeSearchforJavaScriptcodeIDEPluginsIntelliJIDEAWebStormVisualStudioAndroidStudioEclipseVisualStudioCodePyCharmSublimeTextPhpStormVimGoLandRubyMineEmacsJupyterNotebookJupyterLabRiderDataGripAppCodeCompanyAboutUsContactUsCareersResourcesFAQBlogTabnineAcademyTermsofusePrivacypolicyJavaCodeIndexJavascriptCodeIndexGetTabnineforyourIDEnow



請為這篇文章評分?