SpinnerEX ?

LucaMs

Expert
Licensed User
Longtime User
I do not yet know the name to give to a spinner that I am preparing.

But what I want to ask you is advice/help on graphics, because then I'll put it at the disposal of all :D.

Which aspect give to the two buttons? (for the opening of the spinner and for the addition of a new item).

upload_2014-4-21_14-21-2.png
 

DonManfred

Expert
Licensed User
Longtime User
You could the image(s) be part of the initialization of your class... spinnerLM.initialize([..],img1 as Bitmap, img2 as Bitmap)
You can say this parameters can be null. and if null then the "standard" icon is used. If not null the given bitmap is used...
 

LucaMs

Expert
Licensed User
Longtime User
I write only to vent.

I wanted to allow the user (programmer) to change the background color of the "spinner" (it is basically an AutoCompleteEditText) and its text color, but ... the background color of the list is not modifiable, its textcolor can be set; so if the user decides for white text color, it becomes invisible in the list, since the list has a white background!

I'll have to replace it (AutoCompleteEditText) to the Erel's class SearchView :(:D
 

LucaMs

Expert
Licensed User
Longtime User
I'll have to replace it (AutoCompleteEditText) to the Erel's class SearchView :(:D

That is not an easy job!

I can not easily replace AutoCompleteEditText with SearchView.

My custom view is spinner like, so its height should be the same as an EditText (or AutoCompleteEditText), it can not "contain" a listview.

On the other hand, SearchView is composed of an EditText and a Listview.
The EditText should be part of my spinner, the listview should be displayed in the container of my spinner!

(this is just a comment on the difficulty encountered :):()
 

Beja

Expert
Licensed User
Longtime User
LucaMS, do you mean one can add a new item at run time? if yes, is it persistent?

Sorry for talking off point.
 

LucaMs

Expert
Licensed User
Longtime User
"Sorry for talking off point"? I thank you for your interest!


Yes, it is (but i allow the user/programmer to delete items).


I found more difficult than I imagined.

1) I have not been able to use the AutoCompleteEditText view as its "ListView" does not allow to change the background color;

2) I decided to replace the AutoCompleteEditText with SearchView by Erel, but since it is a custom view, I found other difficulties inherent to the "parent" view of its two components: an EditText, whose Parent has to be my custom view, and a ListiView, whose Parent has to be the Parent of my custom view (the grandfather :D);

3) now I have completed a significant change to SearchView: I used a database instead of map objects (Erel had to do a lot of work to use them, impressive!!!). For this, I had to invent a way to give names to the database, but above all to the table for the items.


Yes, I'm off topic with this answer :), but it might be of interest.

Regarding item 3, Erel, I do not know how to name the new version of SearchView (SearchViewDb might be misunderstood, SearchView2?) and I do not know where to publish it: "show me the right way", please :D
 
Last edited:

Beja

Expert
Licensed User
Longtime User
and I do not know where to publish it: "show me the right way", please
Thanks Luca and I think My Creations forum may be the right destination of this work.
 

DonManfred

Expert
Licensed User
Longtime User
I think I have to wait for the opinion of Erel, because I was referring to my edits to his class SearchView.

I know. But i dont think that erel is against that you use his code as basis for yours. You should leave a notice in documentation tough that this "new" class is based on Erels code.
 

LucaMs

Expert
Licensed User
Longtime User
Also, I have a doubt.

I have " struggled " to create the properties (both for the "SpinnerEx" and "SearchView2"): I basically replicated many of the properties of the view components.

I try to explain.

The SearchView is composed of an EditText and a ListView. To make the best use SearchView, it would be necessary, for example, the TextSize property; it should be used as: svCustomers.TextSize = 16.5.

Clearly, the TextSize "belongs" to the EditText, then there are two ways:

1) create a property (two Public Subs) in the code of SearchView:
Public Sub setTextSize(TextSize as Float)
xEditText.TextSize = TextSize
End Sub

Public Sub getTextSize as Float
Return xEditText.TextSize
End Sub

2 ) exspose the xEditText.

Way 1) is more "professional" and safe, but the code is very long and will occupy memory.
Way 2) requires the programmer to manage the coupled MySearchView+xEditText (+ ListView + other views, if they exist).

1) ... 2) ... or publish both ?

(This question also covers future custom views).
 
Top