• 微信号:Zh-y9213
您当前的位置:爱资源分享网 > > 网站源码 > 程序源码

对于Android通知效应

栏目:程序源码时间:2021-11-15 21:28阅读数:67人阅读
在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


资源均来自第三方,谨慎下载,前往第三方网站下载

本站所有文章、数据、图片均来自互联网,一切版权均归源网站或源作者所有。

如果侵犯了你的权益请来信告知我们删除。邮箱:737597453@qq.com