I wanna to replicate the HUD functionality of https://github.com/jdg/MBProgressHUD in Delphi with firemonkey.
This is what look like in iPhone:
The main issue is how make the form semi-transparent & completely remove the borders.
I wanna to replicate the HUD functionality of https://github.com/jdg/MBProgressHUD in Delphi with firemonkey.
This is what look like in iPhone:
The main issue is how make the form semi-transparent & completely remove the borders.
Create your Firemonkey HD form, set it's
Fill.Kind
tobkNone
, and it'sFill.Color
toNull
. Additionally, set it'sTransparency
property to True, and it'sBorderStyle
tobsNone
.Create a TRectangle (or any shape), and set the
Stroke.Kind
property tobkNone
. Set it'sFill.Color
toGray
, it'sOpacity
to 0.5.Create a
TAniIndicator
andTLabel
with parent of both as the form. It'sOpacity
remains at 1.0. Optionally, also create aTImage
and make it the exact same size and position as theTAniIndicator
.From there, it's simply a case of working with
TFloatAnimation
on the TAniIndicator when you want to change the image (to a tick or such) and the label text to simply change to whatever message you want to display. Ideally, you simply create a procedure that accepts either a string or integer as a variable, and then modify the text and indicator/image to match that. For example;You can then create a tpanel in your main form, and then add the above form (that contains the
TAniIndicator, label, and rectangle
) as a child component. You then call the procedure you created with a valid mode variable and it'll run as you indicated in the code. It's easy enough to add more modes and i've done something similar with one of my own applications (although it was related toTRectangle
rather than creating an indicator).