Java Code Examples for android.view.ViewConfiguration#getDefaultActionModeHideDuration()

The following examples show how to use android.view.ViewConfiguration#getDefaultActionModeHideDuration() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FloatingActionMode.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void hide(long duration) {
    if (duration == ActionMode.DEFAULT_HIDE_DURATION) {
        duration = ViewConfiguration.getDefaultActionModeHideDuration();
    }
    duration = Math.min(MAX_HIDE_DURATION, duration);
    mOriginatingView.removeCallbacks(mHideOff);
    if (duration <= 0) {
        mHideOff.run();
    } else {
        mFloatingToolbarVisibilityHelper.setHideRequested(true);
        mFloatingToolbarVisibilityHelper.updateToolbarVisibility();
        mOriginatingView.postDelayed(mHideOff, duration);
    }
}
 
Example 2
Source File: FloatingActionMode.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void hide(long duration) {
    if (duration == ActionMode.DEFAULT_HIDE_DURATION) {
        duration = ViewConfiguration.getDefaultActionModeHideDuration();
    }
    duration = Math.min(MAX_HIDE_DURATION, duration);
    mOriginatingView.removeCallbacks(mHideOff);
    if (duration <= 0) {
        mHideOff.run();
    } else {
        mFloatingToolbarVisibilityHelper.setHideRequested(true);
        mFloatingToolbarVisibilityHelper.updateToolbarVisibility();
        mOriginatingView.postDelayed(mHideOff, duration);
    }
}
 
Example 3
Source File: ApiHelperForM.java    From cronet with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public static long getDefaultActionModeHideDuration() {
    return ViewConfiguration.getDefaultActionModeHideDuration();
}
 
Example 4
Source File: SelectionPopupController.java    From 365browser with Apache License 2.0 4 votes vote down vote up
private long getDefaultHideDuration() {
    if (supportsFloatingActionMode()) {
        return ViewConfiguration.getDefaultActionModeHideDuration();
    }
    return 2000;
}