|
|
@ -184,6 +184,7 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
|
|
|
|
final CheckBox cbSecure = dview.findViewById(R.id.cbSecure);
|
|
|
|
final CheckBox cbSecure = dview.findViewById(R.id.cbSecure);
|
|
|
|
final CheckBox cbSanitize = dview.findViewById(R.id.cbSanitize);
|
|
|
|
final CheckBox cbSanitize = dview.findViewById(R.id.cbSanitize);
|
|
|
|
final CheckBox cbNotAgain = dview.findViewById(R.id.cbNotAgain);
|
|
|
|
final CheckBox cbNotAgain = dview.findViewById(R.id.cbNotAgain);
|
|
|
|
|
|
|
|
final CheckBox cbNeverAgain = dview.findViewById(R.id.cbNeverAgain);
|
|
|
|
final Spinner spOpenWith = dview.findViewById(R.id.spOpenWith);
|
|
|
|
final Spinner spOpenWith = dview.findViewById(R.id.spOpenWith);
|
|
|
|
|
|
|
|
|
|
|
|
ibMore = dview.findViewById(R.id.ibMore);
|
|
|
|
ibMore = dview.findViewById(R.id.ibMore);
|
|
|
@ -350,6 +351,13 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cbNeverAgain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
|
|
|
|
|
|
|
cbNotAgain.setEnabled(!isChecked);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
spOpenWith.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
|
|
spOpenWith.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
|
|
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
|
|
@ -608,6 +616,8 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
|
|
|
|
cbNotAgain.setText(context.getString(R.string.title_no_ask_for_again, chost));
|
|
|
|
cbNotAgain.setText(context.getString(R.string.title_no_ask_for_again, chost));
|
|
|
|
cbNotAgain.setVisibility(!always_confirm && !sanitize_links && chost != null ? View.VISIBLE : View.GONE);
|
|
|
|
cbNotAgain.setVisibility(!always_confirm && !sanitize_links && chost != null ? View.VISIBLE : View.GONE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cbNeverAgain.setVisibility(!always_confirm && !sanitize_links ? View.VISIBLE : View.GONE);
|
|
|
|
|
|
|
|
|
|
|
|
setMore(false);
|
|
|
|
setMore(false);
|
|
|
|
|
|
|
|
|
|
|
|
if (UriHelper.isHyperLink(uri)) {
|
|
|
|
if (UriHelper.isHyperLink(uri)) {
|
|
|
@ -782,13 +792,16 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
|
|
|
|
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
|
|
|
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
if (chost != null &&
|
|
|
|
if (cbNeverAgain.getVisibility() == View.VISIBLE && cbNeverAgain.isChecked())
|
|
|
|
cbNotAgain.getVisibility() == View.VISIBLE && cbNotAgain.isChecked())
|
|
|
|
prefs.edit().putBoolean("confirm_links", false).apply();
|
|
|
|
|
|
|
|
else if (chost != null &&
|
|
|
|
|
|
|
|
cbNotAgain.getVisibility() == View.VISIBLE && cbNotAgain.isChecked()) {
|
|
|
|
prefs.edit()
|
|
|
|
prefs.edit()
|
|
|
|
.putBoolean(chost + ".link_view", false)
|
|
|
|
.putBoolean(chost + ".link_view", false)
|
|
|
|
.putBoolean(chost + ".link_sanitize",
|
|
|
|
.putBoolean(chost + ".link_sanitize",
|
|
|
|
cbSanitize.getVisibility() == View.VISIBLE && cbSanitize.isChecked())
|
|
|
|
cbSanitize.getVisibility() == View.VISIBLE && cbSanitize.isChecked())
|
|
|
|
.apply();
|
|
|
|
.apply();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Uri theUri = Uri.parse(etLink.getText().toString());
|
|
|
|
Uri theUri = Uri.parse(etLink.getText().toString());
|
|
|
|
Package pkg = (Package) spOpenWith.getSelectedItem();
|
|
|
|
Package pkg = (Package) spOpenWith.getSelectedItem();
|
|
|
|