GithubHelp home page GithubHelp logo

songlonggithub / utakephoto Goto Github PK

View Code? Open in Web Editor NEW
141.0 141.0 20.0 377 KB

Android 拍照/选择图片,裁剪,压缩,适配androidQ,不用重写activity,链式调用

Kotlin 2.23% Java 97.77%

utakephoto's People

Contributors

songlonggithub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

utakephoto's Issues

鸿蒙2.0.1系统首次请求权限调系统拍照,无返回

日志
2022-06-14 09:48:44.520 4375-4406/com.sl.utakephoto E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile@ccd9236
2022-06-14 09:48:44.524 4375-4375/com.sl.utakephoto D/SystemFonts: areFontsVariable: script=Hans
2022-06-14 09:48:44.525 4375-4375/com.sl.utakephoto I/ActivityThread: finishPreloaded preloadStatus 0
2022-06-14 09:48:44.095 4375-4375/? I/m.sl.utakephot: Late-enabling -Xcheck:jni
2022-06-14 09:48:44.135 4375-4375/? I/m.sl.utakephot: Unquickening 55 vdex files!
2022-06-14 09:48:44.248 4375-4375/? E/m.sl.utakephot: LoadAppImageStartupCache enabled : 1
2022-06-14 09:48:44.248 4375-4375/? I/m.sl.utakephot: ReInitProperties: persist.vm.debug.dumpapi= false

2022-06-14 09:48:44.258 4375-4375/? I/AndroidRuntime: RuntimeInit: Starting application from zygote

2022-06-14 09:48:44.259 4375-4375/? D/AndroidRuntime: Entered RuntimeInit!
2022-06-14 09:48:44.275 4375-4375/? I/AndroidRuntime: MethodAndArgsCaller run()
2022-06-14 09:48:44.287 4375-4375/? D/ActivityThread: Attach thread to application
HIMAX HXTP STATUS[12]: 300 2 0 3 0 0 10 0 0 0 0 0
2022-06-14 09:48:44.427 4375-4399/com.sl.utakephoto D/HwFrameworkSecurityPartsFactory: HwFrameworkSecurityPartsFactory in.
HIMAX HXTP STATUS[36]: 0 39321 1 651 65535 0 191 27 164 102 14604 14603 HAND(0x66)
2022-06-14 09:48:44.427 4375-4399/com.sl.utakephoto I/HwFrameworkSecurityPartsFactory: add HwFrameworkSecurityPartsFactory to memory.
2022-06-14 09:48:44.427 4375-4399/com.sl.utakephoto E/BehaviorCollectManager: Fail to acquire dataAnalyzerService...
2022-06-14 09:48:44.095 4375-4375/? I/m.sl.utakephot: Late-enabling -Xcheck:jni
2022-06-14 09:48:42.694 17334-17338/? D/afehal: THP HIMAX: HIMAX HXTP [4][1655171322694][1655171322.694510][himax_parse_status] HX_F1_NOISE: 0

2022-06-14 09:48:44.135 4375-4375/? I/m.sl.utakephot: Unquickening 55 vdex files!
2022-06-14 09:48:44.248 4375-4375/? E/m.sl.utakephot: LoadAppImageStartupCache enabled : 1
2022-06-14 09:48:44.248 4375-4375/? I/m.sl.utakephot: ReInitProperties: persist.vm.debug.dumpapi= false
2022-06-14 09:48:44.258 4375-4375/? I/AndroidRuntime: RuntimeInit: Starting application from zygote
2022-06-14 09:48:44.259 4375-4375/? D/AndroidRuntime: Entered RuntimeInit!
2022-06-14 09:48:44.275 4375-4375/? I/AndroidRuntime: MethodAndArgsCaller run()
2022-06-14 09:48:44.287 4375-4375/? D/ActivityThread: Attach thread to application
2022-06-14 09:48:44.426 4375-4399/com.sl.utakephoto I/ActivityThread: Init compatible state: true
2022-06-14 09:48:44.427 4375-4399/com.sl.utakephoto D/HwFrameworkSecurityPartsFactory: HwFrameworkSecurityPartsFactory in.
HIMAX HXTP STATUS[12]: 300 2 0 3 0 0 10 0 0 0 0 0
2022-06-14 09:48:44.427 4375-4399/com.sl.utakephoto I/HwFrameworkSecurityPartsFactory: add HwFrameworkSecurityPartsFactory to memory.
2022-06-14 09:48:44.427 4375-4399/com.sl.utakephoto E/BehaviorCollectManager: Fail to acquire dataAnalyzerService...
HIMAX HXTP STATUS[24]: 102 0 102 0 0 0 34637 0 0 79 310 0
2022-06-14 09:48:44.537 4375-4399/com.sl.utakephoto I/HwPartIawareFactory: add android.common.HwPartIawareFactoryImpl to memory.
2022-06-14 09:48:44.537 4375-4399/com.sl.utakephoto I/AwareBitmapCacher: init processName:com.sl.utakephoto pid=4375 uid=10415
2022-06-14 09:48:44.095 4375-4375/? I/m.sl.utakephot: Late-enabling -Xcheck:jni
2022-06-14 09:48:44.135 4375-4375/? I/m.sl.utakephot: Unquickening 55 vdex files!
2022-06-14 09:48:44.248 4375-4375/? E/m.sl.utakephot: LoadAppImageStartupCache enabled : 1
2022-06-14 09:48:44.248 4375-4375/? I/m.sl.utakephot: ReInitProperties: persist.vm.debug.dumpapi= false
2022-06-14 09:48:44.258 4375-4375/? I/AndroidRuntime: RuntimeInit: Starting application from zygote
2022-06-14 09:48:44.259 4375-4375/? D/AndroidRuntime: Entered RuntimeInit!
2022-06-14 09:48:44.275 4375-4375/? I/AndroidRuntime: MethodAndArgsCaller run()
2022-06-14 09:48:44.287 4375-4375/? D/ActivityThread: Attach thread to application
2022-06-14 09:48:44.426 4375-4399/com.sl.utakephoto I/ActivityThread: Init compatible state: true
2022-06-14 09:48:44.427 4375-4399/com.sl.utakephoto D/HwFrameworkSecurityPartsFactory: HwFrameworkSecurityPartsFactory in.
2022-06-14 09:48:44.427 4375-4399/com.sl.utakephoto I/HwFrameworkSecurityPartsFactory: add HwFrameworkSecurityPartsFactory to memory.
2022-06-14 09:48:44.427 4375-4399/com.sl.utakephoto E/BehaviorCollectManager: Fail to acquire dataAnalyzerService...
2022-06-14 09:48:44.509 4375-4399/com.sl.utakephoto I/HwApiCacheMangerEx: apicache path=/storage/emulated/0 state=mounted key=com.sl.utakephoto#10415#256
2022-06-14 09:48:44.509 4375-4399/com.sl.utakephoto I/HwApiCacheMangerEx: need clear apicache,because volumes changed,oldCnt=0 newCnt=1
2022-06-14 09:48:44.510 4375-4399/com.sl.utakephoto I/HwApiCacheMangerEx: apicache path=/storage/emulated/0 state=mounted key=com.sl.utakephoto#10415#0
2022-06-14 09:48:44.510 4375-4399/com.sl.utakephoto I/HwApiCacheMangerEx: need clear apicache,because volumes changed,oldCnt=1 newCnt=1
2022-06-14 09:48:44.512 4375-4375/com.sl.utakephoto D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2022-06-14 09:48:44.513 4375-4375/com.sl.utakephoto D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2022-06-14 09:48:45.113 4375-4375/com.sl.utakephoto D/OpenGLRenderer: disableOutlineDraw is true
2022-06-14 09:48:45.128 4375-4431/com.sl.utakephoto I/OpenGLRenderer: RenderThread: progress name = [com.sl.utakephoto], viewCornerType = 0, g2param1 = 0.000000, g2param2 = 0.000000
2022-06-14 09:48:45.133 4375-4435/com.sl.utakephoto W/iGraphics: gtx.module.enable is not defined.
2022-06-14 09:48:45.133 4375-4435/com.sl.utakephoto I/iGraphics: [0020080c] pn: com.sl.utakephoto, p: 4375
2022-06-14 09:48:45.133 4375-4435/com.sl.utakephoto I/iGraphics: [0030080c] no spt app: com.sl.utakephoto
2022-06-14 09:48:45.218 4375-4375/com.sl.utakephoto V/ActivityThread: callActivityOnCreate
2022-06-14 09:48:45.246 4375-4375/com.sl.utakephoto D/SupportRequestManagerFragment: onCreate SupportRequestManagerFragment{e9bbabe} (0eafe980-3e23-4610-8648-c44ffa078753 tag=com.sl.utakephoto_lib.manager)
2022-06-14 09:48:45.250 4375-4375/com.sl.utakephoto E/m.sl.utakephot: Invalid ID 0x00000000.
2022-06-14 09:48:45.264 4375-4375/com.sl.utakephoto I/DecorView[]: pkgName:com.sl.utakephoto old windowMode:0 new windoMode:1, isFixedSize:false
2022-06-14 09:48:45.265 4375-4375/com.sl.utakephoto I/RmeSchedManager: init Rme, version is: v1.0
2022-06-14 09:48:45.265 4375-4375/com.sl.utakephoto I/RtgSchedEvent: current pid:4375 AppType:-1
2022-06-14 09:48:45.265 4375-4375/com.sl.utakephoto I/RmeSchedManager: init Rme, version is: v1.0
2022-06-14 09:48:45.280 4375-4375/com.sl.utakephoto I/OverScrollerOptimization: start init SmartSlideOverScroller and get the overscroller config
2022-06-14 09:48:45.280 4375-4375/com.sl.utakephoto I/OverScrollerOptimization: get the overscroller config
2022-06-14 09:48:45.315 4375-4375/com.sl.utakephoto W/m.sl.utakephot: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
2022-06-14 09:48:45.316 4375-4375/com.sl.utakephoto W/m.sl.utakephot: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
2022-06-14 09:48:45.471 4375-4375/com.sl.utakephoto D/ActivityThread: add activity client record, r= ActivityRecord{3743d8c token=android.os.BinderProxy@1a300d {com.sl.utakephoto/com.sl.utakephoto.MainActivity2}} token= android.os.BinderProxy@1a300d
2022-06-14 09:48:45.480 4375-4375/com.sl.utakephoto I/HwPartMagicWindowFactory: add android.common.HwPartMagicWindowFactoryImpl to memory.
2022-06-14 09:48:45.489 4375-4375/com.sl.utakephoto D/MouseWheelSynthesizer: mMoveStepInDp: 64, mMoveStepInPixel: 128, mUpTimeDelayed: 100
2022-06-14 09:48:45.491 4375-4375/com.sl.utakephoto D/ViewRootImpl: ViewRootImpl mIsInProductivePCDisplay: false
2022-06-14 09:48:45.499 4375-4375/com.sl.utakephoto D/InputEventReceiver: dispatchInputInterval 0
2022-06-14 09:48:45.502 4375-4375/com.sl.utakephoto I/RmeSchedManager: init Rme, version is: v1.0
2022-06-14 09:48:45.502 4375-4375/com.sl.utakephoto I/RtgSchedEvent: current pid:4375 AppType:-1
2022-06-14 09:48:45.503 4375-4431/com.sl.utakephoto D/OpenGLRenderer: disableOutlineDraw is true
2022-06-14 09:48:45.521 4375-4441/com.sl.utakephoto D/HiTouch_PressGestureDetector: onAttached, package=com.sl.utakephoto, windowType=1, mHiTouchRestricted=false
2022-06-14 09:48:45.589 4375-4375/com.sl.utakephoto D/InsetsSourceConsumer: setControl mType:1, requestedVisible:true, getLeash:null, needAnimation:true, mIsAnimationPending:false, getRootViewTitle:com.sl.utakephoto/com.sl.utakephoto.MainActivity2
2022-06-14 09:48:45.590 4375-4375/com.sl.utakephoto D/InsetsSourceConsumer: setControl mType:0, requestedVisible:true, getLeash:null, needAnimation:true, mIsAnimationPending:false, getRootViewTitle:com.sl.utakephoto/com.sl.utakephoto.MainActivity2
2022-06-14 09:48:45.592 4375-4431/com.sl.utakephoto I/AdrenoGLES-0: QUALCOMM build : e04cc00185, I911f2d7bd6
Build Date : 08/31/21
OpenGL ES Shader Compiler Version: EV031.35.01.10
Local Branch :
Remote Branch :
Remote Branch :
Reconstruct Branch :
2022-06-14 09:48:45.592 4375-4431/com.sl.utakephoto I/AdrenoGLES-0: Build Config : S P 10.0.7 AArch64
2022-06-14 09:48:45.592 4375-4431/com.sl.utakephoto I/AdrenoGLES-0: Driver Path : /vendor/lib64/egl/libGLESv2_adreno.so
2022-06-14 09:48:45.609 4375-4431/com.sl.utakephoto I/AdrenoGLES-0: PFP: 0x016dc094, ME: 0x00000000
2022-06-14 09:48:45.625 4375-4431/com.sl.utakephoto W/Adreno-AppProfiles: Could not find QSPM HAL service. Skipping adreno profile processing.
2022-06-14 09:48:45.688 4375-4375/com.sl.utakephoto I/HwViewRootImpl: removeInvalidNode jank list is null
2022-06-14 09:48:45.713 4375-4375/com.sl.utakephoto D/InsetsSourceConsumer: setControl mType:1, requestedVisible:true, getLeash:Surface(name=Surface(name=5facfc9 NavigationBar0)/@0x2d7fe26 - animation-leash)/@0xa539da8, needAnimation:false, mIsAnimationPending:true, getRootViewTitle:com.sl.utakephoto/com.sl.utakephoto.MainActivity2
2022-06-14 09:48:45.713 4375-4375/com.sl.utakephoto D/InsetsSourceConsumer: setControl mType:0, requestedVisible:true, getLeash:Surface(name=Surface(name=40afdd2 StatusBar)/@0xf71cd81 - animation-leash)/@0x79380c1, needAnimation:false, mIsAnimationPending:true, getRootViewTitle:com.sl.utakephoto/com.sl.utakephoto.MainActivity2
2022-06-14 09:48:45.713 4375-4375/com.sl.utakephoto D/InsetsController: applyAnimation types:3,show:true
2022-06-14 09:48:45.713 4375-4375/com.sl.utakephoto D/InsetsController: controlAnimation types: 3
2022-06-14 09:48:45.713 4375-4375/com.sl.utakephoto D/InsetsController: controlAnimation after canel existing types: 3
2022-06-14 09:48:45.719 4375-4375/com.sl.utakephoto W/InputMethodManager: startInputReason = 1
2022-06-14 09:48:45.721 4375-4475/com.sl.utakephoto D/RenderService: RCS is disable
2022-06-14 09:48:45.738 4375-4375/com.sl.utakephoto D/InsetsSourceConsumer: setControl mType:1, requestedVisible:true, getLeash:Surface(name=Surface(name=5facfc9 NavigationBar0)/@0x2d7fe26 - animation-leash)/@0x69667fd, needAnimation:false, mIsAnimationPending:false, getRootViewTitle:com.sl.utakephoto/com.sl.utakephoto.MainActivity2
2022-06-14 09:48:45.738 4375-4375/com.sl.utakephoto D/InsetsSourceConsumer: setControl mType:0, requestedVisible:true, getLeash:Surface(name=Surface(name=40afdd2 StatusBar)/@0xf71cd81 - animation-leash)/@0xc678cf2, needAnimation:false, mIsAnimationPending:false, getRootViewTitle:com.sl.utakephoto/com.sl.utakephoto.MainActivity2
2022-06-14 09:48:46.018 4375-4375/com.sl.utakephoto D/InsetsController: cancelAnimation of types: 3, animType: 0
2022-06-14 09:48:46.352 4375-4375/com.sl.utakephoto W/InputMethodManager: startInputReason = 6
2022-06-14 09:48:46.740 4375-4375/com.sl.utakephoto D/InsetsSourceConsumer: setControl mType:1, requestedVisible:true, getLeash:Surface(name=Surface(name=5facfc9 NavigationBar0)/@0x2d7fe26 - animation-leash)/@0xa34ef43, needAnimation:false, mIsAnimationPending:false, getRootViewTitle:com.sl.utakephoto/com.sl.utakephoto.MainActivity2
2022-06-14 09:48:46.740 4375-4375/com.sl.utakephoto D/InsetsSourceConsumer: setControl mType:0, requestedVisible:true, getLeash:Surface(name=Surface(name=40afdd2 StatusBar)/@0xf71cd81 - animation-leash)/@0xa4279c0, needAnimation:false, mIsAnimationPending:false, getRootViewTitle:com.sl.utakephoto/com.sl.utakephoto.MainActivity2

截图

截图的白色框大小固定的吗,我无论怎么改都不会边

优化裁剪

选择完照片后进入裁剪页面时,框默认是贴着屏幕左右两边的。
对于有左右滑动返回手势的系统来说,会导致误操作。
建议默认的裁剪大小不要贴着边缘。

API调用问题

``private` fun showMenuDialog() {
val takePhotoManager = UTakePhoto.with(this)
val items = arrayOf("相册", "拍照", "取消")
MenuDialogBuilder(context)
.addItems(items) { dialog, which ->
when (which) {
0 -> takePhotoManager.openAlbum()
1 -> takePhotoManager.openCamera()
// 2 -> ToastUtils.showShort("取消")
}
dialog.dismiss()
}
.create(R.style.QMUI_Dialog).show()

    takePhotoManager.build(object : ITakePhotoResult {
        override fun takeFailure(ex: TakeException?) {

        }

        override fun takeSuccess(uriList: MutableList<Uri>?) {
        }

        override fun takeCancel() {
        }

    })
}`

必须要调用2次,第1次永远出不来

多图

老哥,期待你的多图功能

清晰度差

我将拍照的uri传入到CropActivity裁剪之后,返回的uri转成图片,清晰度很差,是哪里被压缩了吗

裁剪页面读取照片很慢

vivo Y3s 型号V1901A拍照或选择相册相片,进入裁剪页面要二三十秒,很慢,设置了压缩和裁剪参数也一样

问题反馈

三星一款手机7.0 拍照后 图片加载出来黑屏 or 一直在加载中

华为荣耀v20 andriod Q 图片有时候一直在加载中,然后结束了

Android7.0返回的uri为空

Android7.0返回的uri为空,setWithOwnCrop设置为true的时候可以正常使用,为false返回的为空,vivo手机

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.