|
|
|
@ -173,25 +173,11 @@ public class UnzipDialogFragment extends DialogFragment {
|
|
|
|
|
nt.start();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
/**
|
|
|
|
|
builder.setView(view).setTitle("解压到当前路径").setPositiveButton("解压", new DialogInterface.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
passwd = passwd_edit.getText().toString();
|
|
|
|
|
Handler fHandler = new FileHandler(getActivity(),fragment);
|
|
|
|
|
Thread ft = new Thread(new FileThread(fHandler,srcFile,desPath,passwd,FileHandler.FUNCTION_DECOMPRESS));
|
|
|
|
|
ft.start();
|
|
|
|
|
progressBar.setVisibility(View.VISIBLE);
|
|
|
|
|
//listener.onDialogUnzipClicked();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
**/
|
|
|
|
|
builder.setView(view).setTitle("解压到当前路径").setPositiveButton("解压",null)
|
|
|
|
|
.setNegativeButton("取消", new DialogInterface.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
//Toast.makeText(getActivity(),"取消操作",Toast.LENGTH_SHORT).show();
|
|
|
|
|
Toast.makeText(getActivity(),"取消",Toast.LENGTH_SHORT).show();
|
|
|
|
|
}
|
|
|
|
|
});;
|
|
|
|
|
alertDialog = builder.create();
|
|
|
|
@ -200,6 +186,7 @@ public class UnzipDialogFragment extends DialogFragment {
|
|
|
|
|
@Override
|
|
|
|
|
public void onStart(){
|
|
|
|
|
super.onStart();
|
|
|
|
|
alertDialog.setCanceledOnTouchOutside(false);
|
|
|
|
|
if (alertDialog != null){
|
|
|
|
|
Button pb = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE);
|
|
|
|
|
pb.setOnClickListener(new View.OnClickListener() {
|
|
|
|
@ -212,6 +199,9 @@ public class UnzipDialogFragment extends DialogFragment {
|
|
|
|
|
Thread ft = new Thread(new FileThread(fHandler,srcFile,desPath,passwd,FileHandler.FUNCTION_DECOMPRESS));
|
|
|
|
|
ft.start();
|
|
|
|
|
progressBar.setVisibility(View.VISIBLE);
|
|
|
|
|
Button nb = alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE);
|
|
|
|
|
nb.setClickable(false);
|
|
|
|
|
nb.setTextColor(getResources().getColor(R.color.grey_1));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -226,10 +216,13 @@ public class UnzipDialogFragment extends DialogFragment {
|
|
|
|
|
passwd_edit.setFocusable(false);
|
|
|
|
|
}
|
|
|
|
|
public void setMD5(String md5){
|
|
|
|
|
if(md5 != null && !("".equals(md5))) {
|
|
|
|
|
md5_edit.setText(md5);
|
|
|
|
|
this.md5 = md5_edit.getText().toString();
|
|
|
|
|
md5_edit.setSelection(md5.length());
|
|
|
|
|
md5_edit.setTextColor(getResources().getColor(R.color.grey_1));
|
|
|
|
|
Toast.makeText(getActivity(),"md5码加载完成",Toast.LENGTH_SHORT).show();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public void setSuccessful(boolean successful){
|
|
|
|
|
this.successful = successful;
|
|
|
|
|