ButtonIcon.java 文件源码

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

项目:Mire 作者:
private void initView(Context context)
{
    inflater.inflate(R.layout.ms__button, this, true);

    Resources res = getResources();
    StateListAnimator sla = AnimatorInflater.loadStateListAnimator(context, R.animator.button_elevation);

    setBackground(res.getDrawable(R.drawable.button_background));
    setStateListAnimator(sla);
    setOrientation(LinearLayout.HORIZONTAL);
    setGravity(Gravity.CENTER);
    setOnClickListener(null);

    content = findViewById(R.id.ms__content);

    buttonIcon = (ImageView)content.findViewById(R.id.ms__button_icon);
    buttonIcon.setImageResource(mResource);
    buttonIcon.setImageDrawable(mDrawable);

    buttonText = (TextView)content.findViewById(R.id.ms__button_text);
    buttonText.setText(mText);
    buttonText.setTextColor(mTextColor);
    buttonText.setTextSize(mTextSize);
    if (mState)
    {
        buttonText.setTypeface(mTypface);
    }
    else
    { }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号