android.widget.ScrollView.post()方法的使用及代码示例

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

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

ScrollView.post介绍

暂无

代码示例

代码示例来源:origin: lingochamp/FileDownloader

private void infoAppend(final String msg, final long start) {
  infoTv.append(String.format(" %s: %d\n", msg, System.currentTimeMillis() - start));
  scrollView.post(new Runnable() {
    @Override
    public void run() {
      if (scrollView != null) {
        scrollView.fullScroll(View.FOCUS_DOWN);
      }
    }
  });
}

代码示例来源:origin: lingochamp/FileDownloader

private void updateDisplay(final CharSequence msg) {
  if (downloadMsgTv.getLineCount() > 2500) {
    downloadMsgTv.setText("");
  }
  downloadMsgTv.append(String.format("\n %s", msg));
  tipMsgTv.setText(String.format("%d/%d", finalCounts, totalCounts));
  if (needAuto2Bottom) {
    scrollView.post(scroll2Bottom);
  }
}

代码示例来源:origin: GitLqr/LQRWeChat

public void onTextChanged(CharSequence s, int start, int before, int count) {
  tvTextCouter.setText(String.valueOf(s.length()));
  if (maxBodyHeight == 0) {
    maxBodyHeight = llPage.getHeight() - rlTitle.getHeight() - llBottom.getHeight();
  }
  if (maxBodyHeight > 0) {
    svContent.post(this);
  }
}

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

public void onTextChanged(CharSequence s, int start, int before, int count) {
  tvTextCouter.setText(String.valueOf(s.length()));
  if (maxBodyHeight == 0) {
    maxBodyHeight = llPage.getHeight() - rlTitle.getHeight() - llBottom.getHeight();
  }
  if (maxBodyHeight > 0) {
    svContent.post(this);
  }
}

代码示例来源:origin: chaychan/TouTiao

public static void scrollToBottom(final ScrollView scrollView) {
  if (scrollView != null) {
    scrollView.post(new Runnable() {
      @Override
      public void run() {
        scrollView.fullScroll(ScrollView.FOCUS_DOWN);
      }
    });
  }
}

代码示例来源:origin: ukanth/afwall

protected void print(CharSequence text)
{
  mTextView.append(text);
  mScrollView.post(new Runnable()
  {
    public void run()
    {
      mScrollView.fullScroll(ScrollView.FOCUS_DOWN);
    }
  });
}

代码示例来源:origin: ukanth/afwall

protected void print(CharSequence text) {
  mTextView.append(text);
  mScrollView.post(new Runnable() {
    public void run() {
      mScrollView.fullScroll(ScrollView.FOCUS_DOWN);
    }
  });
}

代码示例来源:origin: uccmawei/FingerprintIdentify

private void append(String msg) {
  mTvTips.append(msg);
  mScrollView.post(new Runnable() {
    @Override
    public void run() {
      mScrollView.fullScroll(View.FOCUS_DOWN);
    }
  });
}

代码示例来源:origin: Stericson/RootTools

protected void print(CharSequence text) {
  mTextView.append(text);
  mScrollView.post(new Runnable() {
    public void run() {
      mScrollView.fullScroll(ScrollView.FOCUS_DOWN);
    }
  });
}

代码示例来源:origin: syncthing/syncthing-android

protected void onPostExecute(String log) {
  // Get a reference to the activity if it is still there.
  LogActivity logActivity = refLogActivity.get();
  if (logActivity == null || logActivity.isFinishing()) {
    return;
  }
  logActivity.mLog.setText(log);
  if (logActivity.mShareIntent != null) {
    logActivity.mShareIntent.putExtra(android.content.Intent.EXTRA_TEXT, log);
  }
  // Scroll to bottom
  logActivity.mScrollView.post(() -> logActivity.mScrollView.scrollTo(0, logActivity.mLog.getBottom()));
}

代码示例来源:origin: Justson/AgentWebX5

public static void scrollToBottom(final ScrollView scrollView) {
  if (scrollView != null) {
    scrollView.post(new Runnable() {
      @Override
      public void run() {
        scrollView.fullScroll(ScrollView.FOCUS_DOWN);
      }
    });
  }
}

代码示例来源:origin: bitcraze/crazyflie-android-client

@Override
  public void run() {
    mConsoleTextView.append("\n" + ftext);
    mConsoleScrollView.post(new Runnable() {
      @Override
      public void run() {
        mConsoleScrollView.fullScroll(ScrollView.FOCUS_DOWN);
      }
    });
  }
});

代码示例来源:origin: bitcraze/crazyflie-android-client

public void appendConsole(String status) {
  Log.d(LOG_TAG, status);
  this.mConsoleTextView.append("\n" + status);
  mScrollView.post(new Runnable() {
    @Override
    public void run() {
      mScrollView.fullScroll(ScrollView.FOCUS_DOWN);
    }
  });
}

代码示例来源:origin: mingjunli/GithubApp

public void onTextChanged(CharSequence s, int start, int before, int count) {
  tvTextCouter.setText(String.valueOf(s.length()));
  if (maxBodyHeight == 0) {
    maxBodyHeight = llPage.getHeight() - rlTitle.getHeight() - llBottom.getHeight();
  }
  if (maxBodyHeight > 0) {
    svContent.post(this);
  }
}

代码示例来源:origin: yoyiyi/bilisoleil

public void onTextChanged(CharSequence s, int start, int before, int count) {
  tvTextCouter.setText(String.valueOf(s.length()));
  if (maxBodyHeight == 0) {
    maxBodyHeight = llPage.getHeight() - rlTitle.getHeight() - llBottom.getHeight();
  }
  if (maxBodyHeight > 0) {
    svContent.post(this);
  }
}

代码示例来源:origin: gaolhjy/enjoyshop

public void onTextChanged(CharSequence s, int start, int before, int count) {
  tvTextCouter.setText(String.valueOf(s.length()));
  if (maxBodyHeight == 0) {
    maxBodyHeight = llPage.getHeight() - rlTitle.getHeight() - llBottom.getHeight();
  }
  if (maxBodyHeight > 0) {
    svContent.post(this);
  }
}

代码示例来源:origin: myxh/CoolShopping

public void onTextChanged(CharSequence s, int start, int before, int count) {
  tvTextCouter.setText(String.valueOf(s.length()));
  if (maxBodyHeight == 0) {
    maxBodyHeight = llPage.getHeight() - rlTitle.getHeight() - llBottom.getHeight();
  }
  if (maxBodyHeight > 0) {
    svContent.post(this);
  }
}

代码示例来源:origin: 6ag/BaoKanAndroid

public void onTextChanged(CharSequence s, int start, int before, int count) {
  tvTextCouter.setText(String.valueOf(s.length()));
  if (maxBodyHeight == 0) {
    maxBodyHeight = llPage.getHeight() - rlTitle.getHeight() - llBottom.getHeight();
  }
  if (maxBodyHeight > 0) {
    svContent.post(this);
  }
}

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

private ScrollView mScrollView;
public void scrollToBottom()
{
  mScrollView = (ScrollView) findViewById(R.id.debug_textview_scrollview);
  mScrollView.post(new Runnable()
  {
    public void run()
    {
      mScrollView.fullScroll(View.FOCUS_DOWN);
    }
  });
}

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

final ScrollView scrollView = (ScrollView) findViewById(R.id.consoleTab);
TextView textView = (TextView) findViewById(R.id.consoleView);
boolean autoScroll = (textView.getBottom() - (scrollView.getHeight() + scrollView.getScrollY())) <= 0;
textView.setText(state.getConsole().getText());

if (autoScroll) {
  scrollView.post(new Runnable() {
   public void run() {
     scrollView.fullScroll(ScrollView.FOCUS_DOWN);
   }
  });
}

相关文章

ScrollView类方法