Skip to content

Commit

Permalink
fix bug and modify readme
Browse files Browse the repository at this point in the history
  • Loading branch information
molihuan committed Dec 31, 2022
1 parent 55812e1 commit 162cc32
Show file tree
Hide file tree
Showing 23 changed files with 448 additions and 102 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright [2020] molihuan

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
41 changes: 29 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ dependencyResolutionManagement {
```java
dependencies {
...
// 请将"版本"替换成具体的版本号,如 1.1.7
// 请将"版本"替换成具体的版本号,如 1.1.11
implementation 'io.github.molihuan:pathselector:版本'
}
```
Expand All @@ -103,10 +103,10 @@ PathSelector.build(this, MConstants.BUILD_DIALOG)//Dialog构建方式
.setMorePopupItemListeners(
new CommonItemListener("OK") {
@Override
public boolean onClick(View v, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {

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

StringBuilder builder = new StringBuilder();
Expand Down Expand Up @@ -144,7 +144,7 @@ PathSelectFragment selector = PathSelector.build(this, MConstants.BUILD_ACTIVITY
.setMorePopupItemListeners(
new CommonItemListener("OK") {
@Override
public boolean onClick(View v, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {

StringBuilder builder = new StringBuilder();
builder.append("you selected:\n");
Expand Down Expand Up @@ -180,7 +180,7 @@ PathSelectFragment selector = PathSelector.build(this, MConstants.BUILD_FRAGMENT
.setMorePopupItemListeners(
new CommonItemListener("OK") {
@Override
public boolean onClick(View v, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {

StringBuilder builder = new StringBuilder();
builder.append("you selected:\n");
Expand Down Expand Up @@ -250,14 +250,14 @@ PathSelectFragment selector = PathSelector.build(this, MConstants.BUILD_DIALOG)
.setMorePopupItemListeners(//设置右上角选项回调
new CommonItemListener("SelectAll") {
@Override
public boolean onClick(View v, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
pathSelectFragment.selectAllFile(true);
return false;
}
},
new CommonItemListener("DeselectAll") {
@Override
public boolean onClick(View v, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
pathSelectFragment.selectAllFile(false);
return false;
}
Expand All @@ -266,7 +266,7 @@ PathSelectFragment selector = PathSelector.build(this, MConstants.BUILD_DIALOG)
.setHandleItemListeners(//设置长按弹出选项回调
new CommonItemListener("OK") {
@Override
public boolean onClick(View v, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
StringBuilder builder = new StringBuilder();
builder.append("you selected:\n");
for (FileBean fileBean : selectedFiles) {
Expand All @@ -278,7 +278,7 @@ PathSelectFragment selector = PathSelector.build(this, MConstants.BUILD_DIALOG)
},
new CommonItemListener("cancel") {
@Override
public boolean onClick(View v, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
pathSelectFragment.openCloseMultipleMode(false);
return false;
}
Expand All @@ -304,7 +304,7 @@ PathSelectFragment selector = PathSelector.build(this, MConstants.BUILD_DIALOG)
//R.drawable.ic_test_mlh是你自己的图片资源id
new CommonItemListener(new FontBean("OK", 18, Color.RED, R.drawable.ic_test_mlh)) {
@Override
public boolean onClick(View v, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
Mtools.toast("You Click");
return false;
}
Expand Down Expand Up @@ -335,7 +335,7 @@ PathSelectFragment selector = PathSelector.build(this, MConstants.BUILD_DIALOG)
}

@Override
public boolean onClick(View v, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
Mtools.toast("You Click");
return false;
}
Expand Down Expand Up @@ -508,4 +508,21 @@ PathSelectFragment selector = PathSelector.build(this, MConstants.BUILD_DIALOG)

开源项目以及其依赖项目。

### [LICENSE ](https://github.com/molihuan/mlhfileselectorlib/blob/master/LICENSE)
### LICENSE

```
Copyright [2020] molihuan
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

42 changes: 29 additions & 13 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ dependencyResolutionManagement {
```java
dependencies {
...
// Please replace "version" with a specific version number, e.g. 1.1.7
// Please replace "version" with a specific version number, e.g. 1.1.11
implementation 'io.github.molihuan:pathselector:version'
}
```
Expand All @@ -103,10 +103,10 @@ PathSelector.build(this, MConstants.BUILD_DIALOG)//Dialog build mode
.setMorePopupItemListeners(
new CommonItemListener("OK") {
@Override
public boolean onClick(View v, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {

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

StringBuilder builder = new StringBuilder();
Expand Down Expand Up @@ -144,7 +144,7 @@ PathSelectFragment selector = PathSelector.build(this, MConstants.BUILD_ACTIVITY
.setMorePopupItemListeners(
new CommonItemListener("OK") {
@Override
public boolean onClick(View v, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {

StringBuilder builder = new StringBuilder();
builder.append("you selected:\n");
Expand Down Expand Up @@ -180,7 +180,7 @@ PathSelectFragment selector = PathSelector.build(this, MConstants.BUILD_FRAGMENT
.setMorePopupItemListeners(
new CommonItemListener("OK") {
@Override
public boolean onClick(View v, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {

StringBuilder builder = new StringBuilder();
builder.append("you selected:\n");
Expand Down Expand Up @@ -250,14 +250,14 @@ PathSelectFragment selector = PathSelector.build(this, MConstants.BUILD_DIALOG)
.setMorePopupItemListeners(//Set the top right option callback
new CommonItemListener("SelectAll") {
@Override
public boolean onClick(View v, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
pathSelectFragment.selectAllFile(true);
return false;
}
},
new CommonItemListener("DeselectAll") {
@Override
public boolean onClick(View v, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
pathSelectFragment.selectAllFile(false);
return false;
}
Expand All @@ -266,7 +266,7 @@ PathSelectFragment selector = PathSelector.build(this, MConstants.BUILD_DIALOG)
.setHandleItemListeners(//Set long press pop-up option callback
new CommonItemListener("OK") {
@Override
public boolean onClick(View v, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
StringBuilder builder = new StringBuilder();
builder.append("you selected:\n");
for (FileBean fileBean : selectedFiles) {
Expand All @@ -278,7 +278,7 @@ PathSelectFragment selector = PathSelector.build(this, MConstants.BUILD_DIALOG)
},
new CommonItemListener("cancel") {
@Override
public boolean onClick(View v, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
pathSelectFragment.openCloseMultipleMode(false);
return false;
}
Expand All @@ -304,7 +304,7 @@ PathSelectFragment selector = PathSelector.build(this, MConstants.BUILD_DIALOG)
//R.drawable.ic_test_mlh is your own image resource id
new CommonItemListener(new FontBean("OK", 18, Color.RED, R.drawable.ic_test_mlh)) {
@Override
public boolean onClick(View v, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
Mtools.toast("You Click");
return false;
}
Expand Down Expand Up @@ -335,7 +335,7 @@ PathSelectFragment selector = PathSelector.build(this, MConstants.BUILD_DIALOG)
}

@Override
public boolean onClick(View v, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
Mtools.toast("You Click");
return false;
}
Expand Down Expand Up @@ -509,4 +509,20 @@ PathSelectFragment selector = PathSelector.build(this, MConstants.BUILD_DIALOG)

Open source projects and their dependencies.

### [LICENSE ](https://github.com/molihuan/mlhfileselectorlib/blob/master/LICENSE)
### LICENSE

```
Copyright [2020] molihuan
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
Binary file modified app/release/app-release.apk
Binary file not shown.
Loading

0 comments on commit 162cc32

Please sign in to comment.