|
|
|
@ -44,6 +44,8 @@ public class UnzipDialogFragment extends DialogFragment {
|
|
|
|
|
Button posi_btn; //点击解压的按钮
|
|
|
|
|
//用一个fragment来存当前这个fragment对象
|
|
|
|
|
Fragment fragment;
|
|
|
|
|
//
|
|
|
|
|
FileManageFragment fmFragment;
|
|
|
|
|
//点击压缩文件弹出来的Dialog
|
|
|
|
|
private UnzipDialogListener listener;
|
|
|
|
|
//源文件绝对路径,目标文件夹绝对路径,md5码和密码
|
|
|
|
@ -94,10 +96,12 @@ public class UnzipDialogFragment extends DialogFragment {
|
|
|
|
|
srcFile_edit = view.findViewById(R.id.src_edit);
|
|
|
|
|
srcFile_edit.setText(srcFile);
|
|
|
|
|
srcFile_edit.setSelection(srcFile.length());
|
|
|
|
|
srcFile_edit.setTextColor(getResources().getColor(R.color.grey_1));
|
|
|
|
|
|
|
|
|
|
desPath_edit = view.findViewById(R.id.des_edit);
|
|
|
|
|
desPath_edit.setText(desPath);
|
|
|
|
|
desPath_edit.setSelection(desPath.length());
|
|
|
|
|
desPath_edit.setTextColor(getResources().getColor(R.color.grey_1));
|
|
|
|
|
|
|
|
|
|
md5_edit = view.findViewById(R.id.md5_edit);
|
|
|
|
|
passwd_edit = view.findViewById(R.id.pwd_edit);
|
|
|
|
@ -112,7 +116,7 @@ public class UnzipDialogFragment extends DialogFragment {
|
|
|
|
|
if(!FileUtils.isEncrypted(srcFile)){
|
|
|
|
|
//当文件不是加密文件时
|
|
|
|
|
TextView text = view.findViewById(R.id.pwd_text);
|
|
|
|
|
text.setTextColor(getResources().getColor(R.color.grey));
|
|
|
|
|
text.setTextColor(getResources().getColor(R.color.grey_1));
|
|
|
|
|
setNoPWD();
|
|
|
|
|
}
|
|
|
|
|
} catch (ZipException e) {
|
|
|
|
@ -225,6 +229,7 @@ public class UnzipDialogFragment extends DialogFragment {
|
|
|
|
|
md5_edit.setText(md5);
|
|
|
|
|
this.md5 = md5_edit.getText().toString();
|
|
|
|
|
md5_edit.setSelection(md5.length());
|
|
|
|
|
md5_edit.setTextColor(getResources().getColor(R.color.grey_1));
|
|
|
|
|
}
|
|
|
|
|
public void setSuccessful(boolean successful){
|
|
|
|
|
this.successful = successful;
|
|
|
|
@ -252,12 +257,19 @@ public class UnzipDialogFragment extends DialogFragment {
|
|
|
|
|
}
|
|
|
|
|
public void setNoPWD(){
|
|
|
|
|
getPWD.setClickable(false);
|
|
|
|
|
getPWD.setTextColor(getResources().getColor(R.color.grey));
|
|
|
|
|
getPWD.setTextColor(getResources().getColor(R.color.grey_1));
|
|
|
|
|
passwd_edit.setFocusable(false);
|
|
|
|
|
passwd_edit.setHint("非加密文件");
|
|
|
|
|
passwd_edit.setHintTextColor(getResources().getColor(R.color.grey_1));
|
|
|
|
|
acceptPWD2SQL.setChecked(false);
|
|
|
|
|
}
|
|
|
|
|
public Button getPosiBtn(){
|
|
|
|
|
return posi_btn;
|
|
|
|
|
}
|
|
|
|
|
public void setFmFragment(FileManageFragment fmFragment){
|
|
|
|
|
this.fmFragment = fmFragment;
|
|
|
|
|
}
|
|
|
|
|
public FileManageFragment getFMFragment(){
|
|
|
|
|
return fmFragment;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|