GF Minimal Notification - Free

  • GFMinimalNotification, GFMinimalNotification Lİbraries
  • Description

  • change log

  • faq

  • Comments

  • This is an Android controller for presenting a beautiful notification that is highly configurable and works for both phone and tablet. GFMinimalNotification is only available for API levels 15+.

    How To Use It

    	/**
     * To use the GFMinimalNotification, you must extends one of the provided activity or fragment classes or
     * pass the container view you wish to display the notification in. You may display this in the activity's
     * window decor view as well.
     */
    public class MainActivity extends BaseNotificationActionBarActivity {
    
        private GFMinimalNotification minimalNotification;
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
    
            minimalNotification = new GFMinimalNotification(this, GFMinimalNotificationStyle.DEFAULT,
                    "This is my awesome title", "This is my awesome sub-title");
        }
    
        /**
         * Showing the notification from a method
         */
        public void show() {
            minimalNotification.show(this);
        }
    
        /**
         * Showing the notification inside a container from a method
         */
        public void showInView() {
            minimalNotification.show(findViewById());
        }
    
        /**
         * Showing the notification in the decor view from a method. If dispalyed from the top, this will overlay the actionbar/toolbar
         */
        public void showFromDecor() {
            minimalNotification.showFromDecor(this);
        }
    
        /**
         * Hiding the notification from a method
         */
        public void dismiss() {
            minimalNotification.dismiss();
        }
    
        /**
         * Set the notification to display from the top of the screen
         */
        public void setDisplayFromTop() {
            minimalNotification.setSlideInFromTop();
        }
    
        /**
         * Set the notification to display from the bottom of the screen
         */
        public void setDisplayFromBottom() {
            minimalNotification.setSlideInFromBottom();
        }
    }
    

     

    Want to use the new Toolbar? You can! Just extend BaseNotificationToolbarActivity to enable toolbar use. Or if you want to use your own implementation, copy this library into your project or use the showFromDecor(...) or show(findViewById(<id_of_your_container_view>) option when displaying your notification.

    Constructors / Options

    /**
     * Note: passing a duration of 0 means the notification will NOT be automatically dismissed, you will need to 
     * dismiss the notification yourself by calling dismiss() on the notification object. If you pass a duration 
     * value greater than 0, this will be the length of time the notification will remain visisble before being 
     * automatically dismissed. Examples follow. Please consult the GFMinimalNotification class to see all available
     * constructors/options.
     */
    
    // With duration
    minimalNotification = new GFMinimalNotification(this, GFMinimalNotificationStyle.DEFAULT,
                    "This is my awesome title", "This is my awesome sub-title", GFMinimalNotification.LENGTH_LONG);
    
    // Without duration and with onClick listener
    minimalNotification = new GFMinimalNotification(this, GFMinimalNotificationStyle.DEFAULT,
                    "This is my awesome title", "This is my awesome sub-title", 0)
                    .setOnGFMinimalNotificationClickListener(new OnGFMinimalNotificationClickListener() {
                        @Override
                        public void onClick(GFMinimalNotification notification) {
                            notification.dismiss();
                        }
                    });
    


    // Available Styles
    public enum GFMinimalNotificationStyle {
        DEFAULT,
        ERROR,
        SUCCESS,
        INFO,
        WARNING
    }
    

    Undo Notifications


    /**
     * To use the GFUndoNotification, you must follow the same principles as expressed in the above example.
     */
    public class MainActivity extends BaseNotificationActionBarActivity {
    
        private GFUndoNotification undoNotification;
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
    
            undoNotification = new GFUndoNotification(this, "You did something")
                    .setGFUndoNotificationCallback(new GFUndoNotificationCallback() {
                                @Override
                                public void onUndoAction(GFUndoNotification notification) {
                                    // undo user performed action
                                }
                            });
        }
    
        /**
         * Showing the undo notification from a method
         */
        public void show() {
            undoNotification.show(this);
        }
    
        /**
         * Showing the undo notification inside a container from a method
         */
        public void showInView() {
            undoNotification.show(findViewById());
        }
    
        /**
         * Showing the undo notification in the decor view from a method. If dispalyed from the top, this will overlay the actionbar/toolbar
         */
        public void showFromDecor() {
            undoNotification.showFromDecor(this);
        }
    
        /**
         * Hiding the undo notification from a method
         */
        public void dismiss() {
            undoNotification.dismiss();
        }
    
        /**
         * Set the notification to display from the top of the screen
         */
        public void setDisplayFromTop() {
            undoNotification.setSlideInFromTop();
        }
    
        /**
         * Set the notification to display from the bottom of the screen
         */
        public void setDisplayFromBottom() {
            undoNotification.setSlideInFromBottom();
        }
    }
    
    There is no Features content
  • There is no Related Products
  • There is no Change Log content
  • There is no FAQ