Skip to content

Commit

Permalink
Added favicon info button
Browse files Browse the repository at this point in the history
  • Loading branch information
M66B committed Jul 12, 2024
1 parent c8c74e9 commit 0ba7583
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private TextView tvFaviconsHint;
private SwitchCompat swFaviconsPartial;
private SwitchCompat swFaviconsManifest;
private ImageButton ibFavicons;
private SwitchCompat swDdg;
private TextView tvDdgPrivacy;
private SwitchCompat swFaviconsDmarc;
Expand Down Expand Up @@ -309,6 +310,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
tvFaviconsHint = view.findViewById(R.id.tvFaviconsHint);
swFaviconsPartial = view.findViewById(R.id.swFaviconsPartial);
swFaviconsManifest = view.findViewById(R.id.swFaviconsManifest);
ibFavicons = view.findViewById(R.id.ibFavicons);
swDdg = view.findViewById(R.id.swDdg);
tvDdgPrivacy = view.findViewById(R.id.tvDdgPrivacy);
swFaviconsDmarc = view.findViewById(R.id.swFaviconsDmarc);
Expand Down Expand Up @@ -922,6 +924,13 @@ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
}
});

ibFavicons.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Helper.viewFAQ(view.getContext(), 154);
}
});

swDdg.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
Expand Down
15 changes: 14 additions & 1 deletion app/src/main/res/layout/fragment_options_display.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,19 @@
app:layout_constraintTop_toBottomOf="@id/swFaviconsPartial"
app:switchPadding="12dp" />

<ImageButton
android:id="@+id/ibFavicons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="6dp"
android:contentDescription="@string/title_info"
android:tag="nosuggest"
android:tooltipText="@string/title_info"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/swFaviconsManifest"
app:srcCompat="@drawable/twotone_info_24" />

<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swDdg"
android:layout_width="0dp"
Expand All @@ -1151,7 +1164,7 @@
android:text="@string/title_advanced_ddg"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swFaviconsManifest"
app:layout_constraintTop_toBottomOf="@id/ibFavicons"
app:switchPadding="12dp" />

<TextView
Expand Down

0 comments on commit 0ba7583

Please sign in to comment.