Android浮動按紐:Floating Action Button library for Android
一個浮動按鈕,擁有許多自定義的屬性。浮動的操作按鈕被用于一種特殊類型的促進作用。它們是由一個圓圈圖標漂浮在UI上述區分,并有相關的變形,發射,并轉印錨點特殊運動行為。
//Button type actionButton.setType(FloatingActionButton.Type.MINI);//Button colors actionButton.setButtonColor(getResources().getColor(R.color.fab_material_lime_500)); actionButton.setButtonColorPressed(getResources().getColor(R.color.fab_material_lime_900));
//Image actionButton.setImageDrawable(getResources().getDrawable(R.drawable.fab_plus_icon)); actionButton.setImageSize(24.0f);
//Shadow actionButton.setShadowColor(Color.parseColor("#757575")); actionButton.setShadowRadius(1.0f); actionButton.setShadowXOffset(0.5f); actionButton.setShadowYOffset(1.0f);
//Stroke actionButton.setStrokeColor(getResources().getColor(R.color.fab_material_blue_grey_500)); actionButton.setStrokeWidth(1.0f);
//Animations actionButton.setAnimationOnShow(FloatingActionButton.Animations.ROLL_FROM_DOWN); actionButton.setAnimationOnHide(FloatingActionButton.Animations.ROLL_TO_DOWN);</pre>
Animations
The Library has several predefined animations:
Fade In - Fade Out | Roll From Down - Roll To Down | Jump From Down - Jump To Down |
---|---|---|
![]() |
![]() |
![]() |