ruobe
V2EX  ›  Android

网易云音乐这种通知栏怎么实现?

  •  
  •   ruobe · Aug 31, 2015 · 18525 views
    This topic created in 4094 days ago, the information mentioned may be changed or developed.
    12 replies  •  2015-09-01 14:23:45 +08:00
    ruobe
    ruobe
    OP
    Aug 31, 2015❤️1
    1



    在 android5.0 上面的效果
    lj3lj3
    lj3lj3
    Aug 31, 2015❤️1
    2
    这不就是一个 ExpandableNotification 么?还是我忽略了重点
    inoris
    inoris
    Aug 31, 2015❤️1
    3
    Applying an expanded layout to a notification: http://developer.android.com/guide/topics/ui/notifiers/notifications.html#ApplyStyle

    要求版本 4.1 以上。
    ruobe
    ruobe
    OP
    Aug 31, 2015
    4
    @lj3lj3 重点就是你实现过吗?
    ruobe
    ruobe
    OP
    Aug 31, 2015
    5
    @inoris
    http://localhost/docs/training/notify-user/expanded.html
    虽然有点像,但是还差的远
    ruobe
    ruobe
    OP
    Aug 31, 2015
    8
    @inoris 并不能用 NotificationCompat.Builder 代替,只能使用 Notification.Builder ,无法支持 5.0 以下版本。

    In Android 5.0 (API level 21 ) the lock screen no longer displays media controls based on the RemoteControlClient...
    balabala......
    Note: The template and the addAction () method are not included in the support library, so these features run in Android 5.0 and higher only.
    duguguiyu
    duguguiyu
    Sep 1, 2015
    10
    这其实和 ongoing 什么没有关系。首先如果大视图就要 4.1 以上的版本,如果是需要做出图片那样,需要用自定义的 RemoteViews 就 OK 。
    ruobe
    ruobe
    OP
    Sep 1, 2015
    11
    @duguguiyu 像 google play music 那样的通知我会,是比较常规向的。但是网易云音乐那个太变态了,从小视图切到大视图后,图片和按钮还有移动效果。。。
    ruobe
    ruobe
    OP
    Sep 1, 2015
    12
    @duguguiyu 现在唯一的问题就是那个移动效果了,其他的都 OK 了,用的就是 RemoteViews ,支持 4.1 版本以上
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   901 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 22:30 · PVG 06:30 · LAX 14:30 · JFK 17:30
    ♥ Do have faith in what you're doing.