package com.base.animset;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;

import com.base.animset.util.NiftyEffects;
import com.base.animset.wedgit.NiftyNotificationView;

public class NiftySimple extends Activity {
    private NiftyEffects effect;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(com.base.animset.R.layout.anim_sample_nifty);
    }

    public void showNotify(View v) {

        String msg = "Today we’d like to share a couple of simple styles and effects for android notifications.";

        int i = v.getId();
        if (i == com.base.animset.R.id.scale) {
            effect = NiftyEffects.scale;

        } else if (i == com.base.animset.R.id.thumbSlider) {
            effect = NiftyEffects.thumbSlider;

        } else if (i == com.base.animset.R.id.jelly) {
            effect = NiftyEffects.jelly;

        } else if (i == com.base.animset.R.id.slidein) {
            effect = NiftyEffects.slideIn;

        } else if (i == com.base.animset.R.id.flip) {
            effect = NiftyEffects.flip;

        } else if (i == com.base.animset.R.id.slideOnTop) {
            effect = NiftyEffects.slideOnTop;

        } else if (i == com.base.animset.R.id.standard) {
            effect = NiftyEffects.standard;

        }


        NiftyNotificationView.build(this, msg, effect, com.base.animset.R.id.mLyout)
                .setIcon(R.drawable.icon_lion)         //You must call this method if you use ThumbSlider effect
                .show();


//        You can configure like this
//        The default

//        NiftyConfiguration cfg=new NiftyConfiguration.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();                               //  show(boolean) allow duplicates   or showSticky() sticky notification,you can call removeSticky() method close it
    }

}
