shehuan / nicedialog Goto Github PK
View Code? Open in Web Editor NEWA nice dialog, that is based on DialogFragment
License: Apache License 2.0
A nice dialog, that is based on DialogFragment
License: Apache License 2.0
我引用你的库,Gradle完报如下错误。
error: expected reference but got (raw string) #66000000.
我的环境信息如下:
Android Studio:3.1.4
gradle tools:3.1.4
gradle-4.4-all.zip
某些情况下,在ViewConvertListener中跳转到其他activity界面会出现没有实现Parcelable 序列化的异常
java.lang.RuntimeException: Parcelable encountered IOException writing serializable object
Caused by: java.io.NotSerializableException
抛出以上异常
有没有必要在NiceDialog增加
@Override
public void onDestroyView() {
super.onDestroyView();
setViewConvertListener(null); // 销毁监听
Log.d(TAG, "onDestroyView: MyDialog");
}
因为不知道里面会遇上什么持久化的事务
我已经翻墙了maven { url "https://jitpack.io" }也加了,就不是下不下来
@OverRide
public void dismiss() {
View view = getCurrentFocus();
if(view instanceof TextView){
InputMethodManager mInputMethodManager = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
mInputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.RESULT_UNCHANGED_SHOWN);
}
super.dismiss();
}
我想问一下,网络开始请求,我显示loading ,等请求回来, 什么在请求结束回调调用dismiss?
请问该如何实现竖屏时从底部弹出dialog,横屏时改为从左侧弹出
Could not download NiceDialog.aar (com.github.SheHuan:NiceDialog:1.1.9)
这是我的开发环境
Android Studio 3.3.1
Build #AI-182.5107.16.33.5264788, built on January 29, 2019
JRE: 1.8.0_152-release-1248-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
现在是写死的NiceDialog主题:
setStyle(DialogFragment.STYLE_NO_TITLE, R.style.NiceDialog);
继承自android默认dialog主题,不是我想要的,目前是通过重写NiceDialog主题来覆盖实现的,不过还是建议改成可配置。
public BaseNiceDialog show(FragmentManager manager) {
FragmentTransaction ft = manager.beginTransaction();
if (this.isAdded()) {
ft.remove(this).commit();
}
ft.add(this, String.valueOf(System.currentTimeMillis()));
ft.commitAllowingStateLoss();
return this;
}
09-11 10:41:36.413 5744 5744 E AndroidRuntime: FATAL EXCEPTION: main
09-11 10:41:36.413 5744 5744 E AndroidRuntime: Process: com.noahedu.intelligentguidestudy, PID: 5744
09-11 10:41:36.413 5744 5744 E AndroidRuntime: java.lang.IllegalStateException: Can't change tag of fragment YxpStarLoadDialog{a60c8e0 #7 1568169695869}: was 1568169695869 now 1568169696411
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at android.support.v4.app.BackStackRecord.doAddOp(BackStackRecord.java:393)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at android.support.v4.app.BackStackRecord.add(BackStackRecord.java:363)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at com.othershe.nicedialog.BaseNiceDialog.show(BaseNiceDialog.java:177)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at com.noahedu.youyou.view.widget.wbeview.MyWebView.showLoadDialog(MyWebView.java:588)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at com.noahedu.youyou.view.widget.wbeview.MyWebView$WebClient$2.run(MyWebView.java:518)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at android.app.Activity.runOnUiThread(Activity.java:5969)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at com.noahedu.youyou.view.widget.wbeview.MyWebView$WebClient.onPageStarted(MyWebView.java:515)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at com.android.webview.chromium.WebViewContentsClientAdapter.onPageStarted(WebViewContentsClientAdapter.java:517)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at org.chromium.android_webview.AwContentsClientCallbackHelper$MyHandler.handleMessage(AwContentsClientCallbackHelper.java:144)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:110)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at android.os.Looper.loop(Looper.java:203)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6293)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1084)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:945)
--------- beginning of system
ft.remove(this).commit();
此方法并不是同步的,当两次show很快的时候,就可能出现这个错。所以可以做下处理,比如换成ft.remove(this).commitNow();
项目使用的Activity不是兼容版本的,怎么使用呢?
if(this.width == 0) {
lp.width = Utils.getScreenWidth(this.getContext()) - 2 * Utils.dp2px(this.getContext(), (float)this.margin);
} else {
lp.width = Utils.dp2px(this.getContext(), (float)this.width);
}
这里加个是否=-2 是不是好点 不然不能包裹了
博主,关于java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState这问题的我是这样解决的,不知道对不对,我这边测试没啥问题
public BaseFragDialog show(FragmentManager manager) {
if (this.isAdded()) {
manager.beginTransaction().remove(this).commit();
}
FragmentTransaction ft = manager.beginTransaction();
ft.add(this, String.valueOf(System.currentTimeMillis()));
ft.commitAllowingStateLoss();
//ft.show(this);
//super.show(manager, String.valueOf(System.currentTimeMillis()));
return this;
}
议把dialogFragment的onCancel事件暴露出来,不然只是为了单纯的监听个cancel事件还需要自定义个dialog
水波纹在Android6.0上有显示的Bug,第一次渲染会空白,当第一次点击后,才显示正常。。
引用:https://hk.saowen.com/a/0673cb03a7dc4b3d61d7b0641d60e98abd5e1e47d6f06dcbefd5a18c08cc024c
HandlerThread.
Message.obj(excluded)
NiceDialog
如何监听点击蒙版消失后事件呢?
E/EventBus: Could not dispatch event: class com.adinnet.logistics.event.MyEventMessage to subscribing class class com.adinnet.logistics.ui.activity.driver.AccountInfoActivity
java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
在使用takephoto框架后调用图片上传使用了进度条对话框,报了上面的错误
你好,nicedialog很好用。
我在使用的时候遇到一个问题
首次点击一个按钮弹出一个框 在editext输入金额之后 下面有一个确定按钮 跟取消按钮, 然后我点击确定按钮的时候 要去网路请求 这个时候我又想跳出loading的dialog 网络完成之后loading消失。这个时候并没有吧包含edittext的dialog 给dismiss掉 暂无头绪 @shehuan
比如 :好友设置,数据集是动态变化的,或者是网络获取的
你好,最近在项目中有用到您NiceDialog,在使用过程中对NiceDialog的接口进行了些扩充,以及一些优化。刚刚把我的代码提了一个PullRequest,可以考虑合进您的master。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.