MAFProgressDialog

The MAFProgressDialog control extends the capabilities of the android.widget.Button native control. MAF adds styling capabilities for the Button UI component, and provides predefined size variations, such as small and normal. MAF supports skinning of tapped/untapped, and enabled/disabled visual states.

To create and present a default SAP style instance of MAFProgressDialog, use:
LinearLayout row1 = new LinearLayout(this);   

MAFProgressDialog btn = MAFUIFactory.getInstance().getButton(this, 
MAFProgressDialog.NORMAL_BUTTON);
                 btn.setText("Button");                
                 btn.setOnClickListener(new OnClickListener() {                           
        
                        @Override
                 public void onClick(View v) {                             
                             // progress dialog is shown                             
                             MAFDialogWithProgressBar dialog = new 
MAFDialogWithProgressBar(ColorApp.this);                             
                             dialog.setMessage("Message");                             
                             dialog.show();                       
                        }
                 });   
row1.addView(btn); 
To create an MAFProgressDialog in the Android layout XML, use:
     <com.sap.maf.uicontrols.view.MAFProgressDialog
           android:id="@+id/MAFProgressDialog"
           android:layout_width="wrap_content"
           android:layout_height="50dip"
           android:text="skinned button" /> 

The MAF skinning engine customizes the buttons. To apply SAP style, set the custom style for background, foreground, shadow, font family, and font size in the XML file.

This is the XAML content for the default style of the Button TargetType:
<Style TargetType="Button" Key="DefButton" platform="android">
                 <VisualStates>                       
                       <VisualState Name="Unfocused_Enabled">                             
                             <Setter Property="Background" Value="#FFDDDDDD" />                             
                             <!-- background color -->                             
                             <Setter Property="Foreground" Value="#FF333333" />                             
                             <!-- text color -->                             
                             <Setter Property="Bg_Bottom_Shadow" Value="#80DDDDDD" />                             
                             <!-- background bottom shadow color -->                             
                             <Setter Property="Bg_Dark_Bottom_Shadow" Value="#FF999999" />                             
                             <!-- background bottom dark shadow color -->                             
                             <Setter Property="Bg_Top_Shadow" Value="#FFEBEBEB" />                             
                             <!-- background top shadow color -->
                       </ VisualState > 

MAFProgressDialog supports skinning of tapped/untapped, and enabled/disabled visual states.

To set visual states, use the <VisualStates></VisualStates> tag:
<VisualState Name="Unfocused_Enabled">                             
        <Setter Property="Background" Value="#FFDDDDDD" />                             
        <!-- background color -->                             
        <Setter Property="Foreground" Value="#FF333333" />                             
        <!-- text color -->                             
        <Setter Property="Bg_Bottom_Shadow" Value="#80DDDDDD" />                             
        <!-- background bottom shadow color -->                             
        <Setter Property="Bg_Dark_Bottom_Shadow" Value="#FF999999" />                             
        <!-- background bottom dark shadow color -->                             
        <Setter Property="Bg_Top_Shadow" Value="#FFEBEBEB" />                             
        <!-- background top shadow color -->                       
</VisualState>                       
<VisualState Name="Unfocused_Disabled">                       
        …                       
</VisualState>                       
<VisualState Name="Focused_Disabled">                       
        …                       
</VisualState>                       
<VisualState Name="Focused_Enabled">                       
        …                       
</VisualState>                       
<VisualState Name="Pressed">                       
        …                         
</ VisualState > 
You can set different sizes for the MAFProgressDialog programmatically. To create a normal-sized standard button, use:
MAFProgressDialog btn = MAFUIFactory.getInstance().getButton(this,MAFProgressDialog.NORMAL_BUTTON); 
To create a small standard button, use:
MAFProgressDialog smallBtn = MAFUIFactory.getInstance().getButton(this,
MAFProgressDialog.SMALL_BUTTON);
You can also inherit the style definition from the standard button and create a flavored button. This is an example for a red styled button flavor:
<Style TargetType="Button" Key="RedButton" BasedOn="DefButton" platform="android">
                 <VisualStates>
                        <VisualState Name="Unfocused_Enabled">                             
                              <Setter Property="Background" Value="#FFAEB9" />                             
                              <Setter Property="Foreground" Value="#B0171F" />                             
                              <Setter Property="Bg_Bottom_Shadow" Value="#ffE466B9" />
                        </VisualState>
                 </VisualStates>
                 <Setter Property="SolidColorBrush" Value="#ff999999" />
                 <!-- group button separator line color -->
           </ Style > 
To create an MAFProgressDialog from code, use:
MAFProgressDialog btn11 = MAFUIFactory.getInstance().getButton this,
MAFProgressDialog.NORMAL_BUTTON, "RedButton");
You can change these properties in the skinning XML:
Background Color of the MAFProgressDialog’s background; can also be a freestyle gradient. Colors are defined as RGBA (red, green, blue, alpha).
Foreground The control's text color.
FontFamily The control's font family.
BorderBrush The border attribute of the MAFProgressDialog .
Shadow The shadow attributes of the MAFProgressDialog :
  • Bg_Bottom_Shadow – background bottom shadow color.
  • Bg_Dark_Bottom_Shadow – background bottom dark shadow color.
  • Bg_Top_Shadow – background top shadow color.