CustomListView - A flexible list based on ScrollView

Status
Not open for further replies.

Richard Peck

Member
Licensed User
Longtime User
Hi All,
I have 2 CustomLisView and I need to copy some of the entries from one to the other. So does anyone know the fastest way to copy a entry from one Clv to another.
Thanks
 

Richard Peck

Member
Licensed User
Longtime User
How are you building the items? It will be easier to use the same method to create new items in the second list.

It's for a file compare for multiple file (greater than 100). It take a long time to create the original clv structure. What I'm trying to do is to use a second clv to display different views like: right file missing, left file missing or equal. I've place a tag in the original clv entries so I can copy only the correct ones to the second clv. So I'm looking for a method to copy the original entry to the second one.

Thanks for any help
 

junglejet

Active Member
Licensed User
Longtime User
Just for the records.
Designer created file with HorizontalAnchor = BOTH does not work in CustomListView.
Size is not auto adjusted and there are strange gaps when panels are added.
When using LEFT and clv1.asview.width=100%x all things are well
-- Andy
 

ThePuiu

Active Member
Licensed User
Longtime User
How to automatically resize a button added to the list depending on screen size? I try like this:
B4X:
Dim b As Button
b.Initialize("button")
b.Text = "Select"
panel.AddView(b, Width - 140dip, 25dip, 140dip * Scale, 50dip * Scale)
but the result was unsatisfactory.
 

GMan

Well-Known Member
Licensed User
Longtime User
Joi,
better U use the DesignerScripts in the Designer (second Tab).

Here an example with a simple TabHost:
B4X:
TabHost1.SetLeftAndRight (0,100%x)
TabHost1.SetTopAndBottom (0,60dip)
 

gdeppi

Member
Licensed User
Longtime User
Thanks man. While that didn't work simply by replacing the drawable's name in the class's code, I was able to get it work with AndroidResources library and now I get the correct holo blue color.

Hi

can someone pls post an example on how to get the correct holo blue color on pressed items?

Rgds.
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
The correct color for Android 4+ is not blue. It is light gray. See the two attached 9 patch images.

You can load them with the code posted here: Nine patch images tutorial
 

Attachments

  • list_selector_pressed_holo_light.9.png
    list_selector_pressed_holo_light.9.png
    187 bytes · Views: 253
  • list_selector_pressed_holo_dark.9.png
    list_selector_pressed_holo_dark.9.png
    191 bytes · Views: 241

gdeppi

Member
Licensed User
Longtime User
Hi Erel,

it is possible to add to the CustomListView a Section Header (Only Text) not cklickable ?

Rgrds.
 

AscySoft

Active Member
Licensed User
Longtime User
'longClick addition

Private Sub Panel_LongClick

If SubExists(CallBack, EventName & "_ItemLongClick") Then
Dim v As View
v = Sender
CallSub3(CallBack, EventName & "_ItemLongClick", v.Tag, items.Get(v.Tag))
End If
End Sub
 

bluedude

Well-Known Member
Licensed User
Longtime User
I think that would be a nice option because after a while I really don't know anymore which views I added in which sequence. I think the designer should have an option to show the internal index number of a view. Like a toggle switch that would show a number on the view.

Sure, would even be better in the properties of the designer.
 
Status
Not open for further replies.
Top