Material Design Hub

Showing posts with label Alert Dialog. Show all posts
Showing posts with label Alert Dialog. Show all posts

Friday, February 27, 2015

SweetAlert Dialog android library

SweetAlert Dialog 


 Android Library


Description:-  SweetAlert for Android, a beautiful and clever alert dialog.

Min SDK;- 9 (Android 2.3–2.3.2 Gingerbread)

watch the demo 




How To Use SweetAlert Dialog  Library :- The simplest way to use SweetAlertDialog is to add the library as aar dependency to your build.

Maven
<dependency>
  <groupId>cn.pedant.sweetalert</groupId>
  <artifactId>library</artifactId>
  <version>1.3</version>
  <type>aar</type>
</dependency>
Gradle
repositories {
    mavenCentral()
}

dependencies {
    compile 'cn.pedant.sweetalert:library:1.3'
}
Usage

SweetAlertDialog pDialog = new SweetAlertDialog(this, SweetAlertDialog.PROGRESS_TYPE);
pDialog.getProgressHelper().setBarColor(Color.parseColor("#A5DC86"));
pDialog.setTitleText("Loading");
pDialog.setCancelable(false);
pDialog.show();
Please Join our Facebook  Group and Page

Facebook group: Android controls

Facebook page: Android Controls

Subscribe YouTube channel: Click here

SUBSCRIBE TO OUR EMAIL NEWSLETTER & RECEIVE UPDATES RIGHT IN YOUR INBOX.   Click here


If You Have Any question or Suggestions Please Feel Free to Comments .

Friday, December 19, 2014

Android Custom Alert Dialog Box with Animation

Android Custom Alert Dialog Box with Animation



Android Library



Description:
The NiftyDialogEffects are a great Library, By using NiftyDialogEffects  android library you

many effects-
FadeinSlideleftSlidetopSlideBottomSliderightFallNewspagerFliphFlipv,RotateBottomRotateLeftSlitShakeSidefill



How To Use NiftyDialogEffects Library :-

Step 1: Create a new Android Project

Step 2: Import  Library to your Android Application Project
     1: File->New->Other
     2: Select Android Project
     3: Select "Create Project from existing source"
     4: Click "Browse and select NiftyDialogEffects Android Library, 
     5: Finish 
     6: Right-click on your project -> Properties
     7: In Android->Library section click Add
     8: select recently added project -> Ok
     9: Download nineoldandroids-2.4.0.jar into your libs directory.
     10: that's it!


Now we are ready to use NiftyDialogEffects Library

NiftyDialogBuilder dialogBuilder=NiftyDialogBuilder.getInstance(this);

dialogBuilder
    .withTitle("Modal Dialog")
    .withMessage("This is a modal Dialog.")
    .show();


Configuration:

dialogBuilder
    .withTitle("Modal Dialog")                                  //.withTitle(null)  no title
    .withTitleColor("#FFFFFF")                                  //def
    .withDividerColor("#11000000")                              //def
    .withMessage("This is a modal Dialog.")                     //.withMessage(null)  no Msg
    .withMessageColor("#FFFFFFFF")                              //def  | withMessageColor(int resid)
    .withDialogColor("#FFE74C3C")                               //def  | withDialogColor(int resid)
    .withIcon(getResources().getDrawable(R.drawable.icon))
    .withDuration(700)                                          //def
    .withEffect(effect)                                         //def Effectstype.Slidetop
    .withButton1Text("OK")                                      //def gone
    .withButton2Text("Cancel")                                  //def gone
    .isCancelableOnTouchOutside(true)                           //def    | isCancelable(true)
    .setCustomView(R.layout.custom_view,v.getContext())         //.setCustomView(View or ResId,context)
    .setButton1Click(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Toast.makeText(v.getContext(), "i'm btn1", Toast.LENGTH_SHORT).show();
                    }
    })
    .setButton2Click(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Toast.makeText(v.getContext(),"i'm btn2",Toast.LENGTH_SHORT).show();
        }
    })
    .show();

Developed By: 

Please Join our Facebook  Group and Page


Facebook group: Android controls

Facebook page: Android Controls


SUBSCRIBE TO OUR EMAIL NEWSLETTER & RECEIVE UPDATES RIGHT IN YOUR INBOX.   Click here


If You Have Any question or Suggestions Please Feel Free to Comments .