Developer

MAFProgressBar

The MAFProgressBar control extends the capabilities of the android.widget.ProgressBar native component. MAF adds styling capabilities to the ProgressBar UI component, and provides predefined size variations, such as small and normal.

To create and present a default SAP style instance of MAFProgressBar, use:
ProgressBar pb = MAFUIFactory.getInstance().getProgressBar(this, 
android.R.attr.progressBarStyleHorizontal);
                 pb.setSecondaryProgress(40);
                 pb.setProgress(10); 
To create an MAFProgressBar in the Android layout XML, use:
     <com.sap.maf.uicontrols.view.MAFProgressBar
           android:id="@+id/MAFProgressBar"
           android:layout_width="wrap_content"
           android:layout_height="50dip"/> 

The MAF skinning engine customizes the ProgressBar. To apply SAP style, set the custom style for background, foreground, and solid color brush in the XML file.

This is the XAML content for the default style of the ProgressBar TargetType:
        <Style TargetType="ProgressBar" Key="DefProgressBar" platform="android">
                 <Setter Property="Background" Value="#80DDDDDD" />
                 <!-- background color -->
                 <Setter Property="Foreground" Value="#ff0062a9" />
                 <!-- progress color -->
                 <Setter Property="SolidColorBrush" Value="#8000a3d7" />
                 <!-- secondary progress color -->
           </ Style > 
You can also inherit the style definition from the standard ProgressBar and create a flavored ProgressBar. Here is an example for a red styled ProgressBar flavor:
        <Style TargetType="ProgressBar" Key="RedProgressBar" BasedOn="DefProgressBar" 
platform="android">
                 <Setter Property="Background" Value="#000099" />
                 <!-- background color -->
                 <Setter Property="Foreground" Value="#ff0000" />
                 <!-- progress color -->
                 <Setter Property="SolidColorBrush" Value="#003333" />
                 <!-- secondary progress color -->
           </ Style > 
To create a ProgressBar from code, use:
MAFProgressBar pb = new MAFProgressBar(context, android.R.attr.progressBarStyle,
"RedProgressBar”); 
You can change these properties in the skinning XML:
Background Color of the MAFProgressBar’s background; Colors are defined as RGBA (red, green, blue, alpha).
Foreground Control's progress color.
SolidColorBrush Control's secondary progress color.