All Projects → hss01248 → Dialogutil

hss01248 / Dialogutil

Licence: apache-2.0
common used dialog with material style ( in support v7),ios style,get top activity automatically, invoke everywhere (any thread , any window)

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Dialogutil

Androidlibs
🔥正在成为史上最全分类 Android 开源大全~~~~(长期更新 Star 一下吧)
Stars: ✭ 7,148 (+654.01%)
Mutual labels:  utils, dialog
TipDialog
flutter tip dialog
Stars: ✭ 78 (-91.77%)
Mutual labels:  dialog, loading
Schematics Utilities
🛠️ Useful exported utilities for working with Schematics
Stars: ✭ 73 (-92.3%)
Mutual labels:  utils, util
Vue Ui For Pc
基于Vue2.x的一套PC端UI组件,包括了Carousel 跑马灯、Cascader 级联、Checkbox 多选框、Collapse 折叠面板、DatePicker 日期选择、Dialog 对话框、Form 表单、Input 输入框、InputNumber 数字输入框、Layer 弹窗层、Loading 加载、Menu 菜单、Page 分页、Progress 进度条、Radio 单选框、SelectDropDown 仿select、Switch 开关、Table 表格、Tabs 标签页、Textarea 文本框、Tooltip 文字提示、BackTop 返回顶部、steps 步骤条、Transfer 穿梭框、Tree 树形、Upload 文件上传、Lazy 图片懒加载、Loading 加载、Pagination 分页等等
Stars: ✭ 156 (-83.54%)
Mutual labels:  dialog, loading
Pydu
Useful data structures and utils for Python
Stars: ✭ 315 (-66.77%)
Mutual labels:  utils, util
Base
🍁 Base是针对于Android开发封装好一些常用的基类,主要包括通用的Adapter、Activity、Fragment、Dialog等、和一些常用的Util类,只为更简单。
Stars: ✭ 249 (-73.73%)
Mutual labels:  util, dialog
jh-weapp-demo
微信小程序项目- 实现一些常用效果、封装通用组件和工具类
Stars: ✭ 60 (-93.67%)
Mutual labels:  utils, loading
Loadingbar
极简使用的解耦Loading组件 - http://blog.csdn.net/aa464971/article/details/70197394
Stars: ✭ 179 (-81.12%)
Mutual labels:  dialog, loading
Android Loading Dialog
这个是我在泡网看见的一个等待的dialog
Stars: ✭ 297 (-68.67%)
Mutual labels:  dialog, loading
go-tools
A utility tool library of Golang.
Stars: ✭ 44 (-95.36%)
Mutual labels:  utils, util
Aiforms.dialogs
AiForms.Dialogs for Xamarin.Forms
Stars: ✭ 143 (-84.92%)
Mutual labels:  dialog, loading
Utils Everywhere
整理并收集各种常用的覆盖面广的工具类
Stars: ✭ 329 (-65.3%)
Mutual labels:  utils, util
Rxtool
Android开发人员不得不收集的工具类集合 | 支付宝支付 | 微信支付(统一下单) | 微信分享 | Zip4j压缩(支持分卷压缩与加密) | 一键集成UCrop选择圆形头像 | 一键集成二维码和条形码的扫描与生成 | 常用Dialog | WebView的封装可播放视频 | 仿斗鱼滑动验证码 | Toast封装 | 震动 | GPS | Location定位 | 图片缩放 | Exif 图片添加地理位置信息(经纬度) | 蛛网等级 | 颜色选择器 | ArcGis | VTPK | 编译运行一下说不定会找到惊喜
Stars: ✭ 11,567 (+1120.15%)
Mutual labels:  utils, dialog
android-blog-samples
source code for my blog~
Stars: ✭ 32 (-96.62%)
Mutual labels:  dialog, loading
Superutils
The utils Project
Stars: ✭ 325 (-65.72%)
Mutual labels:  utils, util
Android Circledialog
仿IOS圆角对话框、进度条、列表框、输入框,ad广告框,支持横竖屏切换
Stars: ✭ 880 (-7.17%)
Mutual labels:  dialog, loading
Myjdbc Rainbow
jpa--轻量级orm模式对象与数据库映射api
Stars: ✭ 23 (-97.57%)
Mutual labels:  utils
Lxd Functions
Simple script to mount LXD container and match host user with container user (uid/gid)
Stars: ✭ 11 (-98.84%)
Mutual labels:  utils
Vue Loadable
⏳ Improve your loading state control with pretty simple methods and helpers.
Stars: ✭ 23 (-97.57%)
Mutual labels:  loading
Windless
Windless makes it easy to implement invisible layout loading view.
Stars: ✭ 919 (-3.06%)
Mutual labels:  loading

DialogUtil

common used dialog with material style ( in support v7),ios style,get top activity automatically,can invoke show() everywhere (any thread , any window)

中文ReadMe
wiki

any problem or bug, join the qq group to get a quick response:

DialogUtil and Android

important points

  • if you do not invoke setActivity(activit), please invoke show() after in or after the activity onResume,or it may show in previous activity!
  • about BadWindowTokenException,see the blog:关于dialog,PopupWindow,SoftInputBoard的弹出时机的问题
  • if some chinese phone do not show dialog ,please invoke setActivity(activit)
  • do not abuse loadingdialog:

the right usage is :

 fist into the page/activity/fragment,use the loadingview inside your layout/xml,there is many statelayout lib,or you can use my: https://github.com/hss01248/PageStateManager
 refresh a part of the contentView,or click a button to request http,which has no effect on the whole contentview,then you can use the loadingDialog, just like the ajax in web.

features

  • include commo dialogs with material style ( in support v7),ios style

  • support custom dialog ,just deliver a view. you can retain the buttons and title with ios or material style,or hide them.

  • get the top activity automatically ,so no need to deliver the activity,also support show in paticular activity by setActivity(activity)

  • safety :can be invoked in any thread

  • when the content is fullScreen ,it can adjust the margin automatically,also support set the height percent and width percent

  • has a shadow backgroud incase of the dimlayer not work,you can also disable it to show your own background in customview

  • chained api, easy to use

  • adapt to phone and tablet,high and low resolution ratio screen

  • support localization

  • support three window types: as a common dialog ,as a widow with TYPE_TOAST,as a activity with dialog style.

  • support show softKeyboard automatically ,just setNeedSoftKeyboard(true)

  • support ad style dialog

effect pics

https://github.com/hss01248/DialogUtil/wiki/0_types(%E6%89%80%E6%9C%89%E7%9A%84%E7%B1%BB%E5%9E%8B)

screen adapt

https://github.com/hss01248/DialogUtil/wiki/screen-adapt(%E5%B1%8F%E5%B9%95%E9%80%82%E9%85%8D)

useage

gradle

Step 1. Add the JitPack repository to your build file

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 {
	        compile ('com.github.hss01248:DialogUtil:lastest release'){
              exclude group: 'com.android.support'
	        }
	         compile 'com.android.support:appcompat-v7:26.1.0'
   			 compile 'com.android.support:recyclerview-v7:26.1.0'
    		 compile 'com.android.support:design:26.1.0'
    		 //change 26.1.0 to the same version as it in your module
	}

lastest release: https://github.com/hss01248/DialogUtil/releases

init

//in oncreate() of BaseApplication:

StyledDialog.init(this);

//get activity instance in ActivityLifecycleCallbacks:
 registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {
            @Override
            public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
                ActivityStackManager.getInstance().addActivity(activity);
            }

            @Override
            public void onActivityStarted(Activity activity) {

            }

            @Override
            public void onActivityResumed(Activity activity) {
            }

            @Override
            public void onActivityPaused(Activity activity) {

            }

            @Override
            public void onActivityStopped(Activity activity) {

            }

            @Override
            public void onActivitySaveInstanceState(Activity activity, Bundle outState) {

            }

            @Override
            public void onActivityDestroyed(Activity activity) {
                ActivityStackManager.getInstance().removeActivity(activity);
            }
        });

demo code( in MainActivity)

        //use default style:
        StyledDialog.buildLoading().show();
        
        //set some style:
        StyledDialog.buildMdAlert("title", msg,  new MyDialogListener() {
                    @Override
                    public void onFirst() {
                        showToast("onFirst");
                    }

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

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


                })
                        .setBtnSize(20)
                        .setBtnText("i","b","3")
                        .show();

callback

MyDialogListener

	public abstract void onFirst();//md-sure button
    public abstract void onSecond();//md-cancel button
    public void onThird(){}//md-netural button

    public void onCancle(){}

    /**
     * callback for Input
     * @param input1
     * @param input2
     */
    public void onGetInput(CharSequence input1,CharSequence input2){

    }

    /**
     * callback for MdSingleChoose
     * @param chosen
     * @param chosenTxt
     */
    public void onGetChoose(int chosen,CharSequence chosenTxt){

    }

    /**
     * callback for MdMultiChoose
     * @param states
     */
    public void onChoosen( List<Integer> selectedIndex, List<CharSequence> selectedStrs,boolean[] states){

    }

MyItemDialogListener

 /**
     * for IosSingleChoose,BottomItemDialog
     * @param text
     * @param position
     */
   public abstract void onItemClick(CharSequence text, int position);


    /**
     * for BottomItemDialog
     */
   public void onBottomBtnClick(){}

apis

build different dialogs :StyledDialog.buildxxx:

methodsofstyledialog

set custom style:setXxx

methodsofconfig

finally ,you must invoke show(),it returns a dialog pbject

dismiss

StyledDialog.dismiss(DialogInterface... dialogs);

the loading dialog can be dismissed by call :

StyledDialog.dismissLoading();

progress dialog

/**
 *  call anywhere
 */
public static void updateProgress( Dialog dialog, int progress,  int max,  CharSequence msg,  boolean isHorizontal)
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].