npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-kpframework-image-picker-updated

v0.0.1

Published

Displaying the image picker

Downloads

2

Readme

react-native-kpframework-image-picker

图片选择器。

原生库

安装方式

第一步: 添加库

yarn add react-native-kpframework-image-picker

第二步: 链接原生 (rn 0.6x 以上版本略过)

react-native link react-native-kpframework-image-picker

第三步

android
Gradle >= 3.1.4 (android/build.gradle)
Android SDK >= 26 (android/app/build.gradle)

build.gradle 修改

  1. 在 build.gradle 的 buildscript 添加
maven { url 'https://jitpack.io' }
  1. minSdkVersion 最低支持版本 19

  2. 如果使用了Glide库,请升级到 v4

  3. 支持 androidx,如果您的项目还没有支持 androidx,请先支持 androidx

iOS

  1. Cocoapods(推荐)
    修改 Podfile 文件,如下:
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'Template' do
  # Pods for Demo61
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'

  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  # 0.6x版本不需要添加
  # pod 'react-native-kpframework-image-picker', :podspec => '../node_modules/react-native/react-native-kpframework-image-picker/react-native-kpframework-image-picker.podspec'

  use_native_modules!
end

install! 'cocoapods', :deterministic_uuids => false

执行 pod install

  1. 手动安装
    Click on project General tab
    Under Deployment Info set Deployment Target to 9.0
    Under Embedded Binaries click + and add react-native-kpframework-image-picker.framework

使用

import KPImagePicker from 'react-native-kpframework-image-picker';
...

KPImagePicker.openPicker().then(value => {

}).catch(error => {

});

API

  • openPicker(options);

1. options 参数说明

| 属性 | 类型 | 默认值 | 说明 | | ------------------------ | ------ | --------------- | ----------------------------------------------------------------------------------------------------------------------- | | mediaType | string | 'any' | 选择的文件类型photo video any | | multiple | bool | false | 是否支持多选 | | maxFiles | number | 9 | 最多选择的文件数(多选时生效) | | minFiles | number | 1 | 最少选择的文件数(多选时生效) | | compressImageMaxWidth(ios) | number | 600(px) | 图片文件压缩大小(根据宽度按比例压缩)如果选择原图,则不会裁剪和压缩 | | compressImageQuality | number | 0.8 | 图片文件压缩质量 | | compressVideoPreset(ios) | string | 'MediumQuality' | 视频文件压缩质量 640x480 960x540 1280x720 1920x1080 LowQuality MediumQuality HighestQuality Passthrough | | includeBase64 | bool | false | 返回图片 data 的 base64 值 | | includeExif | bool | false | 返回 image exif 信息 | | cropping | bool | false | 裁剪功能开关 | | cropWidth | number | 400(px) | 裁剪图片宽(如果超过原图高宽,则无效)度 | | cropHeight | number | 400(px) | 裁剪图片高(如果超过原图高宽,则无效)度 | | cropperCircleOverlay | bool | false | 圆形裁剪框 | | cropRadius(ios) | number | 200(px) | 圆形裁剪图片半径 | | writeTempFile(ios) | bool | true | 裁剪、压缩时生成临时文件 | | showCamera | bool | true | 是否在相册中支持拍照功能 |

4. 其他说明

5. 注意事项

TODO

  • 返回结果需要统一数组还是单个对象
  • android 端集成