Added Pwned info button

pull/215/head
M66B 8 months ago
parent fdb1dcfd52
commit dd6e85cee2

@ -216,7 +216,7 @@ android {
buildConfigField "String", "GEMINI_ENDPOINT", "\"https://generativelanguage.googleapis.com/v1beta/\""
buildConfigField "String", "GEMINI_PRIVACY", "\"https://support.google.com/gemini/answer/13594961\""
buildConfigField "String", "PWNED_ENDPOINT", "\"https://api.pwnedpasswords.com/\""
buildConfigField "String", "PWNED_PRIVACY", "\"https://haveibeenpwned.com/Privacy\""
buildConfigField "String", "PWNED_URI", "\"https://haveibeenpwned.com/\""
buildConfigField "String", "FDROID", "\"https://f-droid.org/packages/%s/\""
}
large {
@ -242,7 +242,7 @@ android {
buildConfigField "String", "GEMINI_ENDPOINT", "\"https://generativelanguage.googleapis.com/v1beta/\""
buildConfigField "String", "GEMINI_PRIVACY", "\"https://support.google.com/gemini/answer/13594961\""
buildConfigField "String", "PWNED_ENDPOINT", "\"https://api.pwnedpasswords.com/\""
buildConfigField "String", "PWNED_PRIVACY", "\"https://haveibeenpwned.com/Privacy\""
buildConfigField "String", "PWNED_URI", "\"https://haveibeenpwned.com/\""
buildConfigField "String", "FDROID", "\"https://f-droid.org/packages/%s/\""
}
fdroid {
@ -277,7 +277,7 @@ android {
buildConfigField "String", "GEMINI_ENDPOINT", "\"https://generativelanguage.googleapis.com/v1beta/\""
buildConfigField "String", "GEMINI_PRIVACY", "\"https://support.google.com/gemini/answer/13594961\""
buildConfigField "String", "PWNED_ENDPOINT", "\"https://api.pwnedpasswords.com/\""
buildConfigField "String", "PWNED_PRIVACY", "\"https://haveibeenpwned.com/Privacy\""
buildConfigField "String", "PWNED_URI", "\"https://haveibeenpwned.com/\""
buildConfigField "String", "FDROID", "\"https://f-droid.org/packages/%s/\""
}
play {
@ -304,7 +304,7 @@ android {
buildConfigField "String", "GEMINI_ENDPOINT", "\"\""
buildConfigField "String", "GEMINI_PRIVACY", "\"\""
buildConfigField "String", "PWNED_ENDPOINT", "\"\""
buildConfigField "String", "PWNED_PRIVACY", "\"\""
buildConfigField "String", "PWNED_URI", "\"\""
buildConfigField "String", "FDROID", "\"\""
getIsDefault().set(true)
}
@ -332,7 +332,7 @@ android {
buildConfigField "String", "GEMINI_ENDPOINT", "\"\""
buildConfigField "String", "GEMINI_PRIVACY", "\"\""
buildConfigField "String", "PWNED_ENDPOINT", "\"\""
buildConfigField "String", "PWNED_PRIVACY", "\"\""
buildConfigField "String", "PWNED_URI", "\"\""
buildConfigField "String", "FDROID", "\"\""
}
}

@ -34,6 +34,7 @@ import android.text.style.StyleSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;
import androidx.annotation.NonNull;
@ -54,6 +55,7 @@ public class FragmentDialogPwned extends FragmentDialogBase {
final TextView tvPwned = dview.findViewById(R.id.tvPwned);
final Button btnCheck = dview.findViewById(R.id.btnCheck);
final ContentLoadingProgressBar pbCheck = dview.findViewById(R.id.pbCheck);
final ImageButton ibPwned = dview.findViewById(R.id.ibPwned);
final TextView tvPrivacy = dview.findViewById(R.id.tvPrivacy);
final Group grpReady = dview.findViewById(R.id.grpReady);
@ -131,15 +133,22 @@ public class FragmentDialogPwned extends FragmentDialogBase {
}
});
ibPwned.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Helper.view(v.getContext(), Uri.parse(BuildConfig.PWNED_URI), true);
}
});
pbCheck.setVisibility(View.GONE);
grpReady.setVisibility(View.GONE);
tvPrivacy.setText(BuildConfig.PWNED_PRIVACY);
tvPrivacy.setText(BuildConfig.PWNED_URI + "Privacy");
tvPrivacy.getPaint().setUnderlineText(true);
tvPrivacy.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Helper.view(v.getContext(), Uri.parse(BuildConfig.PWNED_PRIVACY), true);
Helper.view(v.getContext(), Uri.parse(BuildConfig.PWNED_URI + "Privacy"), true);
}
});

@ -55,6 +55,17 @@
app:layout_constraintStart_toEndOf="@id/btnCheck"
app:layout_constraintTop_toTopOf="@id/btnCheck" />
<ImageButton
android:id="@+id/ibPwned"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/title_info"
android:tooltipText="@string/title_info"
app:layout_constraintBottom_toBottomOf="@id/btnCheck"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/btnCheck"
app:srcCompat="@drawable/twotone_info_24" />
<TextView
android:id="@+id/tvPrivacy"
android:layout_width="wrap_content"

Loading…
Cancel
Save