com.android.ide.common.resources.configuration.TextInputMethodQualifier Java Examples
The following examples show how to use
com.android.ide.common.resources.configuration.TextInputMethodQualifier.
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: ConfigGenerator.java From NBANDROID-V2 with Apache License 2.0 | 5 votes |
public FolderConfiguration getFolderConfig() { FolderConfiguration config = new FolderConfiguration(); // config.createDefault(); config.setDensityQualifier(new DensityQualifier(mDensity)); config.setNavigationMethodQualifier(new NavigationMethodQualifier(mNavigation)); if (mScreenWidth > mScreenHeight) { config.setScreenDimensionQualifier(new ScreenDimensionQualifier(mScreenWidth, mScreenHeight)); } else { config.setScreenDimensionQualifier(new ScreenDimensionQualifier(mScreenHeight, mScreenWidth)); } config.setScreenRatioQualifier(new ScreenRatioQualifier(mRatio)); config.setScreenSizeQualifier(new ScreenSizeQualifier(mSize)); config.setTextInputMethodQualifier(new TextInputMethodQualifier(mKeyboard)); config.setTouchTypeQualifier(new TouchScreenQualifier(mTouchScreen)); config.setKeyboardStateQualifier(new KeyboardStateQualifier(mKeyboardState)); config.setScreenOrientationQualifier(new ScreenOrientationQualifier(mOrientation)); config.updateScreenWidthAndHeight(); // some default qualifiers. config.setUiModeQualifier(new UiModeQualifier(UiMode.NORMAL)); config.setNightModeQualifier(new NightModeQualifier(NightMode.NOTNIGHT)); config.setCountryCodeQualifier(new CountryCodeQualifier()); config.setLayoutDirectionQualifier(new LayoutDirectionQualifier()); config.setNetworkCodeQualifier(new NetworkCodeQualifier()); config.setLocaleQualifier(new LocaleQualifier()); config.setVersionQualifier(new VersionQualifier(28)); return config; }
Example #2
Source File: RenderServiceFactory.java From javaide with GNU General Public License v3.0 | 4 votes |
/** * 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; }