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 9, 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
ShadowConfig ShadowConfig Responsible for button's shadow configuration.
bool InProgress Shows status of the control. false

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");
Clone this wiki locally