android.widget.TextView.startAnimation()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中android.widget.TextView.startAnimation()方法的一些代码示例,展示了TextView.startAnimation()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.startAnimation()方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:startAnimation

TextView.startAnimation介绍

暂无

代码示例

代码示例来源:origin: smuyyh/BookReader

@Override
  public void run() {
    Animation mHiddenAction = new TranslateAnimation(Animation.RELATIVE_TO_SELF,
        0.0f, Animation.RELATIVE_TO_SELF, 0.0f,
        Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
        -1.0f);
    mHiddenAction.setDuration(500);
    tipView.startAnimation(mHiddenAction);
    tipView.setVisibility(View.GONE);
  }
}, delayMillis);

代码示例来源:origin: smuyyh/BookReader

@Override
  public void run() {
    Animation mHiddenAction = new TranslateAnimation(Animation.RELATIVE_TO_SELF,
        0.0f, Animation.RELATIVE_TO_SELF, 0.0f,
        Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
        -1.0f);
    mHiddenAction.setDuration(500);
    tipView.startAnimation(mHiddenAction);
    tipView.setVisibility(View.GONE);
  }
}, 2200);

代码示例来源:origin: smuyyh/BookReader

public void showTipView(String tip) {
  tipView.setText(tip);
  Animation mShowAction = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f,
      Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
      -1.0f, Animation.RELATIVE_TO_SELF, 0.0f);
  mShowAction.setDuration(500);
  tipView.startAnimation(mShowAction);
  tipView.setVisibility(View.VISIBLE);
}

代码示例来源:origin: smuyyh/BookReader

public void showTipViewAndDelayClose(String tip) {
  tipView.setText(tip);
  Animation mShowAction = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f,
      Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
      -1.0f, Animation.RELATIVE_TO_SELF, 0.0f);
  mShowAction.setDuration(500);
  tipView.startAnimation(mShowAction);
  tipView.setVisibility(View.VISIBLE);
  tipView.postDelayed(new Runnable() {
    @Override
    public void run() {
      Animation mHiddenAction = new TranslateAnimation(Animation.RELATIVE_TO_SELF,
          0.0f, Animation.RELATIVE_TO_SELF, 0.0f,
          Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
          -1.0f);
      mHiddenAction.setDuration(500);
      tipView.startAnimation(mHiddenAction);
      tipView.setVisibility(View.GONE);
    }
  }, 2200);
}

代码示例来源:origin: stackoverflow.com

TextView myText = (TextView) findViewById(R.id.myText );

Animation anim = new AlphaAnimation(0.0f, 1.0f);
anim.setDuration(50); //You can manage the blinking time with this parameter
anim.setStartOffset(20);
anim.setRepeatMode(Animation.REVERSE);
anim.setRepeatCount(Animation.INFINITE);
myText.startAnimation(anim);

代码示例来源:origin: stackoverflow.com

TextView myText = (TextView) findViewById(R.id.myText );

Animation anim = new AlphaAnimation(0.0f, 1.0f);
anim.setDuration(50); //You can manage the time of the blink with this parameter
anim.setStartOffset(20);
anim.setRepeatMode(Animation.REVERSE);
anim.setRepeatCount(Animation.INFINITE);
myText.startAnimation(anim);

代码示例来源:origin: jaydenxiao2016/AndroidFire

/**
 * 展示
 *
 * @param v
 */
public void show(View v) {
  if (!isShowing()) {
    int offsetY = -v.getHeight() - getHeight();
    showAsDropDown(v, v.getWidth() / 2 - getWidth() / 2, offsetY);
    if (mAnimationSet == null || mChanged) {
      mAnimationSet = createAnimation();
      mChanged = false;
    }
    mGood.startAnimation(mAnimationSet);
  }
}

代码示例来源:origin: mancj/MaterialSearchBar

/**
 * Hides search input and close arrow
 */
public void disableSearch() {
  animateNavIcon();
  searchEnabled = false;
  Animation out = AnimationUtils.loadAnimation(getContext(), R.anim.fade_out);
  Animation in = AnimationUtils.loadAnimation(getContext(), R.anim.fade_in_right);
  out.setAnimationListener(this);
  searchIcon.setVisibility(VISIBLE);
  inputContainer.startAnimation(out);
  searchIcon.startAnimation(in);
  if (placeholderText != null) {
    placeHolder.setVisibility(VISIBLE);
    placeHolder.startAnimation(in);
  }
  if (listenerExists())
    onSearchActionListener.onSearchStateChanged(false);
  if (suggestionsVisible) animateSuggestions(getListHeight(false), 0);
}

代码示例来源:origin: stackoverflow.com

private void RunAnimation() 
{
  Animation a = AnimationUtils.loadAnimation(this, R.anim.scale);
  a.reset();
  TextView tv = (TextView) findViewById(R.id.firstTextView);
  tv.clearAnimation();
  tv.startAnimation(a);
}

代码示例来源:origin: wooplr/Spotlight

@Override
public void onAnimationEnd(Animator animator) {
  AlphaAnimation fadeIn = new AlphaAnimation(0.0f, 1.0f);
  fadeIn.setAnimationListener(new Animation.AnimationListener() {
    @Override
    public void onAnimationStart(Animation animation) {
    }
    @Override
    public void onAnimationEnd(Animation animation) {
      if(enableDismissAfterShown)
        dismissOnTouch = true;
    }
    @Override
    public void onAnimationRepeat(Animation animation) {
    }
  });
  fadeIn.setDuration(fadingTextDuration);
  fadeIn.setFillAfter(true);
  headingTv.startAnimation(fadeIn);
  subHeadingTv.startAnimation(fadeIn);
  headingTv.setVisibility(View.VISIBLE);
  subHeadingTv.setVisibility(View.VISIBLE);
}

代码示例来源:origin: venshine/GoodView

/**
 * 展示
 *
 * @param v
 */
public void show(View v) {
  if (!isShowing()) {
    int offsetY = -v.getHeight() - getHeight();
    showAsDropDown(v, v.getWidth() / 2 - getWidth() / 2, offsetY);
    if (mAnimationSet == null || mChanged) {
      mAnimationSet = createAnimation();
      mChanged = false;
    }
    mGood.startAnimation(mAnimationSet);
  }
}

代码示例来源:origin: stackoverflow.com

protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.my_activity);

  TextView myTextView = (TextView) findViewById(R.id.myTextView);
  Animation marquee = AnimationUtils.loadAnimation(this, R.anim.marquee);
  myTextView.startAnimation(marquee);
}

代码示例来源:origin: codekidX/storage-chooser

private void playTheAddressBarAnimation() {
  mPathChosen.setText(mAddressClippedPath);
  Animation animation = AnimationUtils.loadAnimation(mContext, R.anim.anim_address_bar);
  mPathChosen.startAnimation(animation);
}

代码示例来源:origin: LanSoSdk/LanSoEditor_advance

@Override
  public void run() {
    // TODO Auto-generated method stub
    tvWord2.startAnimation(AnimationUtils.loadAnimation(
        CameraLayerFullLandscapeActivity.this,
        R.anim.slide_right_in));
    tvWord2.setVisibility(View.VISIBLE);
  }
}, 500);

代码示例来源:origin: LanSoSdk/LanSoEditor_advance

@Override
  public void run() {
    // TODO Auto-generated method stub
    tvWord2.startAnimation(AnimationUtils.loadAnimation(
        CameraLayerFullLandscapeActivity.this,
        R.anim.push_up_out));
    tvWord2.setVisibility(View.INVISIBLE);
  }
}, 500);

代码示例来源:origin: LanSoSdk/LanSoEditor_advance

@Override
  public void run() {
    // TODO Auto-generated method stub
    tvWord3.startAnimation(AnimationUtils.loadAnimation(
        CameraLayerFullLandscapeActivity.this,
        R.anim.push_up_out));
    tvWord3.setVisibility(View.INVISIBLE);
  }
}, 1000);

代码示例来源:origin: LanSoSdk/LanSoEditor_advance

private void showWord() {
  if (tvWord != null && tvWord.getVisibility() != View.VISIBLE) {
    tvWord.startAnimation(AnimationUtils.loadAnimation(
        ViewLayerDemoActivity.this, R.anim.slide_right_in));
    tvWord.setVisibility(View.VISIBLE);
  }
}

代码示例来源:origin: tvbarthel/ChaseWhisplyProject

public void hideTextView(TextView textView) {
  final Context context = getContext();
  if (context != null) {
    final Animation fadeOut = AnimationUtils.loadAnimation(context, R.anim.fade_out);
    fadeOut.setAnimationListener(new FadeOutTextViewListener(textView));
    textView.startAnimation(fadeOut);
  }
}

代码示例来源:origin: tvbarthel/ChaseWhisplyProject

public void showTextView(TextView textView) {
  final Context context = getContext();
  if (context != null) {
    final Animation oldAnimation = textView.getAnimation();
    if (oldAnimation != null) oldAnimation.cancel();
    final Animation fadeIn = AnimationUtils.loadAnimation(context, R.anim.fade_in);
    textView.startAnimation(fadeIn);
  }
}

代码示例来源:origin: tvbarthel/ChaseWhisplyProject

public void changeTextView(TextView textView, String nextString) {
  final Context context = getContext();
  if (context != null) {
    final Animation oldAnimation = textView.getAnimation();
    if (oldAnimation != null) oldAnimation.cancel();
    final Animation fadeOut = AnimationUtils.loadAnimation(context, R.anim.fade_out);
    fadeOut.setAnimationListener(new FadeOutTextViewListener(textView, nextString));
    textView.startAnimation(fadeOut);
  }
}

相关文章

TextView类方法