nul*_*ide 5 android android-layout android-notifications exoplayer exoplayer2.x
我用于PlayerNotificationManager在我的应用程序中显示播放通知。一切工作正常,但我想在通知中使用自定义字体添加应用程序的徽标。
我通过添加更改了通知上的播放和暂停按钮drawables.xml。但找不到更改字体的方法。
那么,如何更改 Exoplayer 提供的默认通知布局和特征?
编辑:
我在 Github 上看到了这个问题,它说我们需要扩展PlayerNotificationManager才能使用自定义布局。但我似乎无法让它发挥作用。
这是我的代码:
private void setPlayerNotificationManager(Player player) {
playerNotificationManager = new PlayerNotificationManager(context, "123", 1234, mediaDescriptionAdapter);
playerNotificationManager.setUseNavigationActions(false);
playerNotificationManager.setUsePlayPauseActions(true);
playerNotificationManager.setRewindIncrementMs(0);
playerNotificationManager.setFastForwardIncrementMs(0);
//playerNotificationManager.setColor(Color.GREEN);
playerNotificationManager.setColorized(true);
playerNotificationManager.setUseChronometer(false);
playerNotificationManager.setSmallIcon(R.drawable.logo);
playerNotificationManager.setPlayer(player);
}
Run Code Online (Sandbox Code Playgroud)
正如存储库中所述,您需要扩展才能执行此PlayerNotificationManager操作,您需要创建此类并复制项目中的所有内容,然后按照此链接中的说明添加要使用的布局
您需要在builder 此处添加您的布局
| 归档时间: |
|
| 查看次数: |
1816 次 |
| 最近记录: |