0
votes

I'm using Delphi XE5 to create a Delphi Firemonkey mobile application.

Is there a way to make the entire list fly left when selecting an item that has children?

I would like the user to select a list box item, and if the item has children (there is code to check for this) then remove current list of items/parents (fly out left) and replace with selected items list of children (continue this until there are no children).

2
Instead of clicking negative, how about telling me what you dont like about my post. Not asking for examples, im asking for directionJakeSays
what you've tried until now? Do you have some code to show us?RBA
@RBA - NO, I have searched and found no direction on whee to begin. As my comment states, I am no seeking code, I am seeking direction. I like to read and put in effort, just dont know where to beginJakeSays

2 Answers

3
votes

out left

Listbox1.AnimateFloat('Position.x', -ListBox1.Width, 1.0);

in right

Listbox1.AnimateFloat('Position.x', 0, 1.0);

The first parameter is the string representation of the property you are animating the second parameter represents the new value you want the property to animate to the third parameter is the duration

Hope this helps!

2
votes

You can use a TTabControl.

procedure TMyForm.lvStationsItemClick(const Sender: TObject;
  const AItem: TListViewItem);
begin
  MyTabControl.SetActiveTabWithTransition(DetailTab, TTabTransition.ttSlide, TTabTransitionDirection.tdNormal);
end;

If you would like more control over the scroll effect (and smoother scrolling), take a look at my TTabControlEx component from the FireMonkey Extensions library. Your code would then look something like this:

procedure TMyForm.lvStationsItemClick(const Sender: TObject;
  const AItem: TListViewItem);
begin
  MyTabControl.SetActiveTabWithTransitionEx(tabStationDetails, TTabTransitionDirection.tdNormal, TInterpolationType.itCubic, 0.2, 1, TAnimationType.atIn);
end;