CookView.java 文件源码

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

项目:stynico 作者:
private void setUp(Context context, AttributeSet attrs)
  {
      TypedArray a =context.obtainStyledAttributes(attrs, R.styleable.CoolImageView);
      String direction=a.getString(R.styleable.CoolImageView_direction);
      if (direction == null)
      {
          throw new RuntimeException("You don't set direction properties,If you don't want to do that." +
                               "You can use ordinary ImageView instead");
      }
else if (direction.equals("vertical"))
      {
          isSetVerticalMove = true;
      }
      else if (direction.equals("horizontal"));
      else
      {
          throw new RuntimeException("Direction attribute set is not valid,It is only allowed to set to vertical or horizontal");
      }
      mDrawable = getDrawable();
      mHandler = new MoveHandler();
      mHandler.sendEmptyMessageDelayed(1, 220L);

  }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号