android.widget.ListView.setTranslationY()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(161)

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

ListView.setTranslationY介绍

暂无

代码示例

代码示例来源:origin: huangfangyi/YiChat

private void completeBackToTop(){
  mListView.setTranslationY(0);
  int num = mListView.getAdapter().getCount() - mLastCount;
  Log.v("czm","num="+num);
  if(num > 0){
    mListView.setSelectionFromTop(num, (int) mLastTranslationY);
  }
}
public void onRefreshComplete(){

代码示例来源:origin: YiChat/android_YiChat_Lite

private void completeBackToTop(){
  mListView.setTranslationY(0);
  int num = mListView.getAdapter().getCount() - mLastCount;
  Log.v("czm","num="+num);
  if(num > 0){
    mListView.setSelectionFromTop(num, (int) mLastTranslationY);
  }
}
public void onRefreshComplete(){

代码示例来源:origin: huangfangyi/YiChat

@Override
  public void onAnimationUpdate(ValueAnimator animation) {
    float val = (float) animation.getAnimatedValue();
    val = mInterpolator.getInterpolation(val / pullHeight) * val;
    if (mListView != null) {
      mListView.setTranslationY(val);
    }
    mRefreshHeader.getLayoutParams().height = (int) (val+0.5f);
    mRefreshHeader.requestLayout();
    Log.d("czm", "offsetY=" + mListView.getTranslationY());
  }
});

代码示例来源:origin: YiChat/android_YiChat_Lite

@Override
  public void onAnimationUpdate(ValueAnimator animation) {
    float val = (float) animation.getAnimatedValue();
    val = mInterpolator.getInterpolation(val / pullHeight) * val;
    if (mListView != null) {
      mListView.setTranslationY(val);
    }
    mRefreshHeader.getLayoutParams().height = (int) (val+0.5f);
    mRefreshHeader.requestLayout();
    Log.d("czm", "offsetY=" + mListView.getTranslationY());
  }
});

代码示例来源:origin: huangfangyi/YiChat

@Override
  public void onAnimationUpdate(ValueAnimator animation) {
    float val = (float) animation.getAnimatedValue();
    val = mInterpolator.getInterpolation(val / pullHeight) * val;
    if (mListView != null) {
      mListView.setTranslationY(val);
    }
    mRefreshHeader.getLayoutParams().height = (int) (val + 0.5f);
    mRefreshHeader.requestLayout();
    Log.d("czm", "offsetY=" + mListView.getTranslationY());
    if (mListView.getTranslationY() <= mHeaderHeight) {
      backToMiddleAnim.cancel();
    }
  }
});

代码示例来源:origin: YiChat/android_YiChat_Lite

@Override
  public void onAnimationUpdate(ValueAnimator animation) {
    float val = (float) animation.getAnimatedValue();
    val = mInterpolator.getInterpolation(val / pullHeight) * val;
    if (mListView != null) {
      mListView.setTranslationY(val);
    }
    mRefreshHeader.getLayoutParams().height = (int) (val + 0.5f);
    mRefreshHeader.requestLayout();
    Log.d("czm", "offsetY=" + mListView.getTranslationY());
    if (mListView.getTranslationY() <= mHeaderHeight) {
      backToMiddleAnim.cancel();
    }
  }
});

代码示例来源:origin: geniusgithub/AndroidDialer

mSubjectList.setTranslationY(mSubjectList.getHeight());
} else {
  mSubjectList.setTranslationY(0);

代码示例来源:origin: huangfangyi/YiChat

Log.d("czm", "dy/mHeight=" + (dy / mHeight));
float offsetY = mInterpolator.getInterpolation(dy / mHeight) * dy/3;
mListView.setTranslationY(offsetY);
mRefreshHeader.getLayoutParams().height = (int) (offsetY+0.5f);
mRefreshHeader.requestLayout();

代码示例来源:origin: YiChat/android_YiChat_Lite

Log.d("czm", "dy/mHeight=" + (dy / mHeight));
float offsetY = mInterpolator.getInterpolation(dy / mHeight) * dy/3;
mListView.setTranslationY(offsetY);
mRefreshHeader.getLayoutParams().height = (int) (offsetY+0.5f);
mRefreshHeader.requestLayout();

相关文章

ListView类方法