Giter Site home page Giter Site logo

customalertdialog's Introduction

使用

类似系统自己的AlertDialog的用法.只是把AlertDialog变成CustomAlertDialog就行了。

    AlertDialog.Builder builder = new AlertDialog.Builder(activity);
    builder.setTitle("Title");
    builder.setMessage(R.string.message);
    builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener(){
        ...
    });
    builder.setNegativeButton("Cancel", null);

如已有以上的代码,则只需要将第一句builder的声明换成CustomAlertDialog即可,其它方法兼容.

    CustomAlertDialog.Builder builder = new CustomAlertDialog.Builder(activity);
    builder.setTitle("Title");
    builder.setMessage(R.string.message);
    builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener(){
        ...
    });
    builder.setNegativeButton("Cancel", null);

Screenshot

main main main

目录

想在改Dialog的布局效果,直接调整res里面以"cad__"开头的文件即可.

    .
    ├── drawable
    │   ├── cad__item_list_selector.xml     列表的点击效果
    │   └── cad__progress.xml   水平进度的效果
    ├── drawable-hdpi
    │   └── cad__bg_dialog_action.9.png     button容器的背景
    ├── layout
    │   ├── cad__custom_dialog_listview.xml     dialog的list
    │   ├── cad__custom_dialog.xml              dialog的布局
    │   ├── cad__custom_progress_cycle.xml      dialog的圆形进度
    │   ├── cad__custom_progress_hori.xml       dialog的水平进度
    │   ├── cad__select_dialog_item.xml         dialog中list的item
    │   └── cad__select_dialog_singlechoice.xml dialog中list的单选item
    └── values
        ├── cad__colors.xml                 dialog里面用到的一些颜色
        ├── cad__custom_dialog_style.xml    dialog的style,主要是Text和Button
        ├── cad__custom_dialog_theme.xml    主题,暂没什么用
        └── cad__dimens.xml                 dalog里面的一些大小值

修改的时候,不要改id,如果有删除view这样的操作,最好,自己修改CustomAlertDialog的源码.

customalertdialog's People

Contributors

holmeszyx avatar

Watchers

James Cloos avatar yibulaxi 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.