├── LICENSE ├── NOTICE ├── README.md ├── art ├── 01.png ├── 02.png ├── 03.png ├── 04.png ├── 05.png ├── 06.png ├── 07.png ├── 08.png └── 09.png ├── circle.yml ├── commons ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── .gitignore │ ├── androidTest │ └── java │ │ └── com │ │ └── alibaba │ │ └── weex │ │ └── commons │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── alibaba │ │ └── weex │ │ └── commons │ │ ├── AbstractWeexActivity.java │ │ ├── SimpleWeexActivity.java │ │ ├── WXAnalyzerDelegate.java │ │ ├── adapter │ │ └── ImageAdapter.java │ │ └── util │ │ ├── AssertUtil.java │ │ └── ScreenUtil.java │ └── res │ └── values │ └── strings.xml ├── playground ├── .gitignore ├── LICENSE ├── NOTICE ├── README.md ├── app │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ ├── animation.js │ │ ├── component │ │ │ ├── a-demo.js │ │ │ ├── countdown-demo.js │ │ │ ├── image-demo.js │ │ │ ├── input-demo.js │ │ │ ├── list │ │ │ │ ├── list-basic.js │ │ │ │ ├── list-demo-horizon.js │ │ │ │ └── list-demo.js │ │ │ ├── marquee-demo.js │ │ │ ├── navigator-demo.js │ │ │ ├── scroller-demo.js │ │ │ ├── slider │ │ │ │ ├── index.js │ │ │ │ ├── slider-item.js │ │ │ │ └── slider-page.js │ │ │ ├── tabbar │ │ │ │ ├── tabbar-demo.js │ │ │ │ └── tabbar-item.js │ │ │ ├── text-demo.js │ │ │ ├── video-demo.js │ │ │ └── web-demo.js │ │ ├── hello.js │ │ ├── iconfont.js │ │ ├── image-demo2.js │ │ ├── index.js │ │ ├── module │ │ │ ├── clipboard.js │ │ │ ├── instance-api.js │ │ │ ├── modal.js │ │ │ ├── storage-demo.js │ │ │ └── stream-demo.js │ │ ├── showcase │ │ │ ├── calculator.js │ │ │ ├── dropdown │ │ │ │ ├── dropdown-demo.js │ │ │ │ └── we-dropdown.js │ │ │ ├── minesweeper.js │ │ │ ├── new-fashion │ │ │ │ ├── banner.js │ │ │ │ ├── banners.js │ │ │ │ ├── brand.js │ │ │ │ ├── category.js │ │ │ │ ├── coupon.js │ │ │ │ ├── fashion.js │ │ │ │ ├── goods.js │ │ │ │ ├── headlines.js │ │ │ │ ├── index.js │ │ │ │ ├── link.js │ │ │ │ ├── main.js │ │ │ │ ├── match.js │ │ │ │ ├── resource.js │ │ │ │ └── scene.js │ │ │ └── ui.js │ │ ├── style │ │ │ ├── index.js │ │ │ ├── style-box.js │ │ │ ├── style-flex.js │ │ │ └── style-item.js │ │ ├── syntax │ │ │ ├── hello-world-1.js │ │ │ ├── hello-world-2.js │ │ │ ├── hello-world-3.js │ │ │ ├── hello-world-4.js │ │ │ ├── hello-world-5.js │ │ │ ├── hello-world.js │ │ │ ├── index.js │ │ │ ├── script-component.js │ │ │ ├── script-data.js │ │ │ ├── script-events.js │ │ │ ├── script-instance.js │ │ │ ├── script-lifecycle.js │ │ │ ├── script-module.js │ │ │ ├── script-options.js │ │ │ ├── template-class.js │ │ │ ├── template-content.js │ │ │ ├── template-event.js │ │ │ ├── template-if.js │ │ │ ├── template-repeat-update.js │ │ │ ├── template-repeat.js │ │ │ └── template-style.js │ │ └── template.js │ │ ├── java │ │ └── com │ │ │ └── alibaba │ │ │ └── weex │ │ │ ├── IndexActivity.java │ │ │ ├── SplashActivity.java │ │ │ ├── WXApplication.java │ │ │ ├── WXBaseActivity.java │ │ │ ├── WXPageActivity.java │ │ │ ├── constants │ │ │ └── Constants.java │ │ │ ├── extend │ │ │ ├── PlayDebugAdapter.java │ │ │ ├── component │ │ │ │ └── RichText.java │ │ │ └── module │ │ │ │ ├── GeolocationModule.java │ │ │ │ ├── MyModule.java │ │ │ │ ├── RenderModule.java │ │ │ │ ├── WXEventModule.java │ │ │ │ └── location │ │ │ │ ├── DefaultLocation.java │ │ │ │ ├── ILocatable.java │ │ │ │ └── LocationFactory.java │ │ │ └── https │ │ │ ├── HotRefreshManager.java │ │ │ ├── WXHttpManager.java │ │ │ ├── WXHttpResponse.java │ │ │ ├── WXHttpTask.java │ │ │ ├── WXOkHttpDispatcher.java │ │ │ └── WXRequestListener.java │ │ ├── java_zxing │ │ └── com │ │ │ └── google │ │ │ └── zxing │ │ │ ├── BarcodeFormat.java │ │ │ ├── Binarizer.java │ │ │ ├── BinaryBitmap.java │ │ │ ├── ChecksumException.java │ │ │ ├── DecodeHintType.java │ │ │ ├── Dimension.java │ │ │ ├── EncodeHintType.java │ │ │ ├── FormatException.java │ │ │ ├── InvertedLuminanceSource.java │ │ │ ├── LuminanceSource.java │ │ │ ├── MultiFormatReader.java │ │ │ ├── MultiFormatWriter.java │ │ │ ├── NotFoundException.java │ │ │ ├── PlanarYUVLuminanceSource.java │ │ │ ├── RGBLuminanceSource.java │ │ │ ├── Reader.java │ │ │ ├── ReaderException.java │ │ │ ├── Result.java │ │ │ ├── ResultMetadataType.java │ │ │ ├── ResultPoint.java │ │ │ ├── ResultPointCallback.java │ │ │ ├── Writer.java │ │ │ ├── WriterException.java │ │ │ ├── aztec │ │ │ ├── AztecDetectorResult.java │ │ │ ├── AztecReader.java │ │ │ ├── AztecWriter.java │ │ │ ├── decoder │ │ │ │ └── Decoder.java │ │ │ ├── detector │ │ │ │ └── Detector.java │ │ │ └── encoder │ │ │ │ ├── AztecCode.java │ │ │ │ ├── BinaryShiftToken.java │ │ │ │ ├── Encoder.java │ │ │ │ ├── HighLevelEncoder.java │ │ │ │ ├── SimpleToken.java │ │ │ │ ├── State.java │ │ │ │ └── Token.java │ │ │ ├── client │ │ │ ├── android │ │ │ │ ├── AmbientLightManager.java │ │ │ │ ├── BeepManager.java │ │ │ │ ├── CaptureActivity.java │ │ │ │ ├── CaptureActivityHandler.java │ │ │ │ ├── Contents.java │ │ │ │ ├── DecodeFormatManager.java │ │ │ │ ├── DecodeHandler.java │ │ │ │ ├── DecodeHintManager.java │ │ │ │ ├── DecodeThread.java │ │ │ │ ├── FinishListener.java │ │ │ │ ├── HelpActivity.java │ │ │ │ ├── HttpHelper.java │ │ │ │ ├── InactivityTimer.java │ │ │ │ ├── IntentSource.java │ │ │ │ ├── Intents.java │ │ │ │ ├── LocaleManager.java │ │ │ │ ├── PreferencesActivity.java │ │ │ │ ├── PreferencesFragment.java │ │ │ │ ├── ScanFromWebPageManager.java │ │ │ │ ├── ViewfinderResultPointCallback.java │ │ │ │ ├── ViewfinderView.java │ │ │ │ ├── book │ │ │ │ │ ├── BrowseBookListener.java │ │ │ │ │ ├── SearchBookContentsActivity.java │ │ │ │ │ ├── SearchBookContentsAdapter.java │ │ │ │ │ ├── SearchBookContentsListItem.java │ │ │ │ │ └── SearchBookContentsResult.java │ │ │ │ ├── camera │ │ │ │ │ ├── AutoFocusManager.java │ │ │ │ │ ├── CameraConfigurationManager.java │ │ │ │ │ ├── CameraConfigurationUtils.java │ │ │ │ │ ├── CameraManager.java │ │ │ │ │ ├── FrontLightMode.java │ │ │ │ │ ├── PreviewCallback.java │ │ │ │ │ └── open │ │ │ │ │ │ ├── CameraFacing.java │ │ │ │ │ │ ├── OpenCamera.java │ │ │ │ │ │ └── OpenCameraInterface.java │ │ │ │ ├── clipboard │ │ │ │ │ └── ClipboardInterface.java │ │ │ │ ├── encode │ │ │ │ │ ├── ContactEncoder.java │ │ │ │ │ ├── EncodeActivity.java │ │ │ │ │ ├── Formatter.java │ │ │ │ │ ├── MECARDContactEncoder.java │ │ │ │ │ ├── QRCodeEncoder.java │ │ │ │ │ ├── VCardContactEncoder.java │ │ │ │ │ ├── VCardFieldFormatter.java │ │ │ │ │ └── VCardTelDisplayFormatter.java │ │ │ │ ├── history │ │ │ │ │ ├── DBHelper.java │ │ │ │ │ ├── HistoryActivity.java │ │ │ │ │ ├── HistoryItem.java │ │ │ │ │ ├── HistoryItemAdapter.java │ │ │ │ │ └── HistoryManager.java │ │ │ │ ├── result │ │ │ │ │ ├── AddressBookResultHandler.java │ │ │ │ │ ├── CalendarResultHandler.java │ │ │ │ │ ├── EmailAddressResultHandler.java │ │ │ │ │ ├── GeoResultHandler.java │ │ │ │ │ ├── ISBNResultHandler.java │ │ │ │ │ ├── ProductResultHandler.java │ │ │ │ │ ├── ResultButtonListener.java │ │ │ │ │ ├── ResultHandler.java │ │ │ │ │ ├── ResultHandlerFactory.java │ │ │ │ │ ├── SMSResultHandler.java │ │ │ │ │ ├── TelResultHandler.java │ │ │ │ │ ├── TextResultHandler.java │ │ │ │ │ ├── URIResultHandler.java │ │ │ │ │ ├── WifiResultHandler.java │ │ │ │ │ └── supplement │ │ │ │ │ │ ├── BookResultInfoRetriever.java │ │ │ │ │ │ ├── ProductResultInfoRetriever.java │ │ │ │ │ │ ├── SupplementalInfoRetriever.java │ │ │ │ │ │ ├── TitleRetriever.java │ │ │ │ │ │ └── URIResultInfoRetriever.java │ │ │ │ ├── share │ │ │ │ │ ├── AppInfo.java │ │ │ │ │ ├── AppPickerActivity.java │ │ │ │ │ ├── BookMarkColumns.java │ │ │ │ │ ├── BookmarkAdapter.java │ │ │ │ │ ├── BookmarkPickerActivity.java │ │ │ │ │ ├── LoadPackagesAsyncTask.java │ │ │ │ │ └── ShareActivity.java │ │ │ │ └── wifi │ │ │ │ │ ├── NetworkType.java │ │ │ │ │ └── WifiConfigManager.java │ │ │ └── result │ │ │ │ ├── AbstractDoCoMoResultParser.java │ │ │ │ ├── AddressBookAUResultParser.java │ │ │ │ ├── AddressBookDoCoMoResultParser.java │ │ │ │ ├── AddressBookParsedResult.java │ │ │ │ ├── BizcardResultParser.java │ │ │ │ ├── BookmarkDoCoMoResultParser.java │ │ │ │ ├── CalendarParsedResult.java │ │ │ │ ├── EmailAddressParsedResult.java │ │ │ │ ├── EmailAddressResultParser.java │ │ │ │ ├── EmailDoCoMoResultParser.java │ │ │ │ ├── ExpandedProductParsedResult.java │ │ │ │ ├── ExpandedProductResultParser.java │ │ │ │ ├── GeoParsedResult.java │ │ │ │ ├── GeoResultParser.java │ │ │ │ ├── ISBNParsedResult.java │ │ │ │ ├── ISBNResultParser.java │ │ │ │ ├── ParsedResult.java │ │ │ │ ├── ParsedResultType.java │ │ │ │ ├── ProductParsedResult.java │ │ │ │ ├── ProductResultParser.java │ │ │ │ ├── ResultParser.java │ │ │ │ ├── SMSMMSResultParser.java │ │ │ │ ├── SMSParsedResult.java │ │ │ │ ├── SMSTOMMSTOResultParser.java │ │ │ │ ├── SMTPResultParser.java │ │ │ │ ├── TelParsedResult.java │ │ │ │ ├── TelResultParser.java │ │ │ │ ├── TextParsedResult.java │ │ │ │ ├── URIParsedResult.java │ │ │ │ ├── URIResultParser.java │ │ │ │ ├── URLTOResultParser.java │ │ │ │ ├── VCardResultParser.java │ │ │ │ ├── VEventResultParser.java │ │ │ │ ├── VINParsedResult.java │ │ │ │ ├── VINResultParser.java │ │ │ │ ├── WifiParsedResult.java │ │ │ │ └── WifiResultParser.java │ │ │ ├── common │ │ │ ├── BitArray.java │ │ │ ├── BitMatrix.java │ │ │ ├── BitSource.java │ │ │ ├── CharacterSetECI.java │ │ │ ├── DecoderResult.java │ │ │ ├── DefaultGridSampler.java │ │ │ ├── DetectorResult.java │ │ │ ├── GlobalHistogramBinarizer.java │ │ │ ├── GridSampler.java │ │ │ ├── HybridBinarizer.java │ │ │ ├── PerspectiveTransform.java │ │ │ ├── StringUtils.java │ │ │ ├── detector │ │ │ │ ├── MathUtils.java │ │ │ │ ├── MonochromeRectangleDetector.java │ │ │ │ └── WhiteRectangleDetector.java │ │ │ └── reedsolomon │ │ │ │ ├── GenericGF.java │ │ │ │ ├── GenericGFPoly.java │ │ │ │ ├── ReedSolomonDecoder.java │ │ │ │ ├── ReedSolomonEncoder.java │ │ │ │ └── ReedSolomonException.java │ │ │ ├── datamatrix │ │ │ ├── DataMatrixReader.java │ │ │ ├── DataMatrixWriter.java │ │ │ ├── decoder │ │ │ │ ├── BitMatrixParser.java │ │ │ │ ├── DataBlock.java │ │ │ │ ├── DecodedBitStreamParser.java │ │ │ │ ├── Decoder.java │ │ │ │ └── Version.java │ │ │ ├── detector │ │ │ │ └── Detector.java │ │ │ └── encoder │ │ │ │ ├── ASCIIEncoder.java │ │ │ │ ├── Base256Encoder.java │ │ │ │ ├── C40Encoder.java │ │ │ │ ├── DataMatrixSymbolInfo144.java │ │ │ │ ├── DefaultPlacement.java │ │ │ │ ├── EdifactEncoder.java │ │ │ │ ├── Encoder.java │ │ │ │ ├── EncoderContext.java │ │ │ │ ├── ErrorCorrection.java │ │ │ │ ├── HighLevelEncoder.java │ │ │ │ ├── SymbolInfo.java │ │ │ │ ├── SymbolShapeHint.java │ │ │ │ ├── TextEncoder.java │ │ │ │ └── X12Encoder.java │ │ │ ├── maxicode │ │ │ ├── MaxiCodeReader.java │ │ │ └── decoder │ │ │ │ ├── BitMatrixParser.java │ │ │ │ ├── DecodedBitStreamParser.java │ │ │ │ └── Decoder.java │ │ │ ├── multi │ │ │ ├── ByQuadrantReader.java │ │ │ ├── GenericMultipleBarcodeReader.java │ │ │ ├── MultipleBarcodeReader.java │ │ │ └── qrcode │ │ │ │ ├── QRCodeMultiReader.java │ │ │ │ └── detector │ │ │ │ ├── MultiDetector.java │ │ │ │ └── MultiFinderPatternFinder.java │ │ │ ├── oned │ │ │ ├── CodaBarReader.java │ │ │ ├── CodaBarWriter.java │ │ │ ├── Code128Reader.java │ │ │ ├── Code128Writer.java │ │ │ ├── Code39Reader.java │ │ │ ├── Code39Writer.java │ │ │ ├── Code93Reader.java │ │ │ ├── Code93Writer.java │ │ │ ├── EAN13Reader.java │ │ │ ├── EAN13Writer.java │ │ │ ├── EAN8Reader.java │ │ │ ├── EAN8Writer.java │ │ │ ├── EANManufacturerOrgSupport.java │ │ │ ├── ITFReader.java │ │ │ ├── ITFWriter.java │ │ │ ├── MultiFormatOneDReader.java │ │ │ ├── MultiFormatUPCEANReader.java │ │ │ ├── OneDReader.java │ │ │ ├── OneDimensionalCodeWriter.java │ │ │ ├── UPCAReader.java │ │ │ ├── UPCAWriter.java │ │ │ ├── UPCEANExtension2Support.java │ │ │ ├── UPCEANExtension5Support.java │ │ │ ├── UPCEANExtensionSupport.java │ │ │ ├── UPCEANReader.java │ │ │ ├── UPCEANWriter.java │ │ │ ├── UPCEReader.java │ │ │ ├── UPCEWriter.java │ │ │ └── rss │ │ │ │ ├── AbstractRSSReader.java │ │ │ │ ├── DataCharacter.java │ │ │ │ ├── FinderPattern.java │ │ │ │ ├── Pair.java │ │ │ │ ├── RSS14Reader.java │ │ │ │ ├── RSSUtils.java │ │ │ │ └── expanded │ │ │ │ ├── BitArrayBuilder.java │ │ │ │ ├── ExpandedPair.java │ │ │ │ ├── ExpandedRow.java │ │ │ │ ├── RSSExpandedReader.java │ │ │ │ └── decoders │ │ │ │ ├── AI013103decoder.java │ │ │ │ ├── AI01320xDecoder.java │ │ │ │ ├── AI01392xDecoder.java │ │ │ │ ├── AI01393xDecoder.java │ │ │ │ ├── AI013x0x1xDecoder.java │ │ │ │ ├── AI013x0xDecoder.java │ │ │ │ ├── AI01AndOtherAIs.java │ │ │ │ ├── AI01decoder.java │ │ │ │ ├── AI01weightDecoder.java │ │ │ │ ├── AbstractExpandedDecoder.java │ │ │ │ ├── AnyAIDecoder.java │ │ │ │ ├── BlockParsedResult.java │ │ │ │ ├── CurrentParsingState.java │ │ │ │ ├── DecodedChar.java │ │ │ │ ├── DecodedInformation.java │ │ │ │ ├── DecodedNumeric.java │ │ │ │ ├── DecodedObject.java │ │ │ │ ├── FieldParser.java │ │ │ │ └── GeneralAppIdDecoder.java │ │ │ ├── pdf417 │ │ │ ├── PDF417Common.java │ │ │ ├── PDF417Reader.java │ │ │ ├── PDF417ResultMetadata.java │ │ │ ├── PDF417Writer.java │ │ │ ├── decoder │ │ │ │ ├── BarcodeMetadata.java │ │ │ │ ├── BarcodeValue.java │ │ │ │ ├── BoundingBox.java │ │ │ │ ├── Codeword.java │ │ │ │ ├── DecodedBitStreamParser.java │ │ │ │ ├── DetectionResult.java │ │ │ │ ├── DetectionResultColumn.java │ │ │ │ ├── DetectionResultRowIndicatorColumn.java │ │ │ │ ├── PDF417CodewordDecoder.java │ │ │ │ ├── PDF417ScanningDecoder.java │ │ │ │ └── ec │ │ │ │ │ ├── ErrorCorrection.java │ │ │ │ │ ├── ModulusGF.java │ │ │ │ │ └── ModulusPoly.java │ │ │ ├── detector │ │ │ │ ├── Detector.java │ │ │ │ └── PDF417DetectorResult.java │ │ │ └── encoder │ │ │ │ ├── BarcodeMatrix.java │ │ │ │ ├── BarcodeRow.java │ │ │ │ ├── Compaction.java │ │ │ │ ├── Dimensions.java │ │ │ │ ├── PDF417.java │ │ │ │ ├── PDF417ErrorCorrection.java │ │ │ │ └── PDF417HighLevelEncoder.java │ │ │ └── qrcode │ │ │ ├── QRCodeReader.java │ │ │ ├── QRCodeWriter.java │ │ │ ├── decoder │ │ │ ├── BitMatrixParser.java │ │ │ ├── DataBlock.java │ │ │ ├── DataMask.java │ │ │ ├── DecodedBitStreamParser.java │ │ │ ├── Decoder.java │ │ │ ├── ErrorCorrectionLevel.java │ │ │ ├── FormatInformation.java │ │ │ ├── Mode.java │ │ │ ├── QRCodeDecoderMetaData.java │ │ │ └── Version.java │ │ │ ├── detector │ │ │ ├── AlignmentPattern.java │ │ │ ├── AlignmentPatternFinder.java │ │ │ ├── Detector.java │ │ │ ├── FinderPattern.java │ │ │ ├── FinderPatternFinder.java │ │ │ └── FinderPatternInfo.java │ │ │ └── encoder │ │ │ ├── BlockPair.java │ │ │ ├── ByteMatrix.java │ │ │ ├── Encoder.java │ │ │ ├── MaskUtil.java │ │ │ ├── MatrixUtil.java │ │ │ └── QRCode.java │ │ └── res │ │ ├── drawable-hdpi │ │ ├── ic_action_refresh.png │ │ └── ic_action_scan.png │ │ ├── drawable-mdpi │ │ ├── ic_action_refresh.png │ │ └── ic_action_scan.png │ │ ├── drawable-v21 │ │ ├── ic_menu_camera.xml │ │ ├── ic_menu_gallery.xml │ │ ├── ic_menu_manage.xml │ │ ├── ic_menu_send.xml │ │ ├── ic_menu_share.xml │ │ └── ic_menu_slideshow.xml │ │ ├── drawable-xhdpi │ │ ├── ic_action_refresh.png │ │ └── ic_action_scan.png │ │ ├── drawable-xxhdpi │ │ ├── ic_action_refresh.png │ │ └── ic_action_scan.png │ │ ├── drawable │ │ └── side_nav_bar.xml │ │ ├── layout │ │ ├── activity_index.xml │ │ ├── activity_splash.xml │ │ ├── activity_wxpage.xml │ │ ├── app_bar_main.xml │ │ ├── app_picker_list_item.xml │ │ ├── bookmark_picker_list_item.xml │ │ ├── camera.xml │ │ ├── capture.xml │ │ ├── catalog_item.xml │ │ ├── content_main.xml │ │ ├── content_wx_main.xml │ │ ├── encode.xml │ │ ├── help.xml │ │ ├── history_list_item.xml │ │ ├── search_book_contents.xml │ │ ├── search_book_contents_header.xml │ │ ├── search_book_contents_list_item.xml │ │ └── share.xml │ │ ├── menu │ │ ├── capture.xml │ │ ├── encode.xml │ │ ├── history.xml │ │ ├── main.xml │ │ ├── main_scan.xml │ │ └── refresh.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── raw │ │ └── beep.ogg │ │ ├── values-v21 │ │ └── styles.xml │ │ ├── values-w820dp │ │ └── dimens.xml │ │ ├── values-zh-rCN │ │ └── strings.xml │ │ ├── values │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── drawables.xml │ │ ├── scan_code_arrays.xml │ │ ├── scan_code_colors.xml │ │ ├── scan_code_dimens.xml │ │ ├── scan_code_ids.xml │ │ ├── scan_code_strings.xml │ │ ├── scan_code_styles.xml │ │ ├── strings.xml │ │ ├── styles.xml │ │ └── themes.xml │ │ └── xml │ │ ├── preferences.xml │ │ └── scan_code_preferences.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle └── weex_analyzer ├── .gitignore ├── binary.gradle ├── build.gradle ├── constants.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── jacoco.gradle ├── maven.gradle ├── proguard-rules.pro ├── run-circle-ci.sh ├── src ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── taobao │ │ │ └── weex │ │ │ └── analyzer │ │ │ ├── Config.java │ │ │ ├── IPermissionHandler.java │ │ │ ├── IWXDevOptions.java │ │ │ ├── WeexDevOptions.java │ │ │ ├── core │ │ │ ├── AbstractLoopTask.java │ │ │ ├── Constants.java │ │ │ ├── DevOptionsConfig.java │ │ │ ├── HandlerThreadWrapper.java │ │ │ ├── LaunchAnalyzerReceiver.java │ │ │ ├── LifecycleAwareUtil.java │ │ │ ├── NetworkEventSender.java │ │ │ ├── ShakeDetector.java │ │ │ ├── TaskEntity.java │ │ │ ├── cpu │ │ │ │ ├── CpuSampleView.java │ │ │ │ ├── CpuSampler.java │ │ │ │ └── CpuTaskEntity.java │ │ │ ├── debug │ │ │ │ ├── DebugTool.java │ │ │ │ └── RemoteDebugManager.java │ │ │ ├── exception │ │ │ │ └── JSExceptionCatcher.java │ │ │ ├── fps │ │ │ │ ├── FPSSampler.java │ │ │ │ ├── FpsSampleView.java │ │ │ │ └── FpsTaskEntity.java │ │ │ ├── inspector │ │ │ │ ├── network │ │ │ │ │ ├── NetworkEventInspector.java │ │ │ │ │ └── NetworkInspectorView.java │ │ │ │ └── view │ │ │ │ │ ├── CSSBoxModelView.java │ │ │ │ │ ├── InspectorView.java │ │ │ │ │ ├── ViewInspectorManager.java │ │ │ │ │ ├── ViewPropertiesSupplier.java │ │ │ │ │ └── WXInspectorItemView.java │ │ │ ├── lint │ │ │ │ ├── ComponentHeightComputer.java │ │ │ │ ├── DomTracker.java │ │ │ │ ├── IVDomMonitor.java │ │ │ │ ├── PollingVDomMonitor.java │ │ │ │ ├── ProfileDomView.java │ │ │ │ ├── RemoteVDomMonitor.java │ │ │ │ ├── StandardVDomMonitor.java │ │ │ │ └── VDomController.java │ │ │ ├── logcat │ │ │ │ ├── LogConfig.java │ │ │ │ ├── LogView.java │ │ │ │ ├── LogcatDumpBuilder.java │ │ │ │ └── LogcatDumper.java │ │ │ ├── memory │ │ │ │ ├── MemorySampleView.java │ │ │ │ ├── MemorySampler.java │ │ │ │ └── MemoryTaskEntity.java │ │ │ ├── reporter │ │ │ │ ├── AnalyzerService.java │ │ │ │ ├── DataReporterFactory.java │ │ │ │ ├── IDataReporter.java │ │ │ │ ├── LogReporter.java │ │ │ │ ├── WebSocketReporter.java │ │ │ │ └── ws │ │ │ │ │ ├── IWebSocketBridge.java │ │ │ │ │ ├── OkHttp3WebSocketClient.java │ │ │ │ │ ├── OkHttpWebSocketClient.java │ │ │ │ │ ├── SimpleSession.java │ │ │ │ │ ├── WebSocketClient.java │ │ │ │ │ └── WebSocketClientFactory.java │ │ │ ├── scalpel │ │ │ │ ├── ScalpelFrameLayout.java │ │ │ │ └── ScalpelViewController.java │ │ │ ├── settings │ │ │ │ └── SettingsActivity.java │ │ │ ├── storage │ │ │ │ ├── StorageHacker.java │ │ │ │ ├── StorageView.java │ │ │ │ └── WXPerfStorage.java │ │ │ ├── traffic │ │ │ │ ├── TrafficSampleView.java │ │ │ │ ├── TrafficSampler.java │ │ │ │ └── TrafficTaskEntity.java │ │ │ └── weex │ │ │ │ ├── PerfSampleOverlayView.java │ │ │ │ ├── Performance.java │ │ │ │ ├── PerformanceMonitor.java │ │ │ │ ├── WXPerfHistoryItemView.java │ │ │ │ ├── WXPerfItemView.java │ │ │ │ └── WXPerformanceAnalysisView.java │ │ │ ├── pojo │ │ │ └── HealthReport.java │ │ │ ├── utils │ │ │ ├── ReflectionUtil.java │ │ │ ├── SDKUtils.java │ │ │ ├── ViewUtils.java │ │ │ └── XiaomiOverlayViewPermissionHelper.java │ │ │ └── view │ │ │ ├── DevOption.java │ │ │ ├── EntranceView.java │ │ │ ├── alert │ │ │ ├── AbstractAlertView.java │ │ │ ├── CompatibleAlertDialogBuilder.java │ │ │ ├── IAlertView.java │ │ │ └── PermissionAlertView.java │ │ │ ├── chart │ │ │ ├── BaseSeries.java │ │ │ ├── ChartView.java │ │ │ ├── DataPoint.java │ │ │ ├── DataPointInterface.java │ │ │ ├── DefaultLabelFormatter.java │ │ │ ├── DynamicChartViewController.java │ │ │ ├── GridLabelRenderer.java │ │ │ ├── LabelFormatter.java │ │ │ ├── LegendRenderer.java │ │ │ ├── LineGraphSeries.java │ │ │ ├── OnDataPointTapListener.java │ │ │ ├── Series.java │ │ │ ├── TimestampLabelFormatter.java │ │ │ └── Viewport.java │ │ │ ├── highlight │ │ │ ├── MutipleViewHighlighter.java │ │ │ ├── ViewHighlightOverlays.java │ │ │ └── ViewHighlighter.java │ │ │ └── overlay │ │ │ ├── AbstractBizItemView.java │ │ │ ├── AbstractOverlayView.java │ │ │ ├── AbstractResizableOverlayView.java │ │ │ ├── DragSupportOverlayView.java │ │ │ ├── IOverlayView.java │ │ │ ├── IResizableView.java │ │ │ ├── PermissionOverlayView.java │ │ │ └── SimpleOverlayView.java │ └── res │ │ ├── drawable-xhdpi │ │ └── wxt_icon_debug.png │ │ ├── drawable-xxhdpi │ │ ├── wxt_icon_3d_rotation.png │ │ ├── wxt_icon_checked.png │ │ ├── wxt_icon_cpu.png │ │ ├── wxt_icon_debug.png │ │ ├── wxt_icon_fps.png │ │ ├── wxt_icon_log.png │ │ ├── wxt_icon_memory.png │ │ ├── wxt_icon_mtop.png │ │ ├── wxt_icon_multi_performance.png │ │ ├── wxt_icon_performance.png │ │ ├── wxt_icon_render_analysis.png │ │ ├── wxt_icon_settings.png │ │ ├── wxt_icon_storage.png │ │ ├── wxt_icon_traffic.png │ │ ├── wxt_icon_unchecked.png │ │ └── wxt_icon_view_inspector.png │ │ ├── drawable │ │ ├── wxt_btn_bg.xml │ │ ├── wxt_check_box_style.xml │ │ ├── wxt_radio_btn_style.xml │ │ ├── wxt_radio_checked.xml │ │ └── wxt_radio_unchecked.xml │ │ ├── layout │ │ ├── wxt_activity_settings.xml │ │ ├── wxt_cur_perf_header.xml │ │ ├── wxt_depth_sample_view.xml │ │ ├── wxt_entrance_layout.xml │ │ ├── wxt_inspector_settings.xml │ │ ├── wxt_inspector_view.xml │ │ ├── wxt_item_log.xml │ │ ├── wxt_item_message.xml │ │ ├── wxt_item_storage.xml │ │ ├── wxt_log_settngs.xml │ │ ├── wxt_log_view.xml │ │ ├── wxt_memory_chart.xml │ │ ├── wxt_memory_view.xml │ │ ├── wxt_network_inspector_view.xml │ │ ├── wxt_option_item.xml │ │ ├── wxt_panel_cur_perf_view.xml │ │ ├── wxt_panel_history_perf_view.xml │ │ ├── wxt_panel_inspector_view.xml │ │ ├── wxt_perf_overlay_view.xml │ │ ├── wxt_storage_view.xml │ │ ├── wxt_styleable_radio_btn.xml │ │ └── wxt_weex_perf_analysis_view.xml │ │ └── values │ │ ├── strings.xml │ │ └── styles.xml └── test │ ├── java │ └── com │ │ └── taobao │ │ └── weex │ │ └── analyzer │ │ ├── core │ │ ├── AnalyzerServiceTest.java │ │ ├── HandlerThreadWrapperTest.java │ │ ├── JSExceptionCatcherTest.java │ │ ├── LaunchAnalyzerReceiverTest.java │ │ ├── MemorySamplerTest.java │ │ ├── MemoryTaskEntityTest.java │ │ ├── PerformanceTest.java │ │ ├── ShakeDetectorTest.java │ │ ├── TrafficSamplerTest.java │ │ ├── TrafficTaskEntityTest.java │ │ ├── VDomControllerTest.java │ │ └── WXPerfStorageTest.java │ │ └── view │ │ └── WXInspectorItemViewTest.java │ └── resources │ └── cpu │ ├── pid_stat │ └── stat └── tb-release.gradle /NOTICE: -------------------------------------------------------------------------------- 1 | Weex Analyzer 2 | 3 | Copyright 2016 Alibaba Group 4 | 5 | 6 | This product includes software developed at Alibaba Group. (http://www.alibabagroup.com) 7 | 8 | This product contains software GraphView(https://github.com/jjoe64/GraphView) developed 9 | by jjoe64 , licensed under Apache2.0 License. 10 | 11 | 12 | This product contains software scalpel(https://github.com/JakeWharton/scalpel) developed 13 | by JakeWharton , licensed under Apache2.0 License. -------------------------------------------------------------------------------- /art/01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/art/01.png -------------------------------------------------------------------------------- /art/02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/art/02.png -------------------------------------------------------------------------------- /art/03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/art/03.png -------------------------------------------------------------------------------- /art/04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/art/04.png -------------------------------------------------------------------------------- /art/05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/art/05.png -------------------------------------------------------------------------------- /art/06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/art/06.png -------------------------------------------------------------------------------- /art/07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/art/07.png -------------------------------------------------------------------------------- /art/08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/art/08.png -------------------------------------------------------------------------------- /art/09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/art/09.png -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | machine: 2 | java: 3 | version: 'oraclejdk8' 4 | test: 5 | override: 6 | - cd weex_analyzer && ./run-circle-ci.sh: 7 | timeout: 6000 8 | post: 9 | - cp -r weex_analyzer/build/reports $CIRCLE_ARTIFACTS/reports 10 | - cp -r weex_analyzer/build/outputs $CIRCLE_ARTIFACTS/outputs 11 | dependencies: 12 | pre: 13 | - echo y | android update sdk --no-ui --all --filter tool,extra-android-m2repository,extra-android-support,extra-google-google_play_services,extra-google-m2repository,android-23 14 | - echo y | android update sdk --no-ui --all --filter build-tools-23.0.2 15 | cache_directories: 16 | - ~/.m2 17 | -------------------------------------------------------------------------------- /commons/.gitignore: -------------------------------------------------------------------------------- 1 | #Android generated 2 | bin 3 | gen 4 | gen-external-apklibs 5 | build 6 | **/bin 7 | **/gen 8 | **/gen-external-apklibs 9 | **/build 10 | 11 | #Eclipse 12 | .project 13 | .classpath 14 | .settings 15 | **/.project 16 | **/.classpath 17 | **/.settings 18 | 19 | #IntelliJ IDEA 20 | .idea 21 | *.iml 22 | *.ipr 23 | *.iws 24 | out 25 | **/*.iml 26 | 27 | 28 | #Maven 29 | target 30 | release.properties 31 | pom.xml.* 32 | 33 | #Ant 34 | build.xml 35 | local.properties 36 | proguard.cfg 37 | 38 | #OSX 39 | .DS_Store 40 | 41 | #gradle 42 | /.gradle 43 | **/.gradle 44 | 45 | #Android 46 | **/project.properties 47 | -------------------------------------------------------------------------------- /commons/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/sospartan/sdks/android_sdk20130219/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /commons/src/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Android template 3 | # Built application files 4 | *.apk 5 | *.ap_ 6 | 7 | # Files for the ART/Dalvik VM 8 | *.dex 9 | 10 | # Java class files 11 | *.class 12 | 13 | # Generated files 14 | bin/ 15 | gen/ 16 | out/ 17 | 18 | # Gradle files 19 | .gradle/ 20 | build/ 21 | 22 | # Local configuration file (sdk path, etc) 23 | local.properties 24 | 25 | # Proguard folder generated by Eclipse 26 | proguard/ 27 | 28 | # Log Files 29 | *.log 30 | 31 | # Android Studio Navigation editor temp files 32 | .navigation/ 33 | 34 | # Android Studio captures folder 35 | captures/ 36 | 37 | # Intellij 38 | *.iml 39 | .idea/workspace.xml 40 | 41 | # Keystore files 42 | *.jks 43 | 44 | -------------------------------------------------------------------------------- /commons/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /playground/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Android template 3 | # Built application files 4 | *.apk 5 | *.ap_ 6 | 7 | # Files for the ART/Dalvik VM 8 | *.dex 9 | 10 | # Java class files 11 | *.class 12 | 13 | # Generated files 14 | bin/ 15 | gen/ 16 | out/ 17 | 18 | # Gradle files 19 | .gradle/ 20 | build/ 21 | 22 | # Local configuration file (sdk path, etc) 23 | local.properties 24 | 25 | # Proguard folder generated by Eclipse 26 | proguard/ 27 | 28 | # Log Files 29 | *.log 30 | 31 | # Android Studio Navigation editor temp files 32 | .navigation/ 33 | 34 | # Android Studio captures folder 35 | captures/ 36 | 37 | # Intellij 38 | *.iml 39 | .idea 40 | 41 | # Keystore files 42 | *.jks 43 | 44 | -------------------------------------------------------------------------------- /playground/NOTICE: -------------------------------------------------------------------------------- 1 | Weex android playground 2 | Copyright 2016 Alibaba Group 3 | 4 | This product includes software developed at Alibaba Group. (http://www.alibabagroup.com) 5 | 6 | This product contains software zxing(https://github.com/zxing/zxing) developed 7 | by Google Inc. , licensed under the Apache License. -------------------------------------------------------------------------------- /playground/README.md: -------------------------------------------------------------------------------- 1 | ### weex apps samples 2 | 3 | *Please install the weex-toolkit before use hotrefresh* 4 | 5 | [Development Tools link](https://github.com/alibaba/weex_toolchain) -------------------------------------------------------------------------------- /playground/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/lixinke/Tool/android-eclipse/adt-bundle-mac-x86_64-20140702/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | ##weex 19 | -keep class com.taobao.weex.bridge.**{*;} 20 | -keep class com.taobao.weex.dom.**{*;} 21 | -keep class com.taobao.weex.adapter.**{*;} 22 | -keep class com.taobao.weex.common.**{*;} 23 | -keep class * implements com.taobao.weex.IWXObject{*;} 24 | -keep class com.taobao.weex.ui.**{*;} 25 | -keep class com.taobao.weex.ui.component.**{*;} 26 | -keep class com.taobao.weex.utils.**{ 27 | public ; 28 | public ; 29 | } 30 | -keep class com.taobao.weex.view.**{*;} 31 | -keep class com.taobao.weex.module.**{*;} 32 | -keep public class * extends com.taobao.weex.common.WXModule{*;} 33 | -keep public class com.taobao.weex.WXDebugTool{*;} -------------------------------------------------------------------------------- /playground/app/src/main/java/com/alibaba/weex/SplashActivity.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.weex; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.view.View; 7 | import android.view.animation.Animation; 8 | import android.view.animation.AnimationSet; 9 | import android.view.animation.RotateAnimation; 10 | import android.view.animation.ScaleAnimation; 11 | 12 | public class SplashActivity extends AppCompatActivity { 13 | 14 | 15 | @Override 16 | protected void onCreate(Bundle savedInstanceState) { 17 | super.onCreate(savedInstanceState); 18 | setContentView(R.layout.activity_splash); 19 | 20 | View textView = findViewById(R.id.fullscreen_content); 21 | ScaleAnimation scaleAnimation = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); 22 | RotateAnimation rotateAnimation = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); 23 | 24 | AnimationSet animationSet = new AnimationSet(false); 25 | animationSet.addAnimation(scaleAnimation); 26 | animationSet.addAnimation(rotateAnimation); 27 | animationSet.setDuration(1500); 28 | 29 | animationSet.setAnimationListener(new Animation.AnimationListener() { 30 | @Override 31 | public void onAnimationStart(Animation animation) { 32 | } 33 | 34 | @Override 35 | public void onAnimationEnd(Animation animation) { 36 | startActivity(new Intent(SplashActivity.this, IndexActivity.class)); 37 | finish(); 38 | } 39 | 40 | @Override 41 | public void onAnimationRepeat(Animation animation) { 42 | } 43 | }); 44 | textView.startAnimation(animationSet); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /playground/app/src/main/java/com/alibaba/weex/WXBaseActivity.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.weex; 2 | 3 | import android.os.Bundle; 4 | import android.os.PersistableBundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | 7 | public abstract class WXBaseActivity extends AppCompatActivity { 8 | 9 | @Override 10 | public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) { 11 | super.onCreate(savedInstanceState, persistentState); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /playground/app/src/main/java/com/alibaba/weex/constants/Constants.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.weex.constants; 2 | 3 | public class Constants { 4 | 5 | // public static final String BUNDLE_URL = "http://t.cn?_wx_tpl=http://h5.waptest.taobao.com/app/weextc031/build/TC__Home.js"; 6 | public static final String BUNDLE_URL = "http://t.cn?_wx_tpl=http://g.tbcdn.cn/weex/weex-tc/0.1.2/build/TC__Home.js"; 7 | public static final String WEEX_SAMPLES_KEY = "?weex-samples"; 8 | public static final String WEEX_TPL_KEY = "_wx_tpl"; 9 | 10 | 11 | //hot refresh 12 | public static final int HOT_REFRESH_CONNECT = 0x111; 13 | public static final int HOT_REFRESH_DISCONNECT = HOT_REFRESH_CONNECT + 1; 14 | public static final int HOT_REFRESH_REFRESH = HOT_REFRESH_DISCONNECT + 1; 15 | public static final int HOT_REFRESH_CONNECT_ERROR = HOT_REFRESH_REFRESH + 1; 16 | } 17 | -------------------------------------------------------------------------------- /playground/app/src/main/java/com/alibaba/weex/extend/component/RichText.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.weex.extend.component; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.NonNull; 5 | import android.text.SpannableString; 6 | import android.text.Spanned; 7 | import android.text.method.LinkMovementMethod; 8 | import android.text.style.URLSpan; 9 | import android.widget.TextView; 10 | 11 | import com.taobao.weex.WXSDKInstance; 12 | import com.taobao.weex.dom.WXDomObject; 13 | import com.taobao.weex.ui.component.WXComponent; 14 | import com.taobao.weex.ui.component.WXComponentProp; 15 | import com.taobao.weex.ui.component.WXVContainer; 16 | 17 | public class RichText extends WXComponent { 18 | 19 | public RichText(WXSDKInstance instance, WXDomObject dom, WXVContainer parent, boolean isLazy) { 20 | super(instance, dom, parent, isLazy); 21 | } 22 | 23 | @Override 24 | protected TextView initComponentHostView(@NonNull Context context) { 25 | TextView view = new TextView(context); 26 | view.setMovementMethod(LinkMovementMethod.getInstance()); 27 | return view; 28 | } 29 | 30 | @WXComponentProp(name = "tel") 31 | public void setTelLink(String tel){ 32 | SpannableString spannable=new SpannableString(tel); 33 | spannable.setSpan(new URLSpan("tel:"+tel),0,tel.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); 34 | ((TextView) getHostView()).setText(spannable); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /playground/app/src/main/java/com/alibaba/weex/extend/module/MyModule.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.weex.extend.module; 2 | 3 | import android.widget.Toast; 4 | 5 | import com.taobao.weex.common.WXModule; 6 | import com.taobao.weex.common.WXModuleAnno; 7 | 8 | public class MyModule extends WXModule { 9 | 10 | @WXModuleAnno(runOnUIThread = true) 11 | public void printLog(String msg) { 12 | Toast.makeText(mWXSDKInstance.getContext(),msg,Toast.LENGTH_SHORT).show(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /playground/app/src/main/java/com/alibaba/weex/extend/module/RenderModule.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.weex.extend.module; 2 | 3 | import android.util.Log; 4 | 5 | import com.taobao.weex.common.WXModule; 6 | import com.taobao.weex.common.WXModuleAnno; 7 | 8 | 9 | public class RenderModule extends WXModule { 10 | 11 | @WXModuleAnno 12 | public void performClick() { 13 | Log.d("Render", "Render"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /playground/app/src/main/java/com/alibaba/weex/extend/module/WXEventModule.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.weex.extend.module; 2 | 3 | import android.content.Intent; 4 | import android.net.Uri; 5 | import android.text.TextUtils; 6 | 7 | import com.taobao.weex.common.WXModule; 8 | import com.taobao.weex.common.WXModuleAnno; 9 | 10 | 11 | public class WXEventModule extends WXModule { 12 | 13 | private static final String WEEX_CATEGORY = "com.taobao.android.intent.category.WEEX"; 14 | 15 | @WXModuleAnno(moduleMethod = true,runOnUIThread = true) 16 | public void openURL(String url) { 17 | if (TextUtils.isEmpty(url)) { 18 | return; 19 | } 20 | String scheme = Uri.parse(url).getScheme(); 21 | StringBuilder builder = new StringBuilder(); 22 | if (TextUtils.equals("http",scheme) || TextUtils.equals("https",scheme) || TextUtils.equals("file",scheme)) { 23 | builder.append(url); 24 | } else { 25 | builder.append("http:"); 26 | builder.append(url); 27 | } 28 | 29 | Uri uri = Uri.parse(builder.toString()); 30 | Intent intent = new Intent(Intent.ACTION_VIEW, uri); 31 | intent.addCategory(WEEX_CATEGORY); 32 | mWXSDKInstance.getContext().startActivity(intent); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /playground/app/src/main/java/com/alibaba/weex/extend/module/location/LocationFactory.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.weex.extend.module.location; 2 | 3 | import com.taobao.weex.WXSDKInstance; 4 | 5 | /** 6 | */ 7 | public class LocationFactory { 8 | 9 | public static ILocatable getLocationProvider(WXSDKInstance context){ 10 | return new DefaultLocation(context); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /playground/app/src/main/java/com/alibaba/weex/https/WXHttpManager.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.weex.https; 2 | 3 | import android.os.Handler; 4 | import android.os.Message; 5 | 6 | public class WXHttpManager { 7 | 8 | private static WXHttpManager wxHttpManager; 9 | private WXOkHttpDispatcher mOkHttpDispatcher; 10 | private Handler mHandler = new Handler(new Handler.Callback() { 11 | 12 | @Override 13 | public boolean handleMessage(Message msg) { 14 | WXHttpTask httpTask = (WXHttpTask) msg.obj; 15 | if (httpTask == null || httpTask.requestListener == null) { 16 | return true; 17 | } 18 | WXHttpResponse response = httpTask.response; 19 | if (response == null || response.code >= 300) { 20 | httpTask.requestListener.onError(httpTask); 21 | } else { 22 | httpTask.requestListener.onSuccess(httpTask); 23 | } 24 | return true; 25 | } 26 | }); 27 | 28 | private WXHttpManager() { 29 | mOkHttpDispatcher = new WXOkHttpDispatcher(mHandler); 30 | } 31 | 32 | public static WXHttpManager getInstance() { 33 | if (wxHttpManager == null) { 34 | wxHttpManager = new WXHttpManager(); 35 | } 36 | return wxHttpManager; 37 | } 38 | 39 | public void sendRequest(WXHttpTask httpTask) { 40 | mOkHttpDispatcher.dispatchSubmit(httpTask); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /playground/app/src/main/java/com/alibaba/weex/https/WXHttpResponse.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.weex.https; 2 | 3 | public class WXHttpResponse { 4 | 5 | public int code; 6 | public byte[] data; 7 | } 8 | -------------------------------------------------------------------------------- /playground/app/src/main/java/com/alibaba/weex/https/WXHttpTask.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.weex.https; 2 | 3 | public class WXHttpTask { 4 | 5 | public String url; 6 | public WXRequestListener requestListener; 7 | public WXHttpResponse response; 8 | } 9 | -------------------------------------------------------------------------------- /playground/app/src/main/java/com/alibaba/weex/https/WXRequestListener.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.weex.https; 2 | 3 | public interface WXRequestListener { 4 | 5 | void onSuccess(WXHttpTask task); 6 | 7 | void onError(WXHttpTask task); 8 | } 9 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/ChecksumException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing; 18 | 19 | /** 20 | * Thrown when a barcode was successfully detected and decoded, but 21 | * was not returned because its checksum feature failed. 22 | * 23 | * @author Sean Owen 24 | */ 25 | public final class ChecksumException extends ReaderException { 26 | 27 | private static final ChecksumException INSTANCE = new ChecksumException(); 28 | static { 29 | INSTANCE.setStackTrace(NO_TRACE); // since it's meaningless 30 | } 31 | 32 | private ChecksumException() { 33 | // do nothing 34 | } 35 | 36 | private ChecksumException(Throwable cause) { 37 | super(cause); 38 | } 39 | 40 | public static ChecksumException getChecksumInstance() { 41 | return isStackTrace ? new ChecksumException() : INSTANCE; 42 | } 43 | 44 | public static ChecksumException getChecksumInstance(Throwable cause) { 45 | return isStackTrace ? new ChecksumException(cause) : INSTANCE; 46 | } 47 | } -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/Dimension.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing; 18 | 19 | /** 20 | * Simply encapsulates a width and height. 21 | */ 22 | public final class Dimension { 23 | 24 | private final int width; 25 | private final int height; 26 | 27 | public Dimension(int width, int height) { 28 | if (width < 0 || height < 0) { 29 | throw new IllegalArgumentException(); 30 | } 31 | this.width = width; 32 | this.height = height; 33 | } 34 | 35 | public int getWidth() { 36 | return width; 37 | } 38 | 39 | public int getHeight() { 40 | return height; 41 | } 42 | 43 | @Override 44 | public boolean equals(Object other) { 45 | if (other instanceof Dimension) { 46 | Dimension d = (Dimension) other; 47 | return width == d.width && height == d.height; 48 | } 49 | return false; 50 | } 51 | 52 | @Override 53 | public int hashCode() { 54 | return width * 32713 + height; 55 | } 56 | 57 | @Override 58 | public String toString() { 59 | return width + "x" + height; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/FormatException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing; 18 | 19 | /** 20 | * Thrown when a barcode was successfully detected, but some aspect of 21 | * the content did not conform to the barcode's format rules. This could have 22 | * been due to a mis-detection. 23 | * 24 | * @author Sean Owen 25 | */ 26 | public final class FormatException extends ReaderException { 27 | 28 | private static final FormatException INSTANCE = new FormatException(); 29 | static { 30 | INSTANCE.setStackTrace(NO_TRACE); // since it's meaningless 31 | } 32 | 33 | private FormatException() { 34 | } 35 | 36 | private FormatException(Throwable cause) { 37 | super(cause); 38 | } 39 | 40 | public static FormatException getFormatInstance() { 41 | return isStackTrace ? new FormatException() : INSTANCE; 42 | } 43 | 44 | public static FormatException getFormatInstance(Throwable cause) { 45 | return isStackTrace ? new FormatException(cause) : INSTANCE; 46 | } 47 | } -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/NotFoundException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing; 18 | 19 | /** 20 | * Thrown when a barcode was not found in the image. It might have been 21 | * partially detected but could not be confirmed. 22 | * 23 | * @author Sean Owen 24 | */ 25 | public final class NotFoundException extends ReaderException { 26 | 27 | private static final NotFoundException INSTANCE = new NotFoundException(); 28 | static { 29 | INSTANCE.setStackTrace(NO_TRACE); // since it's meaningless 30 | } 31 | 32 | private NotFoundException() { 33 | // do nothing 34 | } 35 | 36 | public static NotFoundException getNotFoundInstance() { 37 | return INSTANCE; 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/ResultPointCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing; 18 | 19 | /** 20 | * Callback which is invoked when a possible result point (significant 21 | * point in the barcode image such as a corner) is found. 22 | * 23 | * @see DecodeHintType#NEED_RESULT_POINT_CALLBACK 24 | */ 25 | public interface ResultPointCallback { 26 | 27 | void foundPossibleResultPoint(ResultPoint point); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/WriterException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing; 18 | 19 | /** 20 | * A base class which covers the range of exceptions which may occur when encoding a barcode using 21 | * the Writer framework. 22 | * 23 | * @author dswitkin@google.com (Daniel Switkin) 24 | */ 25 | public final class WriterException extends Exception { 26 | 27 | public WriterException() { 28 | } 29 | 30 | public WriterException(String message) { 31 | super(message); 32 | } 33 | 34 | public WriterException(Throwable cause) { 35 | super(cause); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/aztec/AztecDetectorResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.aztec; 18 | 19 | import com.google.zxing.ResultPoint; 20 | import com.google.zxing.common.BitMatrix; 21 | import com.google.zxing.common.DetectorResult; 22 | 23 | public final class AztecDetectorResult extends DetectorResult { 24 | 25 | private final boolean compact; 26 | private final int nbDatablocks; 27 | private final int nbLayers; 28 | 29 | public AztecDetectorResult(BitMatrix bits, 30 | ResultPoint[] points, 31 | boolean compact, 32 | int nbDatablocks, 33 | int nbLayers) { 34 | super(bits, points); 35 | this.compact = compact; 36 | this.nbDatablocks = nbDatablocks; 37 | this.nbLayers = nbLayers; 38 | } 39 | 40 | public int getNbLayers() { 41 | return nbLayers; 42 | } 43 | 44 | public int getNbDatablocks() { 45 | return nbDatablocks; 46 | } 47 | 48 | public boolean isCompact() { 49 | return compact; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/aztec/encoder/SimpleToken.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.aztec.encoder; 18 | 19 | import com.google.zxing.common.BitArray; 20 | 21 | final class SimpleToken extends Token { 22 | 23 | // For normal words, indicates value and bitCount 24 | private final short value; 25 | private final short bitCount; 26 | 27 | SimpleToken(Token previous, int value, int bitCount) { 28 | super(previous); 29 | this.value = (short) value; 30 | this.bitCount = (short) bitCount; 31 | } 32 | 33 | @Override 34 | void appendTo(BitArray bitArray, byte[] text) { 35 | bitArray.appendBits(value, bitCount); 36 | } 37 | 38 | @Override 39 | public String toString() { 40 | int value = this.value & ((1 << bitCount) - 1); 41 | value |= 1 << bitCount; 42 | return '<' + Integer.toBinaryString(value | (1 << bitCount)).substring(1) + '>'; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/aztec/encoder/Token.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.aztec.encoder; 18 | 19 | import com.google.zxing.common.BitArray; 20 | 21 | abstract class Token { 22 | 23 | static final Token EMPTY = new SimpleToken(null, 0, 0); 24 | 25 | private final Token previous; 26 | 27 | Token(Token previous) { 28 | this.previous = previous; 29 | } 30 | 31 | final Token getPrevious() { 32 | return previous; 33 | } 34 | 35 | final Token add(int value, int bitCount) { 36 | return new SimpleToken(this, value, bitCount); 37 | } 38 | 39 | final Token addBinaryShift(int start, int byteCount) { 40 | //int bitCount = (byteCount * 8) + (byteCount <= 31 ? 10 : byteCount <= 62 ? 20 : 21); 41 | return new BinaryShiftToken(this, start, byteCount); 42 | } 43 | 44 | abstract void appendTo(BitArray bitArray, byte[] text); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/client/android/FinishListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.client.android; 18 | 19 | import android.app.Activity; 20 | import android.content.DialogInterface; 21 | 22 | /** 23 | * Simple listener used to exit the app in a few cases. 24 | * 25 | * @author Sean Owen 26 | */ 27 | public final class FinishListener implements DialogInterface.OnClickListener, DialogInterface.OnCancelListener { 28 | 29 | private final Activity activityToFinish; 30 | 31 | public FinishListener(Activity activityToFinish) { 32 | this.activityToFinish = activityToFinish; 33 | } 34 | 35 | @Override 36 | public void onCancel(DialogInterface dialogInterface) { 37 | run(); 38 | } 39 | 40 | @Override 41 | public void onClick(DialogInterface dialogInterface, int i) { 42 | run(); 43 | } 44 | 45 | private void run() { 46 | activityToFinish.finish(); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/client/android/IntentSource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.client.android; 18 | 19 | enum IntentSource { 20 | 21 | NATIVE_APP_INTENT, 22 | PRODUCT_SEARCH_LINK, 23 | ZXING_LINK, 24 | NONE 25 | 26 | } 27 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/client/android/ViewfinderResultPointCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.client.android; 18 | 19 | import com.google.zxing.ResultPoint; 20 | import com.google.zxing.ResultPointCallback; 21 | 22 | final class ViewfinderResultPointCallback implements ResultPointCallback { 23 | 24 | private final ViewfinderView viewfinderView; 25 | 26 | ViewfinderResultPointCallback(ViewfinderView viewfinderView) { 27 | this.viewfinderView = viewfinderView; 28 | } 29 | 30 | @Override 31 | public void foundPossibleResultPoint(ResultPoint point) { 32 | viewfinderView.addPossibleResultPoint(point); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/client/android/camera/FrontLightMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.client.android.camera; 18 | 19 | import android.content.SharedPreferences; 20 | 21 | import com.google.zxing.client.android.PreferencesActivity; 22 | 23 | /** 24 | * Enumerates settings of the preference controlling the front light. 25 | */ 26 | public enum FrontLightMode { 27 | 28 | /** Always on. */ 29 | ON, 30 | /** On only when ambient light is low. */ 31 | AUTO, 32 | /** Always off. */ 33 | OFF; 34 | 35 | private static FrontLightMode parse(String modeString) { 36 | return modeString == null ? OFF : valueOf(modeString); 37 | } 38 | 39 | public static FrontLightMode readPref(SharedPreferences sharedPrefs) { 40 | return parse(sharedPrefs.getString(PreferencesActivity.KEY_FRONT_LIGHT_MODE, OFF.toString())); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/client/android/camera/open/CameraFacing.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.client.android.camera.open; 18 | 19 | public enum CameraFacing { 20 | 21 | BACK, // must be value 0! 22 | FRONT, // must be value 1! 23 | 24 | } 25 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/client/android/camera/open/OpenCamera.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.client.android.camera.open; 18 | 19 | import android.hardware.Camera; 20 | 21 | public final class OpenCamera { 22 | 23 | private final int index; 24 | private final Camera camera; 25 | private final CameraFacing facing; 26 | private final int orientation; 27 | 28 | public OpenCamera(int index, Camera camera, CameraFacing facing, int orientation) { 29 | this.index = index; 30 | this.camera = camera; 31 | this.facing = facing; 32 | this.orientation = orientation; 33 | } 34 | 35 | public Camera getCamera() { 36 | return camera; 37 | } 38 | 39 | public CameraFacing getFacing() { 40 | return facing; 41 | } 42 | 43 | public int getOrientation() { 44 | return orientation; 45 | } 46 | 47 | @Override 48 | public String toString() { 49 | return "Camera #" + index + " : " + facing + ',' + orientation; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/client/android/encode/Formatter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.client.android.encode; 18 | 19 | /** 20 | * Encapsulates some simple formatting logic, to aid refactoring in {@link ContactEncoder}. 21 | * 22 | * @author Sean Owen 23 | */ 24 | interface Formatter { 25 | 26 | /** 27 | * @param value value to format 28 | * @param index index of value in a list of values to be formatted 29 | * @return formatted value 30 | */ 31 | CharSequence format(CharSequence value, int index); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/client/android/history/HistoryItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.client.android.history; 18 | 19 | import com.google.zxing.Result; 20 | 21 | public final class HistoryItem { 22 | 23 | private final Result result; 24 | private final String display; 25 | private final String details; 26 | 27 | HistoryItem(Result result, String display, String details) { 28 | this.result = result; 29 | this.display = display; 30 | this.details = details; 31 | } 32 | 33 | public Result getResult() { 34 | return result; 35 | } 36 | 37 | public String getDisplayAndDetails() { 38 | StringBuilder displayResult = new StringBuilder(); 39 | if (display == null || display.isEmpty()) { 40 | displayResult.append(result.getText()); 41 | } else { 42 | displayResult.append(display); 43 | } 44 | if (details != null && !details.isEmpty()) { 45 | displayResult.append(" : ").append(details); 46 | } 47 | return displayResult.toString(); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/client/android/result/ResultButtonListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.client.android.result; 18 | 19 | import android.view.View; 20 | 21 | /** 22 | * Handles the result of barcode decoding in the context of the Android platform, by dispatching the 23 | * proper intents to open other activities like GMail, Maps, etc. 24 | * 25 | * @author dswitkin@google.com (Daniel Switkin) 26 | */ 27 | public final class ResultButtonListener implements View.OnClickListener { 28 | private final ResultHandler resultHandler; 29 | private final int index; 30 | 31 | public ResultButtonListener(ResultHandler resultHandler, int index) { 32 | this.resultHandler = resultHandler; 33 | this.index = index; 34 | } 35 | 36 | @Override 37 | public void onClick(View view) { 38 | resultHandler.handleButtonPress(index); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/client/android/wifi/NetworkType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.client.android.wifi; 18 | 19 | enum NetworkType { 20 | 21 | WEP, 22 | WPA, 23 | NO_PASSWORD; 24 | 25 | static NetworkType forIntentValue(String networkTypeString) { 26 | if (networkTypeString == null) { 27 | return NO_PASSWORD; 28 | } 29 | if ("WPA".equals(networkTypeString)) { 30 | return WPA; 31 | } 32 | if ("WEP".equals(networkTypeString)) { 33 | return WEP; 34 | } 35 | if ("nopass".equals(networkTypeString)) { 36 | return NO_PASSWORD; 37 | } 38 | throw new IllegalArgumentException(networkTypeString); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/client/result/AbstractDoCoMoResultParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.client.result; 18 | 19 | /** 20 | *

See 21 | * 22 | * DoCoMo's documentation about the result types represented by subclasses of this class.

23 | * 24 | *

Thanks to Jeff Griffin for proposing rewrite of these classes that relies less 25 | * on exception-based mechanisms during parsing.

26 | * 27 | * @author Sean Owen 28 | */ 29 | abstract class AbstractDoCoMoResultParser extends ResultParser { 30 | 31 | static String[] matchDoCoMoPrefixedField(String prefix, String rawText, boolean trim) { 32 | return matchPrefixedField(prefix, rawText, ';', trim); 33 | } 34 | 35 | static String matchSingleDoCoMoPrefixedField(String prefix, String rawText, boolean trim) { 36 | return matchSinglePrefixedField(prefix, rawText, ';', trim); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/client/result/BookmarkDoCoMoResultParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.client.result; 18 | 19 | import com.google.zxing.Result; 20 | 21 | /** 22 | * @author Sean Owen 23 | */ 24 | public final class BookmarkDoCoMoResultParser extends AbstractDoCoMoResultParser { 25 | 26 | @Override 27 | public URIParsedResult parse(Result result) { 28 | String rawText = result.getText(); 29 | if (!rawText.startsWith("MEBKM:")) { 30 | return null; 31 | } 32 | String title = matchSingleDoCoMoPrefixedField("TITLE:", rawText, true); 33 | String[] rawUri = matchDoCoMoPrefixedField("URL:", rawText, true); 34 | if (rawUri == null) { 35 | return null; 36 | } 37 | String uri = rawUri[0]; 38 | return URIResultParser.isBasicallyValidURI(uri) ? new URIParsedResult(uri, title) : null; 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/client/result/ISBNParsedResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.client.result; 18 | 19 | /** 20 | * @author jbreiden@google.com (Jeff Breidenbach) 21 | */ 22 | public final class ISBNParsedResult extends ParsedResult { 23 | 24 | private final String isbn; 25 | 26 | ISBNParsedResult(String isbn) { 27 | super(ParsedResultType.ISBN); 28 | this.isbn = isbn; 29 | } 30 | 31 | public String getISBN() { 32 | return isbn; 33 | } 34 | 35 | @Override 36 | public String getDisplayResult() { 37 | return isbn; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/client/result/ISBNResultParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.client.result; 18 | 19 | import com.google.zxing.BarcodeFormat; 20 | import com.google.zxing.Result; 21 | 22 | /** 23 | * Parses strings of digits that represent a ISBN. 24 | * 25 | * @author jbreiden@google.com (Jeff Breidenbach) 26 | */ 27 | public final class ISBNResultParser extends ResultParser { 28 | 29 | /** 30 | * See ISBN-13 For Dummies 31 | */ 32 | @Override 33 | public ISBNParsedResult parse(Result result) { 34 | BarcodeFormat format = result.getBarcodeFormat(); 35 | if (format != BarcodeFormat.EAN_13) { 36 | return null; 37 | } 38 | String rawText = getMassagedText(result); 39 | int length = rawText.length(); 40 | if (length != 13) { 41 | return null; 42 | } 43 | if (!rawText.startsWith("978") && !rawText.startsWith("979")) { 44 | return null; 45 | } 46 | 47 | return new ISBNParsedResult(rawText); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/client/result/ParsedResultType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.client.result; 18 | 19 | /** 20 | * Represents the type of data encoded by a barcode -- from plain text, to a 21 | * URI, to an e-mail address, etc. 22 | * 23 | * @author Sean Owen 24 | */ 25 | public enum ParsedResultType { 26 | 27 | ADDRESSBOOK, 28 | EMAIL_ADDRESS, 29 | PRODUCT, 30 | URI, 31 | TEXT, 32 | GEO, 33 | TEL, 34 | SMS, 35 | CALENDAR, 36 | WIFI, 37 | ISBN, 38 | VIN, 39 | 40 | } 41 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/client/result/ProductParsedResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.client.result; 18 | 19 | /** 20 | * @author dswitkin@google.com (Daniel Switkin) 21 | */ 22 | public final class ProductParsedResult extends ParsedResult { 23 | 24 | private final String productID; 25 | private final String normalizedProductID; 26 | 27 | ProductParsedResult(String productID) { 28 | this(productID, productID); 29 | } 30 | 31 | ProductParsedResult(String productID, String normalizedProductID) { 32 | super(ParsedResultType.PRODUCT); 33 | this.productID = productID; 34 | this.normalizedProductID = normalizedProductID; 35 | } 36 | 37 | public String getProductID() { 38 | return productID; 39 | } 40 | 41 | public String getNormalizedProductID() { 42 | return normalizedProductID; 43 | } 44 | 45 | @Override 46 | public String getDisplayResult() { 47 | return productID; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/client/result/TelParsedResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.client.result; 18 | 19 | /** 20 | * @author Sean Owen 21 | */ 22 | public final class TelParsedResult extends ParsedResult { 23 | 24 | private final String number; 25 | private final String telURI; 26 | private final String title; 27 | 28 | public TelParsedResult(String number, String telURI, String title) { 29 | super(ParsedResultType.TEL); 30 | this.number = number; 31 | this.telURI = telURI; 32 | this.title = title; 33 | } 34 | 35 | public String getNumber() { 36 | return number; 37 | } 38 | 39 | public String getTelURI() { 40 | return telURI; 41 | } 42 | 43 | public String getTitle() { 44 | return title; 45 | } 46 | 47 | @Override 48 | public String getDisplayResult() { 49 | StringBuilder result = new StringBuilder(20); 50 | maybeAppend(number, result); 51 | maybeAppend(title, result); 52 | return result.toString(); 53 | } 54 | 55 | } -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/client/result/TelResultParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.client.result; 18 | 19 | import com.google.zxing.Result; 20 | 21 | /** 22 | * Parses a "tel:" URI result, which specifies a phone number. 23 | * 24 | * @author Sean Owen 25 | */ 26 | public final class TelResultParser extends ResultParser { 27 | 28 | @Override 29 | public TelParsedResult parse(Result result) { 30 | String rawText = getMassagedText(result); 31 | if (!rawText.startsWith("tel:") && !rawText.startsWith("TEL:")) { 32 | return null; 33 | } 34 | // Normalize "TEL:" to "tel:" 35 | String telURI = rawText.startsWith("TEL:") ? "tel:" + rawText.substring(4) : rawText; 36 | // Drop tel, query portion 37 | int queryStart = rawText.indexOf('?', 4); 38 | String number = queryStart < 0 ? rawText.substring(4) : rawText.substring(4, queryStart); 39 | return new TelParsedResult(number, telURI, null); 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/client/result/TextParsedResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.client.result; 18 | 19 | /** 20 | * A simple result type encapsulating a string that has no further 21 | * interpretation. 22 | * 23 | * @author Sean Owen 24 | */ 25 | public final class TextParsedResult extends ParsedResult { 26 | 27 | private final String text; 28 | private final String language; 29 | 30 | public TextParsedResult(String text, String language) { 31 | super(ParsedResultType.TEXT); 32 | this.text = text; 33 | this.language = language; 34 | } 35 | 36 | public String getText() { 37 | return text; 38 | } 39 | 40 | public String getLanguage() { 41 | return language; 42 | } 43 | 44 | @Override 45 | public String getDisplayResult() { 46 | return text; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/client/result/URLTOResultParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.client.result; 18 | 19 | import com.google.zxing.Result; 20 | 21 | /** 22 | * Parses the "URLTO" result format, which is of the form "URLTO:[title]:[url]". 23 | * This seems to be used sometimes, but I am not able to find documentation 24 | * on its origin or official format? 25 | * 26 | * @author Sean Owen 27 | */ 28 | public final class URLTOResultParser extends ResultParser { 29 | 30 | @Override 31 | public URIParsedResult parse(Result result) { 32 | String rawText = getMassagedText(result); 33 | if (!rawText.startsWith("urlto:") && !rawText.startsWith("URLTO:")) { 34 | return null; 35 | } 36 | int titleEnd = rawText.indexOf(':', 6); 37 | if (titleEnd < 0) { 38 | return null; 39 | } 40 | String title = titleEnd <= 6 ? null : rawText.substring(6, titleEnd); 41 | String uri = rawText.substring(titleEnd + 1); 42 | return new URIParsedResult(uri, title); 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/common/DetectorResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.common; 18 | 19 | import com.google.zxing.ResultPoint; 20 | 21 | /** 22 | *

Encapsulates the result of detecting a barcode in an image. This includes the raw 23 | * matrix of black/white pixels corresponding to the barcode, and possibly points of interest 24 | * in the image, like the location of finder patterns or corners of the barcode in the image.

25 | * 26 | * @author Sean Owen 27 | */ 28 | public class DetectorResult { 29 | 30 | private final BitMatrix bits; 31 | private final ResultPoint[] points; 32 | 33 | public DetectorResult(BitMatrix bits, ResultPoint[] points) { 34 | this.bits = bits; 35 | this.points = points; 36 | } 37 | 38 | public final BitMatrix getBits() { 39 | return bits; 40 | } 41 | 42 | public final ResultPoint[] getPoints() { 43 | return points; 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/common/detector/MathUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.common.detector; 18 | 19 | public final class MathUtils { 20 | 21 | private MathUtils() { 22 | } 23 | 24 | /** 25 | * Ends up being a bit faster than {@link Math#round(float)}. This merely rounds its 26 | * argument to the nearest int, where x.5 rounds up to x+1. Semantics of this shortcut 27 | * differ slightly from {@link Math#round(float)} in that half rounds down for negative 28 | * values. -2.5 rounds to -3, not -2. For purposes here it makes no difference. 29 | * 30 | * @param d real value to round 31 | * @return nearest {@code int} 32 | */ 33 | public static int round(float d) { 34 | return (int) (d + (d < 0.0f ? -0.5f : 0.5f)); 35 | } 36 | 37 | public static float distance(float aX, float aY, float bX, float bY) { 38 | float xDiff = aX - bX; 39 | float yDiff = aY - bY; 40 | return (float) Math.sqrt(xDiff * xDiff + yDiff * yDiff); 41 | } 42 | 43 | public static float distance(int aX, int aY, int bX, int bY) { 44 | int xDiff = aX - bX; 45 | int yDiff = aY - bY; 46 | return (float) Math.sqrt(xDiff * xDiff + yDiff * yDiff); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/common/reedsolomon/ReedSolomonException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.common.reedsolomon; 18 | 19 | /** 20 | *

Thrown when an exception occurs during Reed-Solomon decoding, such as when 21 | * there are too many errors to correct.

22 | * 23 | * @author Sean Owen 24 | */ 25 | public final class ReedSolomonException extends Exception { 26 | 27 | public ReedSolomonException(String message) { 28 | super(message); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/datamatrix/encoder/DataMatrixSymbolInfo144.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006 Jeremias Maerki 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.datamatrix.encoder; 18 | 19 | final class DataMatrixSymbolInfo144 extends SymbolInfo { 20 | 21 | DataMatrixSymbolInfo144() { 22 | super(false, 1558, 620, 22, 22, 36, -1, 62); 23 | } 24 | 25 | @Override 26 | public int getInterleavedBlockCount() { 27 | return 10; 28 | } 29 | 30 | @Override 31 | public int getDataLengthForInterleavedBlock(int index) { 32 | return (index <= 8) ? 156 : 155; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/datamatrix/encoder/Encoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2007 Jeremias Maerki. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.datamatrix.encoder; 18 | 19 | interface Encoder { 20 | 21 | int getEncodingMode(); 22 | 23 | void encode(EncoderContext context); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/datamatrix/encoder/SymbolShapeHint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Jeremias Maerki. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.datamatrix.encoder; 18 | 19 | /** 20 | * Enumeration for DataMatrix symbol shape hint. It can be used to force square or rectangular 21 | * symbols. 22 | */ 23 | public enum SymbolShapeHint { 24 | 25 | FORCE_NONE, 26 | FORCE_SQUARE, 27 | FORCE_RECTANGLE, 28 | 29 | } 30 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/multi/MultipleBarcodeReader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.multi; 18 | 19 | import java.util.Map; 20 | 21 | import com.google.zxing.BinaryBitmap; 22 | import com.google.zxing.DecodeHintType; 23 | import com.google.zxing.NotFoundException; 24 | import com.google.zxing.Result; 25 | 26 | /** 27 | * Implementation of this interface attempt to read several barcodes from one image. 28 | * 29 | * @see com.google.zxing.Reader 30 | * @author Sean Owen 31 | */ 32 | public interface MultipleBarcodeReader { 33 | 34 | Result[] decodeMultiple(BinaryBitmap image) throws NotFoundException; 35 | 36 | Result[] decodeMultiple(BinaryBitmap image, 37 | Map hints) throws NotFoundException; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/oned/UPCEANExtensionSupport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.oned; 18 | 19 | import com.google.zxing.NotFoundException; 20 | import com.google.zxing.ReaderException; 21 | import com.google.zxing.Result; 22 | import com.google.zxing.common.BitArray; 23 | 24 | final class UPCEANExtensionSupport { 25 | 26 | private static final int[] EXTENSION_START_PATTERN = {1,1,2}; 27 | 28 | private final UPCEANExtension2Support twoSupport = new UPCEANExtension2Support(); 29 | private final UPCEANExtension5Support fiveSupport = new UPCEANExtension5Support(); 30 | 31 | Result decodeRow(int rowNumber, BitArray row, int rowOffset) throws NotFoundException { 32 | int[] extensionStartRange = UPCEANReader.findGuardPattern(row, rowOffset, false, EXTENSION_START_PATTERN); 33 | try { 34 | return fiveSupport.decodeRow(rowNumber, row, extensionStartRange); 35 | } catch (ReaderException ignored) { 36 | return twoSupport.decodeRow(rowNumber, row, extensionStartRange); 37 | } 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/oned/UPCEANWriter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.oned; 18 | 19 | /** 20 | *

Encapsulates functionality and implementation that is common to UPC and EAN families 21 | * of one-dimensional barcodes.

22 | * 23 | * @author aripollak@gmail.com (Ari Pollak) 24 | * @author dsbnatut@gmail.com (Kazuki Nishiura) 25 | */ 26 | public abstract class UPCEANWriter extends OneDimensionalCodeWriter { 27 | 28 | @Override 29 | public int getDefaultMargin() { 30 | // Use a different default more appropriate for UPC/EAN 31 | return UPCEANReader.START_END_PATTERN.length; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/oned/rss/DataCharacter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.oned.rss; 18 | 19 | public class DataCharacter { 20 | 21 | private final int value; 22 | private final int checksumPortion; 23 | 24 | public DataCharacter(int value, int checksumPortion) { 25 | this.value = value; 26 | this.checksumPortion = checksumPortion; 27 | } 28 | 29 | public final int getValue() { 30 | return value; 31 | } 32 | 33 | public final int getChecksumPortion() { 34 | return checksumPortion; 35 | } 36 | 37 | @Override 38 | public final String toString() { 39 | return value + "(" + checksumPortion + ')'; 40 | } 41 | 42 | @Override 43 | public final boolean equals(Object o) { 44 | if(!(o instanceof DataCharacter)) { 45 | return false; 46 | } 47 | DataCharacter that = (DataCharacter) o; 48 | return value == that.value && checksumPortion == that.checksumPortion; 49 | } 50 | 51 | @Override 52 | public final int hashCode() { 53 | return value ^ checksumPortion; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/oned/rss/Pair.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.oned.rss; 18 | 19 | final class Pair extends DataCharacter { 20 | 21 | private final FinderPattern finderPattern; 22 | private int count; 23 | 24 | Pair(int value, int checksumPortion, FinderPattern finderPattern) { 25 | super(value, checksumPortion); 26 | this.finderPattern = finderPattern; 27 | } 28 | 29 | FinderPattern getFinderPattern() { 30 | return finderPattern; 31 | } 32 | 33 | int getCount() { 34 | return count; 35 | } 36 | 37 | void incrementCount() { 38 | count++; 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/oned/rss/expanded/decoders/AI013103decoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* 18 | * These authors would like to acknowledge the Spanish Ministry of Industry, 19 | * Tourism and Trade, for the support in the project TSI020301-2008-2 20 | * "PIRAmIDE: Personalizable Interactions with Resources on AmI-enabled 21 | * Mobile Dynamic Environments", led by Treelogic 22 | * ( http://www.treelogic.com/ ): 23 | * 24 | * http://www.piramidepse.com/ 25 | */ 26 | 27 | package com.google.zxing.oned.rss.expanded.decoders; 28 | 29 | import com.google.zxing.common.BitArray; 30 | 31 | /** 32 | * @author Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) 33 | */ 34 | final class AI013103decoder extends AI013x0xDecoder { 35 | 36 | AI013103decoder(BitArray information) { 37 | super(information); 38 | } 39 | 40 | @Override 41 | protected void addWeightCode(StringBuilder buf, int weight) { 42 | buf.append("(3103)"); 43 | } 44 | 45 | @Override 46 | protected int checkWeight(int weight) { 47 | return weight; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/oned/rss/expanded/decoders/DecodedChar.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* 18 | * These authors would like to acknowledge the Spanish Ministry of Industry, 19 | * Tourism and Trade, for the support in the project TSI020301-2008-2 20 | * "PIRAmIDE: Personalizable Interactions with Resources on AmI-enabled 21 | * Mobile Dynamic Environments", led by Treelogic 22 | * ( http://www.treelogic.com/ ): 23 | * 24 | * http://www.piramidepse.com/ 25 | */ 26 | 27 | package com.google.zxing.oned.rss.expanded.decoders; 28 | 29 | /** 30 | * @author Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) 31 | * @author Eduardo Castillejo, University of Deusto (eduardo.castillejo@deusto.es) 32 | */ 33 | final class DecodedChar extends DecodedObject { 34 | 35 | private final char value; 36 | 37 | static final char FNC1 = '$'; // It's not in Alphanumeric neither in ISO/IEC 646 charset 38 | 39 | DecodedChar(int newPosition, char value) { 40 | super(newPosition); 41 | this.value = value; 42 | } 43 | 44 | char getValue(){ 45 | return this.value; 46 | } 47 | 48 | boolean isFNC1(){ 49 | return this.value == FNC1; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/oned/rss/expanded/decoders/DecodedObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* 18 | * These authors would like to acknowledge the Spanish Ministry of Industry, 19 | * Tourism and Trade, for the support in the project TSI020301-2008-2 20 | * "PIRAmIDE: Personalizable Interactions with Resources on AmI-enabled 21 | * Mobile Dynamic Environments", led by Treelogic 22 | * ( http://www.treelogic.com/ ): 23 | * 24 | * http://www.piramidepse.com/ 25 | */ 26 | 27 | package com.google.zxing.oned.rss.expanded.decoders; 28 | 29 | /** 30 | * @author Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) 31 | */ 32 | abstract class DecodedObject { 33 | 34 | private final int newPosition; 35 | 36 | DecodedObject(int newPosition){ 37 | this.newPosition = newPosition; 38 | } 39 | 40 | final int getNewPosition() { 41 | return this.newPosition; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/pdf417/PDF417ResultMetadata.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.pdf417; 18 | 19 | /** 20 | * @author Guenther Grau 21 | */ 22 | public final class PDF417ResultMetadata { 23 | 24 | private int segmentIndex; 25 | private String fileId; 26 | private int[] optionalData; 27 | private boolean lastSegment; 28 | 29 | public int getSegmentIndex() { 30 | return segmentIndex; 31 | } 32 | 33 | public void setSegmentIndex(int segmentIndex) { 34 | this.segmentIndex = segmentIndex; 35 | } 36 | 37 | public String getFileId() { 38 | return fileId; 39 | } 40 | 41 | public void setFileId(String fileId) { 42 | this.fileId = fileId; 43 | } 44 | 45 | public int[] getOptionalData() { 46 | return optionalData; 47 | } 48 | 49 | public void setOptionalData(int[] optionalData) { 50 | this.optionalData = optionalData; 51 | } 52 | 53 | public boolean isLastSegment() { 54 | return lastSegment; 55 | } 56 | 57 | public void setLastSegment(boolean lastSegment) { 58 | this.lastSegment = lastSegment; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/pdf417/detector/PDF417DetectorResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.pdf417.detector; 18 | 19 | import java.util.List; 20 | 21 | import com.google.zxing.ResultPoint; 22 | import com.google.zxing.common.BitMatrix; 23 | 24 | /** 25 | * @author Guenther Grau 26 | */ 27 | public final class PDF417DetectorResult { 28 | 29 | private final BitMatrix bits; 30 | private final List points; 31 | 32 | public PDF417DetectorResult(BitMatrix bits, List points) { 33 | this.bits = bits; 34 | this.points = points; 35 | } 36 | 37 | public BitMatrix getBits() { 38 | return bits; 39 | } 40 | 41 | public List getPoints() { 42 | return points; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/pdf417/encoder/Compaction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.pdf417.encoder; 18 | 19 | public enum Compaction { 20 | 21 | AUTO, 22 | TEXT, 23 | BYTE, 24 | NUMERIC 25 | 26 | } 27 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/pdf417/encoder/Dimensions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.pdf417.encoder; 18 | 19 | /** 20 | * Data object to specify the minimum and maximum number of rows and columns for a PDF417 barcode. 21 | * 22 | * @author qwandor@google.com (Andrew Walbran) 23 | */ 24 | public final class Dimensions { 25 | 26 | private final int minCols; 27 | private final int maxCols; 28 | private final int minRows; 29 | private final int maxRows; 30 | 31 | public Dimensions(int minCols, int maxCols, int minRows, int maxRows) { 32 | this.minCols = minCols; 33 | this.maxCols = maxCols; 34 | this.minRows = minRows; 35 | this.maxRows = maxRows; 36 | } 37 | 38 | public int getMinCols() { 39 | return minCols; 40 | } 41 | 42 | public int getMaxCols() { 43 | return maxCols; 44 | } 45 | 46 | public int getMinRows() { 47 | return minRows; 48 | } 49 | 50 | public int getMaxRows() { 51 | return maxRows; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/qrcode/detector/FinderPatternInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.qrcode.detector; 18 | 19 | /** 20 | *

Encapsulates information about finder patterns in an image, including the location of 21 | * the three finder patterns, and their estimated module size.

22 | * 23 | * @author Sean Owen 24 | */ 25 | public final class FinderPatternInfo { 26 | 27 | private final FinderPattern bottomLeft; 28 | private final FinderPattern topLeft; 29 | private final FinderPattern topRight; 30 | 31 | public FinderPatternInfo(FinderPattern[] patternCenters) { 32 | this.bottomLeft = patternCenters[0]; 33 | this.topLeft = patternCenters[1]; 34 | this.topRight = patternCenters[2]; 35 | } 36 | 37 | public FinderPattern getBottomLeft() { 38 | return bottomLeft; 39 | } 40 | 41 | public FinderPattern getTopLeft() { 42 | return topLeft; 43 | } 44 | 45 | public FinderPattern getTopRight() { 46 | return topRight; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /playground/app/src/main/java_zxing/com/google/zxing/qrcode/encoder/BlockPair.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.zxing.qrcode.encoder; 18 | 19 | final class BlockPair { 20 | 21 | private final byte[] dataBytes; 22 | private final byte[] errorCorrectionBytes; 23 | 24 | BlockPair(byte[] data, byte[] errorCorrection) { 25 | dataBytes = data; 26 | errorCorrectionBytes = errorCorrection; 27 | } 28 | 29 | public byte[] getDataBytes() { 30 | return dataBytes; 31 | } 32 | 33 | public byte[] getErrorCorrectionBytes() { 34 | return errorCorrectionBytes; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /playground/app/src/main/res/drawable-hdpi/ic_action_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/playground/app/src/main/res/drawable-hdpi/ic_action_refresh.png -------------------------------------------------------------------------------- /playground/app/src/main/res/drawable-hdpi/ic_action_scan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/playground/app/src/main/res/drawable-hdpi/ic_action_scan.png -------------------------------------------------------------------------------- /playground/app/src/main/res/drawable-mdpi/ic_action_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/playground/app/src/main/res/drawable-mdpi/ic_action_refresh.png -------------------------------------------------------------------------------- /playground/app/src/main/res/drawable-mdpi/ic_action_scan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/playground/app/src/main/res/drawable-mdpi/ic_action_scan.png -------------------------------------------------------------------------------- /playground/app/src/main/res/drawable-v21/ic_menu_camera.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /playground/app/src/main/res/drawable-v21/ic_menu_gallery.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /playground/app/src/main/res/drawable-v21/ic_menu_manage.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /playground/app/src/main/res/drawable-v21/ic_menu_send.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /playground/app/src/main/res/drawable-v21/ic_menu_share.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /playground/app/src/main/res/drawable-v21/ic_menu_slideshow.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /playground/app/src/main/res/drawable-xhdpi/ic_action_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/playground/app/src/main/res/drawable-xhdpi/ic_action_refresh.png -------------------------------------------------------------------------------- /playground/app/src/main/res/drawable-xhdpi/ic_action_scan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/playground/app/src/main/res/drawable-xhdpi/ic_action_scan.png -------------------------------------------------------------------------------- /playground/app/src/main/res/drawable-xxhdpi/ic_action_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/playground/app/src/main/res/drawable-xxhdpi/ic_action_refresh.png -------------------------------------------------------------------------------- /playground/app/src/main/res/drawable-xxhdpi/ic_action_scan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/playground/app/src/main/res/drawable-xxhdpi/ic_action_scan.png -------------------------------------------------------------------------------- /playground/app/src/main/res/drawable/side_nav_bar.xml: -------------------------------------------------------------------------------- 1 | 3 | 9 | -------------------------------------------------------------------------------- /playground/app/src/main/res/layout/activity_index.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /playground/app/src/main/res/layout/activity_splash.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 18 | 19 | -------------------------------------------------------------------------------- /playground/app/src/main/res/layout/app_bar_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /playground/app/src/main/res/layout/app_picker_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 22 | 23 | 29 | 30 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /playground/app/src/main/res/layout/bookmark_picker_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 24 | 30 | 31 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /playground/app/src/main/res/layout/camera.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 11 | 12 | 17 | 18 | -------------------------------------------------------------------------------- /playground/app/src/main/res/layout/catalog_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /playground/app/src/main/res/layout/content_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /playground/app/src/main/res/layout/content_wx_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 13 | 14 | 17 | 24 | -------------------------------------------------------------------------------- /playground/app/src/main/res/layout/help.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /playground/app/src/main/res/layout/history_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 24 | 30 | 31 | 37 | 38 | -------------------------------------------------------------------------------- /playground/app/src/main/res/layout/search_book_contents_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 25 | -------------------------------------------------------------------------------- /playground/app/src/main/res/layout/search_book_contents_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 24 | 32 | 33 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /playground/app/src/main/res/menu/capture.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 23 | 28 | 38 | -------------------------------------------------------------------------------- /playground/app/src/main/res/menu/encode.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 23 | 28 | -------------------------------------------------------------------------------- /playground/app/src/main/res/menu/history.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 23 | 28 | -------------------------------------------------------------------------------- /playground/app/src/main/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /playground/app/src/main/res/menu/main_scan.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /playground/app/src/main/res/menu/refresh.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /playground/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/playground/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /playground/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/playground/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /playground/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/playground/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /playground/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/playground/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /playground/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/playground/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /playground/app/src/main/res/raw/beep.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/playground/app/src/main/res/raw/beep.ogg -------------------------------------------------------------------------------- /playground/app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | > 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /playground/app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /playground/app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /playground/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | #66000000 8 | 9 | -------------------------------------------------------------------------------- /playground/app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 160dp 5 | 6 | 16dp 7 | 16dp 8 | 16dp 9 | 16dp 10 | 11 | -------------------------------------------------------------------------------- /playground/app/src/main/res/values/drawables.xml: -------------------------------------------------------------------------------- 1 | 2 | @android:drawable/ic_menu_camera 3 | @android:drawable/ic_menu_gallery 4 | @android:drawable/ic_menu_slideshow 5 | @android:drawable/ic_menu_manage 6 | @android:drawable/ic_menu_share 7 | @android:drawable/ic_menu_send 8 | 9 | -------------------------------------------------------------------------------- /playground/app/src/main/res/values/scan_code_colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | #ff000000 19 | #ffffffff 20 | #c0ffbd21 21 | #ffc0c0c0 22 | #c099cc00 23 | #ffffffff 24 | #b0000000 25 | #ffffffff 26 | #00000000 27 | #ffcc0000 28 | #60000000 29 | 30 | -------------------------------------------------------------------------------- /playground/app/src/main/res/values/scan_code_dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 8dip 19 | 4dip 20 | -------------------------------------------------------------------------------- /playground/app/src/main/res/values/scan_code_ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /playground/app/src/main/res/values/scan_code_styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 25 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /playground/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | WEEX 3 | 4 | Open navigation drawer 5 | Close navigation drawer 6 | 7 | Settings 8 | Hello blank fragment 9 | Main2Activity 10 | WXMainActivity 11 | 12 | SplashActivity 13 | Dummy Button 14 | WEEX\nPLAYGROUND 15 | 16 | Sorry, your current device is x86 architecture.\n We only support arm architecture devices! 17 | 18 | Network Error!\n1.Make sure you use the command "npm run serve" launched local service\n2.Make sure you modify "your_current_ip" to your local IP in "WXMainActivity" 19 | 20 | -------------------------------------------------------------------------------- /playground/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 | 27 | 28 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /playground/app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 24 | 25 | -------------------------------------------------------------------------------- /playground/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | mavenCentral() 6 | jcenter() 7 | maven { 8 | url 'https://maven.google.com/' 9 | name 'Google' 10 | } 11 | } 12 | dependencies { 13 | classpath 'com.android.tools.build:gradle:2.3.0' 14 | } 15 | } 16 | 17 | allprojects { 18 | repositories { 19 | maven { 20 | url "http://mvnrepo.alibaba-inc.com/mvn/repository" 21 | } 22 | mavenCentral() 23 | jcenter() 24 | maven { 25 | url 'https://maven.google.com/' 26 | name 'Google' 27 | } 28 | } 29 | } 30 | 31 | task clean(type: Delete) { 32 | delete rootProject.buildDir 33 | } 34 | -------------------------------------------------------------------------------- /playground/gradle.properties: -------------------------------------------------------------------------------- 1 | ## Project-wide Gradle settings. 2 | # 3 | # For more details on how to configure your build environment visit 4 | # http://www.gradle.org/docs/current/userguide/build_environment.html 5 | # 6 | # Specifies the JVM arguments used for the daemon process. 7 | # The setting is particularly useful for tweaking memory settings. 8 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 9 | # 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | #Mon Jun 27 20:06:22 CST 2016 14 | org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 15 | org.gradle.parallel=true 16 | android.useDeprecatedNdk=true 17 | -------------------------------------------------------------------------------- /playground/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/playground/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /playground/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Mar 21 11:18:57 CST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip 7 | -------------------------------------------------------------------------------- /playground/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | 4 | include ":commons" 5 | project(":commons").projectDir=new File("../commons") 6 | 7 | 8 | include ":weex_analyzer" 9 | project(":weex_analyzer").projectDir=new File("../weex_analyzer") 10 | -------------------------------------------------------------------------------- /weex_analyzer/.gitignore: -------------------------------------------------------------------------------- 1 | #Android generated 2 | bin 3 | gen 4 | gen-external-apklibs 5 | build 6 | **/bin 7 | **/gen 8 | **/gen-external-apklibs 9 | **/build 10 | 11 | #Eclipse 12 | .project 13 | .classpath 14 | .settings 15 | **/.project 16 | **/.classpath 17 | **/.settings 18 | 19 | #IntelliJ IDEA 20 | .idea 21 | *.iml 22 | *.ipr 23 | *.iws 24 | out 25 | **/*.iml 26 | 27 | 28 | #Maven 29 | target 30 | release.properties 31 | pom.xml.* 32 | 33 | #Ant 34 | build.xml 35 | local.properties 36 | proguard.cfg 37 | 38 | #OSX 39 | .DS_Store 40 | 41 | #gradle 42 | /.gradle 43 | **/.gradle 44 | 45 | #Android 46 | **/project.properties 47 | -------------------------------------------------------------------------------- /weex_analyzer/binary.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.jfrog.bintray' 2 | apply from: 'constants.gradle' 3 | 4 | // 5 | version = mavenVersion 6 | group = mavenGroup 7 | // 8 | 9 | 10 | 11 | task sourcesJar(type: Jar) { 12 | from android.sourceSets.main.java.srcDirs 13 | classifier = 'sources' 14 | } 15 | 16 | artifacts { 17 | archives sourcesJar 18 | } 19 | 20 | 21 | Properties properties = new Properties() 22 | properties.load(project.rootProject.file('local.properties').newDataInputStream()) 23 | bintray { 24 | user = properties.getProperty("bintray.user") 25 | key = properties.getProperty("bintray.apikey") 26 | configurations = ['archives'] 27 | pkg { 28 | repo = projectName 29 | name = mavenArtifactId 30 | userOrg = orgName 31 | websiteUrl = siteUrl 32 | vcsUrl = gitUrl 33 | licenses = ["Apache-2.0"] 34 | publish = true 35 | } 36 | } -------------------------------------------------------------------------------- /weex_analyzer/constants.gradle: -------------------------------------------------------------------------------- 1 | /** 2 | * use [./gradlew clean install bintrayUpload] to publish(bintray) 3 | * */ 4 | 5 | ext { 6 | projectName = 'maven' 7 | projectDesc = 'weex analyzer' 8 | 9 | siteUrl = 'https://github.com/weexteam/weex-analyzer-android' 10 | gitUrl = 'git@github.com:weexteam/weex-analyzer-android.git' 11 | 12 | mavenGroup = 'com.taobao.android' 13 | mavenArtifactId = 'weex_analyzer' 14 | mavenVersion = '0.1.0.9' 15 | 16 | orgName = 'rowandjj' 17 | } -------------------------------------------------------------------------------- /weex_analyzer/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/weex_analyzer/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /weex_analyzer/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Apr 12 10:06:38 CST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | #distributionUrl=http://gw.alicdn.com/bao/uploaded/LB1J5WLJVXXXXcMXpXXXXXXXXXX.zip 7 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 8 | #distributionUrl=gradle-2.10-bin.zip -------------------------------------------------------------------------------- /weex_analyzer/maven.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.github.dcendents.android-maven' 2 | apply from: 'constants.gradle' 3 | 4 | install { 5 | repositories.mavenInstaller { 6 | // This generates POM.xml with proper parameters 7 | pom { 8 | project { 9 | // Add your description here 10 | name projectName 11 | description projectDesc 12 | url siteUrl 13 | 14 | packaging 'aar' 15 | 16 | groupId mavenGroup 17 | artifactId mavenArtifactId 18 | version mavenVersion 19 | 20 | 21 | // Set your license 22 | licenses { 23 | license { 24 | name 'The Apache Software License, Version 2.0' 25 | url 'http://www.apache.org/licenses/LICENSE-2.0.txt' 26 | } 27 | } 28 | developers { 29 | developer { 30 | id 'Rowandjj' 31 | name '栗子' 32 | email 'rjchuyi@gmail.com' 33 | } 34 | } 35 | scm { 36 | connection gitUrl 37 | developerConnection gitUrl 38 | url siteUrl 39 | } 40 | } 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /weex_analyzer/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/rowandjj/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /weex_analyzer/run-circle-ci.sh: -------------------------------------------------------------------------------- 1 | # !/bin/sh -eu 2 | 3 | ./gradlew clean build test testDebugUnitTestCoverage -Dorg.gradle.daemon=true -Dorg.gradle.parallel=true -Dorg.gradle.jvmargs="-Xmx512m -XX:+HeapDumpOnOutOfMemoryError" -Dfile.encoding=UTF-8 4 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/IPermissionHandler.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer; 2 | 3 | import android.support.annotation.NonNull; 4 | 5 | /** 6 | * Description: 7 | * 8 | * Created by rowandjj(chuyi)
9 | */ 10 | 11 | public interface IPermissionHandler { 12 | boolean isPermissionGranted(@NonNull Config config); 13 | } 14 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/IWXDevOptions.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer; 2 | 3 | import android.support.annotation.Nullable; 4 | import android.view.KeyEvent; 5 | import android.view.MotionEvent; 6 | import android.view.View; 7 | 8 | import com.taobao.weex.WXSDKInstance; 9 | 10 | /** 11 | * Description:

Created by rowandjj(chuyi)
Date: 2016/10/27
Time: 下午4:56
12 | */ 13 | 14 | public interface IWXDevOptions { 15 | void onCreate(); 16 | 17 | void onStart(); 18 | 19 | void onResume(); 20 | 21 | void onPause(); 22 | 23 | void onStop(); 24 | 25 | void onDestroy(); 26 | 27 | void onWeexRenderSuccess(@Nullable WXSDKInstance instance); 28 | 29 | View onWeexViewCreated(WXSDKInstance instance, View view); 30 | 31 | boolean onKeyUp(int keyCode, KeyEvent event); 32 | 33 | void onException(WXSDKInstance instance, String errCode, String msg); 34 | 35 | public void onReceiveTouchEvent(MotionEvent ev); 36 | } 37 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/core/Constants.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core; 2 | 3 | /** 4 | * Description: 5 | * 6 | * Created by rowandjj(chuyi)
7 | */ 8 | 9 | public class Constants { 10 | public static final String TAG = "weex-analyzer"; 11 | } 12 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/core/HandlerThreadWrapper.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core; 2 | 3 | import android.os.Handler; 4 | import android.os.HandlerThread; 5 | import android.support.annotation.NonNull; 6 | import android.support.annotation.Nullable; 7 | 8 | /** 9 | * Description: 10 | *

11 | * Created by rowandjj(chuyi)
12 | * Date: 2016/11/7
13 | * Time: 下午8:07
14 | */ 15 | 16 | public class HandlerThreadWrapper { 17 | private Handler mHandler; 18 | 19 | private HandlerThread mHandlerThread; 20 | 21 | public HandlerThreadWrapper(@NonNull String threadName) { 22 | this(threadName,null); 23 | } 24 | 25 | public HandlerThreadWrapper(@NonNull String threadName, @Nullable Handler.Callback callback) { 26 | mHandlerThread = new HandlerThread(threadName); 27 | mHandlerThread.start(); 28 | mHandler = new Handler(mHandlerThread.getLooper(),callback); 29 | } 30 | 31 | public @NonNull Handler getHandler() { 32 | return this.mHandler; 33 | } 34 | 35 | public boolean isAlive(){ 36 | if(mHandlerThread == null){ 37 | return false; 38 | } 39 | return mHandlerThread.isAlive(); 40 | } 41 | 42 | public void quit() { 43 | if(mHandlerThread != null){ 44 | if(mHandler != null){ 45 | mHandler.removeCallbacksAndMessages(null); 46 | } 47 | mHandlerThread.quit(); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/core/TaskEntity.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core; 2 | 3 | import android.support.annotation.NonNull; 4 | 5 | /** 6 | * Description: 7 | * 8 | * Created by rowandjj(chuyi)
9 | */ 10 | 11 | public interface TaskEntity { 12 | 13 | void onTaskInit(); 14 | 15 | @NonNull 16 | T onTaskRun(); 17 | 18 | void onTaskStop(); 19 | } 20 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/core/cpu/CpuSampler.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core.cpu; 2 | 3 | import android.support.annotation.NonNull; 4 | import android.support.annotation.VisibleForTesting; 5 | 6 | import java.io.BufferedReader; 7 | import java.io.FileInputStream; 8 | import java.io.IOException; 9 | import java.io.InputStreamReader; 10 | 11 | /** 12 | * Description:

Created by rowandjj(chuyi)
Date: 2016/11/7
Time: 下午4:14
13 | */ 14 | 15 | class CpuSampler { 16 | 17 | private CpuSampler(){} 18 | static String sampleCpuRate() { 19 | return doSample("/proc/stat"); 20 | } 21 | 22 | static String samplePidCpuRate() { 23 | int pid = android.os.Process.myPid(); 24 | return doSample("/proc/" + pid + "/stat"); 25 | } 26 | 27 | @VisibleForTesting 28 | static String doSample(@NonNull String filename) { 29 | BufferedReader cpuReader = null; 30 | String cpuRate = ""; 31 | try { 32 | cpuReader = new BufferedReader(new InputStreamReader(new FileInputStream(filename)), 1024); 33 | cpuRate = cpuReader.readLine(); 34 | } catch (Exception e) { 35 | e.printStackTrace(); 36 | } finally { 37 | try { 38 | if (cpuReader != null) { 39 | cpuReader.close(); 40 | } 41 | } catch (IOException e) { 42 | e.printStackTrace(); 43 | } 44 | } 45 | return cpuRate; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/core/debug/DebugTool.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core.debug; 2 | 3 | import android.support.annotation.NonNull; 4 | 5 | import com.taobao.weex.WXEnvironment; 6 | import com.taobao.weex.WXSDKEngine; 7 | import com.taobao.weex.bridge.WXBridgeManager; 8 | import com.taobao.weex.utils.WXLogUtils; 9 | 10 | import java.lang.reflect.Method; 11 | 12 | /** 13 | * Description: 14 | * 15 | * Created by rowandjj(chuyi)
16 | */ 17 | 18 | public class DebugTool { 19 | 20 | private static final String TAG = "DebugTool"; 21 | 22 | private DebugTool() { 23 | } 24 | 25 | public static void startRemoteDebug(@NonNull String serverAddress) { 26 | try { 27 | WXEnvironment.sRemoteDebugProxyUrl = serverAddress; 28 | WXEnvironment.sRemoteDebugMode = true; 29 | WXSDKEngine.reload(); 30 | }catch (Exception e) { 31 | WXLogUtils.e(TAG,e.getMessage()); 32 | } 33 | } 34 | 35 | public static boolean stopRemoteDebug() { 36 | try { 37 | WXBridgeManager manager = WXBridgeManager.getInstance(); 38 | Method method = manager.getClass().getDeclaredMethod("stopRemoteDebug"); 39 | method.setAccessible(true); 40 | method.invoke(manager); 41 | return true; 42 | }catch (Exception e) { 43 | WXLogUtils.e(TAG,e.getMessage()); 44 | return false; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/core/fps/FpsTaskEntity.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core.fps; 2 | 3 | import android.annotation.TargetApi; 4 | import android.os.Build; 5 | import android.support.annotation.NonNull; 6 | import android.view.Choreographer; 7 | 8 | import com.taobao.weex.analyzer.core.TaskEntity; 9 | 10 | /** 11 | * Description: 12 | * 13 | * Created by rowandjj(chuyi)
14 | */ 15 | 16 | public class FpsTaskEntity implements TaskEntity { 17 | 18 | private FPSSampler mFpsChecker; 19 | 20 | @Override 21 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN) 22 | public void onTaskInit() { 23 | this.mFpsChecker = new FPSSampler(Choreographer.getInstance()); 24 | mFpsChecker.reset(); 25 | mFpsChecker.start(); 26 | } 27 | 28 | @NonNull 29 | @Override 30 | public Double onTaskRun() { 31 | if(mFpsChecker == null) { 32 | onTaskInit(); 33 | } 34 | Double fps = mFpsChecker.getFPS(); 35 | mFpsChecker.reset(); 36 | return fps; 37 | } 38 | 39 | @Override 40 | public void onTaskStop() { 41 | mFpsChecker.stop(); 42 | mFpsChecker = null; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/core/lint/IVDomMonitor.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core.lint; 2 | 3 | import android.support.annotation.NonNull; 4 | 5 | import com.taobao.weex.WXSDKInstance; 6 | 7 | /** 8 | * Description: 9 | * 10 | * Created by rowandjj(chuyi)
11 | */ 12 | 13 | public interface IVDomMonitor { 14 | void monitor(@NonNull final WXSDKInstance instance); 15 | 16 | void destroy(); 17 | } 18 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/core/lint/VDomController.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core.lint; 2 | 3 | import android.support.annotation.NonNull; 4 | 5 | import com.taobao.weex.WXSDKInstance; 6 | 7 | /** 8 | * Description: 9 | * 10 | * Created by rowandjj(chuyi)
11 | */ 12 | 13 | public class VDomController implements IVDomMonitor { 14 | public static boolean isPollingMode = false; 15 | public static boolean isStandardMode = false; 16 | 17 | private PollingVDomMonitor mPollingVDomMonitor; 18 | private StandardVDomMonitor mStandardVDomMonitor; 19 | 20 | public VDomController(@NonNull PollingVDomMonitor pollingVDomMonitor,@NonNull StandardVDomMonitor standardVDomMonitor) { 21 | mPollingVDomMonitor = pollingVDomMonitor; 22 | mStandardVDomMonitor = standardVDomMonitor; 23 | } 24 | 25 | @Override 26 | public void monitor(@NonNull WXSDKInstance instance) { 27 | if (isPollingMode) { 28 | mPollingVDomMonitor.monitor(instance); 29 | } else if(isStandardMode) { 30 | mStandardVDomMonitor.monitor(instance); 31 | } 32 | } 33 | 34 | @Override 35 | public void destroy() { 36 | mPollingVDomMonitor.destroy(); 37 | mStandardVDomMonitor.destroy(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/core/logcat/LogConfig.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core.logcat; 2 | 3 | import com.taobao.weex.analyzer.view.overlay.IResizableView; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Description: 9 | * 10 | * Created by rowandjj(chuyi)
11 | */ 12 | 13 | public class LogConfig { 14 | private boolean showLogLevelPanel = true; 15 | private boolean showLogFilterPanel = true; 16 | private boolean showSearchPanel = true; 17 | 18 | private int viewSize = -1; 19 | 20 | private List mCustomRule; 21 | 22 | public boolean isShowLogLevelPanel() { 23 | return showLogLevelPanel; 24 | } 25 | 26 | public void setShowLogLevelPanel(boolean showLogLevelPanel) { 27 | this.showLogLevelPanel = showLogLevelPanel; 28 | } 29 | 30 | public boolean isShowLogFilterPanel() { 31 | return showLogFilterPanel; 32 | } 33 | 34 | public void setShowLogFilterPanel(boolean showLogFilterPanel) { 35 | this.showLogFilterPanel = showLogFilterPanel; 36 | } 37 | 38 | public boolean isShowSearchPanel() { 39 | return showSearchPanel; 40 | } 41 | 42 | public void setShowSearchPanel(boolean showSearchPanel) { 43 | this.showSearchPanel = showSearchPanel; 44 | } 45 | 46 | public List getCustomRule() { 47 | return mCustomRule; 48 | } 49 | 50 | public void setCustomRule(List customRule) { 51 | this.mCustomRule = customRule; 52 | } 53 | 54 | public int getViewSize() { 55 | return viewSize; 56 | } 57 | 58 | public void setViewSize(@IResizableView.Size int viewSize) { 59 | this.viewSize = viewSize; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/core/memory/MemorySampler.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core.memory; 2 | 3 | import android.support.annotation.WorkerThread; 4 | 5 | /** 6 | * Description: 7 | *

8 | * Created by rowandjj(chuyi)
9 | * Date: 16/10/8
10 | * Time: 下午4:22
11 | */ 12 | 13 | public class MemorySampler { 14 | private MemorySampler() { 15 | } 16 | 17 | /** 18 | * 获取当前内存占用,单位是MB 19 | */ 20 | public static double getMemoryUsage() { 21 | Runtime runtime = Runtime.getRuntime(); 22 | return (runtime.totalMemory() - runtime.freeMemory()) / (double) 1048576; 23 | } 24 | 25 | /** 26 | * 获取当前应用能获取的总内存,单位是MB 27 | */ 28 | public static double maxMemory() { 29 | return Runtime.getRuntime().maxMemory() / (double) 1048576; 30 | } 31 | 32 | /** 33 | * 获取当前应用总内存 34 | * */ 35 | public static double totalMemory() { 36 | return Runtime.getRuntime().totalMemory() / (double) 1048576; 37 | } 38 | 39 | @WorkerThread 40 | public static void tryForceGC() { 41 | // System.gc() does not garbage collect every time. Runtime.gc() is 42 | // more likely to perfom a gc. 43 | Runtime.getRuntime().gc(); 44 | enqueueReferences(); 45 | System.runFinalization(); 46 | } 47 | 48 | private static void enqueueReferences() { 49 | /* 50 | * Hack. We don't have a programmatic way to wait for the reference queue 51 | * daemon to move references to the appropriate queues. 52 | */ 53 | try { 54 | Thread.sleep(100); 55 | } catch (InterruptedException e) { 56 | throw new AssertionError(); 57 | } 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/core/memory/MemoryTaskEntity.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core.memory; 2 | 3 | import android.support.annotation.NonNull; 4 | 5 | import com.taobao.weex.analyzer.core.TaskEntity; 6 | 7 | /** 8 | * Description: 9 | * 10 | * Created by rowandjj(chuyi)
11 | */ 12 | 13 | public class MemoryTaskEntity implements TaskEntity { 14 | 15 | @Override 16 | public void onTaskInit() { 17 | } 18 | 19 | @NonNull 20 | @Override 21 | public Double onTaskRun() { 22 | return MemorySampler.getMemoryUsage(); 23 | } 24 | 25 | @Override 26 | public void onTaskStop() { 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/core/reporter/DataReporterFactory.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core.reporter; 2 | 3 | import android.support.annotation.NonNull; 4 | import android.util.Log; 5 | 6 | import com.taobao.weex.analyzer.core.Constants; 7 | import com.taobao.weex.analyzer.core.reporter.ws.IWebSocketBridge; 8 | import com.taobao.weex.analyzer.core.reporter.ws.WebSocketClient; 9 | 10 | /** 11 | * Description: 12 | * 13 | * Created by rowandjj(chuyi)
14 | */ 15 | 16 | class DataReporterFactory { 17 | private DataReporterFactory(){} 18 | 19 | private static final String MDS = "mds"; 20 | 21 | 22 | static IDataReporter createLogReporter(boolean enabled) { 23 | return new LogReporter(enabled); 24 | } 25 | 26 | static IDataReporter createWSReporter(@NonNull String from, @NonNull String deviceId,@NonNull String server,WebSocketClient.Callback callback, IWebSocketBridge bridge) { 27 | WebSocketReporter reporter= new WebSocketReporter(MDS.equals(from), bridge); 28 | reporter.connect(server,callback); 29 | Log.d(Constants.TAG, "try connect server:"+server); 30 | return reporter; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/core/reporter/LogReporter.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core.reporter; 2 | 3 | import android.support.annotation.NonNull; 4 | import android.util.Log; 5 | 6 | import com.taobao.weex.analyzer.core.Constants; 7 | 8 | /** 9 | * Description: 10 | * 11 | * Created by rowandjj(chuyi)
12 | */ 13 | 14 | class LogReporter implements IDataReporter { 15 | 16 | private boolean isEnabled; 17 | 18 | LogReporter(boolean enabled) { 19 | this.isEnabled = enabled; 20 | } 21 | 22 | @Override 23 | public void report(@NonNull ProcessedData data) { 24 | if(data.getData() != null) { 25 | Log.d(Constants.TAG,data.getData()); 26 | } 27 | } 28 | 29 | @Override 30 | public boolean isEnabled() { 31 | return isEnabled; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/core/reporter/ws/IWebSocketBridge.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core.reporter.ws; 2 | 3 | /** 4 | * Description: 5 | * 6 | * Created by rowandjj(chuyi)
7 | */ 8 | 9 | public interface IWebSocketBridge { 10 | public void handleMessage(String message); 11 | } 12 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/core/reporter/ws/SimpleSession.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | package com.taobao.weex.analyzer.core.reporter.ws; 11 | 12 | /** 13 | * Alternative to JSR-356's Session class but with a less insane J2EE-style API. 14 | */ 15 | interface SimpleSession { 16 | void sendText(String payload); 17 | 18 | void sendBinary(byte[] payload); 19 | 20 | /** 21 | * Request that the session be closed. 22 | * 23 | * @param closeReason Close reason, as per RFC6455 24 | * @param reasonPhrase Possibly arbitrary close reason phrase. 25 | */ 26 | void close(int closeReason, String reasonPhrase); 27 | 28 | boolean isOpen(); 29 | } 30 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/core/reporter/ws/WebSocketClientFactory.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core.reporter.ws; 2 | 3 | 4 | import android.support.annotation.NonNull; 5 | 6 | import com.taobao.weex.analyzer.utils.ReflectionUtil; 7 | 8 | 9 | public class WebSocketClientFactory { 10 | public static WebSocketClient create(@NonNull IWebSocketBridge bridge) { 11 | if (ReflectionUtil.tryGetClassForName("okhttp3.ws.WebSocketListener") != null) { 12 | return new OkHttp3WebSocketClient(bridge); 13 | } else if (ReflectionUtil.tryGetClassForName("com.squareup.okhttp.ws.WebSocketListener") != null) { 14 | return new OkHttpWebSocketClient(bridge); 15 | } 16 | return null; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/core/traffic/TrafficSampler.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core.traffic; 2 | 3 | import android.net.TrafficStats; 4 | 5 | /** 6 | * Description: 7 | * 8 | * Created by rowandjj(chuyi) 9 | */ 10 | 11 | public class TrafficSampler { 12 | 13 | public static double getUidRxBytes(int uid) { 14 | return TrafficStats.getUidRxBytes(uid) == TrafficStats.UNSUPPORTED ? 0 : TrafficStats.getUidRxBytes(uid); 15 | } 16 | 17 | 18 | public static double getUidTxBytes(int uid) { 19 | return TrafficStats.getUidTxBytes(uid) == TrafficStats.UNSUPPORTED ? 0 : TrafficStats.getUidTxBytes(uid); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/view/DevOption.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.view; 2 | 3 | import android.support.annotation.DrawableRes; 4 | 5 | /** 6 | * Description: 7 | *

8 | * Created by rowandjj(chuyi)
9 | * Date: 2016/11/4
10 | * Time: 下午3:40
11 | */ 12 | 13 | public class DevOption { 14 | public String optionName; 15 | @DrawableRes public int iconRes; 16 | public OnOptionClickListener listener; 17 | public boolean isOverlayView; 18 | public boolean isPermissionGranted = true; 19 | 20 | public DevOption(){ 21 | } 22 | 23 | public DevOption(String optionName,int iconRes, OnOptionClickListener listener){ 24 | this(optionName,iconRes,listener,false); 25 | } 26 | 27 | public DevOption(String optionName, int iconRes, OnOptionClickListener listener, boolean isOverlayView) { 28 | this(optionName,iconRes,listener,isOverlayView,true); 29 | } 30 | 31 | public DevOption(String optionName, int iconRes, OnOptionClickListener listener, boolean isOverlayView, boolean isPermissionGranted) { 32 | this.optionName = optionName; 33 | this.iconRes = iconRes; 34 | this.listener = listener; 35 | this.isOverlayView = isOverlayView; 36 | this.isPermissionGranted = isPermissionGranted; 37 | } 38 | 39 | public interface OnOptionClickListener { 40 | void onOptionClick(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/view/alert/CompatibleAlertDialogBuilder.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.view.alert; 2 | 3 | import android.app.AlertDialog; 4 | import android.content.Context; 5 | import android.os.Build; 6 | import android.view.WindowManager; 7 | 8 | /** 9 | * Description: 10 | *

11 | * Created by rowandjj(chuyi)
12 | * Date: 2016/10/31
13 | * Time: 上午11:56
14 | */ 15 | 16 | public class CompatibleAlertDialogBuilder extends AlertDialog.Builder { 17 | public CompatibleAlertDialogBuilder(Context context) { 18 | super(context); 19 | } 20 | 21 | @Override 22 | public AlertDialog create() { 23 | AlertDialog dialog = super.create(); 24 | try { 25 | if (dialog.getWindow() != null) { 26 | if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) { 27 | int type = WindowManager.LayoutParams.TYPE_APPLICATION_PANEL; 28 | dialog.getWindow().setType(type); 29 | } 30 | } 31 | } catch (Exception e) { 32 | e.printStackTrace(); 33 | } 34 | return dialog; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/view/alert/IAlertView.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.view.alert; 2 | 3 | /** 4 | * Description: 5 | *

6 | * Created by rowandjj(chuyi)
7 | * Date: 16/10/19
8 | * Time: 上午11:36
9 | */ 10 | 11 | public interface IAlertView { 12 | void show(); 13 | 14 | void dismiss(); 15 | } 16 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/view/alert/PermissionAlertView.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.view.alert; 2 | 3 | import android.content.Context; 4 | 5 | import com.taobao.weex.analyzer.Config; 6 | import com.taobao.weex.analyzer.IPermissionHandler; 7 | 8 | /** 9 | * Description: 10 | * 11 | * Created by rowandjj(chuyi)
12 | */ 13 | 14 | public abstract class PermissionAlertView extends AbstractAlertView implements IPermissionHandler { 15 | private Config mConfig; 16 | public PermissionAlertView(Context context, Config config) { 17 | super(context); 18 | this.mConfig = config; 19 | } 20 | 21 | @Override 22 | public void show() { 23 | if(mConfig != null && !isPermissionGranted(mConfig)) { 24 | return; 25 | } 26 | super.show(); 27 | } 28 | } -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/view/chart/DataPoint.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.view.chart; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * default data point implementation. 7 | * This stores the x and y values. 8 | */ 9 | public class DataPoint implements DataPointInterface, Serializable { 10 | private static final long serialVersionUID=1428263322645L; 11 | 12 | private double x; 13 | private double y; 14 | 15 | public DataPoint(double x, double y) { 16 | this.x=x; 17 | this.y=y; 18 | } 19 | 20 | @Override 21 | public double getX() { 22 | return x; 23 | } 24 | 25 | @Override 26 | public double getY() { 27 | return y; 28 | } 29 | 30 | @Override 31 | public String toString() { 32 | return "["+x+"/"+y+"]"; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/view/chart/DataPointInterface.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.view.chart; 2 | 3 | public interface DataPointInterface { 4 | /** 5 | * @return the x value 6 | */ 7 | public double getX(); 8 | 9 | /** 10 | * @return the y value 11 | */ 12 | public double getY(); 13 | } 14 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/view/chart/LabelFormatter.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.view.chart; 2 | 3 | /** 4 | * Interface to use as label formatter. 5 | * Implement this in order to generate 6 | * your own labels format. 7 | */ 8 | public interface LabelFormatter { 9 | /** 10 | * converts a raw number as input to 11 | * a formatted string for the label. 12 | * 13 | * @param value raw input number 14 | * @param isValueX true if it is a value for the x axis 15 | * false if it is a value for the y axis 16 | * @return the formatted number as string 17 | */ 18 | public String formatLabel(double value, boolean isValueX); 19 | 20 | /** 21 | * will be called in order to have a 22 | * reference to the current viewport. 23 | * This is useful if you need the bounds 24 | * to generate your labels. 25 | * You store this viewport in as member variable 26 | * and access it e.g. in the {@link #formatLabel(double, boolean)} 27 | * method. 28 | * 29 | * @param viewport the used viewport 30 | */ 31 | public void setViewport(Viewport viewport); 32 | } 33 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/view/chart/OnDataPointTapListener.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.view.chart; 2 | 3 | /** 4 | * Listener for the tap event which will be 5 | * triggered when the user touches on a datapoint. 6 | */ 7 | public interface OnDataPointTapListener { 8 | /** 9 | * gets called when the user touches on a datapoint. 10 | * 11 | * @param series the corresponding series 12 | * @param dataPoint the data point that was tapped on 13 | */ 14 | void onTap(Series series, DataPointInterface dataPoint); 15 | } 16 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/view/chart/TimestampLabelFormatter.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.view.chart; 2 | 3 | /** 4 | * Description: 5 | *

6 | * Created by rowandjj(chuyi)
7 | * Date: 16/10/17
8 | * Time: 下午1:54
9 | */ 10 | 11 | public class TimestampLabelFormatter extends DefaultLabelFormatter { 12 | public TimestampLabelFormatter() { 13 | } 14 | 15 | @Override 16 | public String formatLabel(double value, boolean isValueX) { 17 | if (isValueX) { 18 | return formatTime(value); 19 | } else { 20 | return super.formatLabel(value, false); 21 | } 22 | } 23 | 24 | private String formatTime(double value) { 25 | if(value < 60){ 26 | return ((int)value)+"s"; 27 | } 28 | 29 | int seconds = (int) (value % 60); 30 | int minutes = (int) ((value / 60) % 60); 31 | int hours = (int) (value / (60 * 60)); 32 | 33 | StringBuilder builder = new StringBuilder(); 34 | 35 | if(hours > 0){ 36 | builder.append(hours).append("h"); 37 | } 38 | if(minutes > 0){ 39 | builder.append(minutes).append("m"); 40 | } 41 | if(seconds > 0){ 42 | builder.append(seconds).append("s"); 43 | } 44 | return builder.toString(); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/view/overlay/AbstractBizItemView.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.view.overlay; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.LayoutRes; 5 | import android.util.AttributeSet; 6 | import android.view.LayoutInflater; 7 | import android.widget.FrameLayout; 8 | 9 | /** 10 | * Description: 11 | *

12 | * Created by rowandjj(chuyi)
13 | * Date: 2016/11/3
14 | * Time: 下午4:49
15 | */ 16 | 17 | public abstract class AbstractBizItemView extends FrameLayout { 18 | public AbstractBizItemView(Context context) { 19 | super(context); 20 | init(); 21 | } 22 | 23 | public AbstractBizItemView(Context context, AttributeSet attrs) { 24 | super(context, attrs); 25 | init(); 26 | } 27 | 28 | public AbstractBizItemView(Context context, AttributeSet attrs, int defStyleAttr) { 29 | super(context, attrs, defStyleAttr); 30 | init(); 31 | 32 | } 33 | 34 | private void init() { 35 | LayoutInflater.from(getContext()).inflate(getLayoutResId(), this, true); 36 | prepareView(); 37 | } 38 | 39 | protected abstract void prepareView(); 40 | 41 | 42 | protected abstract @LayoutRes int getLayoutResId(); 43 | 44 | 45 | public void inflateData(T data) { 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/view/overlay/IOverlayView.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.view.overlay; 2 | 3 | /** 4 | * Description: 5 | *

6 | * Created by rowandjj(chuyi)
7 | * Date: 16/10/12
8 | * Time: 上午10:52
9 | */ 10 | 11 | public interface IOverlayView { 12 | boolean isViewAttached(); 13 | 14 | void show(); 15 | 16 | void dismiss(); 17 | 18 | interface OnCloseListener { 19 | void close(IOverlayView host); 20 | } 21 | 22 | interface ITask{ 23 | void start(); 24 | void stop(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/view/overlay/IResizableView.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.view.overlay; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.View; 5 | 6 | import com.taobao.weex.analyzer.core.logcat.LogView; 7 | 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.RetentionPolicy; 10 | 11 | /** 12 | * Description: 13 | * 14 | * Created by rowandjj(chuyi)
15 | */ 16 | 17 | public interface IResizableView { 18 | 19 | @IntDef({LogView.Size.SMALL, LogView.Size.MEDIUM, LogView.Size.LARGE}) 20 | @Retention(RetentionPolicy.SOURCE) 21 | @interface Size { 22 | int SMALL = 0; 23 | int MEDIUM = 1; 24 | int LARGE = 2; 25 | } 26 | 27 | interface OnSizeChangedListener { 28 | void onSizeChanged(@Size int size); 29 | } 30 | 31 | void setViewSize(@LogView.Size int size, View contentView, boolean allowFireEvent); 32 | } 33 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/java/com/taobao/weex/analyzer/view/overlay/PermissionOverlayView.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.view.overlay; 2 | 3 | import android.content.Context; 4 | 5 | import com.taobao.weex.analyzer.Config; 6 | import com.taobao.weex.analyzer.IPermissionHandler; 7 | 8 | /** 9 | * Description: 10 | * 11 | * Created by rowandjj(chuyi)
12 | */ 13 | 14 | public abstract class PermissionOverlayView extends DragSupportOverlayView implements IPermissionHandler{ 15 | protected Config mConfig; 16 | 17 | public PermissionOverlayView(Context application) { 18 | super(application); 19 | mConfig = null; 20 | } 21 | 22 | public PermissionOverlayView(Context application, boolean enableDrag) { 23 | super(application, enableDrag); 24 | mConfig = null; 25 | } 26 | 27 | public PermissionOverlayView(Context application, boolean enableDrag, Config config) { 28 | super(application, enableDrag); 29 | mConfig = config; 30 | } 31 | 32 | @Override 33 | public void show() { 34 | if(mConfig != null && !isPermissionGranted(mConfig)) { 35 | return; 36 | } 37 | super.show(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/drawable-xhdpi/wxt_icon_debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/weex_analyzer/src/main/res/drawable-xhdpi/wxt_icon_debug.png -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_3d_rotation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_3d_rotation.png -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_checked.png -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_cpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_cpu.png -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_debug.png -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_fps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_fps.png -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_log.png -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_memory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_memory.png -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_mtop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_mtop.png -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_multi_performance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_multi_performance.png -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_performance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_performance.png -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_render_analysis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_render_analysis.png -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_settings.png -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_storage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_storage.png -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_traffic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_traffic.png -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_unchecked.png -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_view_inspector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weexteam/analyzer-of-android-for-Apache-Weex/a79af9bf684d825348b4bd23d3ad5c5d7eec3b1f/weex_analyzer/src/main/res/drawable-xxhdpi/wxt_icon_view_inspector.png -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/drawable/wxt_btn_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 11 | 12 | 15 | 16 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/drawable/wxt_check_box_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/drawable/wxt_radio_btn_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/drawable/wxt_radio_checked.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/drawable/wxt_radio_unchecked.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/layout/wxt_item_log.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 13 | 14 | 19 | 20 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/layout/wxt_item_storage.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 18 | 19 | 28 | 29 | 38 | 39 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/layout/wxt_log_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/layout/wxt_memory_chart.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/layout/wxt_network_inspector_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/layout/wxt_option_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 18 | 19 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/layout/wxt_panel_cur_perf_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 19 | 20 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/layout/wxt_panel_inspector_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 14 | 15 | 24 | 25 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/layout/wxt_perf_overlay_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 19 | 20 | 27 | 28 | 35 | 36 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/layout/wxt_styleable_radio_btn.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Close 4 | Size 5 | closed 6 | opened 7 | memory statistics 8 | Weex性能指标统计 9 | fps statistics 10 | cpu statistics(current app,user+kernel) 11 | traffic statistics 12 | Settings 13 | Clear 14 | Search 15 | Collapse 16 | createInstance时间:%1$.2fms \n首屏时间:%2$.2fms \n网络时间:%3$.2fms 17 | history performance statistics of current page 18 | 19 | clear keyword 20 | input keyword 21 | current keyword: 22 | current keyword:%s 23 | Weex-Analyzer 24 | tips:点击选择你要审查的元素 25 | 26 | -------------------------------------------------------------------------------- /weex_analyzer/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 13 | -------------------------------------------------------------------------------- /weex_analyzer/src/test/java/com/taobao/weex/analyzer/core/AnalyzerServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core; 2 | 3 | import android.content.Intent; 4 | 5 | import com.taobao.weex.analyzer.core.reporter.AnalyzerService; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | import org.robolectric.RobolectricTestRunner; 10 | import org.robolectric.annotation.Config; 11 | import org.robolectric.shadows.ShadowApplication; 12 | import org.robolectric.shadows.ShadowLog; 13 | 14 | import static org.junit.Assert.assertEquals; 15 | 16 | /** 17 | * Description: 18 | * 19 | * Created by rowandjj(chuyi)
20 | */ 21 | @RunWith(RobolectricTestRunner.class) 22 | @Config(manifest = "src/main/AndroidManifest.xml",sdk = 21) 23 | public class AnalyzerServiceTest { 24 | static { 25 | ShadowLog.stream = System.out; 26 | } 27 | @Test 28 | public void onStartCommand() throws Exception { 29 | Intent intent = new Intent(ShadowApplication.getInstance().getApplicationContext(), AnalyzerService.class); 30 | ShadowApplication.getInstance().startService(intent); 31 | 32 | Intent i = ShadowApplication.getInstance().peekNextStartedService(); 33 | assertEquals(i.getComponent().getClassName(),AnalyzerService.class.getCanonicalName()); 34 | 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /weex_analyzer/src/test/java/com/taobao/weex/analyzer/core/HandlerThreadWrapperTest.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core; 2 | 3 | import android.os.Handler; 4 | 5 | import org.junit.After; 6 | import org.junit.Before; 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | import org.robolectric.RobolectricTestRunner; 10 | import org.robolectric.annotation.Config; 11 | 12 | import static org.junit.Assert.assertFalse; 13 | import static org.junit.Assert.assertNotNull; 14 | import static org.junit.Assert.assertTrue; 15 | 16 | /** 17 | * Description: 18 | * 19 | * Created by rowandjj(chuyi)
20 | */ 21 | @RunWith(RobolectricTestRunner.class) 22 | @Config(manifest = Config.NONE) 23 | public class HandlerThreadWrapperTest { 24 | @Before 25 | public void setUp() throws Exception { 26 | } 27 | 28 | @After 29 | public void tearDown() throws Exception { 30 | } 31 | 32 | @Test 33 | public void getHandler() throws Exception { 34 | HandlerThreadWrapper mHandlerThreadWrapper = new HandlerThreadWrapper("test"); 35 | Handler handler = mHandlerThreadWrapper.getHandler(); 36 | assertNotNull(handler); 37 | } 38 | 39 | @Test 40 | public void isAlive() throws Exception { 41 | HandlerThreadWrapper mHandlerThreadWrapper = new HandlerThreadWrapper("test"); 42 | boolean result = mHandlerThreadWrapper.isAlive(); 43 | assertTrue(result); 44 | 45 | mHandlerThreadWrapper.quit(); 46 | //make sure thread has quited 47 | Thread.sleep(200); 48 | result = mHandlerThreadWrapper.isAlive(); 49 | assertFalse(result); 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /weex_analyzer/src/test/java/com/taobao/weex/analyzer/core/JSExceptionCatcherTest.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core; 2 | 3 | import android.app.AlertDialog; 4 | 5 | import com.taobao.weex.analyzer.core.exception.JSExceptionCatcher; 6 | 7 | import org.junit.After; 8 | import org.junit.Before; 9 | import org.junit.Test; 10 | import org.junit.runner.RunWith; 11 | import org.robolectric.RobolectricTestRunner; 12 | import org.robolectric.RuntimeEnvironment; 13 | import org.robolectric.shadows.ShadowAlertDialog; 14 | 15 | import static org.junit.Assert.assertEquals; 16 | import static org.junit.Assert.assertNotNull; 17 | import static org.robolectric.Shadows.shadowOf; 18 | 19 | /** 20 | * Description: 21 | * 22 | * Created by rowandjj(chuyi)
23 | */ 24 | @RunWith(RobolectricTestRunner.class) 25 | public class JSExceptionCatcherTest { 26 | @Before 27 | public void setUp() throws Exception { 28 | 29 | } 30 | 31 | @After 32 | public void tearDown() throws Exception { 33 | 34 | } 35 | 36 | @Test 37 | public void catchException() throws Exception { 38 | String fakeErrCode = "fake_error_code"; 39 | String fakeMsg = "fake_msg"; 40 | AlertDialog dialog = JSExceptionCatcher.catchException(RuntimeEnvironment.application,null,null,fakeErrCode,fakeMsg); 41 | 42 | assertNotNull(dialog); 43 | ShadowAlertDialog shadowAlertDialog = shadowOf(dialog); 44 | assertEquals(dialog.isShowing(),true); 45 | assertEquals(ShadowAlertDialog.getLatestAlertDialog(),dialog); 46 | 47 | assertEquals("WeexAnalyzer捕捉到异常",shadowAlertDialog.getTitle()); 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /weex_analyzer/src/test/java/com/taobao/weex/analyzer/core/MemorySamplerTest.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core; 2 | 3 | import com.taobao.weex.analyzer.core.memory.MemorySampler; 4 | 5 | import org.junit.After; 6 | import org.junit.Before; 7 | import org.junit.Test; 8 | 9 | import static org.junit.Assert.assertTrue; 10 | 11 | 12 | /** 13 | * Description: 14 | * 15 | * Created by rowandjj(chuyi)
16 | */ 17 | 18 | public class MemorySamplerTest { 19 | 20 | 21 | @Before 22 | public void setUp() throws Exception { 23 | } 24 | 25 | @After 26 | public void tearDown() throws Exception { 27 | 28 | } 29 | 30 | @Test 31 | public void getMemoryUsage() throws Exception { 32 | double d = MemorySampler.getMemoryUsage(); 33 | System.out.println("usage:"+d); 34 | assertTrue(d>=0); 35 | } 36 | 37 | @Test 38 | public void maxMemory() throws Exception { 39 | double d = MemorySampler.maxMemory(); 40 | System.out.println("max:"+d); 41 | assertTrue(d>=0); 42 | } 43 | 44 | @Test 45 | public void totalMemory() throws Exception { 46 | double d = MemorySampler.totalMemory(); 47 | System.out.println("total:"+d); 48 | assertTrue(d>=0); 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /weex_analyzer/src/test/java/com/taobao/weex/analyzer/core/MemoryTaskEntityTest.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core; 2 | 3 | import com.taobao.weex.analyzer.core.memory.MemorySampler; 4 | import com.taobao.weex.analyzer.core.memory.MemoryTaskEntity; 5 | 6 | import org.junit.After; 7 | import org.junit.Before; 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | import org.mockito.Mockito; 11 | import org.powermock.api.mockito.PowerMockito; 12 | import org.powermock.core.classloader.annotations.PrepareForTest; 13 | import org.powermock.modules.junit4.PowerMockRunner; 14 | 15 | import static org.junit.Assert.assertEquals; 16 | 17 | /** 18 | * Description: 19 | * 20 | * Created by rowandjj(chuyi)
21 | */ 22 | @RunWith(PowerMockRunner.class) 23 | @PrepareForTest(MemorySampler.class) 24 | public class MemoryTaskEntityTest { 25 | 26 | private MemoryTaskEntity entity; 27 | @Before 28 | public void setUp() throws Exception { 29 | PowerMockito.mockStatic(MemorySampler.class); 30 | Mockito.when(MemorySampler.getMemoryUsage()).thenReturn(1.5); 31 | entity = new MemoryTaskEntity(); 32 | } 33 | 34 | @After 35 | public void tearDown() throws Exception { 36 | entity = null; 37 | } 38 | 39 | @Test 40 | public void onTaskRun() throws Exception { 41 | double result = entity.onTaskRun(); 42 | assertEquals(result,1.5,0); 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /weex_analyzer/src/test/java/com/taobao/weex/analyzer/core/PerformanceTest.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core; 2 | 3 | import com.taobao.weex.analyzer.core.weex.Performance; 4 | 5 | import org.junit.After; 6 | import org.junit.Before; 7 | import org.junit.Test; 8 | 9 | import java.util.List; 10 | 11 | import static org.hamcrest.CoreMatchers.hasItem; 12 | import static org.hamcrest.MatcherAssert.assertThat; 13 | import static org.junit.Assert.assertEquals; 14 | 15 | /** 16 | * Description: 17 | * 18 | * Created by rowandjj(chuyi)
19 | */ 20 | public class PerformanceTest { 21 | 22 | private Performance mFakePerformance; 23 | 24 | @Before 25 | public void setUp() throws Exception { 26 | mFakePerformance = new Performance(); 27 | mFakePerformance.requestType = "fakeType"; 28 | mFakePerformance.pageName = "fakeUrl"; 29 | } 30 | 31 | @After 32 | public void tearDown() throws Exception { 33 | mFakePerformance = null; 34 | } 35 | 36 | @Test 37 | public void transfer() throws Exception { 38 | List fakeList = Performance.transfer(mFakePerformance); 39 | assertEquals(22,fakeList.size()); 40 | assertThat(fakeList,hasItem("requestType : fakeType")); 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /weex_analyzer/src/test/java/com/taobao/weex/analyzer/core/ShakeDetectorTest.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core; 2 | 3 | import android.hardware.Sensor; 4 | import android.hardware.SensorManager; 5 | 6 | import org.junit.Before; 7 | import org.junit.Test; 8 | import org.mockito.Mock; 9 | import org.mockito.MockitoAnnotations; 10 | 11 | import static org.mockito.Mockito.mock; 12 | import static org.mockito.Mockito.verify; 13 | import static org.mockito.Mockito.when; 14 | 15 | /** 16 | * Description: 17 | * 18 | * Created by rowandjj(chuyi)
19 | */ 20 | public class ShakeDetectorTest { 21 | 22 | @Mock 23 | private SensorManager mSensorManager; 24 | 25 | @Before 26 | public void setup() { 27 | MockitoAnnotations.initMocks(this); 28 | } 29 | 30 | @Test 31 | public void start() throws Exception { 32 | 33 | ShakeDetector.ShakeListener mockListener = mock(ShakeDetector.ShakeListener.class); 34 | Sensor sensor = mock(Sensor.class); 35 | ShakeDetector detector = new ShakeDetector(mockListener,null); 36 | when(mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER)).thenReturn(sensor); 37 | 38 | detector.start(mSensorManager); 39 | 40 | verify(mSensorManager).getDefaultSensor(Sensor.TYPE_ACCELEROMETER); 41 | verify(mSensorManager).registerListener(detector,sensor,SensorManager.SENSOR_DELAY_UI); 42 | } 43 | 44 | @Test 45 | public void stop() throws Exception { 46 | 47 | } 48 | 49 | 50 | } -------------------------------------------------------------------------------- /weex_analyzer/src/test/java/com/taobao/weex/analyzer/core/TrafficTaskEntityTest.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.core; 2 | 3 | import android.os.Process; 4 | 5 | import com.taobao.weex.analyzer.core.traffic.TrafficSampler; 6 | import com.taobao.weex.analyzer.core.traffic.TrafficTaskEntity; 7 | 8 | import org.junit.After; 9 | import org.junit.Before; 10 | import org.junit.Test; 11 | import org.junit.runner.RunWith; 12 | import org.powermock.api.mockito.PowerMockito; 13 | import org.powermock.core.classloader.annotations.PrepareForTest; 14 | import org.powermock.modules.junit4.PowerMockRunner; 15 | 16 | import static org.mockito.Matchers.anyInt; 17 | import static org.mockito.Mockito.times; 18 | 19 | /** 20 | * Description: 21 | * 22 | * Created by rowandjj(chuyi)
23 | */ 24 | @RunWith(PowerMockRunner.class) 25 | @PrepareForTest({Process.class,TrafficSampler.class}) 26 | public class TrafficTaskEntityTest { 27 | @Before 28 | public void setUp() throws Exception { 29 | PowerMockito.mockStatic(TrafficSampler.class); 30 | PowerMockito.mockStatic(Process.class); 31 | } 32 | 33 | @After 34 | public void tearDown() throws Exception { 35 | 36 | } 37 | 38 | @Test 39 | public void onTaskInit() throws Exception { 40 | 41 | } 42 | 43 | @Test 44 | public void onTaskRun() throws Exception { 45 | TrafficTaskEntity entity = new TrafficTaskEntity(200); 46 | entity.onTaskRun(); 47 | 48 | PowerMockito.verifyStatic(times(2)); 49 | Process.myUid(); 50 | PowerMockito.verifyStatic(); 51 | TrafficSampler.getUidRxBytes(anyInt()); 52 | PowerMockito.verifyStatic(); 53 | TrafficSampler.getUidTxBytes(anyInt()); 54 | } 55 | 56 | @Test 57 | public void onTaskStop() throws Exception { 58 | 59 | } 60 | 61 | } -------------------------------------------------------------------------------- /weex_analyzer/src/test/java/com/taobao/weex/analyzer/view/WXInspectorItemViewTest.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.analyzer.view; 2 | 3 | import com.taobao.weex.analyzer.core.inspector.view.WXInspectorItemView; 4 | 5 | import org.junit.After; 6 | import org.junit.Before; 7 | import org.junit.Test; 8 | 9 | import static org.junit.Assert.assertEquals; 10 | 11 | /** 12 | * Description: 13 | * 14 | * Created by rowandjj(chuyi)
15 | */ 16 | public class WXInspectorItemViewTest { 17 | @Before 18 | public void setUp() throws Exception { 19 | 20 | } 21 | 22 | @After 23 | public void tearDown() throws Exception { 24 | 25 | } 26 | 27 | @Test 28 | public void getPureValue() throws Exception { 29 | assertEquals("13", WXInspectorItemView.getPureValue("12.78")); 30 | assertEquals("12",WXInspectorItemView.getPureValue("12.")); 31 | assertEquals("-13",WXInspectorItemView.getPureValue("-12.78")); 32 | assertEquals("13",WXInspectorItemView.getPureValue("12.a78")); 33 | assertEquals("-13",WXInspectorItemView.getPureValue("-12.78px")); 34 | assertEquals("12",WXInspectorItemView.getPureValue("12wx")); 35 | assertEquals("3",WXInspectorItemView.getPureValue("3.424223324244")); 36 | assertEquals("-3",WXInspectorItemView.getPureValue("-3.424223324244")); 37 | assertEquals("0",WXInspectorItemView.getPureValue(".424223324244")); 38 | assertEquals("1",WXInspectorItemView.getPureValue("0.8")); 39 | 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /weex_analyzer/src/test/resources/cpu/pid_stat: -------------------------------------------------------------------------------- 1 | 2815 (com.alibaba.weex) S 1163 1163 0 0 -1 1077961024 20146 367 0 0 273 214 0 3 20 0 22 0 4908 788004864 13729 4294967295 3078434816 3078440316 3218548544 3218546108 3077705499 0 4612 0 38136 4294967295 0 0 17 3 0 0 0 0 0 3078446592 3078447088 3093508096 3218549823 3218549899 3218549899 3218550756 0 2 | -------------------------------------------------------------------------------- /weex_analyzer/src/test/resources/cpu/stat: -------------------------------------------------------------------------------- 1 | cpu 1317 473 3808 48467 308 1 4 0 0 0 2 | cpu0 345 85 1209 11601 157 1 4 0 0 0 3 | cpu1 326 152 873 12247 51 0 0 0 0 0 4 | cpu2 351 94 801 12335 65 0 0 0 0 0 5 | cpu3 295 142 925 12284 35 0 0 0 0 0 6 | intr 189713 29 0 0 0 6 0 0 0 1 0 3527 6681 0 0 0 9 0 440 18595 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 | ctxt 733959 8 | btime 1488339905 9 | processes 3011 10 | procs_running 2 11 | procs_blocked 0 12 | softirq 38041 0 14629 0 237 3 0 153 9136 48 13835 13 | --------------------------------------------------------------------------------