Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

FabProgress

IGR777 edited this page Oct 22, 2018 · 7 revisions

Round button which has progress functionality. Doesn't use classic FAB concept, despite it's naming.

FabProgress inherits from AppCompatImageButton/UIButton.

Customization fields

Type Field Description Default value
UIImage
Drawable
Image Icon, which will be displayed on FabProgress button.
UIImage
Drawable
PreloaderImage Icon, which will be displayed on FabProgress button, after user tapped it.
UIColor
Color
BackgroundColor Responsible for button's background color in normal state. #3C6DF0
UIColor
Color
DisabledBackgroundColor Responsible for button's background color in disabled state. #EAEAEA
UIColor
Color
PressedBackgroundColor Responsible for button's background color in pressed state. #3151B7
UIColor
Color
DisabledImageColor Responsible for button's icon color in the disabled state. #C0BFC0
UIColor
Color
EnabledImageColor Responsible for button's icon color in the enabled state. #FFFFFF
bool InProgress Shows status of the control. false
ShadowConfig ShadowConfig Responsible for button's shadow configuration.
string LottieAnimationKey Sets resource key for the animation. false
LOTAnimationView LottieAnimation Gets a Lottie view, which was set from LottieAnimationKey
LottieDrawable LottieAnimation Responsible for lottie animation, including animation which was set by LottieAnimationKey.

Notes

For correct displaying, width of control must be equal to its height.

Usage

Android

For Android platform there are two ways to add FabProgress to the layout: to the axml markup file or to the code behind.

Sample for creating FabProgress in axml markup for Android:

<EOS.UI.Droid.Controls.FabProgress
    android:id="@+id/fabProgress"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>

Sample of customization FabProgress in code behind for Android:

var fabProgress = new FabProgress(Context);
fabProgress.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
fabProgress.BackgroundColor = Color.Orange;
fabProgress.DisabledBackgroundColor = Color.LightGray;
fabProgress.PressedBackgroundColor = Color.Blue;
fabProgress.Image = Resources.GetDrawable(Resource.Drawable.icFabProgress);
fabProgress.PreloaderImage = Resources.GetDrawable(Resource.Drawable.icPreload);

iOS

For iOS FabProgress can be added from the .xib/storyboards files or from code behind.

The sample for creating FabProgress in code behind for IOS:

var fabProgress = new FabProgress();
fabProgress.Frame = new CGRect(0, 0, 52, 52);
fabProgress.BackgroundColor = UIColor.Orange;
fabProgress.DisabledBackgroundColor = UIColor.LightGray;
fabProgress.PressedBackgroundColor = UIColor.Blue;
fabProgress.Image = UIImage.FromBundle("fabIcon");
fabProgress.PreloaderImage = UIImage.FromBundle("preloaderImage");