1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-26 17:57:16 +00:00

Added safe browsing info button

This commit is contained in:
M66B 2020-03-29 18:46:48 +02:00
parent 0ce292d331
commit 72c11c4a4f
2 changed files with 20 additions and 0 deletions

View file

@ -24,6 +24,7 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
@ -63,6 +64,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
private SwitchCompat swDisplayHidden;
private SwitchCompat swSecure;
private SwitchCompat swSafeBrowsing;
private Button btnSafeBrowsing;
private final static String[] RESET_OPTIONS = new String[]{
"confirm_links", "confirm_images", "confirm_html", "disable_tracking",
@ -91,6 +93,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
swDisplayHidden = view.findViewById(R.id.swDisplayHidden);
swSecure = view.findViewById(R.id.swSecure);
swSafeBrowsing = view.findViewById(R.id.swSafeBrowsing);
btnSafeBrowsing = view.findViewById(R.id.btnSafeBrowsing);
setOptions();
@ -200,6 +203,13 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
}
});
btnSafeBrowsing.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Helper.view(getContext(), Uri.parse("https://developers.google.com/safe-browsing"), true);
}
});
PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);
return view;

View file

@ -250,5 +250,15 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSecureHint"
app:switchPadding="12dp" />
<Button
android:id="@+id/btnSafeBrowsing"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/title_info"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swSafeBrowsing" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>