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.
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);
<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.
<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.
<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 >
MAFProgressDialog btn = MAFUIFactory.getInstance().getButton(this,MAFProgressDialog.NORMAL_BUTTON);
MAFProgressDialog smallBtn = MAFUIFactory.getInstance().getButton(this, MAFProgressDialog.SMALL_BUTTON);
<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 >
MAFProgressDialog btn11 = MAFUIFactory.getInstance().getButton this, MAFProgressDialog.NORMAL_BUTTON, "RedButton");
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 :
|