Android Bottom Pop-up iOS7 Style dialog option box (QQ dialog box)--The third party open source ios_dialog_library_android

Source: Internet
Author: User

First to show you the effect of the picture, like friends can download the source Oh.

This effect is accomplished by using the Ios_dialog_library

Download Address: http://xiazai.jb51.net/201509/yuanma/IOS_Dialog_Library (jb51.net)

The download is then imported into eclipse and then introduced as a library into its own project and used directly as a Third-party control.

Test code:

 <linearlayout xmlns:android= "Http://schemas.android.com/apk/res/android" Xmlns:tools
 = "Http://schemas.android.com/tools" android:layout_width= "match_parent" android:layout_height= "Match_parent" android:orientation= "vertical" > <button android:id= "@+id/btn" android:layout_width= "Match_parent" Android:la yout_height= "wrap_content" android:text= "message"/> <button android:id= "@+id/btn" android:layout_width= "Match_par" Ent "android:layout_height=" wrap_content "android:text=" picture "/> <button android:id=" @+id/btn "android:layou T_width= "Match_parent" android:layout_height= wrap_content "android:text=" list "/> <button android:id=" @+id/btn "Android:layout_width=" match_parent "android:layout_height=" Wrap_content "android:text=" Exit "/> <Button and Roid:id= "@+id/btn" android:layout_width= "match_parent" android:layout_height= "wrap_content" android:text= "error hint"/&
 Gt </linearlayout> 

Mainactivity.java:

 Package com.example.testiosdialog;
 Import Zhangphil.iosdialog.widget.ActionSheetDialog;
 Import Zhangphil.iosdialog.widget.ActionSheetDialog.OnSheetItemClickListener;
 Import Zhangphil.iosdialog.widget.ActionSheetDialog.SheetItemColor;
 Import Zhangphil.iosdialog.widget.AlertDialog;
 Import android.app.Activity;
 Import Android.os.Bundle;
 Import Android.view.View;
 Import Android.view.View.OnClickListener;
 Import Android.widget.Button;
 public class Mainactivity extends activity implements Onclicklistener {private Button btn, BTN, BTN, BTN, BTN;
  @Override protected void OnCreate (Bundle savedinstancestate) {super.oncreate (savedinstancestate);
  Setcontentview (R.layout.activity_main);
 Initview ();
  private void Initview () {btn = (Button) Findviewbyid (R.ID.BTN);
  BTN = (Button) Findviewbyid (R.ID.BTN);
  BTN = (Button) Findviewbyid (R.ID.BTN);
  BTN = (Button) Findviewbyid (R.ID.BTN); 
  BTN = (Button) Findviewbyid (R.ID.BTN);
  Btn.setonclicklistener (this); Btn.setoncliCklistener (this);
  Btn.setonclicklistener (this);
  Btn.setonclicklistener (this);
 Btn.setonclicklistener (this); @Override the public void OnClick (View v) {//setcancelable setting is canceled, Setcanceledontouchoutside set to cancel the switch (V.getid ()) on the external touch {Case R.id.btn:new Actionsheetdialog (mainactivity.this). Builder (). Settitle ("After emptying the list of messages, the chat record remains, OK to clear the list of messages?"). "). Setcancelable (True). Setcanceledontouchoutside (True). Addsheetitem (" Empty message list ", sheetitemcolor.red, New OnS
   Heetitemclicklistener () {@Override public void OnClick (int which) {}}]. Show ();
  Break Case R.id.btn:new Actionsheetdialog (mainactivity.this). Builder (). Setcancelable (True). Setcanceledontouchoutside (true). Addsheetitem ("Send to Buddy", Sheetitemcolor.blue, New Onsheetitemclicklistener () {@Override public voi  d onClick (int which) {}}). Addsheetitem ("Reprint to Space album", Sheetitemcolor.blue, New Onsheetitemclicklistener () {@Override public void onClick (int which) {}}). Addsheetitem ("Upload to Group albums", Sheetitemcolor.blue, New Onsheetitemclicklistener ( {@Override public void OnClick (int which) {}}). Addsheetitem ("Save to Phone", SHEETITEMCOLOR.BL  
  UE, New Onsheetitemclicklistener () {@Override public void OnClick (int which) {}}). Show ();
  Break Case R.id.btn:new Actionsheetdialog (mainactivity.this). Builder (). Settitle (Buddy list). Setcancelable (True). SETCA Nceledontouchoutside (True). Addsheetitem ("Remove Buddy", sheetitemcolor.red, New Onsheetitemclicklistener () {@Overri De public void OnClick (int which) {}}). Addsheetitem ("Add Friends", Sheetitemcolor.blue, New ONSHEETITEMCL Icklistener () {@Override public void OnClick (int which) {}}). Addsheetitem ("Remarks", sheetitemcolor.b
  Lue, New Onsheetitemclicklistener () {@Override public void OnClick (int which) {}}]. Show ();
  Break //Setnegativebutton relative Setpositivebutton color to shallow some case r.id.btn:new alertdialog (mainactivity.this). Builder (). Settitle ( "Exit current Account"). Setmsg ("Again consecutive landing days, the variable as QQ talent." Exit QQ may make your existing records return to zero, OK exit? "). Setpositivebutton (" Confirm Exit ", new Onclicklistener () {@Override public void OnClick (View v) {}}). SE
  Tnegativebutton ("Cancel", new Onclicklistener () {@Override public void OnClick (View v) {}}). Show ();
  Break Case R.id.btn:new Alertdialog (mainactivity.this). Builder (). Settitle ("error message"). Setmsg ("Your cell phone SD card problem, suggest to delete unwanted files, or collect
  No pictures and videos etc. "). Setpositivebutton (OK), new Onclicklistener () {@Override public void OnClick (View v) {}
  ). Show ();
  Break }
 }
 }

The above is small to share the Android bottom pop-up iOS7 Style dialog Options box (QQ dialog box)--third party open source--ios_dialog_library All content, I hope you like.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.