本文整理了Java中android.widget.TextView.removeOnLayoutChangeListener()
方法的一些代码示例,展示了TextView.removeOnLayoutChangeListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.removeOnLayoutChangeListener()
方法的具体详情如下:
包路径:android.widget.TextView
类名称: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();
}
});
内容来源于网络,如有侵权,请联系作者删除!