Git Product home page Git Product logo

ios_style_dialog's Introduction

iOS style Dialog

demo API

快速使用

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

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

Step 2. Add the dependency

dependencies {
	implementation 'com.github.shaoshuai904:iOS_Style_Dialog:1.2.3'
}

show_01

show_02

show_03

AlertDialog

样式布局:[ 标题 + 消息 + 左按钮 + 右按钮]
        new AlertDialog(mContext)
                .setCancelable(false)
                .setTitle("退出当前账号")
                .setMessage("再连续登陆15天,就可变身为QQ达人。退出QQ可能会使你现有记录归零,确定退出?")
                .setLeftButton("取消", null)
                .setRightButton("确认退出", new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        showToast("exit");
                    }
                })
                .show();

AlertEditDialog

样式布局:[ 标题 + 消息 + 输入框 + 左按钮 + 右按钮 ]
        new AlertEditDialog(mContext)
                .setTitle("姓名")
                .setMessage("请输入您的真实姓名。")
                .setLeftButton("取消", null)
                .setRightButton("确定", new AlertEditDialog.EditTextCallListener() {
                    @Override
                    public void callBack(String str) {
                        showToast(str);
                    }
                })
                .show();

ActionSheetDialog

样式布局:[ 标题 + 页签条目 + 取消按钮 ]
        new ActionSheetDialog(mContext)
                .setTitle("请选择操作")
                .setCancelable(false)
                .setCanceledOnTouchOutside(false)
                .addSheetItem("条目一", Color.parseColor(DEF_RED), new ActionSheetDialog.OnSheetItemClickListener() {
                    @Override
                    public void onClick(int which) {
                        showToast("item " + which);
                    }
                })
                .addSheetItem("条目二", new ActionSheetDialog.OnSheetItemClickListener() {
                    @Override
                    public void onClick(int which) {
                        showToast("item " + which);
                    }
                })
                .addSheetItem("条目三", Color.BLUE, new ActionSheetDialog.OnSheetItemClickListener() {
                    @Override
                    public void onClick(int which) {
                        showToast("item " + which);
                    }
                })
                // ……
                .addSheetItem("条目十", new ActionSheetDialog.OnSheetItemClickListener() {
                    @Override
                    public void onClick(int which) {
                        showToast("item " + which);
                    }
                }).show();

AlertNumberPickerDialog

样式布局:[ 标题 + 选择框 + 左按钮 + 右按钮 ]
        numbers = new String[]{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"};
        defValue = numbers[index];

        new AlertNumberPickerDialog(mContext)
                .setTitle("Number")
                .setNumberValues(numbers, index, new NumberPicker.OnValueChangeListener() {
                    @Override
                    public void onValueChange(NumberPicker picker, int oldVal, int newVal) {
                        defValue = numbers[newVal];
                    }
                })
                .setLeftButton("Cancel", null)
                .setRightButton("OK", new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        showToast(defValue);
                    }
                })
                .show();

完整预览各类用法 -(简单使用类 传送门)


v1.2.3

  • add AlertNumberPickerDialog
  • update AlertEditDialog text callback.
  • update minSdkVersion to 14.

v1.2

  • 对各个Dialog的TitleMessageCancel/OK Button,新增了字体大小字体颜色是否加粗等设置。
  • 改变了Dialog的默认色系。(QQ style --> iOS style)
  • 开放了ActionSheetDialog中 SheetItem 字体颜色和 Cancel Button 显示文本的自定义设置。

v1.1

  • 创建父类BaseDialog,对Dialog进行统一管理。
  • 新增AlertDialog和AlertEditDialog的Cancelable自适应宽度设置。

v1.0

  • ActionSheetDialog
  • AlertEditDialog
  • AlertDialog

ios_style_dialog's People

Contributors

mapleshao avatar shaoshuai904 avatar

Watchers

 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.