File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
nicedialog/src/main/java/com/othershe/nicedialog Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ allprojects {
2323** Step 2. 添加项目依赖**
2424``` gradle
2525dependencies {
26- compile 'com.github.Othershe:NiceDialog:1.1.3 '
26+ compile 'com.github.Othershe:NiceDialog:1.1.4 '
2727}
2828```
2929** Step 3. 配置、展示dialog**
Original file line number Diff line number Diff line change 66import android .support .annotation .StyleRes ;
77import android .support .v4 .app .DialogFragment ;
88import android .support .v4 .app .FragmentManager ;
9+ import android .support .v4 .app .FragmentTransaction ;
910import android .view .Gravity ;
1011import android .view .LayoutInflater ;
1112import android .view .View ;
@@ -162,7 +163,12 @@ public BaseNiceDialog setAnimStyle(@StyleRes int animStyle) {
162163 }
163164
164165 public BaseNiceDialog show (FragmentManager manager ) {
165- super .show (manager , String .valueOf (System .currentTimeMillis ()));
166+ FragmentTransaction ft = manager .beginTransaction ();
167+ if (this .isAdded ()) {
168+ ft .remove (this ).commit ();
169+ }
170+ ft .add (this , String .valueOf (System .currentTimeMillis ()));
171+ ft .commitAllowingStateLoss ();
166172 return this ;
167173 }
168174}
You can’t perform that action at this time.
0 commit comments