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

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

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

TextView.removeOnLayoutChangeListener介绍

暂无

代码示例

代码示例来源:origin: grantland/android-autofittextview

/**
 * Set the enabled state of automatically resizing text.
 */
public AutofitHelper setEnabled(boolean enabled) {
  if (mEnabled != enabled) {
    mEnabled = enabled;
    if (enabled) {
      mTextView.addTextChangedListener(mTextWatcher);
      mTextView.addOnLayoutChangeListener(mOnLayoutChangeListener);
      autofit();
    } else {
      mTextView.removeTextChangedListener(mTextWatcher);
      mTextView.removeOnLayoutChangeListener(mOnLayoutChangeListener);
      mTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, mTextSize);
    }
  }
  return this;
}

代码示例来源:origin: victorminerva/AutoResizeEditText

/**
 * Set the enabled state of automatically resizing text.
 */
public AutofitHelper setEnabled(boolean enabled) {
  if (mEnabled != enabled) {
    mEnabled = enabled;
    if (enabled) {
      mTextView.addTextChangedListener(mTextWatcher);
      mTextView.addOnLayoutChangeListener(mOnLayoutChangeListener);
      autofit();
    } else {
      mTextView.removeTextChangedListener(mTextWatcher);
      mTextView.removeOnLayoutChangeListener(mOnLayoutChangeListener);
      mTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, mTextSize);
    }
  }
  return this;
}

代码示例来源:origin: derry/delion

@Override
  public void onLayoutChange(View v, int left, int top, int right, int bottom,
      int oldLeft, int oldTop, int oldRight, int oldBottom) {
    mUrlBar.removeOnLayoutChangeListener(this);
    int[] newLoc = new int[2];
    mUrlBar.getLocationInWindow(newLoc);
    mUrlBar.setScaleX(scale);
    mUrlBar.setScaleY(scale);
    mUrlBar.setTranslationX(oldLoc[0] - newLoc[0]);
    mUrlBar.setTranslationY(oldLoc[1] - newLoc[1]);
    mUrlBar.animate().scaleX(1f).scaleY(1f).translationX(0).translationY(0)
        .setDuration(CUSTOM_TAB_TOOLBAR_SLIDE_DURATION_MS)
        .setInterpolator(BakedBezierInterpolator.TRANSFORM_CURVE)
        .setListener(new AnimatorListenerAdapter() {
          @Override
          public void onAnimationEnd(Animator animation) {
            mTitleBar.animate().alpha(1f)
              .setInterpolator(BakedBezierInterpolator.FADE_IN_CURVE)
              .setDuration(CUSTOM_TAB_TOOLBAR_FADE_DURATION_MS).start();
          }
        }).start();
  }
});

相关文章

微信公众号

最新文章

更多

TextView类方法