本文整理汇总了Java中android.support.design.widget.FloatingActionButton.postDelayed方法的典型用法代码示例。如果您正苦于以下问题:Java FloatingActionButton.postDelayed方法的具体用法?Java FloatingActionButton.postDelayed怎么用?Java FloatingActionButton.postDelayed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.design.widget.FloatingActionButton
的用法示例。
在下文中一共展示了FloatingActionButton.postDelayed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onNestedScroll
import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
@Override
public void onNestedScroll(final CoordinatorLayout coordinatorLayout, final FloatingActionButton fab,
final View target, final int dxConsumed, final int dyConsumed,
final int dxUnconsumed, final int dyUnconsumed) {
super.onNestedScroll(coordinatorLayout, fab, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed);
if (!enabled) return;
if (dyConsumed > 0 && fab.getVisibility() == View.VISIBLE) {
// User scrolled down and the FAB is currently visible -> hide the FAB
fab.hide();
} else if (dyConsumed < 0 && fab.getVisibility() != View.VISIBLE) {
// User scrolled up and the FAB is currently not visible -> show the FAB
fab.postDelayed(new Runnable() {
@Override
public void run() {
fab.show();
}
}, 200L);
}
}
示例2: createFANViewAndListener
import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
public void createFANViewAndListener() {
doneFAB = (FloatingActionButton) findViewById(R.id.done_fab);
doneFAB.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialogOnAddButtonPressed();
}
});
fabAnimationRunnable = new Runnable() {
@Override
public void run() {
AnimationTools.startCircularReveal(doneFAB);
}
};
doneFAB.postDelayed(fabAnimationRunnable, 600);
}