Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: implement app:textClearHistory #34

Merged
merged 2 commits into from
Feb 11, 2024

Conversation

david-allison
Copy link
Contributor

@david-allison david-allison commented Feb 8, 2024

Previously the XML attribute has no effect on the <com.bytehamster.lib.preferencesearch.SearchPreference /> element

tested with the following on my S21 (thanks so much for the example repo):

Relevant commit: dbdbcb4

testing + patch
Index: app/src/main/res/xml/preferences.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml
--- a/app/src/main/res/xml/preferences.xml	(revision https://github.com/ByteHamster/SearchPreference/commit/856ae2ca7f5a955dfb0eb7834319d159c269fba0)
+++ b/app/src/main/res/xml/preferences.xml	(date 1707366854942)
@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto">

     <com.bytehamster.lib.preferencesearch.SearchPreference
+            app:textClearHistory="AA"
             android:key="searchPreference" />

     <CheckBoxPreference
=

image


I added a gradle wrapper upgrade in here as I needed it to get the repo to compile on my machine, feel free to drop this.

For clarity: patch is licensed under MIT & you have full permission to relicense as you see fit


Problem was introduced in 4532977

Suggested by Android Studio, required to build

then obtained error:

```
Unable to make field private final java.lang.String java.io.File.path
accessible: module java.base does not "opens java.io" to unnamed module
@4dbd62bc
```

Fixed by updating build tools to 7.0.X,
(this is the first release which supports 7.2 according to
https://stackoverflow.com/a/70807648/
Previously the XML attribute has no effect on the
<com.bytehamster.lib.preferencesearch.SearchPreference />
element

tested with:

```
Index: app/src/main/res/xml/preferences.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml
--- a/app/src/main/res/xml/preferences.xml	(revision 856ae2c)
+++ b/app/src/main/res/xml/preferences.xml	(date 1707366854942)
@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto">

     <com.bytehamster.lib.preferencesearch.SearchPreference
+            app:textClearHistory="AA"
             android:key="searchPreference" />

     <CheckBoxPreference
=
```

Fixes 33
@ByteHamster ByteHamster merged commit 4883193 into ByteHamster:master Feb 11, 2024
1 check passed
@ByteHamster
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] app:textClearHistory has no effect
2 participants