├── .gitignore ├── .idea └── dictionaries │ └── zq.xml ├── .npmignore ├── .swift-version ├── README.md ├── WeexGcanvas.podspec ├── android └── library │ ├── build.gradle │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── proguard-rules.pro │ └── src │ ├── com │ └── alibaba │ │ └── weex │ │ └── plugin │ │ └── gcanvas │ │ ├── GcanvasModule.java │ │ ├── WXGCanvasGLSurfaceView.java │ │ └── WXGcanvasComponent.java │ └── main │ ├── AndroidManifest.xml │ └── res │ └── values │ └── strings.xml ├── build ├── webpack.config.js ├── webpack.examples.config.js ├── webpack.examples.js ├── webpack.examples.web.config.js └── webpack.examples.web.js ├── doc ├── how-to-develop.md └── index.md ├── examples ├── index.vue ├── transparent.vue ├── we │ └── index.we └── web-entry │ └── index.js ├── index.html ├── ios ├── Info.plist ├── Podfile ├── Sources │ ├── WXGCanvasComponent.h │ ├── WXGCanvasComponent.mm │ ├── WXGCanvasModule.h │ ├── WXGCanvasModule.m │ └── WeexGcanvas.h └── WeexGcanvas.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── jerry.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ ├── xcshareddata │ └── xcschemes │ │ └── WeexGcanvas.xcscheme │ └── xcuserdata │ └── jerry.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── js ├── build │ └── main.js └── src │ ├── gcanvas.js │ ├── gcontext2d.js │ ├── glog.js │ ├── gutil.js │ ├── gwebgl.js │ ├── index.js │ └── package.json ├── package.json ├── playground ├── android │ ├── app │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── weex │ │ │ │ └── demo │ │ │ │ └── ExampleInstrumentedTest.java │ │ │ ├── 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 │ │ │ │ │ ├── process-bar-demo.js │ │ │ │ │ ├── scroller-demo.js │ │ │ │ │ ├── slider-neighbor │ │ │ │ │ │ ├── silder-neighbor.js │ │ │ │ │ │ ├── slider-neighbor-item.js │ │ │ │ │ │ └── slider-neighbor-page.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 │ │ │ │ ├── hello_weex.js │ │ │ │ ├── iconfont.js │ │ │ │ ├── index.js │ │ │ │ ├── module │ │ │ │ │ ├── clipboard.js │ │ │ │ │ ├── componentRect.js │ │ │ │ │ ├── instance-api.js │ │ │ │ │ ├── modal.js │ │ │ │ │ ├── picker-demo.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 │ │ │ │ │ ├── BenchmarkActivity.java │ │ │ │ │ ├── IndexActivity.java │ │ │ │ │ ├── SplashActivity.java │ │ │ │ │ ├── WXApplication.java │ │ │ │ │ ├── WXBaseActivity.java │ │ │ │ │ ├── WXDebugActivity.java │ │ │ │ │ ├── WXPageActivity.java │ │ │ │ │ ├── constants │ │ │ │ │ └── Constants.java │ │ │ │ │ ├── extend │ │ │ │ │ ├── PlayDebugAdapter.java │ │ │ │ │ ├── adapter │ │ │ │ │ │ └── InterceptWXHttpAdapter.java │ │ │ │ │ ├── component │ │ │ │ │ │ ├── RichText.java │ │ │ │ │ │ └── WXComponentSyncTest.java │ │ │ │ │ └── module │ │ │ │ │ │ ├── GeolocationModule.java │ │ │ │ │ │ ├── MyModule.java │ │ │ │ │ │ ├── RenderModule.java │ │ │ │ │ │ ├── SyncTestModule.java │ │ │ │ │ │ ├── WXEventModule.java │ │ │ │ │ │ └── location │ │ │ │ │ │ ├── DefaultLocation.java │ │ │ │ │ │ ├── ILocatable.java │ │ │ │ │ │ └── LocationFactory.java │ │ │ │ │ └── https │ │ │ │ │ ├── HotRefreshManager.java │ │ │ │ │ ├── WXHttpManager.java │ │ │ │ │ ├── WXHttpResponse.java │ │ │ │ │ ├── WXHttpTask.java │ │ │ │ │ ├── WXOkHttpDispatcher.java │ │ │ │ │ └── WXRequestListener.java │ │ │ ├── java_commons │ │ │ │ └── com │ │ │ │ │ └── alibaba │ │ │ │ │ └── weex │ │ │ │ │ └── commons │ │ │ │ │ ├── AbstractWeexActivity.java │ │ │ │ │ ├── SimpleWeexActivity.java │ │ │ │ │ ├── WXAnalyzerDelegate.java │ │ │ │ │ ├── adapter │ │ │ │ │ ├── BlurTool.java │ │ │ │ │ ├── BlurTransformation.java │ │ │ │ │ ├── DefaultWebSocketAdapter.java │ │ │ │ │ ├── DefaultWebSocketAdapterFactory.java │ │ │ │ │ ├── FrescoImageAdapter.java │ │ │ │ │ ├── FrescoImageComponent.java │ │ │ │ │ ├── FrescoImageView.java │ │ │ │ │ ├── ImageAdapter.java │ │ │ │ │ └── JSExceptionAdapter.java │ │ │ │ │ └── util │ │ │ │ │ ├── AssertUtil.java │ │ │ │ │ └── ScreenUtil.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-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_dynamic.xml │ │ │ │ ├── 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_dynamic.xml │ │ │ │ ├── content_main.xml │ │ │ │ ├── content_wx_main.xml │ │ │ │ ├── encode.xml │ │ │ │ ├── hello_weex.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 │ │ │ └── test │ │ │ └── java │ │ │ └── org │ │ │ └── weex │ │ │ └── demo │ │ │ └── ExampleUnitTest.java │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── browser │ ├── index-vue.html │ ├── index-we.html │ ├── lib │ │ └── browser.js │ ├── pluginInstall.js │ └── weex-vue-render │ │ ├── README.md │ │ ├── index.js │ │ └── package.json └── ios │ ├── Podfile │ ├── README.md │ ├── WeexDemo.xcodeproj │ ├── project.pbxproj │ ├── xcshareddata │ │ └── xcschemes │ │ │ └── WeexDemo.xcscheme │ └── xcuserdata │ │ └── jerry.xcuserdatad │ │ └── xcschemes │ │ ├── WeexDemo.xcscheme │ │ ├── WeexUITestDemo.xcscheme │ │ └── xcschememanagement.plist │ ├── WeexDemo.xcworkspace │ └── contents.xcworkspacedata │ ├── WeexDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-29.png │ │ │ ├── Icon-29@2x-1.png │ │ │ ├── Icon-29@2x.png │ │ │ ├── Icon-29@3x.png │ │ │ ├── Icon-40.png │ │ │ ├── Icon-40@2x-1.png │ │ │ ├── Icon-40@2x.png │ │ │ ├── Icon-40@3x.png │ │ │ ├── Icon-60@2x.png │ │ │ ├── Icon-60@3x.png │ │ │ ├── Icon-76.png │ │ │ ├── Icon-76@2x.png │ │ │ └── Icon-83.5@2x.png │ │ ├── Contents.json │ │ ├── LaunchImage.launchimage │ │ │ ├── Contents.json │ │ │ ├── Default-4.7@2x.png │ │ │ ├── Default-568h@2x-1.png │ │ │ ├── Default-568h@2x.png │ │ │ ├── Default.png │ │ │ ├── Default@2x-1.png │ │ │ ├── Default@2x.png │ │ │ ├── Default@3x-1.png │ │ │ └── Default@3x.png │ │ ├── back.imageset │ │ │ ├── Contents.json │ │ │ ├── back.png │ │ │ ├── back@2x.png │ │ │ └── back@3x.png │ │ ├── reload.imageset │ │ │ ├── Contents.json │ │ │ ├── reload.png │ │ │ ├── reload@2x.png │ │ │ └── reload@3x.png │ │ └── scan.imageset │ │ │ ├── Contents.json │ │ │ ├── scan.png │ │ │ ├── scan@2x.png │ │ │ └── scan@3x.png │ ├── DemoBaseViewController.h │ ├── DemoBaseViewController.m │ ├── DemoDefine.h │ ├── Images.xcassets │ │ └── Brand Assets.launchimage │ │ │ └── Contents.json │ ├── Info.plist │ ├── Scanner │ │ ├── WXScannerVC.h │ │ └── WXScannerVC.m │ ├── UIView+UIThreadCheck.h │ ├── UIView+UIThreadCheck.m │ ├── UIViewController+WXDemoNaviBar.h │ ├── UIViewController+WXDemoNaviBar.m │ ├── WXDemoViewController.h │ ├── WXDemoViewController.m │ ├── WXSyncTestModule.h │ ├── WXSyncTestModule.m │ ├── debug │ │ ├── WXATLoggerPlugin.h │ │ ├── WXATLoggerPlugin.m │ │ ├── WXATViewHierarchyPlugin.h │ │ └── WXATViewHierarchyPlugin.m │ ├── extend │ │ ├── component │ │ │ ├── WXSelectComponent.h │ │ │ └── WXSelectComponent.m │ │ ├── handler │ │ │ ├── WXImgLoaderDefaultImpl.h │ │ │ └── WXImgLoaderDefaultImpl.m │ │ └── module │ │ │ ├── WXEventModule.h │ │ │ └── WXEventModule.m │ ├── main.m │ └── weex-icon.png │ ├── WeexDemoTests │ ├── Info.plist │ └── WeexDemoTests.m │ ├── WeexUITestDemo-Info.plist │ ├── WeexUITestDemoUITests │ ├── Info.plist │ └── WeexUITestDemoUITests.m │ ├── bundlejs │ ├── actionsheet.js │ ├── 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 │ │ ├── process-bar-demo.js │ │ ├── scroller-demo.js │ │ ├── slider-neighbor │ │ │ ├── index.js │ │ │ ├── slider-neighbor-item.js │ │ │ └── slider-neighbor-page.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 │ ├── error.js │ ├── geolocation.js │ ├── hello.js │ ├── iconfont.js │ ├── index.js │ ├── linear-gradient.js │ ├── module │ │ ├── clipboard.js │ │ ├── componentRect.js │ │ ├── instance-api.js │ │ ├── modal.js │ │ ├── picker-demo.js │ │ ├── storage-demo.js │ │ ├── stream-demo.js │ │ └── websocket-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 │ │ │ ├── image-demo.js │ │ │ ├── index.js │ │ │ ├── link.js │ │ │ ├── list │ │ │ │ ├── list-basic.js │ │ │ │ ├── list-demo-horizon.js │ │ │ │ └── list-demo.js │ │ │ ├── main.js │ │ │ ├── match.js │ │ │ ├── resource.js │ │ │ └── scene.js │ │ ├── pseudo-class.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 │ ├── test.js │ └── vue │ │ ├── animation.js │ │ ├── components │ │ ├── a.js │ │ ├── countdown.js │ │ ├── image.js │ │ ├── input.js │ │ ├── list.js │ │ ├── marquee.js │ │ ├── navigator.js │ │ ├── scroller.js │ │ ├── slider.js │ │ ├── tabbar.js │ │ ├── text.js │ │ ├── video.js │ │ └── web.js │ │ ├── hello.js │ │ ├── iconfont.js │ │ ├── index.js │ │ ├── modules │ │ ├── clipboard.js │ │ ├── instance-api.js │ │ ├── modal.js │ │ ├── storage.js │ │ └── stream.js │ │ ├── showcase │ │ ├── calculator.js │ │ ├── itemlist.js │ │ ├── new-fashion.js │ │ └── progress.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 │ │ ├── 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 │ ├── weex.png │ └── weex@2x.png ├── screenshot └── device-2017-04-19-174713.png ├── start └── start-web /.gitignore: -------------------------------------------------------------------------------- 1 | playground/ios/Pods/ 2 | playground/ios/Podfile.lock 3 | ios/Pods/ 4 | ios/Podfile.lock 5 | node_modules/ 6 | examples/build/ 7 | playground/browser/build/ 8 | # Built application files 9 | *.apk 10 | *.ap_ 11 | 12 | # Files for the ART/Dalvik VM 13 | *.dex 14 | 15 | # Java class files 16 | *.class 17 | 18 | # Generated files 19 | bin/ 20 | gen/ 21 | out/ 22 | 23 | # Gradle files 24 | .gradle/ 25 | 26 | # Local configuration file (sdk path, etc) 27 | local.properties 28 | 29 | # Proguard folder generated by Eclipse 30 | proguard/ 31 | 32 | # Log Files 33 | *.log 34 | 35 | # Android Studio Navigation editor temp files 36 | .navigation/ 37 | 38 | # Android Studio captures folder 39 | captures/ 40 | 41 | # Intellij 42 | *.iml 43 | .idea/workspace.xml 44 | 45 | # Keystore files 46 | *.jks 47 | 48 | .idea 49 | -------------------------------------------------------------------------------- /.idea/dictionaries/zq.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | android 2 | doc 3 | examples 4 | ios 5 | playground 6 | WeexGcanvas.podspec -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 2.3 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # weex-gcanvas 2 | weex-gcanvas是一个weex插件,可以通过weexpack快速集成,可以丰富weex功能 3 | 4 | 支持的weexpack版本: >= 0.2.0 5 | 支持的WeexSDK版本: >= 0.10.0 6 | 7 | # 功能 8 | 9 | # 快速使用 10 | - 通过weexpack初始化一个weextest工程 11 | ``` 12 | weexpack create weextest 13 | ``` 14 | - 添加ios平台 15 | ``` 16 | weexpack platform add ios 17 | ``` 18 | - 添加android平台 19 | ``` 20 | weexpack platform add android 21 | ``` 22 | - 添加插件 23 | ``` 24 | weexpack plugin add weex-gcanvas 25 | ``` 26 | 27 | # 已有工程集成 28 | ## iOS集成插件WeexGcanvas 29 | - 命令行集成 30 | ``` 31 | weexpack plugin add weex-gcanvas 32 | ``` 33 | - 手动集成 34 | 在podfile 中添加 35 | ``` 36 | pod 'WeexGcanvas' 37 | ``` 38 | 39 | ## 安卓集成插件weexgcanvas 40 | - 命令行集成 41 | ``` 42 | weexpack plugin add weex-gcanvas 43 | ``` 44 | - 手动集成 45 |  在相应工程的build.gradle文件的dependencies中添加 46 | ``` 47 | compile 'org.weex.plugin:weexgcanvas:0.0.1' 48 | ``` 49 |  注意:您需要自行指定插件的groupId和version并将构建产物发布到相应的依赖管理仓库内去(例如maven), 您也可以对插件的name进行自定义,默认将使用插件工程的名称作为name 50 | 51 | 52 | ## 浏览器端集成 weex-gcanvas 53 | - 命令行集成 54 | ``` 55 | npm install weex-gcanvas 56 | ``` 57 | - 手动集成 58 |  在相应工程的package.json文件的dependencies中添加 59 | ``` 60 | weex-gcanvas:0.3.8' 61 | ``` 62 |   63 | -------------------------------------------------------------------------------- /WeexGcanvas.podspec: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | Pod::Spec.new do |s| 4 | s.name = "WeexGcanvas" 5 | s.version = "0.0.1.11" 6 | s.summary = "Weex Plugin" 7 | 8 | s.description = <<-DESC 9 | Weexplugin Source Description 10 | DESC 11 | 12 | s.homepage = "https://github.com/weex-plugins/weex-plugin-gcanvas" 13 | s.license = { 14 | :type => 'Copyright', 15 | :text => <<-LICENSE 16 | copyright 17 | LICENSE 18 | } 19 | s.authors = { 20 | "yourname" =>"youreamail" 21 | } 22 | s.platform = :ios 23 | s.ios.deployment_target = "7.0" 24 | 25 | s.source = { :git => 'https://github.com/weex-plugins/weex-plugin-gcanvas.git', :tag => '0.0.1.11' } 26 | #s.source = { :path => '.' } 27 | s.source_files = "ios/Sources/*.{h,m,mm}" 28 | 29 | s.requires_arc = true 30 | s.dependency "WeexPluginLoader" 31 | s.dependency "WeexSDK" 32 | s.dependency "GCanvas" 33 | s.dependency "SDWebImage", "< 4.0.0" 34 | s.libraries = "stdc++" 35 | end 36 | -------------------------------------------------------------------------------- /android/library/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/android/library/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/library/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=http\://mirrors.taobao.net/mirror/gradle/gradle-3.2.1-all.zip 9 | #distributionUrl=http\://mirrors.taobao.net/mirror/gradle/gradle-2.10-all.zip 10 | #distributionUrl=gradle-2.10-bin.zip -------------------------------------------------------------------------------- /android/library/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/moxun/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 | -------------------------------------------------------------------------------- /android/library/src/com/alibaba/weex/plugin/gcanvas/WXGCanvasGLSurfaceView.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.weex.plugin.gcanvas; 2 | 3 | 4 | import android.content.Context; 5 | import android.graphics.Canvas; 6 | import android.view.MotionEvent; 7 | import android.view.SurfaceHolder; 8 | 9 | import com.taobao.gcanvas.GCanvasView; 10 | import com.taobao.weex.dom.WXDomObject; 11 | import com.taobao.weex.ui.view.gesture.WXGesture; 12 | import com.taobao.weex.ui.view.gesture.WXGestureObservable; 13 | 14 | 15 | public class WXGCanvasGLSurfaceView extends GCanvasView implements WXGestureObservable { 16 | 17 | 18 | private WXGesture wxGesture; 19 | 20 | public WXGCanvasGLSurfaceView(Context context, WXDomObject element) { 21 | super(context); 22 | 23 | } 24 | 25 | 26 | @Override 27 | protected void onDraw(Canvas canvas) { 28 | 29 | super.onDraw(canvas); 30 | 31 | } 32 | 33 | @Override 34 | public void registerGestureListener(WXGesture wxGesture) { 35 | this.wxGesture = wxGesture; 36 | } 37 | 38 | @Override 39 | public boolean onTouchEvent(MotionEvent event) { 40 | boolean result = super.onTouchEvent(event); 41 | if (wxGesture != null) { 42 | result |= wxGesture.onTouch(this, event); 43 | } 44 | return result; 45 | } 46 | 47 | @Override 48 | protected void onLayout(boolean changed, int left, int top, int right, 49 | int bottom) { 50 | 51 | super.onLayout(changed, left, top, right, bottom); 52 | 53 | } 54 | 55 | 56 | @Override 57 | public void surfaceDestroyed(SurfaceHolder holder) { 58 | 59 | super.surfaceDestroyed(holder); 60 | 61 | 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /android/library/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/library/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ActionSheet 3 | 4 | -------------------------------------------------------------------------------- /build/webpack.config.js: -------------------------------------------------------------------------------- 1 | 2 | var fs = require('fs'); 3 | var webpack = require('webpack'); 4 | 5 | 6 | var bannerExcludeFiles = []; 7 | 8 | var banner = '// { "framework": "Vue" }\n' 9 | 10 | var bannerPlugin = new webpack.BannerPlugin(banner, { 11 | raw: true, 12 | exclude: bannerExcludeFiles 13 | }) 14 | 15 | module.exports = { 16 | entry: "./js/src/index.js", 17 | output : { 18 | path: './js/build/', 19 | filename: '[name].js' 20 | }, 21 | module: { 22 | loaders: [ 23 | { 24 | test: /\.(we|vue)(\?[^?]+)?$/, 25 | loader: 'weex' 26 | }, 27 | { 28 | test: /\.js(\?[^?]+)?$/, 29 | exclude: /node_modules/, 30 | loader: 'babel-loader?presets[]=es2015', 31 | }, 32 | { 33 | test: /\.css(\?[^?]+)?$/, 34 | loader: 'style-loader!css-loader' 35 | } 36 | ] 37 | }, 38 | plugins: [bannerPlugin] 39 | } 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /doc/how-to-develop.md: -------------------------------------------------------------------------------- 1 | # weex 插件开发套件 2 | - weex 插件开发套件旨在帮助用户快速,方便开发插件,一键集成,无需更改任何业务代码 3 | 4 | ## iOS 5 | 6 | ### 如何开发插件 7 | - 通过weexpack初始化一个WeexPluginGcanvas工程 8 | ``` 9 | weex create dev WeexPluginGcanvas 10 | ``` 11 | - 工程目录如下 12 | ``` 13 | ├── android(Android插件工程) 14 | │ ├── buid.gradle(android发布文件) 15 | ├── ios(ios插件工程) 16 | ├── js(h5插件工程) 17 | ├── example(例子,开发者用来测试问题) 18 | │ ├── android(demo) 19 | │ ├── ios(demo) 20 | │ ├── js(demo) 21 | │ └── index.we 22 | ├── ****.podspec(ios发布文件) 23 | ├── start(weex编译命令) 24 | ├── package.json(js发布文件) 25 | ├── README.md 26 | ``` 27 | - 请在ios目录下用如下命令初始化ios工程 28 | ``` 29 | pod update 30 | ``` 31 | - 添加插件初测信息 32 | - component示例 33 | ``` 34 | WX_PlUGIN_EXPORT_MODULE(test, WPTestComponent) 35 | ``` 36 | - module示例 37 | ``` 38 | WX_PlUGIN_EXPORT_COMPONENT(test, WPTestModule) 39 | ``` 40 | - Handler示例 41 | ``` 42 | WX_PlUGIN_EXPORT_HANDLER(WPTestHandler, WXImgLoaderProtocol) 43 | ``` 44 | - 插件开发完成请在example/ios测试 45 | - 初始化测试工程 46 | ``` 47 | pod update 48 | ``` 49 | - 检验测试结果,demo运行起来会在控制台输入下面类似信息 50 | ``` 51 | 2017-03-24 16:54:52.934 WeexDemo[88059:2693902] WPTestComponent register 52 | 2017-03-24 16:54:52.936 WeexDemo[88059:2693902] WXImgLoaderProtocol register 53 | 2017-03-24 16:54:52.937 WeexDemo[88059:2693902] WPTestModule register 54 | ``` 55 | 56 | ### 如何发布插件 57 | - 发布插件到cocoapods 仓库 58 | - 已经默认创建好podspec,开发者在根目录通过如下命令检查iOS插件的正确性 59 | ``` 60 | pod spec lint --allow-warnings 61 | ``` 62 | - 发布插件到cocoapods 仓库 63 | ``` 64 | pod trunk push --allow-warnings 65 | ``` 66 | 67 | ### 如何发布插件到weex market 68 | - 通过weex命令发布 69 | ``` 70 | weex plugin publish 71 | ``` 72 | 73 | ### 如何集成插件WeexPluginGcanvas 74 | - 命令行集成 75 | ``` 76 | weex plugin add WeexPluginGcanvas 77 | ``` 78 | - 手动集成 79 | 在podfile 中添加 80 | ``` 81 | pod 'WeexPluginGcanvas' 82 | ``` 83 | -------------------------------------------------------------------------------- /doc/index.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/doc/index.md -------------------------------------------------------------------------------- /examples/index.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /examples/we/index.we: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /examples/web-entry/index.js: -------------------------------------------------------------------------------- 1 | var App = require('../index.vue') 2 | App.el = '#root' 3 | new Vue(App) 4 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Weex Vue Demo 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /ios/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | platform :ios, '7.0' 3 | #inhibit_all_warnings! 4 | 5 | def common 6 | pod 'WeexSDK' 7 | pod 'WeexPluginLoader' 8 | pod 'GCanvas' 9 | pod 'SDWebImage', '3.7.5' 10 | end 11 | 12 | target 'WeexGcanvas' do 13 | common 14 | end 15 | 16 | 17 | -------------------------------------------------------------------------------- /ios/Sources/WXGCanvasComponent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #import 21 | #import 22 | #import 23 | 24 | @interface WXGCanvasComponent : WXComponent 25 | 26 | @property(nonatomic, strong) GLKView* glkview; 27 | @property(nonatomic, assign) CGRect componetFrame; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /ios/Sources/WXGCanvasModule.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #import 21 | #import 22 | 23 | @interface WXGCanvasModule : NSObject 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /ios/Sources/WeexGcanvas.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | #import "WXGCanvasModule.h" 20 | #import "WXGCanvasComponent.h" 21 | 22 | #ifndef WeexGcanvas_h 23 | #define WeexGcanvas_h 24 | 25 | 26 | #endif /* WeexGcanvas_h */ 27 | -------------------------------------------------------------------------------- /ios/WeexGcanvas.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/WeexGcanvas.xcodeproj/project.xcworkspace/xcuserdata/jerry.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/ios/WeexGcanvas.xcodeproj/project.xcworkspace/xcuserdata/jerry.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ios/WeexGcanvas.xcodeproj/xcuserdata/jerry.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | WeexGcanvas.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | C431394A1E954AA8008B80D0 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /js/src/index.js: -------------------------------------------------------------------------------- 1 | 2 | var context; 3 | function getProto (Weex) { 4 | return { 5 | create: function () { 6 | this.node = document.createElement('canvas') 7 | return this.node 8 | }, 9 | getContext: function (type) { 10 | context = this.node.getContext(type || '2d') 11 | return context 12 | }, 13 | 14 | getContextAsyn: function (type, callback) { 15 | context = this.node.getContext(type || '2d') 16 | callback(context) 17 | }, 18 | 19 | drawImage: function (url) { 20 | var img = new Image(); 21 | img.src = url 22 | arguments[0] = img 23 | return context.drawImage.apply(context, arguments) 24 | } 25 | 26 | } 27 | } 28 | 29 | function init (Weex) { 30 | const Component = Weex.Component 31 | const extend = Weex.utils.extend 32 | 33 | function GCanvas (data) { 34 | Component.call(this, data) 35 | } 36 | 37 | GCanvas.prototype = Object.create(Component.prototype) 38 | extend(GCanvas.prototype, getProto(Weex)) 39 | 40 | Weex.registerComponent('gcanvas', GCanvas) 41 | } 42 | 43 | module.exports = { 44 | init: init 45 | } 46 | 47 | -------------------------------------------------------------------------------- /js/src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "weex-gcanvas", 3 | "version": "0.3.4", 4 | "main":"gcanvas.js", 5 | "platform": [ 6 | "ios", 7 | "android" 8 | ], 9 | "description": "", 10 | "keywords": [ 11 | "weex", 12 | "plugin" 13 | ], 14 | "license": "Apache 2.0" 15 | } 16 | -------------------------------------------------------------------------------- /playground/android/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/moxun/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 | -------------------------------------------------------------------------------- /playground/android/app/src/androidTest/java/org/weex/demo/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.demo; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.taobao.weex.actionsheet", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /playground/android/app/src/main/assets/hello_weex.js: -------------------------------------------------------------------------------- 1 | define('@weex-component/037a188b382be8b4caa073b6cf436427', function(require, exports, module) { 2 | 3 | ; 4 | 5 | ; 6 | module.exports.style = {} 7 | 8 | ; 9 | module.exports.template = { 10 | "type": "div", 11 | "children": [{ 12 | "type": "text", 13 | "style": { 14 | "fontSize": 100 15 | }, 16 | "attr": { 17 | "value": "Hello World." 18 | } 19 | }] 20 | } 21 | 22 | ; 23 | }) 24 | 25 | // require module 26 | bootstrap('@weex-component/037a188b382be8b4caa073b6cf436427', { 27 | "transformerVersion": "0.3.1" 28 | }) -------------------------------------------------------------------------------- /playground/android/app/src/main/java_zxing/com/google/zxing/BarcodeFormat.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 | * Enumerates barcode formats known to this package. Please keep alphabetized. 21 | * 22 | * @author Sean Owen 23 | */ 24 | public enum BarcodeFormat { 25 | 26 | /** Aztec 2D barcode format. */ 27 | AZTEC, 28 | 29 | /** CODABAR 1D format. */ 30 | CODABAR, 31 | 32 | /** Code 39 1D format. */ 33 | CODE_39, 34 | 35 | /** Code 93 1D format. */ 36 | CODE_93, 37 | 38 | /** Code 128 1D format. */ 39 | CODE_128, 40 | 41 | /** Data Matrix 2D barcode format. */ 42 | DATA_MATRIX, 43 | 44 | /** EAN-8 1D format. */ 45 | EAN_8, 46 | 47 | /** EAN-13 1D format. */ 48 | EAN_13, 49 | 50 | /** ITF (Interleaved Two of Five) 1D format. */ 51 | ITF, 52 | 53 | /** MaxiCode 2D barcode format. */ 54 | MAXICODE, 55 | 56 | /** PDF417 format. */ 57 | PDF_417, 58 | 59 | /** QR Code 2D barcode format. */ 60 | QR_CODE, 61 | 62 | /** RSS 14 */ 63 | RSS_14, 64 | 65 | /** RSS EXPANDED */ 66 | RSS_EXPANDED, 67 | 68 | /** UPC-A 1D format. */ 69 | UPC_A, 70 | 71 | /** UPC-E 1D format. */ 72 | UPC_E, 73 | 74 | /** UPC/EAN extension format. Not a stand-alone format. */ 75 | UPC_EAN_EXTENSION 76 | 77 | } 78 | -------------------------------------------------------------------------------- /playground/android/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/android/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/android/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/android/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/android/app/src/main/java_zxing/com/google/zxing/ReaderException.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 | * The general exception class throw when something goes wrong during decoding of a barcode. 21 | * This includes, but is not limited to, failing checksums / error correction algorithms, being 22 | * unable to locate finder timing patterns, and so on. 23 | * 24 | * @author Sean Owen 25 | */ 26 | public abstract class ReaderException extends Exception { 27 | 28 | // disable stack traces when not running inside test units 29 | protected static final boolean isStackTrace = 30 | System.getProperty("surefire.test.class.path") != null; 31 | protected static final StackTraceElement[] NO_TRACE = new StackTraceElement[0]; 32 | 33 | ReaderException() { 34 | // do nothing 35 | } 36 | 37 | ReaderException(Throwable cause) { 38 | super(cause); 39 | } 40 | 41 | // Prevent stack traces from being taken 42 | // srowen says: huh, my IDE is saying this is not an override. native methods can't be overridden? 43 | // This, at least, does not hurt. Because we use a singleton pattern here, it doesn't matter anyhow. 44 | @Override 45 | public final Throwable fillInStackTrace() { 46 | return null; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /playground/android/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/android/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/android/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/android/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/android/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/android/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/android/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/android/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/android/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/android/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/android/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/android/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/android/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/android/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/android/app/src/main/java_zxing/com/google/zxing/client/android/share/AppInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 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.client.android.share; 18 | 19 | import android.graphics.drawable.Drawable; 20 | 21 | final class AppInfo implements Comparable { 22 | 23 | private final String packageName; 24 | private final String label; 25 | private final Drawable icon; 26 | 27 | AppInfo(String packageName, String label, Drawable icon) { 28 | this.packageName = packageName; 29 | this.label = label; 30 | this.icon = icon; 31 | } 32 | 33 | String getPackageName() { 34 | return packageName; 35 | } 36 | 37 | Drawable getIcon() { 38 | return icon; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | return label; 44 | } 45 | 46 | @Override 47 | public int compareTo(AppInfo another) { 48 | return label.compareTo(another.label); 49 | } 50 | 51 | @Override 52 | public int hashCode() { 53 | return label.hashCode(); 54 | } 55 | 56 | @Override 57 | public boolean equals(Object other) { 58 | if (!(other instanceof AppInfo)) { 59 | return false; 60 | } 61 | AppInfo another = (AppInfo) other; 62 | return label.equals(another.label); 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /playground/android/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/android/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/android/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/android/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/android/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/android/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/android/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/android/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/android/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/android/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/android/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/android/app/src/main/java_zxing/com/google/zxing/client/result/WifiResultParser.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 | import com.google.zxing.Result; 20 | 21 | /** 22 | *

Parses a WIFI configuration string. Strings will be of the form:

23 | * 24 | *

{@code WIFI:T:[network type];S:[network SSID];P:[network password];H:[hidden?];;}

25 | * 26 | *

The fields can appear in any order. Only "S:" is required.

27 | * 28 | * @author Vikram Aggarwal 29 | * @author Sean Owen 30 | */ 31 | public final class WifiResultParser extends ResultParser { 32 | 33 | @Override 34 | public WifiParsedResult parse(Result result) { 35 | String rawText = getMassagedText(result); 36 | if (!rawText.startsWith("WIFI:")) { 37 | return null; 38 | } 39 | String ssid = matchSinglePrefixedField("S:", rawText, ';', false); 40 | if (ssid == null || ssid.isEmpty()) { 41 | return null; 42 | } 43 | String pass = matchSinglePrefixedField("P:", rawText, ';', false); 44 | String type = matchSinglePrefixedField("T:", rawText, ';', false); 45 | if (type == null) { 46 | type = "nopass"; 47 | } 48 | boolean hidden = Boolean.parseBoolean(matchSinglePrefixedField("H:", rawText, ';', false)); 49 | return new WifiParsedResult(type, ssid, pass, hidden); 50 | } 51 | } -------------------------------------------------------------------------------- /playground/android/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/android/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/android/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/android/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/android/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/android/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/android/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/android/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/android/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/android/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/android/app/src/main/java_zxing/com/google/zxing/oned/rss/FinderPattern.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 | import com.google.zxing.ResultPoint; 20 | 21 | public final class FinderPattern { 22 | 23 | private final int value; 24 | private final int[] startEnd; 25 | private final ResultPoint[] resultPoints; 26 | 27 | public FinderPattern(int value, int[] startEnd, int start, int end, int rowNumber) { 28 | this.value = value; 29 | this.startEnd = startEnd; 30 | this.resultPoints = new ResultPoint[] { 31 | new ResultPoint((float) start, (float) rowNumber), 32 | new ResultPoint((float) end, (float) rowNumber), 33 | }; 34 | } 35 | 36 | public int getValue() { 37 | return value; 38 | } 39 | 40 | public int[] getStartEnd() { 41 | return startEnd; 42 | } 43 | 44 | public ResultPoint[] getResultPoints() { 45 | return resultPoints; 46 | } 47 | 48 | @Override 49 | public boolean equals(Object o) { 50 | if(!(o instanceof FinderPattern)) { 51 | return false; 52 | } 53 | FinderPattern that = (FinderPattern) o; 54 | return value == that.value; 55 | } 56 | 57 | @Override 58 | public int hashCode() { 59 | return value; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /playground/android/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/android/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/android/app/src/main/java_zxing/com/google/zxing/oned/rss/expanded/decoders/AI01320xDecoder.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 AI01320xDecoder extends AI013x0xDecoder { 35 | 36 | AI01320xDecoder(BitArray information) { 37 | super(information); 38 | } 39 | 40 | @Override 41 | protected void addWeightCode(StringBuilder buf, int weight) { 42 | if (weight < 10000) { 43 | buf.append("(3202)"); 44 | } else { 45 | buf.append("(3203)"); 46 | } 47 | } 48 | 49 | @Override 50 | protected int checkWeight(int weight) { 51 | if(weight < 10000) { 52 | return weight; 53 | } 54 | return weight - 10000; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /playground/android/app/src/main/java_zxing/com/google/zxing/oned/rss/expanded/decoders/AnyAIDecoder.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.FormatException; 30 | import com.google.zxing.NotFoundException; 31 | import com.google.zxing.common.BitArray; 32 | 33 | /** 34 | * @author Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) 35 | * @author Eduardo Castillejo, University of Deusto (eduardo.castillejo@deusto.es) 36 | */ 37 | final class AnyAIDecoder extends AbstractExpandedDecoder { 38 | 39 | private static final int HEADER_SIZE = 2 + 1 + 2; 40 | 41 | AnyAIDecoder(BitArray information) { 42 | super(information); 43 | } 44 | 45 | @Override 46 | public String parseInformation() throws NotFoundException, FormatException { 47 | StringBuilder buf = new StringBuilder(); 48 | return this.getGeneralDecoder().decodeAllCodes(buf, HEADER_SIZE); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /playground/android/app/src/main/java_zxing/com/google/zxing/oned/rss/expanded/decoders/BlockParsedResult.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 BlockParsedResult { 34 | 35 | private final DecodedInformation decodedInformation; 36 | private final boolean finished; 37 | 38 | BlockParsedResult(boolean finished) { 39 | this(null, finished); 40 | } 41 | 42 | BlockParsedResult(DecodedInformation information, boolean finished) { 43 | this.finished = finished; 44 | this.decodedInformation = information; 45 | } 46 | 47 | DecodedInformation getDecodedInformation() { 48 | return this.decodedInformation; 49 | } 50 | 51 | boolean isFinished() { 52 | return this.finished; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /playground/android/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/android/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/android/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/android/app/src/main/java_zxing/com/google/zxing/pdf417/decoder/BarcodeMetadata.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.decoder; 18 | 19 | /** 20 | * @author Guenther Grau 21 | */ 22 | final class BarcodeMetadata { 23 | 24 | private final int columnCount; 25 | private final int errorCorrectionLevel; 26 | private final int rowCountUpperPart; 27 | private final int rowCountLowerPart; 28 | private final int rowCount; 29 | 30 | BarcodeMetadata(int columnCount, int rowCountUpperPart, int rowCountLowerPart, int errorCorrectionLevel) { 31 | this.columnCount = columnCount; 32 | this.errorCorrectionLevel = errorCorrectionLevel; 33 | this.rowCountUpperPart = rowCountUpperPart; 34 | this.rowCountLowerPart = rowCountLowerPart; 35 | this.rowCount = rowCountUpperPart + rowCountLowerPart; 36 | } 37 | 38 | int getColumnCount() { 39 | return columnCount; 40 | } 41 | 42 | int getErrorCorrectionLevel() { 43 | return errorCorrectionLevel; 44 | } 45 | 46 | int getRowCount() { 47 | return rowCount; 48 | } 49 | 50 | int getRowCountUpperPart() { 51 | return rowCountUpperPart; 52 | } 53 | 54 | int getRowCountLowerPart() { 55 | return rowCountLowerPart; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /playground/android/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/android/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/android/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/android/app/src/main/java_zxing/com/google/zxing/qrcode/decoder/ErrorCorrectionLevel.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.decoder; 18 | 19 | /** 20 | *

See ISO 18004:2006, 6.5.1. This enum encapsulates the four error correction levels 21 | * defined by the QR code standard.

22 | * 23 | * @author Sean Owen 24 | */ 25 | public enum ErrorCorrectionLevel { 26 | 27 | /** L = ~7% correction */ 28 | L(0x01), 29 | /** M = ~15% correction */ 30 | M(0x00), 31 | /** Q = ~25% correction */ 32 | Q(0x03), 33 | /** H = ~30% correction */ 34 | H(0x02); 35 | 36 | private static final ErrorCorrectionLevel[] FOR_BITS = {M, L, H, Q}; 37 | 38 | private final int bits; 39 | 40 | ErrorCorrectionLevel(int bits) { 41 | this.bits = bits; 42 | } 43 | 44 | public int getBits() { 45 | return bits; 46 | } 47 | 48 | /** 49 | * @param bits int containing the two bits encoding a QR Code's error correction level 50 | * @return ErrorCorrectionLevel representing the encoded error correction level 51 | */ 52 | public static ErrorCorrectionLevel forBits(int bits) { 53 | if (bits < 0 || bits >= FOR_BITS.length) { 54 | throw new IllegalArgumentException(); 55 | } 56 | return FOR_BITS[bits]; 57 | } 58 | 59 | 60 | } 61 | -------------------------------------------------------------------------------- /playground/android/app/src/main/java_zxing/com/google/zxing/qrcode/decoder/QRCodeDecoderMetaData.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.qrcode.decoder; 18 | 19 | import com.google.zxing.ResultPoint; 20 | 21 | /** 22 | * Meta-data container for QR Code decoding. Instances of this class may be used to convey information back to the 23 | * decoding caller. Callers are expected to process this. 24 | * 25 | * @see com.google.zxing.common.DecoderResult#getOther() 26 | */ 27 | public final class QRCodeDecoderMetaData { 28 | 29 | private final boolean mirrored; 30 | 31 | QRCodeDecoderMetaData(boolean mirrored) { 32 | this.mirrored = mirrored; 33 | } 34 | 35 | /** 36 | * @return true if the QR Code was mirrored. 37 | */ 38 | public boolean isMirrored() { 39 | return mirrored; 40 | } 41 | 42 | /** 43 | * Apply the result points' order correction due to mirroring. 44 | * 45 | * @param points Array of points to apply mirror correction to. 46 | */ 47 | public void applyMirroredCorrection(ResultPoint[] points) { 48 | if (!mirrored || points == null || points.length < 3) { 49 | return; 50 | } 51 | ResultPoint bottomLeft = points[0]; 52 | points[0] = points[2]; 53 | points[2] = bottomLeft; 54 | // No need to 'fix' top-left and alignment pattern. 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /playground/android/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/android/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/android/app/src/main/res/drawable-v21/ic_menu_camera.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/drawable-v21/ic_menu_gallery.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/drawable-v21/ic_menu_manage.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/drawable-v21/ic_menu_send.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/drawable-v21/ic_menu_share.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/drawable-v21/ic_menu_slideshow.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/drawable-xhdpi/ic_action_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/android/app/src/main/res/drawable-xhdpi/ic_action_refresh.png -------------------------------------------------------------------------------- /playground/android/app/src/main/res/drawable-xhdpi/ic_action_scan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/android/app/src/main/res/drawable-xhdpi/ic_action_scan.png -------------------------------------------------------------------------------- /playground/android/app/src/main/res/drawable-xxhdpi/ic_action_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/android/app/src/main/res/drawable-xxhdpi/ic_action_refresh.png -------------------------------------------------------------------------------- /playground/android/app/src/main/res/drawable-xxhdpi/ic_action_scan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/android/app/src/main/res/drawable-xxhdpi/ic_action_scan.png -------------------------------------------------------------------------------- /playground/android/app/src/main/res/drawable/side_nav_bar.xml: -------------------------------------------------------------------------------- 1 | 3 | 9 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/layout/activity_dynamic.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/layout/activity_index.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/layout/activity_splash.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 18 | 19 | -------------------------------------------------------------------------------- /playground/android/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/android/app/src/main/res/layout/app_picker_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 22 | 23 | 29 | 30 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/layout/bookmark_picker_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 24 | 30 | 31 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/layout/camera.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 11 | 12 | 17 | 18 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/layout/catalog_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/layout/content_dynamic.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 16 | 24 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/layout/content_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/layout/content_wx_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 13 | 14 | 17 | 24 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/layout/help.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/layout/history_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 24 | 30 | 31 | 37 | 38 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/layout/search_book_contents_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 25 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/layout/search_book_contents_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 24 | 32 | 33 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/menu/capture.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 23 | 28 | 38 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/menu/encode.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 23 | 28 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/menu/history.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 23 | 28 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/menu/main_scan.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/menu/refresh.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /playground/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /playground/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /playground/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /playground/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /playground/android/app/src/main/res/raw/beep.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/android/app/src/main/res/raw/beep.ogg -------------------------------------------------------------------------------- /playground/android/app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | > 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | #66000000 8 | 9 | -------------------------------------------------------------------------------- /playground/android/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/android/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/android/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/android/app/src/main/res/values/scan_code_dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 8dip 19 | 4dip 20 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/values/scan_code_ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /playground/android/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/android/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 17 | support arm architecture devices! 18 | 19 | 20 | Network Error!\n1.Make sure you use the command "npm run serve" 21 | launched local service\n2.Make sure you modify "your_current_ip" to your local IP in 22 | "WXMainActivity" 23 | 24 | DynamicActivity 25 | 26 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 | 27 | 28 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 24 | 25 | -------------------------------------------------------------------------------- /playground/android/app/src/test/java/org/weex/demo/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.demo; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /playground/android/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 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.2.3' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | jcenter() 18 | // maven { url 'http://mvnrepo.alibaba-inc.com/mvn/repository' } 19 | // maven { url 'http://mvnrepo.alibaba-inc.com/mvn/snapshots'} 20 | } 21 | } 22 | 23 | task clean(type: Delete) { 24 | delete rootProject.buildDir 25 | } 26 | 27 | ext { 28 | androidSupportVersion = "25.2.0" 29 | weex_sdk = "0.10.0" 30 | } 31 | -------------------------------------------------------------------------------- /playground/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /playground/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /playground/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 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-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /playground/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | include ":library" 4 | project (':library').projectDir = new File("../../android/library") -------------------------------------------------------------------------------- /playground/browser/index-vue.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Weex Vue Demo 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /playground/browser/pluginInstall.js: -------------------------------------------------------------------------------- 1 | if(window.Weex){ 2 | Weex.install(require("../../js/src/gcanvas").htmlPlugin); 3 | } 4 | else if(window.weex){ 5 | weex.install(require("../../js/src/gcanvas").htmlPlugin); 6 | } 7 | -------------------------------------------------------------------------------- /playground/browser/weex-vue-render/README.md: -------------------------------------------------------------------------------- 1 | # Vue Components for Weex 2 | 3 | This is a group of Vue 2.x components for Weex, which have the same behavior with the Weex built-in components on the native. 4 | 5 | It can be run on browser only based on Vue 2.x (without Weex). 6 | -------------------------------------------------------------------------------- /playground/browser/weex-vue-render/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "weex-vue-render", 3 | "version": "0.2.0", 4 | "description": "Weex built-in components for Vue 2.x.", 5 | "license": "Apache-2.0", 6 | "main": "index.js", 7 | "repository": { 8 | "type": "git", 9 | "url": "git@github.com:alibaba/weex.git" 10 | }, 11 | "homepage": "http://alibaba.github.io/weex/", 12 | "bugs": { 13 | "url": "https://github.com/alibaba/weex/issues" 14 | }, 15 | "keywords": [ 16 | "weex", 17 | "vue", 18 | "web", 19 | "component" 20 | ], 21 | "peerDependencies": { 22 | "vue": "^2.1.5" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /playground/ios/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | platform :ios, '7.0' 3 | #inhibit_all_warnings! 4 | 5 | def common 6 | pod 'WeexSDK' 7 | pod 'WXDevtool', '0.9.5' 8 | pod 'SDWebImage', '3.7.5' 9 | pod 'SocketRocket', '0.4.2' 10 | pod 'ATSDK-Weex', '0.0.1' 11 | pod 'WeexGcanvas', :path=>'../../' 12 | pod 'WeexPluginLoader' 13 | pod 'GCanvas' 14 | end 15 | 16 | target 'WeexDemo' do 17 | common 18 | end 19 | 20 | -------------------------------------------------------------------------------- /playground/ios/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/README.md -------------------------------------------------------------------------------- /playground/ios/WeexDemo.xcodeproj/xcuserdata/jerry.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | WeexDemo.xcscheme 8 | 9 | orderHint 10 | 4 11 | 12 | WeexUITestDemo.xcscheme 13 | 14 | orderHint 15 | 5 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 775BEE7A1C1E8ECC008D1629 21 | 22 | primary 23 | 24 | 25 | 775BEE931C1E8ECC008D1629 26 | 27 | primary 28 | 29 | 30 | 84361D261CA10F8E00F43825 31 | 32 | primary 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /playground/ios/WeexDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /playground/ios/WeexDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (strong, nonatomic) UIWindow *window; 15 | @property (strong, nonatomic) NSString *latestVer; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-29.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-29@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-29@2x-1.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-29@2x.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-29@3x.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40@2x-1.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-76.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default-4.7@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default-4.7@2x.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x-1.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default@2x-1.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default@2x.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default@3x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default@3x-1.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default@3x.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/back.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "back.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "back@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "back@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/back.imageset/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/back.imageset/back.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/back.imageset/back@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/back.imageset/back@2x.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/back.imageset/back@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/back.imageset/back@3x.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/reload.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "reload.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "reload@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "reload@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/reload.imageset/reload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/reload.imageset/reload.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/reload.imageset/reload@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/reload.imageset/reload@2x.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/reload.imageset/reload@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/reload.imageset/reload@3x.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/scan.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "scan.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "scan@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "scan@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/scan.imageset/scan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/scan.imageset/scan.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/scan.imageset/scan@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/scan.imageset/scan@2x.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Assets.xcassets/scan.imageset/scan@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/Assets.xcassets/scan.imageset/scan@3x.png -------------------------------------------------------------------------------- /playground/ios/WeexDemo/DemoBaseViewController.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | 11 | @interface DemoBaseViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /playground/ios/WeexDemo/DemoBaseViewController.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import "DemoBaseViewController.h" 10 | #import "UIViewController+WXDemoNaviBar.h" 11 | 12 | @interface DemoBaseViewController () 13 | 14 | @end 15 | 16 | @implementation DemoBaseViewController 17 | 18 | - (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 19 | { 20 | return [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 21 | } 22 | 23 | - (void)viewDidLoad { 24 | [super viewDidLoad]; 25 | // Do any additional setup after loading the view. 26 | [self setupNaviBar]; 27 | } 28 | 29 | - (void)didReceiveMemoryWarning { 30 | [super didReceiveMemoryWarning]; 31 | // Dispose of any resources that can be recreated. 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /playground/ios/WeexDemo/DemoDefine.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | 11 | #define CURRENT_IP [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"localServer-ip" ofType:@".txt"] encoding:NSUTF8StringEncoding error:nil] 12 | 13 | #if TARGET_IPHONE_SIMULATOR 14 | #define DEMO_HOST @"127.0.0.1" 15 | #else 16 | #define DEMO_HOST CURRENT_IP 17 | #endif 18 | 19 | #define DEMO_URL(path) [NSString stringWithFormat:@"http://%@:12580/%s", DEMO_HOST, #path] 20 | 21 | #define HOME_URL [NSString stringWithFormat:@"http://%@:12580/examples/build/index.js", DEMO_HOST] 22 | 23 | #define BUNDLE_URL [NSString stringWithFormat:@"file://%@/bundlejs/index.js",[NSBundle mainBundle].bundlePath] 24 | 25 | #define UITEST_HOME_URL @"http://test?_wx_tpl=http://localhost:12580/test/build/TC__Home.js" 26 | 27 | #define QRSCAN @"com.taobao.WeexDemo.scan" 28 | #define WEEX_COLOR [UIColor colorWithRed:0.27 green:0.71 blue:0.94 alpha:1] 29 | -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Images.xcassets/Brand Assets.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "minimum-system-version" : "7.0", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "orientation" : "portrait", 11 | "idiom" : "iphone", 12 | "minimum-system-version" : "7.0", 13 | "subtype" : "retina4", 14 | "scale" : "2x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /playground/ios/WeexDemo/Scanner/WXScannerVC.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | #import 11 | 12 | @interface WXScannerVC : UIViewController 13 | 14 | @end -------------------------------------------------------------------------------- /playground/ios/WeexDemo/UIView+UIThreadCheck.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | 11 | @interface UIView (UIThreadCheck) 12 | 13 | + (void)wx_checkUIThread; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /playground/ios/WeexDemo/UIView+UIThreadCheck.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import "UIView+UIThreadCheck.h" 10 | #import 11 | 12 | #define WXCheckUIThread() NSAssert([NSThread isMainThread], \ 13 | @"You can not change UI on main thread!") 14 | 15 | @implementation UIView (UIThreadCheck) 16 | 17 | + (void)wx_checkUIThread 18 | { 19 | [self weex_swizzle:[self class] Method:@selector(setNeedsLayout) withMethod:@selector(wx_setNeedsLayout)]; 20 | [self weex_swizzle:[self class] Method:@selector(setNeedsDisplay) withMethod:@selector(wx_setNeedsDisplay)]; 21 | [self weex_swizzle:[self class] Method:@selector(setNeedsDisplayInRect:) withMethod:@selector(wx_setNeedsDisplayInRect:)]; 22 | } 23 | 24 | - (void)wx_setNeedsLayout 25 | { 26 | WXCheckUIThread(); 27 | [self wx_setNeedsLayout]; 28 | } 29 | 30 | - (void)wx_setNeedsDisplay 31 | { 32 | WXCheckUIThread(); 33 | [self wx_setNeedsDisplay]; 34 | } 35 | 36 | - (void)wx_setNeedsDisplayInRect:(CGRect)rect 37 | { 38 | WXCheckUIThread(); 39 | [self wx_setNeedsDisplayInRect:rect]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /playground/ios/WeexDemo/UIViewController+WXDemoNaviBar.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | #import "DemoDefine.h" 11 | 12 | @interface UIViewController (WXDemoNaviBar) 13 | 14 | /** 15 | * back button click action 16 | * @param sender responder 17 | */ 18 | - (void)backButtonClicked:(id)sender; 19 | 20 | - (void)setupNaviBar; 21 | 22 | @end 23 | 24 | -------------------------------------------------------------------------------- /playground/ios/WeexDemo/WXDemoViewController.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | #import 11 | 12 | @interface WXDemoViewController : UIViewController 13 | 14 | @property (nonatomic, strong) NSString *script; 15 | @property (nonatomic, strong) NSURL *url; 16 | 17 | @property (nonatomic, strong) SRWebSocket *hotReloadSocket; 18 | @property (nonatomic, strong) NSString *source; 19 | 20 | @end 21 | 22 | -------------------------------------------------------------------------------- /playground/ios/WeexDemo/WXSyncTestModule.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | #import 11 | 12 | @interface WXSyncTestModule : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /playground/ios/WeexDemo/WXSyncTestModule.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import "WXSyncTestModule.h" 10 | 11 | @implementation WXSyncTestModule 12 | 13 | WX_EXPORT_METHOD_SYNC(@selector(getString)) 14 | WX_EXPORT_METHOD_SYNC(@selector(getNumber)) 15 | WX_EXPORT_METHOD_SYNC(@selector(getArray)) 16 | WX_EXPORT_METHOD_SYNC(@selector(getObject)) 17 | 18 | - (NSString *)getString 19 | { 20 | return @"testString"; 21 | } 22 | 23 | - (NSUInteger)getNumber 24 | { 25 | return 111111; 26 | } 27 | 28 | - (NSArray *)getArray 29 | { 30 | return @[@(111111),@"testString",@"testString2"]; 31 | } 32 | 33 | - (NSDictionary *)getObject 34 | { 35 | return @{@"number":@(111111), @"string1":@"testString",@"string2":@"testString2"}; 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /playground/ios/WeexDemo/debug/WXATLoggerPlugin.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | #import 11 | 12 | @interface WXATLoggerPlugin : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /playground/ios/WeexDemo/debug/WXATLoggerPlugin.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import "WXATLoggerPlugin.h" 10 | #import 11 | 12 | @implementation WXATLoggerPlugin 13 | 14 | - (void)pluginDidLoadWithArgs:(NSArray *)args 15 | { 16 | 17 | } 18 | 19 | - (void)pluginWillOpenInContainer:(UIViewController *)container withArg:(NSArray *)args 20 | { 21 | NSURL *URL = [NSURL URLWithString:@"http://127.0.0.1:8687/launchDebugger"]; 22 | NSURLRequest *request = [NSURLRequest requestWithURL:URL]; 23 | 24 | NSURLSession *session = [NSURLSession sharedSession]; 25 | NSURLSessionDataTask *task = [session dataTaskWithRequest:request 26 | completionHandler: 27 | ^(NSData *data, NSURLResponse *response, NSError *error) { 28 | // ... 29 | }]; 30 | 31 | [task resume]; 32 | 33 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 34 | [WXSDKEngine connectDebugServer:@"ws://127.0.0.1:8687/debugger/0/renderer"]; 35 | }); 36 | } 37 | 38 | - (void)pluginWillClose 39 | { 40 | 41 | } 42 | 43 | - (void)pluginDidUnload 44 | { 45 | 46 | } 47 | 48 | - (CGRect)wantReactArea 49 | { 50 | return CGRectZero; 51 | } 52 | 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /playground/ios/WeexDemo/debug/WXATViewHierarchyPlugin.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | //#import 10 | //#import 11 | // 12 | //@interface WXATViewHierarchyPlugin : NSObject 13 | // 14 | //@end 15 | -------------------------------------------------------------------------------- /playground/ios/WeexDemo/debug/WXATViewHierarchyPlugin.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | //#import "WXATViewHierarchyPlugin.h" 10 | //#import 11 | // 12 | //@implementation WXATViewHierarchyPlugin 13 | //{ 14 | // WXViewHierarchy *_hierarchy; 15 | //} 16 | // 17 | //- (void)pluginDidLoadWithArgs:(NSArray *)args 18 | //{ 19 | // _hierarchy = [[WXViewHierarchy alloc] init]; 20 | // _hierarchy.hidden = YES; 21 | //} 22 | // 23 | //- (void)pluginWillOpenInContainer:(UIViewController *)container withArg:(NSArray *)args 24 | //{ 25 | // [_hierarchy show]; 26 | //} 27 | // 28 | //- (void)pluginWillClose 29 | //{ 30 | // [_hierarchy hide]; 31 | //} 32 | // 33 | //- (void)pluginDidUnload 34 | //{ 35 | // _hierarchy = nil; 36 | //} 37 | // 38 | //- (CGRect)wantReactArea 39 | //{ 40 | // return CGRectZero; 41 | //} 42 | // 43 | //@end 44 | -------------------------------------------------------------------------------- /playground/ios/WeexDemo/extend/component/WXSelectComponent.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | #import 11 | 12 | @interface WXSelectComponent : WXComponent 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /playground/ios/WeexDemo/extend/handler/WXImgLoaderDefaultImpl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | #import 11 | 12 | @interface WXImgLoaderDefaultImpl : NSObject 13 | @end 14 | -------------------------------------------------------------------------------- /playground/ios/WeexDemo/extend/handler/WXImgLoaderDefaultImpl.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import "WXImgLoaderDefaultImpl.h" 10 | #import 11 | 12 | #define MIN_IMAGE_WIDTH 36 13 | #define MIN_IMAGE_HEIGHT 36 14 | 15 | #if OS_OBJECT_USE_OBJC 16 | #undef WXDispatchQueueRelease 17 | #undef WXDispatchQueueSetterSementics 18 | #define WXDispatchQueueRelease(q) 19 | #define WXDispatchQueueSetterSementics strong 20 | #else 21 | #undef WXDispatchQueueRelease 22 | #undef WXDispatchQueueSetterSementics 23 | #define WXDispatchQueueRelease(q) (dispatch_release(q)) 24 | #define WXDispatchQueueSetterSementics assign 25 | #endif 26 | 27 | @interface WXImgLoaderDefaultImpl() 28 | 29 | @property (WXDispatchQueueSetterSementics, nonatomic) dispatch_queue_t ioQueue; 30 | 31 | @end 32 | 33 | @implementation WXImgLoaderDefaultImpl 34 | 35 | #pragma mark - 36 | #pragma mark WXImgLoaderProtocol 37 | 38 | - (id)downloadImageWithURL:(NSString *)url imageFrame:(CGRect)imageFrame userInfo:(NSDictionary *)userInfo completed:(void(^)(UIImage *image, NSError *error, BOOL finished))completedBlock 39 | { 40 | if ([url hasPrefix:@"//"]) { 41 | url = [@"http:" stringByAppendingString:url]; 42 | } 43 | return (id)[[SDWebImageManager sharedManager] downloadImageWithURL:[NSURL URLWithString:url] options:0 progress:^(NSInteger receivedSize, NSInteger expectedSize) { 44 | 45 | } completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { 46 | if (completedBlock) { 47 | completedBlock(image, error, finished); 48 | } 49 | }]; 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /playground/ios/WeexDemo/extend/module/WXEventModule.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | @interface WXEventModule : NSObject 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /playground/ios/WeexDemo/extend/module/WXEventModule.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import "WXEventModule.h" 10 | #import "WXDemoViewController.h" 11 | #import 12 | 13 | @implementation WXEventModule 14 | 15 | @synthesize weexInstance; 16 | 17 | WX_EXPORT_METHOD(@selector(openURL:)) 18 | 19 | - (void)openURL:(NSString *)url 20 | { 21 | NSString *newURL = url; 22 | if ([url hasPrefix:@"//"]) { 23 | newURL = [NSString stringWithFormat:@"http:%@", url]; 24 | } else if (![url hasPrefix:@"http"]) { 25 | // relative path 26 | newURL = [NSURL URLWithString:url relativeToURL:weexInstance.scriptURL].absoluteString; 27 | } 28 | 29 | UIViewController *controller = [[WXDemoViewController alloc] init]; 30 | ((WXDemoViewController *)controller).url = [NSURL URLWithString:newURL]; 31 | 32 | [[weexInstance.viewController navigationController] pushViewController:controller animated:YES]; 33 | } 34 | 35 | @end 36 | 37 | -------------------------------------------------------------------------------- /playground/ios/WeexDemo/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /playground/ios/WeexDemo/weex-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/WeexDemo/weex-icon.png -------------------------------------------------------------------------------- /playground/ios/WeexDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSLocationWhenInUseUsageDescription 6 | $(PRODUCT_NAME) will access your location 7 | NSCameraUsageDescription 8 | $(PRODUCT_NAME) will access your camera 9 | CFBundleDevelopmentRegion 10 | en 11 | CFBundleExecutable 12 | $(EXECUTABLE_NAME) 13 | CFBundleIdentifier 14 | $(PRODUCT_BUNDLE_IDENTIFIER) 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | $(PRODUCT_NAME) 19 | CFBundlePackageType 20 | BNDL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1 27 | 28 | 29 | -------------------------------------------------------------------------------- /playground/ios/WeexDemoTests/WeexDemoTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | 11 | @interface WeexDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation WeexDemoTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /playground/ios/WeexUITestDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 99.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 10000 23 | LSRequiresIPhoneOS 24 | 25 | NSAppTransportSecurity 26 | 27 | NSAllowsArbitraryLoads 28 | 29 | 30 | UILaunchStoryboardName 31 | LaunchScreen 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UIStatusBarStyle 37 | UIStatusBarStyleLightContent 38 | UISupportedInterfaceOrientations 39 | 40 | UIInterfaceOrientationPortrait 41 | 42 | UISupportedInterfaceOrientations~ipad 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | UIViewControllerBasedStatusBarAppearance 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /playground/ios/WeexUITestDemoUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /playground/ios/WeexUITestDemoUITests/WeexUITestDemoUITests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | 11 | @interface WeexUITestDemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation WeexUITestDemoUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /playground/ios/weex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/weex.png -------------------------------------------------------------------------------- /playground/ios/weex@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/playground/ios/weex@2x.png -------------------------------------------------------------------------------- /screenshot/device-2017-04-19-174713.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/Gcanvas-For-Apache-weex/82f677bd9d7ef2d462b77ef7a1e74df7a0eefcc6/screenshot/device-2017-04-19-174713.png -------------------------------------------------------------------------------- /start: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # called by native 3 | THIS_DIR=$(dirname "$0") 4 | pushd "$THIS_DIR" 5 | 6 | npm run build 7 | npm run serve & 8 | npm run dev:examples 9 | 10 | popd 11 | -------------------------------------------------------------------------------- /start-web: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # called by native 3 | THIS_DIR=$(dirname "$0") 4 | pushd "$THIS_DIR" 5 | 6 | npm run build 7 | npm run serve & 8 | npm run dev:examples:web 9 | 10 | popd 11 | --------------------------------------------------------------------------------