Java Code Examples for org.chromium.content.browser.DeviceUtils#isTablet()

The following examples show how to use org.chromium.content.browser.DeviceUtils#isTablet() . 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: InfoBarContainer.java    From android-chromium with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public InfoBarContainer(Activity activity, AutoLoginProcessor autoLoginProcessor,
        int tabId, ViewGroup parentView, int nativeWebContents) {
    super(activity);
    setOrientation(LinearLayout.VERTICAL);
    mAnimationListener = null;
    mInfoBarTransitions = new ArrayDeque<InfoBarTransitionInfo>();

    mAutoLoginDelegate = new AutoLoginDelegate(autoLoginProcessor, activity);
    mActivity = activity;
    mTabId = tabId;
    mParentView = parentView;

    mAnimationSizer = new FrameLayout(activity);
    mAnimationSizer.setVisibility(INVISIBLE);

    // The tablet has the infobars below the location bar. On the phone they are at the bottom.
    mInfoBarsOnTop = DeviceUtils.isTablet(activity);
    setGravity(determineGravity());

    // Chromium's InfoBarContainer may add an InfoBar immediately during this initialization
    // call, so make sure everything in the InfoBarContainer is completely ready beforehand.
    mNativeInfoBarContainer = nativeInit(nativeWebContents, mAutoLoginDelegate);
}
 
Example 2
Source File: InfoBarContainer.java    From android-chromium with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public InfoBarContainer(Activity activity, AutoLoginProcessor autoLoginProcessor,
        int tabId, ViewGroup parentView, int nativeWebContents) {
    super(activity);
    setOrientation(LinearLayout.VERTICAL);
    mAnimationListener = null;
    mInfoBarTransitions = new ArrayDeque<InfoBarTransitionInfo>();

    mAutoLoginDelegate = new AutoLoginDelegate(autoLoginProcessor, activity);
    mActivity = activity;
    mTabId = tabId;
    mParentView = parentView;

    mAnimationSizer = new FrameLayout(activity);
    mAnimationSizer.setVisibility(INVISIBLE);

    // The tablet has the infobars below the location bar. On the phone they are at the bottom.
    mInfoBarsOnTop = DeviceUtils.isTablet(activity);
    setGravity(determineGravity());

    // Chromium's InfoBarContainer may add an InfoBar immediately during this initialization
    // call, so make sure everything in the InfoBarContainer is completely ready beforehand.
    mNativeInfoBarContainer = nativeInit(nativeWebContents, mAutoLoginDelegate);
}
 
Example 3
Source File: TranslateInfoBar.java    From android-chromium with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private boolean needsAlwaysPanel() {
    return (getInfoBarType() == TranslateInfoBar.AFTER_TRANSLATE_INFOBAR
            && mOptions.alwaysTranslateLanguageState() && !DeviceUtils.isTablet(getContext()));
}
 
Example 4
Source File: TranslateInfoBar.java    From android-chromium with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private boolean needsAlwaysPanel() {
    return (getInfoBarType() == TranslateInfoBar.AFTER_TRANSLATE_INFOBAR
            && mOptions.alwaysTranslateLanguageState() && !DeviceUtils.isTablet(getContext()));
}