FloatingActionButton.java 文件源码

java
阅读 36 收藏 0 点赞 0 评论 0

项目:abelana 作者:
/**
 * Constructor.
 * @param context the application context.
 * @param attrs attributes.
 * @param defStyleAttr attribute in the current theme that contains a
 *                     reference to a style resource that supplies defaults
 *                     values for the StyledAttributes
 * @param defStyleRes a resource identifier of a style resource that
 *                    supplies default values for the StyledAttributes,
 *                    used only if defStyleAttr is 0 or can not be found
 *                    in the theme
 */
public FloatingActionButton(Context context, AttributeSet attrs,
                            int defStyleAttr, int defStyleRes) {
    super(context, attrs, defStyleAttr);

    setClickable(true);

    // Set the outline provider for this view. The provider is given the
    // outline which it can then modify as needed. In this case we set the
    // outline to be an oval fitting the height and width.
    setOutlineProvider(new ViewOutlineProvider() {
        @Override
        public void getOutline(View view, Outline outline) {
            outline.setOval(0, 0, getWidth(), getHeight());
        }
    });

    // Finally, enable clipping to the outline, using the provider we set
    // above
    setClipToOutline(true);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号