Request (Style Programically)
Setting a style via xml doesn't really help in an app where the gui dynamically changes based on colors. I would enjoy the ability to tint the search icon and text via code.
@rgocal , you can check my pull request that gives you the ability to change the search icon color . Check it out at #16
Sweet
let me know when you have issues. Since it has not been merged with the upstream branch, you may need to go to jitpack to get my build
Alright, il give this a go sometime later. Working on a main project atm
How do we include your build in a project? The documentation in your github still points to this project instead. What specifically is the Gradle implementation/api syntax for your build in jitpack?
@ryust use this build implementation 'com.github.kojofosu:MultiSearchView:0.4'
i updated my README, you can check it out at https://github.com/kojofosu/MultiSearchView
Thanks for the update. Unfortunately, I wasn't able to get things to work. It would be sooooooooo much simpler if there was a getter method on the EditText so that I can easily change items programmatically (like hint) instead of messing around with XML styles and trying to hook it all together when using multiple 3rd party libraries.
@ryust your request seems to be on the edittext itself rather than the icon ..am I right? If yes, i think i can work on that for you
Yes, exactly. The original post request was to set styles programmatically… regardless of the widget. So getter methods is the easiest way to access underlying components so developers have the most flexibility to modify the widgets via code (not XML). I’m surprised the original library didn’t have it, but apparently that developer has abandoned the project. Thanks for taking it over!
On Jul 19, 2021, at 8:56 AM, Kojo Fosu Bempa Edue @.***> wrote:
@ryust https://github.com/ryust your request seems to be on the edittext itself rather than the icon ..am I right? If yes, i think i can work on that for you
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/iammert/MultiSearchView/issues/11#issuecomment-882568679, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACGR4SXYMU4QZ5LQOM7KNLTYQVHHANCNFSM4QP6IQXQ.
@ryust your request seems to be on the edittext itself rather than the icon ..am I right? If yes, i think i can work on that for you
Any idea when you could get something working? If awhile, then I'll look at other search libraries. This one looked good, but it's very inflexible in customization... I just can't get the styles XML method to work in my project.
Will Friday be too far out for you? Currently wrapping up on another library I'm building .
On Wed, 21 Jul 2021, 2:22 pm Ron Yust, @.***> wrote:
@ryust https://github.com/ryust your request seems to be on the edittext itself rather than the icon ..am I right? If yes, i think i can work on that for you
Any idea when you could get something working? If awhile, then I'll look at other search libraries. This one looked good, but it's very inflexible in customization... I just can't get the styles XML method to work in my project.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/iammert/MultiSearchView/issues/11#issuecomment-884230119, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE2ERLWYZDDQDF7OIN6CU3LTY3JY7ANCNFSM4QP6IQXQ .
Friday will work. Thanks!
@ryust I've added getter and setter method to change search hint...will have time to make the editext itself accessible. Are there any other customizations you would like me to prioritize?
Thanks! The hint was the most important attribute, but having complete control of the EditText is ideal. I'll work with what you've done.
@ryust alright, let me know if there are any issues. And to change the hint, you will need to remove the line that sets the "style" for the search view in the xml
Well.... that's the core of my problem... I don't use XML layouts and create UI views programmatically. So if I have to mess with styles and XML, then I'm back to my original problem... I won't be able to use what you've done.
@ryust you don't need xml for that. you can do everything programmatically now. Just try it and let me know how it goes
OK, I got the hint to work and that works well, but have a couple other issues with the new library:
-
I wanted change the icon color programmatically, but it appears that the setSearchIconColor expects an argument of a color resource... I want to use a Color directly instead.
-
When creating multiple search items, the length of each is much wider than the original library... to the point that you can't see multiple items at the same time in the search.
Alright. I'll look into that for you !
On Fri, 23 Jul 2021, 8:50 pm Ron Yust, @.***> wrote:
OK, I got the hint to work and that works well, but have a couple other issues with the new library:
I wanted change the icon color programmatically, but it appears that the setSearchIconColor expects an argument of a color resource... I want to use a Color directly instead. 2.
When creating multiple search items, the length of each is much wider than the original library... to the point that you can't see multiple items at the same time in the search.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/iammert/MultiSearchView/issues/11#issuecomment-885907001, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE2ERLTBC4LYKUWFFKM7ZU3TZHI2RANCNFSM4QP6IQXQ .
Great! And I also need the ability to tint the hint for dark mode colors. :)
alright
@ryust kindly check version 0.6
That version is not found. Gradle can't find it.
try again..Jitpack didn't finish building at that time..my bad @ryust
I'm about to give up on the library. Now creating MultiSearchView programmatically (as I've done before) results in a NPE:
java.lang.NullPointerException
at com.iammert.library.ui.multisearchviewlib.MultiSearchView.
@ryust i apologize once again. These were quick fixes and i didnt really test for the nullpointer exception. But that has been fixed in 0.7 now.
android.content.res.Resources$NotFoundException: Resource ID #0xff43a047
at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:215)
at android.content.res.Resources.getColorStateList(Resources.java:1020)
at androidx.core.content.res.ResourcesCompat.getColorStateList(ResourcesCompat.java:195)
at androidx.core.content.ContextCompat.getColorStateList(ContextCompat.java:519)
at androidx.appcompat.content.res.AppCompatResources.getColorStateList(AppCompatResources.java:48)
at com.iammert.library.ui.multisearchviewlib.MultiSearchView.setSearchIconColor(MultiSearchView.kt:85)
And the width of the search items still take up the full width of the parent view unlike the original library so you can't really see more than one search item at a time.
setHintColor(Integer value)
What exactly is Integer? Resource id? Color int?
android.content.res.Resources$NotFoundException: Resource ID #0xff43a047 at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:215) at android.content.res.Resources.getColorStateList(Resources.java:1020) at androidx.core.content.res.ResourcesCompat.getColorStateList(ResourcesCompat.java:195) at androidx.core.content.ContextCompat.getColorStateList(ContextCompat.java:519) at androidx.appcompat.content.res.AppCompatResources.getColorStateList(AppCompatResources.java:48) at com.iammert.library.ui.multisearchviewlib.MultiSearchView.setSearchIconColor(MultiSearchView.kt:85)
how are you setting the color?