public static String getClipBoardText() { // #sijapp cond.if modules_ANDROID is "true" # String androidClipboard = ru.net.jimm.JimmActivity.getInstance().clipboard.get(); if (!StringUtils.isEmpty(androidClipboard) && !androidClipboard.equals(instance.text)) { instance.set(androidClipboard); } // #sijapp cond.end # return isClipBoardEmpty() ? "" : (instance.text + " "); }
private void set(String text) { this.text = text; // #sijapp cond.if modules_ANDROID is "true" # ru.net.jimm.JimmActivity.getInstance().clipboard.put(text); // #sijapp cond.end # }
static AndroidFont getFont(Font meFont) { AndroidFont result = fonts.get(meFont); if (result == null) { Typeface family = Typeface.SANS_SERIF; if (meFont.getFace() == Font.FACE_SYSTEM) { family = Typeface.SANS_SERIF; } else if (meFont.getFace() == Font.FACE_MONOSPACE) { family = Typeface.MONOSPACE; } else if (meFont.getFace() == Font.FACE_PROPORTIONAL) { family = Typeface.SANS_SERIF; } int style = 0; if ((meFont.getStyle() & Font.STYLE_PLAIN) != 0) { style |= Typeface.NORMAL; } if ((meFont.getStyle() & Font.STYLE_BOLD) != 0) { style |= Typeface.BOLD; } if ((meFont.getStyle() & Font.STYLE_ITALIC) != 0) { style |= Typeface.ITALIC; } boolean underlined = false; if ((meFont.getStyle() & Font.STYLE_UNDERLINED) != 0) { underlined = true; } int size = 0; float fontSize = 0; if (meFont.getSize() == Font.SIZE_SMALL) { fontSize = JimmActivity.getInstance() .getResources() .getDimensionPixelSize(R.dimen.small_font_size); size = MicroEmulatorActivity.config.FONT_SIZE_SMALL; } else if (meFont.getSize() == Font.SIZE_MEDIUM) { fontSize = JimmActivity.getInstance() .getResources() .getDimensionPixelSize(R.dimen.medium_font_size); size = MicroEmulatorActivity.config.FONT_SIZE_MEDIUM; } else if (meFont.getSize() == Font.SIZE_LARGE) { fontSize = JimmActivity.getInstance() .getResources() .getDimensionPixelSize(R.dimen.large_font_size); size = MicroEmulatorActivity.config.FONT_SIZE_LARGE; } // Once default font size is defined, // compute size relative to scaleDensity // to enable consistent font size ratio // accross any device resolution/density // size *= metrics.scaledDensity; // fontSize = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, size, metrics); result = new AndroidFont(Typeface.create(family, style), fontSize, underlined); fonts.put(meFont, result); } return result; }