android_picture
所属分类:Kotlin编程
开发工具:Java
文件大小:0KB
下载次数:0
上传日期:2023-11-02 07:46:44
上 传 者:
sh-1993
说明: 相册选择库(Kotlin版本),单个图像类似于个人中心头像上传,多个图像类似于意见c...
(????Photo album selection library (Kotlin version), single image similar to personal center avatar upload, multi image similar to opinion comments multi image upload, support for cropping, image rotation function, support for animation pop-up, etc)
文件列表:
.idea/ (0, 2023-11-29)
.idea/.name (7, 2023-11-29)
.idea/compiler.xml (169, 2023-11-29)
.idea/gradle.xml (924, 2023-11-29)
.idea/misc.xml (468, 2023-11-29)
.idea/vcs.xml (167, 2023-11-29)
GIF/ (0, 2023-11-29)
GIF/android.png (169545, 2023-11-29)
GIF/camera.gif (9228208, 2023-11-29)
GIF/dtgif.gif (9213389, 2023-11-29)
GIF/dtgif2.gif (7494841, 2023-11-29)
GIF/gif1.gif (67718710, 2023-11-29)
GIF/image.gif (3374571, 2023-11-29)
GIF/wx.jpg (138808, 2023-11-29)
GIF/zfb.jpg (251239, 2023-11-29)
app/ (0, 2023-11-29)
app/build.gradle (1183, 2023-11-29)
app/proguard-rules.pro (750, 2023-11-29)
app/src/ (0, 2023-11-29)
app/src/androidTest/ (0, 2023-11-29)
app/src/androidTest/java/ (0, 2023-11-29)
app/src/androidTest/java/com/ (0, 2023-11-29)
app/src/androidTest/java/com/github/ (0, 2023-11-29)
app/src/androidTest/java/com/github/yuan/ (0, 2023-11-29)
app/src/androidTest/java/com/github/yuan/picture/ (0, 2023-11-29)
app/src/androidTest/java/com/github/yuan/picture/ExampleInstrumentedTest.kt (673, 2023-11-29)
app/src/main/ (0, 2023-11-29)
app/src/main/AndroidManifest.xml (910, 2023-11-29)
app/src/main/java/ (0, 2023-11-29)
app/src/main/java/com/ (0, 2023-11-29)
app/src/main/java/com/github/ (0, 2023-11-29)
app/src/main/java/com/github/yuan/ (0, 2023-11-29)
app/src/main/java/com/github/yuan/picture/ (0, 2023-11-29)
app/src/main/java/com/github/yuan/picture/MainActivity.kt (2729, 2023-11-29)
app/src/main/res/ (0, 2023-11-29)
... ...
# Album Selection Library [![](https://jitpack.io/v/AnglePengCoding/android_picture.svg)](https://jitpack.io/#AnglePengCoding/android_picture)
[中文](https://github.com/AngleCoding/android_picture/blob/main/READMEC.md)
Photo album selection library (Kotlin version), single image similar to personal center avatar upload, multi image similar to opinion comments multi image upload, support for cropping, image rotation function, support for animation pop-up, etc
Add Dependency
```java
implementation'com.github.AnglePengCoding:android_picture:Tag'
```
Version differences v.1.0.0/v2.0.0
v.1.0.0 Using only a single image,v2.0.0In the future, multiple image selection has been added, and developers can choose the corresponding development mode。
Screen recording
Single image function
```java
PictureChooseDialog.build(this){
setSingleCameraRequestCode(10086)//Set up a single image camera RequestCode
setSingleImageRequestCode(10096)//Set up a single photo album RequestCode
show() //必设置
}
```
onActivityResult
```java
@Deprecated("Deprecated in Java")
override fun onActivityResult(requestCode:Int,resultCode:Int,data:Intent?){
if(resultCode==RESULT_OK){
when(requestCode){
10096->{ //Processing after selecting an album
data?.data?.let{PictureUtils.initUCrop(this,it)}
}
10086->{ //Processing after selecting a camera
PictureUtils.initUCrop(this,PictureUtils.imageUriFromCamera)
}
UCrop.REQUEST_CROP->{ //Processing after cropping
val resultUri=UCrop.getOutput(data!!)
val file=
File(PictureUtils.getImageAbsolutePath(this,resultUri).toString())
findViewById
(R.id.mIv).post{
findViewById(R.id.mIv).setImageURI(resultUri)
}
}
}
}
super.onActivityResult(requestCode,resultCode,data)
}
```
Multi image function
```java
adapter=GridImageAdapter(mContext)
adapter.setAddPicClickListener(this)
cameraBinding.mRecyclerView.layoutManager=FullyGridLayoutManager(mContext,4)
cameraBinding.mRecyclerView.adapter=adapter
override fun onAddPicClick(position:Int){
PictureChooseDialog.build(this){
setSingleOrMutableMode(true)//Enable multi image mode
setMaxSelectNum(2)//maximum number
openGalleryChooseMode(SelectMimeType.TYPE_ALL)//Multi Image Mode - Album
openCameraChooseMode(SelectMimeType.TYPE_ALL)//Multi Image Mode - Camera
setSelectedData(adapter.data)// Album Selected Data
setImageMutableForResult(object:OnResultCallbackListener {
//Multi Image Mode - Select Album Echo Data
override fun onResult(result:ArrayList){
adapter.setList(result)
}
override fun onCancel(){
}
})
setCameraMutableForResult(object:OnResultCallbackListener {
//Multi image mode - select camera echo data
override fun onResult(result:ArrayList){
adapter.setList(result)
}
override fun onCancel(){
}
})
show()
}
}
```
Cropping function
```java
setUCropToolbarColor(R.color.teal_200)//Setting the cropping ToolbarColor is optional
setUCropStatusBarColor(R.color.teal_200)//Setting the color of the cropping status bar is optional
setMaxScaleMultiplier(2f)//Set the maximum zoom ratio for cropping
setImageToCropBoundsAnimDuration(1000)//Animate images when switching scales
setShowCropFrame(true)//Set whether to display rectangular clipping boxes
setCropGridStrokeWidth(R.color.teal_200)//Set the color of the crop box's horizontal and vertical lines
setCropGridColumnCount(1)//Set the number of crop vertical lines
setCropGridRowCount(2)//Set the number of crop lines
```
Pop up style and other auxiliary functions
```java
setFileTextSize(18f)//Set the font size of the dialog "album" button according to business needs
setFileTextColor(Color.parseColor("#FF3700B3"))//Set the font color of the dialog "album" button according to business needs
setCameraTextSize(15f)//Set the font size of the dialog "camera" button according to business needs
setCameraTextColor(Color.parseColor("#ffcc0000"))//Set the font color of the dialog "camera" button according to business needs
setAnimationDuration(2000)//Set the duration of the dialog animation according to business needs
pictureDialogAnimation(PictureDialogAnimation.TranslateFromBottom)//Set dialog pop-up animation according to business needs
setCameraDialogVisibility(true)//Set dialog camera buttons to hide according to business needs
setFileDialogVisibility(true)//Set the dialog album button to hide according to business needs
setRecyclerAnimationMode()//Album List Animation Effects
setLanguage()//Set Album Language
setRequestedOrientation()//Set screen rotation direction
setMaxVideoSelectNum()//Maximum number of video selections
setMinVideoSelectNum()//Minimum number of video selections
isPreviewAudio()//Does it support audio preview
isPreviewImage()//Does it support previewing images
isPreviewFullScreenMode()//Preview click full screen effect
isWithSelectVideoImage()//Does it support video and image selection
isEmptyResultReturn()//Support unselected return
isCameraRotateImage()//Does the photo correct the rotation of the image
isAutoVideoPlay()//Whether the preview video will automatically play
isFastSlidingSelect()//Quick slide selection
isDirectReturnSingle()//Do you want to return immediately when selecting a single option
setCameraImageFormat()//Photo output format
setCameraImageFormatForQ()//Photo output format, Android Q or above
setCameraVideoFormat()//Photo Video Output Format
setCameraInterceptListener()//Intercept camera events and implement custom cameras
```
Intentional description
```java
The camera uses the PictureSelector album library, but due to the incompatibility of the permission library with Android Q and above versions, permission compatibility has been processed!
```
***
```java
MIT License
Copyright(c)2023Yuang
Permission is hereby granted,free of charge,to any person obtaining a copy
of this software and associated documentation files(the"Software"),to deal
in the Software without restriction,including without limitation the rights
to use,copy,modify,merge,publish,distribute,sublicense,and/or sell
copies of the Software,and to permit persons to whom the Software is
furnished to do so,subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED"AS IS",WITHOUT WARRANTY OF ANY KIND,EXPRESS OR
IMPLIED,INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER
LIABILITY,WHETHER IN AN ACTION OF CONTRACT,TORT OR OTHERWISE,ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
近期下载者:
相关文件:
收藏者: