对于Android通知效应

时间:2016-08-23 15:52 来源:互联网 作者:源码搜藏收藏

  • 源码类别:通知Notification
  • 源码大小:未知
  • 编码格式:gbk,utf8,不限
  • 运行环境:php+mysql
  • 广告推荐

在Android notifications.base效果

截图

图片

用法

  NiftyNotificationView.build(this,msg, effect,R.id.mLyout)
      .setIcon(R.drawable.lion)    //You must call this method if you use ThumbSlider effect
      show();
<!-- ViewGroup-->
<RelativeLayout
      android:id="@+id/mLyout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      >

</RelativeLayout>

组态

Configuration cfg=new Configuration.Builder()
      .setAnimDuration(700)
      .setDispalyDuration(1500)
      .setBackgroundColor("#FFBDC3C7")
      .setTextColor("#FF444444")
      .setIconBackgroundColor("#FFFFFFFF")
      .setTextPadding(5)                      //dp
      .setViewHeight(48)                      //dp
      .setTextLines(2)                        //You had better use setViewHeight and setTextLines together
      .setTextGravity(Gravity.CENTER)         //only text def  Gravity.CENTER,contain icon Gravity.CENTER_VERTICAL
      .build();

NiftyNotificationView.build(this,msg, effect,R.id.mLyout,cfg)
      .setIcon(R.drawable.lion)               //remove this line ,only text
      .setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
      //add your code
      }
      })
      .show();                              //显示(布尔)允许重复或showSticky()粘通知,您可以拨打removeSticky()方法关闭

安装

您可以安装使用从摇篮JitPack添加到您的build.gradle文件:

    repositories {
        maven { url "https://jitpack.io" }
    }

    dependencies {
        compile 'com.github.sd6352051:NiftyNotification:1.2'
    }

还是这个复制到libs目录中。

  • NineOldAndroid-2.4.0

  • NiftyNotification-1.2

本站资源仅限于学习研究,严禁从事商业或者非法活动! 源码搜藏网所有源码来自互联网转载与用户上传分享,如果侵犯了您的权益请与我们联系,我们将在24小时内删除!谢谢!
上一篇:没有了

通知Notification下载排行

最新文章