Embarcadero has some sample code up which shows you how to do a pull or swipe down to refresh a TListView. A lot of mobile apps like Facebook use this functionality instead of having a refresh button. It saves screen real estate by not having an extra button to deal with. The idea is that you are at the top of the list and you put your finger down on the list and swipe or pull down. The list drags down and then you show a activity spinner above the list. Once the update is complete and the list gets updated the activity spinner goes away. The blog post talks about being for IOS but this will work on both Android and IOS. The code is simple enough and just checks the ScrollViewPos property of TListView. Take a look: procedure TForm.ListView1MouseMove(Sender: TObject; Shift: TShiftState; X,
if not Updating and (ListView1.ScrollViewPos < -40) then
Updating := true;
AniIndicator1.Visible := True;
AniIndicator1.Enabled := true;
I := Myposition + 1 to Myposition +20 do
LItem := ListView1.Items.Add;
LItem.Text := Format(’Text %d’, [I]);
You could combine this code with the TListView RSS viewer demo.
FMXExpress.com has over 700 tips and tricks for building cross platform apps on Android, IOS, OSX, Windows, and Linux with a single codebase and single UI using the FireMonkey framework found in Delphi and C++Builder.
FMXExpress covers top cross platform secrets for FireMonkey in C++Builder and Delphi XE5, XE6, XE7, XE8, Seattle, Berlin, Tokyo, Rio, and Sydney.