diff --git a/1224/qrcode-generator.md b/1224/qrcode-generator.md new file mode 100644 index 0000000000000000000000000000000000000000..665a2918ba32d2943fb24942115f852d0e635000 --- /dev/null +++ b/1224/qrcode-generator.md @@ -0,0 +1,159 @@ +> 模板版本:v0.1.3 + +

+

qrcode-generator

+

+

+ + License + +

+ +> [!tip] [Github 地址](https://github.com/kazuhikoarase/qrcode-generator) + +## 安装与使用 + + + +进入到工程目录并输入以下命令: + +#### **npm** + +```bash +npm install qrcode-generator@1.4.4 +``` + +#### **yarn** + +```bash +yarn add qrcode-generator@1.4.4 +``` + +快速使用: + +```js +import React,{useState,useEffect} from "react"; +import{View,Text,Image} from "react-native" +import QRCode from 'qrcode-generator' + +export const CustomQrCode = ({text,style}) => { + const [base64Img,setBase64Img] = useState('hello word') + useEffect(() => { + const typeNumber = 4 + const errorCorrectionLevel = 'L' + const qr = QRCode(typeNumber,errorCorrectionLevel) + qr.addData(text) + qr.make() + setBase64Img(qr.createDataURL(4,10)) + },[text]) + + return( + base64Img ? : null + ) +} +``` + +约束与限制 +------------------------------------------------------------------------------------------------------------------------------- + +### 兼容性 + +在下述版本验证通过: + +1. RNOH:0.72.13; SDK:HarmonyOS NEXT Developer Preview1; IDE:DevEco Studio 4.1.3.500; ROM:2.0.0.59; + +API列表 +------------------------------------------------------------------------------------------------------- + +**以下 `QRCode` 均为qrcode-generator导出的对象,即:** + +```js +import QRCode from 'qrcode-generator'; +``` + +#### Base + +**静态方法** + +"HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 + + + +| Name | Description | Type | Required | HarmonyOS Support | +| --------------------------------------- | ----------------------- | -------- | -------- | ----------------- | +| QRCode(typeNumber,errorCorrectionLevel) | Create a QRCode Object. | function | Yes | Yes | + +**api** + +| Name | Description | Type | Required | HarmonyOS Support | +| -------------------- | ---------------------------------------------- | ------ | -------- | ----------------- | +| typeNumber | Type number (1 ~ 40), or 0 for auto detection. | number | Yes | Yes | +| errorCorrectionLevel | Error correction level ('L', 'M', 'Q', 'H') | string | Yes | Yes | + +**静态方法** + +| Name | Description | Type | Required | HarmonyOS Support | +| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | ----------------- | +| QRCode.stringToBytes(s) | Encodes a string into an array of number(byte) using any charset. This function is used by internal. Overwrite this function to encode using a multibyte charset. | function | Yes | Yes | + +api + +| Name | Description | Type | Required | HarmonyOS Support | +| ---- | ---------------- | ------ | -------- | ----------------- | +| s | string to encode | string | Yes | Yes | + +**静态方法** + +| Name | Description | Type | Required | HarmonyOS Support | +| ------------------------- | --------------------- | -------- | -------- | ----------------- | +| QRCode.addData(data,mode) | Add a data to encode. | function | Yes | Yes | + +api + +| Name | Description | Type | Required | HarmonyOS Support | +| ---- | ---------------------------------------------------------- | ------ | -------- | ----------------- | +| data | string to encode | string | Yes | Yes | +| mode | Mode ('Numeric', 'Alphanumeric', 'Byte'(default), 'Kanji') | Yes | | | + +**静态方法** + +| Name | Description | Type | Required | HarmonyOS Support | +| ----------------------- | ------------------------------------------------------------------------------------------- | -------- | -------- | ----------------- | +| QRCode.make() | Make a QR Code. | function | Yes | Yes | +| QRCode.getModuleCount() | The number of modules(cells) for each orientation. [Note] call make() before this function. | function | Yes | Yes | +| QRCode.isDark(row,col) | The module at row and col is dark or not. [Note] call make() before this function. | function | Yes | Yes | + +**api** + +| Name | Description | Type | Required | HarmonyOS Support | +| ---- | ------------------- | ------ | -------- | ----------------- | +| row | 0 ~ moduleCount - 1 | number | Yes | Yes | +| col | 0 ~ moduleCount - 1 | number | Yes | Yes | + + + +**静态方法** + +| Name | Description | Type | Required | HarmonyOS Support | +| ----------------------------------------- | ------------------------------------------------------------------------------------------------------ | -------- | -------- | ----------------- | +| QRCode.createDataURL(cellSize, margin) | Generate base64 links,Helper functions for HTML. [Note] call make() before these functions. | function | Yes | Yes | +| QRCode.createImgTag(cellSize, margin,alt) | Generate img tag QR code,Helper functions for HTML. [Note] call make() before these functions. | function | Yes | Yes | +| QRCode.createSvgTag(cellSize, margin) | Generate QR codes for svg tags,Helper functions for HTML. [Note] call make() before these functions. | function | Yes | Yes | +| QRCode.createTableTag(cellSize, margin) | Generate QR codes for table tags,Helper functions for HTML. [Note] call make() before these functions. | function | Yes | Yes | +| QRCode.createASCII(cellSize, margin) | Generate ASCII code,Helper functions for HTML. [Note] call make() before these functions. | function | Yes | Yes | + +**api** + +| Name | Description | Type | Required | HarmonyOS Support | +| -------- | --------------------- | -------- | -------- | ----------------- | +| cellSize | default: 2 | function | No | Yes | +| margin | default: cellSize * 4 | function | No | Yes | +| alt | (optional) | function | No | Yes | + +## 遗留问题 + +## 其他 + +## 开源协议 + +本项目基于 [The MIT License (MIT)](https://github.com/facebook/prop-types/blob/v15.8.1/LICENSE) ,请自由地享受和参与开源。 diff --git a/zh-cn/qrcode-generator.md b/zh-cn/qrcode-generator.md new file mode 100644 index 0000000000000000000000000000000000000000..665a2918ba32d2943fb24942115f852d0e635000 --- /dev/null +++ b/zh-cn/qrcode-generator.md @@ -0,0 +1,159 @@ +> 模板版本:v0.1.3 + +

+

qrcode-generator

+

+

+ + License + +

+ +> [!tip] [Github 地址](https://github.com/kazuhikoarase/qrcode-generator) + +## 安装与使用 + + + +进入到工程目录并输入以下命令: + +#### **npm** + +```bash +npm install qrcode-generator@1.4.4 +``` + +#### **yarn** + +```bash +yarn add qrcode-generator@1.4.4 +``` + +快速使用: + +```js +import React,{useState,useEffect} from "react"; +import{View,Text,Image} from "react-native" +import QRCode from 'qrcode-generator' + +export const CustomQrCode = ({text,style}) => { + const [base64Img,setBase64Img] = useState('hello word') + useEffect(() => { + const typeNumber = 4 + const errorCorrectionLevel = 'L' + const qr = QRCode(typeNumber,errorCorrectionLevel) + qr.addData(text) + qr.make() + setBase64Img(qr.createDataURL(4,10)) + },[text]) + + return( + base64Img ? : null + ) +} +``` + +约束与限制 +------------------------------------------------------------------------------------------------------------------------------- + +### 兼容性 + +在下述版本验证通过: + +1. RNOH:0.72.13; SDK:HarmonyOS NEXT Developer Preview1; IDE:DevEco Studio 4.1.3.500; ROM:2.0.0.59; + +API列表 +------------------------------------------------------------------------------------------------------- + +**以下 `QRCode` 均为qrcode-generator导出的对象,即:** + +```js +import QRCode from 'qrcode-generator'; +``` + +#### Base + +**静态方法** + +"HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 + + + +| Name | Description | Type | Required | HarmonyOS Support | +| --------------------------------------- | ----------------------- | -------- | -------- | ----------------- | +| QRCode(typeNumber,errorCorrectionLevel) | Create a QRCode Object. | function | Yes | Yes | + +**api** + +| Name | Description | Type | Required | HarmonyOS Support | +| -------------------- | ---------------------------------------------- | ------ | -------- | ----------------- | +| typeNumber | Type number (1 ~ 40), or 0 for auto detection. | number | Yes | Yes | +| errorCorrectionLevel | Error correction level ('L', 'M', 'Q', 'H') | string | Yes | Yes | + +**静态方法** + +| Name | Description | Type | Required | HarmonyOS Support | +| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | ----------------- | +| QRCode.stringToBytes(s) | Encodes a string into an array of number(byte) using any charset. This function is used by internal. Overwrite this function to encode using a multibyte charset. | function | Yes | Yes | + +api + +| Name | Description | Type | Required | HarmonyOS Support | +| ---- | ---------------- | ------ | -------- | ----------------- | +| s | string to encode | string | Yes | Yes | + +**静态方法** + +| Name | Description | Type | Required | HarmonyOS Support | +| ------------------------- | --------------------- | -------- | -------- | ----------------- | +| QRCode.addData(data,mode) | Add a data to encode. | function | Yes | Yes | + +api + +| Name | Description | Type | Required | HarmonyOS Support | +| ---- | ---------------------------------------------------------- | ------ | -------- | ----------------- | +| data | string to encode | string | Yes | Yes | +| mode | Mode ('Numeric', 'Alphanumeric', 'Byte'(default), 'Kanji') | Yes | | | + +**静态方法** + +| Name | Description | Type | Required | HarmonyOS Support | +| ----------------------- | ------------------------------------------------------------------------------------------- | -------- | -------- | ----------------- | +| QRCode.make() | Make a QR Code. | function | Yes | Yes | +| QRCode.getModuleCount() | The number of modules(cells) for each orientation. [Note] call make() before this function. | function | Yes | Yes | +| QRCode.isDark(row,col) | The module at row and col is dark or not. [Note] call make() before this function. | function | Yes | Yes | + +**api** + +| Name | Description | Type | Required | HarmonyOS Support | +| ---- | ------------------- | ------ | -------- | ----------------- | +| row | 0 ~ moduleCount - 1 | number | Yes | Yes | +| col | 0 ~ moduleCount - 1 | number | Yes | Yes | + + + +**静态方法** + +| Name | Description | Type | Required | HarmonyOS Support | +| ----------------------------------------- | ------------------------------------------------------------------------------------------------------ | -------- | -------- | ----------------- | +| QRCode.createDataURL(cellSize, margin) | Generate base64 links,Helper functions for HTML. [Note] call make() before these functions. | function | Yes | Yes | +| QRCode.createImgTag(cellSize, margin,alt) | Generate img tag QR code,Helper functions for HTML. [Note] call make() before these functions. | function | Yes | Yes | +| QRCode.createSvgTag(cellSize, margin) | Generate QR codes for svg tags,Helper functions for HTML. [Note] call make() before these functions. | function | Yes | Yes | +| QRCode.createTableTag(cellSize, margin) | Generate QR codes for table tags,Helper functions for HTML. [Note] call make() before these functions. | function | Yes | Yes | +| QRCode.createASCII(cellSize, margin) | Generate ASCII code,Helper functions for HTML. [Note] call make() before these functions. | function | Yes | Yes | + +**api** + +| Name | Description | Type | Required | HarmonyOS Support | +| -------- | --------------------- | -------- | -------- | ----------------- | +| cellSize | default: 2 | function | No | Yes | +| margin | default: cellSize * 4 | function | No | Yes | +| alt | (optional) | function | No | Yes | + +## 遗留问题 + +## 其他 + +## 开源协议 + +本项目基于 [The MIT License (MIT)](https://github.com/facebook/prop-types/blob/v15.8.1/LICENSE) ,请自由地享受和参与开源。 diff --git a/zh-cn/react-native-image-viewing.md b/zh-cn/react-native-image-viewing.md new file mode 100644 index 0000000000000000000000000000000000000000..d5234327fde9330e75779b2ebe5b6fcffad44aa3 --- /dev/null +++ b/zh-cn/react-native-image-viewing.md @@ -0,0 +1,96 @@ +> 模板版本:v0.1.2 + +

+

react-native-image-viewing

+

+

+ + License + +

+ +> [!tip] [Github 地址][https://github.com/jobtoday/react-native-image-viewing] + +## 安装与使用 + + + +进入到工程目录并输入以下命令: + +#### **npm** + +```bash +npm install react-native-image-viewing@0.2.2 +``` + +#### **yarn** + +```bash +yarn add react-native-image-viewing@0.2.2 +``` + +快速使用: + +```js +import ImageView from "react-native-image-viewing"; + +const images = [ + { + uri: "https://images.unsplash.com/photo-1571501679680-de32f1e7aad4", + }, + { + uri: "https://images.unsplash.com/photo-1573273787173-0eb81a833b34", + }, + { + uri: "https://images.unsplash.com/photo-1569569970363-df7b6160d111", + }, +]; + +const [visible, setIsVisible] = useState(false); + + setIsVisible(false)} +/> +``` + +约束与限制 +------------------------------------------------------------------------------------------------------------------------------- + +### 兼容性 + +在下述版本验证通过: + +1. RNOH:0.72.5; SDK:HarmonyOS NEXT DP2; IDE:DevEco Studio 4.1.3.700; ROM:204.1.0.72(SP2DEVC00E72R1P1); + +API列表 +------------------------------------------------------------------------------------------------------- + + +| Name | Description | Type | Required | HarmonyOS Support | +| ---------------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------- | -------- | ----------------- | +| images | Array of images to display | ImageSource[] | Yes | Yes | +| keyExtractor | Uniqely identifying each image | (imageSrc: ImageSource, index: number) => string | No | Yes | +| imageIndex | Current index of image to display | number | Yes | Yes | +| visible | Is modal shown or not | boolean | No | Yes | +| onRequestClose | Function called to close the modal | function | Yes | Yes | +| onImageIndexChange | Function called when image index has been changed | function | No | Yes | +| onLongPress | Function called when image long pressed | function (event: GestureResponderEvent, image: ImageSource) | No | Yes | +| delayLongPress | Delay in ms, before onLongPress is called: default | number | No | Yes | +| animationType | Animation modal presented with: default | none, fade, slide | No | Yes | +| presentationStyle | Modal presentation style: default: fullScreen Android: Use overFullScreen to hide StatusBar | fullScreen, pageSheet, formSheet, overFullScreen | No | Yes | +| backgroundColor | Background color of the modal in HEX | string | No | Yes | +| swipeToCloseEnabled | Close modal with swipe up or down: default | boolean | No | Yes | +| doubleTapToZoomEnabled | Zoom image by double tap on it: default | boolean | No | Yes | +| HeaderComponent | Header component, gets current imageIndex as a prop | component, function | No | Yes | +| FooterComponent | Footer component, gets current imageIndex as a prop | component, function | No | Yes | + +## 遗留问题 + +## 其他 + +## 开源协议 + +本项目基于 [The MIT License (MIT)](https://github.com/facebook/prop-types/blob/v15.8.1/LICENSE) ,请自由地享受和参与开源。