如何解决如何在Exoplayer通知中设置自定义布局和字体?
我正在使用PlayerNotificationManager
在应用程序中显示播放通知。一切正常,但我想在通知中使用自定义字体添加应用程序的徽标。
我通过添加drawables.xml
更改了通知上的播放和暂停按钮。但是找不到改变字体的方法。
那么,如何更改Exoplayer提供的默认通知布局和特征?
编辑:
我在Github上看到this问题,该问题说我们需要扩展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);
}
解决方法
如回购协议所述,您需要扩展PlayerNotificationManager
来执行此操作,以创建此class并复制项目中的所有内容,然后按照中所述添加要使用的布局这个link
您需要在builder
here
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。