MCPcopy Create free account
hub / github.com/FongMi/TV / encode

Method encode

app/src/leanback/java/com/fongmi/android/tv/utils/QRCode.java:34–39  ·  view source on GitHub ↗
(String content, int size, int margin)

Source from the content-addressed store, hash-verified

32 }
33
34 private static BitMatrix encode(String content, int size, int margin) throws Exception {
35 Map<EncodeHintType, Object> hints = new EnumMap<>(EncodeHintType.class);
36 hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
37 hints.put(EncodeHintType.MARGIN, margin);
38 return new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, ResUtil.dp2px(size), ResUtil.dp2px(size), hints);
39 }
40
41 private static int detectQuietZone(BitMatrix matrix) {
42 for (int y = 0; y < matrix.getHeight(); y++) for (int x = 0; x < matrix.getWidth(); x++) if (matrix.get(x, y)) return Math.min(x, y);

Callers 8

getBitmapMethod · 0.95
downloadFunction · 0.80
js2ProxyMethod · 0.80
getSuggestMethod · 0.80
convertMethod · 0.80
fetchMethod · 0.80
getSuggestMethod · 0.80
generateAppKeyMethod · 0.80

Calls 2

dp2pxMethod · 0.95
putMethod · 0.45

Tested by

no test coverage detected