Skip to content

Commit

Permalink
Fixed issue where Dialog cannot dismiss()
Browse files Browse the repository at this point in the history
  • Loading branch information
molihuan committed Dec 15, 2022
1 parent f602cd4 commit c424a74
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ dependencyResolutionManagement {
```java
dependencies {
...
// 请将"版本"替换成具体的版本号,如 1.1.2
// 请将"版本"替换成具体的版本号,如 1.1.3
implementation 'io.github.molihuan:pathselector:版本'
}
```
Expand All @@ -100,6 +100,10 @@ PathSelector.build(this, MConstants.BUILD_DIALOG)//Dialog构建方式
new CommonItemListener("OK") {
@Override
public boolean onClick(View v, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {

/**取消dialog弹窗
* pathSelectFragment.getSelectConfigData().buildController.getDialogFragment().dismiss();
*/

StringBuilder builder = new StringBuilder();
builder.append("you selected:\n");
Expand Down
4 changes: 4 additions & 0 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ PathSelector.build(this, MConstants.BUILD_DIALOG)//Dialog build mode
new CommonItemListener("OK") {
@Override
public boolean onClick(View v, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {

/**dialog.dismiss()
* pathSelectFragment.getSelectConfigData().buildController.getDialogFragment().dismiss();
*/

StringBuilder builder = new StringBuilder();
builder.append("you selected:\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,11 @@ private void dialogSelectShow() {
new CommonItemListener("SelectAll") {
@Override
public boolean onClick(View v, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
/**取消dialog弹窗
* pathSelectFragment.getSelectConfigData().buildController.getDialogFragment().dismiss();
*/

pathSelectFragment.selectAllFile(true);

return false;
}
},
Expand Down
Binary file added art/Cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.molihuan.pathselector.fragment;

import com.molihuan.pathselector.dao.SelectConfigData;
import com.molihuan.pathselector.interfaces.IFileShowFragment;
import com.molihuan.pathselector.interfaces.IHandleFragment;
import com.molihuan.pathselector.interfaces.ITabbarFragment;
Expand All @@ -19,6 +20,8 @@ public abstract class BasePathSelectFragment extends AbstractFragment implements

public abstract void returnDataToActivityResult();

public abstract SelectConfigData getSelectConfigData();

/**
* 显示或隐藏handleFragment
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.molihuan.pathselector.R;
import com.molihuan.pathselector.adapter.FileListAdapter;
import com.molihuan.pathselector.adapter.TabbarListAdapter;
import com.molihuan.pathselector.dao.SelectConfigData;
import com.molihuan.pathselector.entity.FileBean;
import com.molihuan.pathselector.entity.TabbarFileBean;
import com.molihuan.pathselector.fragment.AbstractFileShowFragment;
Expand Down Expand Up @@ -181,6 +182,11 @@ public void returnDataToActivityResult() {
pathFileManager.returnDataToActivityResult(getSelectedFileList(), mActivity);
}

@Override
public SelectConfigData getSelectConfigData() {
return mConfigData;
}

@SuppressLint("WrongConstant")
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
Expand Down

0 comments on commit c424a74

Please sign in to comment.