VirusTotal: repeat privacy policy on upload

This commit is contained in:
M66B 2022-07-25 11:00:49 +02:00
parent 2800036e61
commit c3b3896455
2 changed files with 27 additions and 2 deletions

View File

@ -543,6 +543,7 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
final Button btnUpload = view.findViewById(R.id.btnUpload);
final ProgressBar pbUpload = view.findViewById(R.id.pbUpload);
final TextView tvAnalyzing = view.findViewById(R.id.tvAnalyzing);
final TextView tvPrivacy = view.findViewById(R.id.tvPrivacy);
final ProgressBar pbWait = view.findViewById(R.id.pbWait);
tvName.setText(name);
@ -551,8 +552,8 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
tvUnknown.setVisibility(View.GONE);
tvSummary.setVisibility(View.GONE);
tvLabel.setVisibility(View.GONE);
tvReport.getPaint().setUnderlineText(true);
tvReport.setVisibility(View.GONE);
tvReport.getPaint().setUnderlineText(true);
rvScan.setHasFixedSize(false);
LinearLayoutManager llm = new LinearLayoutManager(getContext());
@ -566,6 +567,8 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
btnUpload.setVisibility(View.GONE);
pbUpload.setVisibility(View.GONE);
tvAnalyzing.setVisibility(View.GONE);
tvPrivacy.setVisibility(View.GONE);
tvPrivacy.getPaint().setUnderlineText(true);
pbWait.setVisibility(View.GONE);
final SimpleTask<Bundle> taskLookup = new SimpleTask<Bundle>() {
@ -611,6 +614,7 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
adapter.set(scans == null ? new ArrayList<>() : scans);
rvScan.setVisibility(scans == null ? View.GONE : View.VISIBLE);
btnUpload.setVisibility(scans == null && !TextUtils.isEmpty(apiKey) ? View.VISIBLE : View.GONE);
tvPrivacy.setVisibility(btnUpload.getVisibility());
}
@Override
@ -697,6 +701,13 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
}
});
tvPrivacy.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Helper.view(v.getContext(), Uri.parse(VirusTotal.URI_PRIVACY), true);
}
});
if (!TextUtils.isEmpty(apiKey))
taskLookup.execute(this, args, "attachment:lookup");
else

View File

@ -89,6 +89,20 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnUpload" />
<TextView
android:id="@+id/tvPrivacy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:drawableEnd="@drawable/twotone_open_in_new_12"
android:drawablePadding="6dp"
android:drawableTint="?android:attr/textColorLink"
android:text="@string/title_privacy_policy"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorLink"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvAnalyzing" />
<TextView
android:id="@+id/tvSummary"
android:layout_width="wrap_content"
@ -98,7 +112,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="?attr/colorWarning"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvAnalyzing" />
app:layout_constraintTop_toBottomOf="@id/tvPrivacy" />
<TextView
android:id="@+id/tvLabel"