All Projects → liujinchao → DialogUi

liujinchao / DialogUi

Licence: other
关于toast、等待框、对话框、选择框、地址选择框、软键盘等工具的封装

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to DialogUi

mac-terminal-shortcuts
Useful and common terminal shortcuts for macOS
Stars: ✭ 39 (-20.41%)
Mutual labels:  keyboard
unigem-objective-c
Unicode Gems, a Mac app, an iOS app, and an iOS keyboard for letter-like unicode.
Stars: ✭ 22 (-55.1%)
Mutual labels:  keyboard
dasher-web
Dasher text entry in HTML, CSS, JavaScript, and SVG
Stars: ✭ 34 (-30.61%)
Mutual labels:  keyboard
vue-focus-keyboard
A keyboard component for Vue. Start to write immediately. No input element definition. Plug and play!
Stars: ✭ 63 (+28.57%)
Mutual labels:  keyboard
Kimiko
Build-Guide for the Kimiko Split-Keyboard pcb.
Stars: ✭ 34 (-30.61%)
Mutual labels:  keyboard
react-native-screen-keyboard
On-screen keyboard with customisable keys and tactile / UI feedback 📱
Stars: ✭ 22 (-55.1%)
Mutual labels:  keyboard
Chordly
Chordly is a javascript library that may be used to detect and act upon key sequences entered by a user.
Stars: ✭ 14 (-71.43%)
Mutual labels:  keyboard
react-keys
Simple way to bind keyboard to react with redux.
Stars: ✭ 50 (+2.04%)
Mutual labels:  keyboard
snake
A stylised graphical tool for configuring and controlling Razer devices on Linux
Stars: ✭ 52 (+6.12%)
Mutual labels:  keyboard
KeyboardKitPro
KeyboardKit Pro extends KeyboardKit with pro features.
Stars: ✭ 42 (-14.29%)
Mutual labels:  keyboard
pi400kb
Raw HID keyboard forwarder to turn the Pi 400 into a USB keyboard
Stars: ✭ 182 (+271.43%)
Mutual labels:  keyboard
keyboard mouse emulate on raspberry
Bluetooth Keyboard Mouse Emulator on Raspberry Pi
Stars: ✭ 230 (+369.39%)
Mutual labels:  keyboard
keyboard-css
Show off your keyboard shortcuts with style 🦄.
Stars: ✭ 52 (+6.12%)
Mutual labels:  keyboard
hidstream
Streaming HID events in Node.js
Stars: ✭ 52 (+6.12%)
Mutual labels:  keyboard
nativescript-numeric-keyboard
🔢 Replace the meh default number/phone keyboard with this stylish one
Stars: ✭ 33 (-32.65%)
Mutual labels:  keyboard
use-keyboard-shortcut
A custom hook that allows adding keyboard shortcuts to React applications
Stars: ✭ 41 (-16.33%)
Mutual labels:  keyboard
ck550-macos
MacOS effect control SW for a CoolMaster CK550 & CK530 Keyboard (US Layout).
Stars: ✭ 14 (-71.43%)
Mutual labels:  keyboard
habits
An application to monitor your habits with your PC. So you can study how many kilometers travel with your mouse or how many keystrokes.
Stars: ✭ 19 (-61.22%)
Mutual labels:  keyboard
kinesis-advantage-2
Keyboard layouts and macros for the Kinesis Advantage 2 keyboard.
Stars: ✭ 72 (+46.94%)
Mutual labels:  keyboard
intuiter
Global productivity app for anyone who use Windows
Stars: ✭ 24 (-51.02%)
Mutual labels:  keyboard

DialogUi

关于toast、等待框、对话框、选择框、下拉刷新等工具的封装。

在代码中build中集成compile 'com.liujc.util:jcdialog:1.0.1'.

主界面

image

Toast 工具   主要设置toast的显示位置及自定义toast的显示布局

在使用ToastUtil的时候需要调用XDialog.init(getApplicationContext())传入上下文;

  1. 顶部toast

ToastUtil.showToastTop("顶部的Toast");

  1. 中部toast

ToastUtil.showToastCenter("中部的Toast");

  1. 底部toast

ToastUtil.showToast("默认的Toast"); 4. 显示带图片的toast

ToastUtil.showToastWithImg("image Toast",R.drawable.ic_success);

  1. 自定义布局和显示位置的toast

ToastUtil.showToastLayout(toastLayout, gravity)

image

对话框工具

image image image

  1. popuwindow弹出框
XDialog.showPopupWindow(mContext, btnPopu,new TdataListener() {
        @Override
        public void initPopupData(List<PopuBean> lists) {
            for (int i = 0; i < 5; i++) {
                PopuBean popu = new PopuBean();
                popu.setTitle("item"+i);
                popu.setId(i);
                lists.add(popu);
            }
        }

        @Override
        public void onItemClick(int position, PopupWindowView popupWindowView) {
            showToast("标题:"+popupWindowView.getTitle(position));
            popupWindowView.dismiss();
        }
    });
  1. 各种等待框
XDialog.showLoadingVertical(this, "加载中...", false).show();
XDialog.showLoadingHorizontal(this, "加载中...", false).show();
XDialog.showMdLoadingVertical(this, "加载中...").show();
XDialog.showMdLoadingHorizontal(this, "加载中...").show();
  1. 各种对话框
XDialog.showMdAlert(mActivity, "标题", msg, new DialogUIListener() {
        @Override
        public void onPositive() {
            showToast("onPositive");
        }

        @Override
        public void onNegative() {
            showToast("onNegative");
        }

    }).show();
  1. 各种列表选择框
//单选
String[] words2 = new String[]{"1", "2", "3"};
XDialog.showSingleChoose(mActivity, "单选", 0, words2, new DialogUIItemListener() {
    @Override
    public void onItemClick(CharSequence text, int position) {
        showToast(text + "--" + position);
    }
}).show();

//多选
String[] words = new String[]{"1", "2", "3"};
boolean[] choseDefault = new boolean[]{false, false, false};
XDialog.showMdMultiChoose(mActivity, "标题", words, choseDefault, new DialogUIListener() {
    @Override
    public void onPositive() {

    }

    @Override
    public void onNegative() {

    }
}).show();
  1. 时间选择框
XDialog.showDatePick(mActivity, Gravity.CENTER, "选择日期", System.currentTimeMillis() + 60000, DateSelectorWheelView.TYPE_YYYYMMDDHHMM, 0, new DialogUIDateTimeSaveListener() {
        @Override
        public void onSaveSelectedDate(int tag, String selectedDate) {
            showToast(selectedDate);
        }
    }).show();

或者

XDialog.showTimePickView(mActivity,"选择日期",TimePickerView.Type.ALL,new TimePickerView.OnTimeSelectListener() {
       @Override
       public void onTimeSelect(Date date) {
           ToastUtil.showToast(getTime(date));
       }
   });

image image

  1. 地址联动选择框

image image

DefaultAddressProvider addressProvider = new DefaultAddressProvider(mActivity);
XDialog.showAddrPickView(mActivity, "选择地址",addressProvider, new OptionsPickerView.OnOptionsSelectListener() {
    @Override
    public void onOptionsSelect(int options1, int option2, int options3) {
        String tx = addressProvider.provideProvince().get(options1)
                + addressProvider.provideCities().get(options1).get(option2)
                + addressProvider.provideCounties().get(options1).get(option2).get(options3).getPickerViewText()
                +addressProvider.provideZipCode().get(addressProvider.provideCounties().get(options1).get(option2).get(options3).getPickerViewText());
        ToastUtil.showToast(tx);
    }
});

// 或
BottomDialog dialog1 = XDialog.showAddressDialog(mActivity);
dialog1.setOnAddressSelectedListener(new OnAddressSelectedListener() {
    @Override
    public void onAddressSelected(ProvinceModel province, CityModel city, DistrictModel county) {
        String s =(province == null ? "" : province.getName()) +
                (city == null ? "" : "\n" + city.getName()) +
                (county == null ? "" : "\n" + county.getName());
        showToast(s);
        dialog1.dismiss();
    }
});

内嵌加载等待框

支付键盘

一般键盘

image

支付键盘

image

升级提示弹框

image image

  UpdateAppBean updateAppBean = new UpdateAppBean.Builder()
        .setUpdate(true)
        .setNewVersion("2.0.20")
        .setApkFileUrl("http://106.54.169.177/file/app_dialog.apk")
        .setUpdateDesc("1,赏个脸支持(star)一下。\r\n2,用扯淡的方式,分享技术的内涵。\r\n3,谈的是技术,更是我们的人生。")
        .setApkSize("5.20M")
        .setNewMd5("B5A7C226C5D10C3734D2090282DF3FBD")
        .setForceUpdate(false)
        .create();
  UpdateAppManager updateAppManager = new UpdateAppManager.Builder(this)
  //                .showIgnoreVersion()
        .handleException(new ExceptionHandler() {
            @Override
            public void onException(Exception e) {
                ToastUtil.showToast(e.getLocalizedMessage());
            }
        })
        .dismissNotificationProgress()
        // 监听更新提示框相关事件
        .setUpdateDialogFragmentListener(new IUpdateDialogFragmentListener() {
            @Override
            public void startDownloadApk(UpdateAppBean updateApp, final IDownloadCallBack downloadCallback) {
                ToastUtil.showToast("开始下载");
                doDownLoadAction(downloadCallback);
            }

            @Override
            public void cancelDownloadApk(UpdateAppBean updateApp) {
                if(updateApp.isForceUpdate()){
                    // 处理强制更新,被用户cancel的情况
                }
                ToastUtil.showToast("取消更新");
            }
        })
        .create();
  XDialog.showUpdateDialog(updateAppManager, updateAppBean, new IUpdateCallback() {
    @Override
    public void hasNewApp(UpdateDialogFragment updateDialogFragment) {
        ToastUtil.showToast("有更新包");
    }

    @Override
    public void noNewApp() {
        ToastUtil.showToast("当前已是最新包");
    }
  });
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].