Ejemplo n.º 1
0
  /**
   * 得到对应动画接口实现类的类名
   *
   * @param name
   * @return 类名
   * @deprecated
   */
  private String GetAnimationClassName(String name) {

    if (name.equals(PropertiesUtils.getAnimationInfo(MSSService.this)[C.ANIMATION_BUBBLE])) {

      return "BubbleAnimationProcess";
    } else if (name.equals(
        PropertiesUtils.getAnimationInfo(MSSService.this)[C.ANIMATION_STARSHINE])) {

      return "StarshineAnimationProcess";
    } else if (name.equals(
        PropertiesUtils.getAnimationInfo(MSSService.this)[C.ANIMATION_PICTUREWALL])) {

      // 幻灯片动画不需要让动画继续进行
      // 每次重新开始即可
      return null;
    } else if (name.equals(PropertiesUtils.getAnimationInfo(MSSService.this)[C.ANIMATION_RAIN])) {

      return "RainAnimationProcess";
    }

    return null;
  }
Ejemplo n.º 2
0
  /**
   * 实例一个动画 其中,存放动画的sharePreference的name为事件的name+动画的name
   *
   * @param name 动画名字
   * @param event 事件
   * @return AnimationProcess
   * @deprecated
   */
  private AnimationProcess instanceAnimation(String name, int event) {

    AnimationProcess animationP = null;
    if (name.equals(PropertiesUtils.getAnimationInfo(this)[C.ANIMATION_BUBBLE])) {

      animationP =
          new BubbleAnimationProcess(
              MSSService.this,
              sp.getString("start" + event, "")
                  + PropertiesUtils.getAnimationInfo(this)[C.ANIMATION_BUBBLE]);

    } else if (name.equals(PropertiesUtils.getAnimationInfo(this)[C.ANIMATION_STARSHINE])) {

      animationP =
          new StarshineAnimationProcess(
              MSSService.this,
              sp.getString("start" + event, "")
                  + PropertiesUtils.getAnimationInfo(this)[C.ANIMATION_STARSHINE]);

    } else if (name.equals(PropertiesUtils.getAnimationInfo(this)[C.ANIMATION_PICTUREWALL])) {
      animationP =
          new PictureWallAnimationProcess(
              MSSService.this,
              sp.getString("start" + event, "")
                  + PropertiesUtils.getAnimationInfo(this)[C.ANIMATION_PICTUREWALL]);
    } else if (name.equals(PropertiesUtils.getAnimationInfo(this)[C.ANIMATION_RAIN])) {

      animationP =
          new RainAnimationProcess(
              MSSService.this,
              sp.getString("start" + event, "")
                  + PropertiesUtils.getAnimationInfo(this)[C.ANIMATION_RAIN]);
    }

    return animationP;
  }
    @Override
    public View getView(final int position, View convertView, ViewGroup parent) {
      LayoutInflater inflater = LayoutInflater.from(getActivity());
      convertView = inflater.inflate(R.layout.gv_mss, parent, false);
      ImageView img = (ImageView) convertView.findViewById(R.id.img_gv);
      Button button = (Button) convertView.findViewById(R.id.bt_gv);
      switch (position) {
        case 0:
          button.setText(PropertiesUtils.getAnimationInfo(getActivity())[C.ANIMATION_BUBBLE]);
          img.setImageResource(R.drawable.preview_bubble);
          break;
        case 1:
          button.setText(PropertiesUtils.getAnimationInfo(getActivity())[C.ANIMATION_STARSHINE]);
          img.setImageResource(R.drawable.preview_starshine);
          break;
        case 2:
          button.setText(PropertiesUtils.getAnimationInfo(getActivity())[C.ANIMATION_PICTUREWALL]);
          img.setImageResource(R.drawable.preview_picturewall);
          break;
        case 3:
          button.setText(PropertiesUtils.getAnimationInfo(getActivity())[C.ANIMATION_RAIN]);
          img.setImageResource(R.drawable.preview_rain);
          break;
        case 4:
          button.setText(PropertiesUtils.getAnimationInfo(getActivity())[C.ANIMATION_SNOW]);
          img.setImageResource(R.drawable.preview_snow);
          break;
        default:
          break;
      }
      img.setOnClickListener(
          new View.OnClickListener() {
            @Override
            public void onClick(View v) {
              Intent it = new Intent();
              Bundle b = new Bundle();
              switch (position) {
                case 0:
                  b.putInt("animation", C.ANIMATION_BUBBLE);
                  break;
                case 1:
                  b.putInt("animation", C.ANIMATION_STARSHINE);
                  break;
                case 2:
                  b.putInt("animation", C.ANIMATION_PICTUREWALL);
                  break;
                case 3:
                  b.putInt("animation", C.ANIMATION_RAIN);
                  break;
                case 4:
                  b.putInt("animation", C.ANIMATION_SNOW);
                  break;
                default:
                  break;
              }
              Log.i(TAG, "" + position);
              it.putExtras(b);
              it.setClass(getActivity(), PreviewAnimation.class);
              getActivity().startActivity(it);
            }
          });

      return convertView;
    }