org.chromium.chrome.browser.tabmodel.document.DocumentTabModelSelector Java Examples

The following examples show how to use org.chromium.chrome.browser.tabmodel.document.DocumentTabModelSelector. 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: LayoutManagerDocument.java    From delion with Apache License 2.0 6 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void changeTabs() {
    DocumentTabModelSelector selector =
            ChromeApplication.getDocumentTabModelSelector();
    TabModel tabModel = selector.getCurrentModel();
    int currentIndex = tabModel.index();
    if (mLastScroll == ScrollDirection.LEFT) {
        if (currentIndex < tabModel.getCount() - 1) {
            TabModelUtils.setIndex(tabModel, currentIndex + 1);
        }
    } else {
        if (currentIndex > 0) {
            TabModelUtils.setIndex(tabModel, currentIndex - 1);
        }
    }
}
 
Example #2
Source File: LayoutManagerDocument.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void changeTabs() {
    DocumentTabModelSelector selector =
            ChromeApplication.getDocumentTabModelSelector();
    TabModel tabModel = selector.getCurrentModel();
    int currentIndex = tabModel.index();
    if (mLastScroll == ScrollDirection.LEFT) {
        if (currentIndex < tabModel.getCount() - 1) {
            TabModelUtils.setIndex(tabModel, currentIndex + 1);
        }
    } else {
        if (currentIndex > 0) {
            TabModelUtils.setIndex(tabModel, currentIndex - 1);
        }
    }
}
 
Example #3
Source File: LayoutManagerDocument.java    From 365browser with Apache License 2.0 6 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void changeTabs() {
    DocumentTabModelSelector selector =
            ChromeApplication.getDocumentTabModelSelector();
    TabModel tabModel = selector.getCurrentModel();
    int currentIndex = tabModel.index();
    if (mLastScroll == ScrollDirection.LEFT) {
        if (currentIndex < tabModel.getCount() - 1) {
            TabModelUtils.setIndex(tabModel, currentIndex + 1);
        }
    } else {
        if (currentIndex > 0) {
            TabModelUtils.setIndex(tabModel, currentIndex - 1);
        }
    }
}