Coder Social home page Coder Social logo

chsguitar1 / circulardialogs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 1singhmanmeet/circulardialogs

0.0 3.0 0.0 2.87 MB

Its a library for the creating simple success and warning dialogs for android

License: Apache License 2.0

Java 100.00%

circulardialogs's Introduction

CircularDialogs

CircularDialogs is custom Android dialog library to give user feedback about the common operations like Success, Warning and Errors. You can easily use the it by adding the dependency to your gradle file. It allows you to make beautiful dialogs with just few lines of code. You can choose from the predefined entry and exit animations. You can use lot of options as discussed below:

Screenshots

Alt text Alt text Alt text

Add Gradle dependency

Add it in your root build.gradle at the end of repositories:

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Add the dependency

  dependencies {
	        compile 'com.github.1singhmanmeet:CircularDialogs:v1.0.1'
	}
  

Example

new CDialog(this).createAlert("You missed something",
                CDConstants.WARNING,   // Type of dialog
                CDConstants.LARGE)    //  size of dialog
                .setAnimation(CDConstants.SCALE_FROM_BOTTOM_TO_TOP)     //  Animation for enter/exit  
                .setDuration(2000)   // in milliseconds
                .setTextSize(CDConstants.LARGE_TEXT_SIZE)  // CDConstants.LARGE_TEXT_SIZE, CDConstants.NORMAL_TEXT_SIZE
                .show();

Options Available

Here are the different customizations that you can use to make things look different.

For Animations

     CDConstants.SCALE_FROM_BOTTOM_TO_TOP, CDConstants.SCALE_FROM_RIGHT_TO_LEFT, 
      // Bottom and top can be exchanged as well as right to left.
     // Like scale you can also use SLIDE animation just replace SLIDE with SCALE.
     CDConstants.SLIDE_FROM_BOTTOM_TO_TOP

TextSize

   setTextSize(CDConstants.NORMAL_TEXT_SIZE | CDConstants.LARGE_TEXT_SIZE);
   // NOTE: If you give any other value it won't work always use these two values only.
   

Duration

You can give duration in milliseconds. If you don't give duration dialog will close after user tap on the screen.

   .setDuration(2000)   // in milliseconds

Dialog Type

Right now only three types of dialogs are supported CDConstants.SUCCES, CDConstants.WARNING and CDConstants.ERROR. see the top example for usage.

Use you own icon

You can use your own icons if you want. Here is the way :

   CDialog createAlert(String message,Bitmap icon,int alertType,int size);        // using Bitmap
   CDialog createAlert(String message,Drawable icon,int alertType,int size);       // Using Drawable

   // Everything will be same just parameters are changed.
...

circulardialogs's People

Contributors

1singhmanmeet avatar

Watchers

James Cloos avatar Cristiano avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.