Example usage for android.support.v4.widget NestedScrollView postDelayed

List of usage examples for android.support.v4.widget NestedScrollView postDelayed

Introduction

In this page you can find the example usage for android.support.v4.widget NestedScrollView postDelayed.

Prototype

public boolean postDelayed(Runnable action, long delayMillis) 

Source Link

Document

Causes the Runnable to be added to the message queue, to be run after the specified amount of time elapses.

Usage

From source file:ar.uba.fi.splitapp.ChatRoomActivity.java

private void scrollToLast() {
    final NestedScrollView scrollview = ((NestedScrollView) findViewById(R.id.messages_lay));
    assert scrollview != null; //Debug assert
    scrollview.postDelayed(() -> scrollview.fullScroll(NestedScrollView.FOCUS_DOWN), 100);
    AppBarLayout appBarLayout = (AppBarLayout) findViewById(R.id.app_bar);
    assert appBarLayout != null; //Debug assert
    appBarLayout.setExpanded(false, true);
    Utility.hideKeyboard(this);
}