V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
ruobe
V2EX  ›  Android

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

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



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

    要求版本 4.1 以上。
    ruobe
        4
    ruobe  
    OP
       Aug 31, 2015
    @lj3lj3 重点就是你实现过吗?
    ruobe
        5
    ruobe  
    OP
       Aug 31, 2015
    @inoris
    http://localhost/docs/training/notify-user/expanded.html
    虽然有点像,但是还差的远
    ruobe
        8
    ruobe  
    OP
       Aug 31, 2015
    @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
        10
    duguguiyu  
       Sep 1, 2015
    这其实和 ongoing 什么没有关系。首先如果大视图就要 4.1 以上的版本,如果是需要做出图片那样,需要用自定义的 RemoteViews 就 OK 。
    ruobe
        11
    ruobe  
    OP
       Sep 1, 2015
    @duguguiyu 像 google play music 那样的通知我会,是比较常规向的。但是网易云音乐那个太变态了,从小视图切到大视图后,图片和按钮还有移动效果。。。
    ruobe
        12
    ruobe  
    OP
       Sep 1, 2015
    @duguguiyu 现在唯一的问题就是那个移动效果了,其他的都 OK 了,用的就是 RemoteViews ,支持 4.1 版本以上
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2442 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 60ms · UTC 15:28 · PVG 23:28 · LAX 08:28 · JFK 11:28
    ♥ Do have faith in what you're doing.