com.android.resources.NavigationState Java Examples

The following examples show how to use com.android.resources.NavigationState. 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: NavigationStateQualifier.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
@Override
public boolean checkAndSet(String value, FolderConfiguration config) {
    NavigationState state = NavigationState.getEnum(value);
    if (state != null) {
        NavigationStateQualifier qualifier = new NavigationStateQualifier();
        qualifier.mValue = state;
        config.setNavigationStateQualifier(qualifier);
        return true;
    }

    return false;
}
 
Example #2
Source File: NavigationStateQualifier.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean checkAndSet(String value, FolderConfiguration config) {
    NavigationState state = NavigationState.getEnum(value);
    if (state != null) {
        NavigationStateQualifier qualifier = new NavigationStateQualifier();
        qualifier.mValue = state;
        config.setNavigationStateQualifier(qualifier);
        return true;
    }

    return false;
}
 
Example #3
Source File: State.java    From java-n-IDE-for-Android with Apache License 2.0 4 votes vote down vote up
public NavigationState getNavState() {
    return mNavState;
}
 
Example #4
Source File: State.java    From java-n-IDE-for-Android with Apache License 2.0 4 votes vote down vote up
public void setNavState(NavigationState navState) {
    mNavState = navState;
}
 
Example #5
Source File: NavigationStateQualifier.java    From java-n-IDE-for-Android with Apache License 2.0 4 votes vote down vote up
public NavigationStateQualifier(NavigationState value) {
    mValue = value;
}
 
Example #6
Source File: NavigationStateQualifier.java    From java-n-IDE-for-Android with Apache License 2.0 4 votes vote down vote up
public NavigationState getValue() {
    return mValue;
}
 
Example #7
Source File: State.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
public NavigationState getNavState() {
    return mNavState;
}
 
Example #8
Source File: State.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
public void setNavState(NavigationState navState) {
    mNavState = navState;
}
 
Example #9
Source File: RenderServiceFactory.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Creates a config. This must be a valid config like a device would return. This is to
 * prevent issues where some resources don't exist in all cases and not in the default
 * (for instance only available in hdpi and mdpi but not in default).
 *
 * @param size1
 * @param size2
 * @param screenSize
 * @param screenRatio
 * @param orientation
 * @param density
 * @param touchScreen
 * @param keyboardState
 * @param keyboard
 * @param navigationState
 * @param navigation
 * @param apiLevel
 * @return
 */
public static FolderConfiguration createConfig(
        int size1,
        int size2,
        ScreenSize screenSize,
        ScreenRatio screenRatio,
        ScreenOrientation orientation,
        Density density,
        TouchScreen touchScreen,
        KeyboardState keyboardState,
        Keyboard keyboard,
        NavigationState navigationState,
        Navigation navigation,
        int apiLevel) {
    FolderConfiguration config = new FolderConfiguration();

    int width = size1, height = size2;
    switch (orientation) {
        case LANDSCAPE:
            width = size1 < size2 ? size2 : size1;
            height = size1 < size2 ? size1 : size2;
            break;
        case PORTRAIT:
            width = size1 < size2 ? size1 : size2;
            height = size1 < size2 ? size2 : size1;
            break;
        case SQUARE:
            width = height = size1;
            break;
    }

    int wdp = (width * Density.DEFAULT_DENSITY) / density.getDpiValue();
    int hdp = (height * Density.DEFAULT_DENSITY) / density.getDpiValue();

    config.addQualifier(new SmallestScreenWidthQualifier(wdp < hdp ? wdp : hdp));
    config.addQualifier(new ScreenWidthQualifier(wdp));
    config.addQualifier(new ScreenHeightQualifier(hdp));

    config.addQualifier(new ScreenSizeQualifier(screenSize));
    config.addQualifier(new ScreenRatioQualifier(screenRatio));
    config.addQualifier(new ScreenOrientationQualifier(orientation));
    config.addQualifier(new DensityQualifier(density));
    config.addQualifier(new TouchScreenQualifier(touchScreen));
    config.addQualifier(new KeyboardStateQualifier(keyboardState));
    config.addQualifier(new TextInputMethodQualifier(keyboard));
    config.addQualifier(new NavigationStateQualifier(navigationState));
    config.addQualifier(new NavigationMethodQualifier(navigation));
    config.addQualifier(width > height ? new ScreenDimensionQualifier(width, height) :
        new ScreenDimensionQualifier(height, width));
    config.addQualifier(new VersionQualifier(apiLevel));

    config.updateScreenWidthAndHeight();

    return config;
}
 
Example #10
Source File: NavigationStateQualifier.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
public NavigationStateQualifier(NavigationState value) {
    mValue = value;
}
 
Example #11
Source File: NavigationStateQualifier.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
public NavigationState getValue() {
    return mValue;
}