{"id":13644095,"url":"https://github.com/Tofira/ImagePickerWithCrop","last_synced_at":"2025-04-21T06:33:00.134Z","repository":{"id":217102609,"uuid":"71218232","full_name":"Tofira/ImagePickerWithCrop","owner":"Tofira","description":"A library designated for selecting an image via gallery or camera, with cropping abilities, in an easy way.","archived":false,"fork":false,"pushed_at":"2017-10-02T07:43:41.000Z","size":1481,"stargazers_count":74,"open_issues_count":6,"forks_count":26,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-09T16:43:47.343Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tofira.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-18T06:57:32.000Z","updated_at":"2023-10-28T02:53:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"b9a7f6d8-2328-4447-8d45-80cef83e852a","html_url":"https://github.com/Tofira/ImagePickerWithCrop","commit_stats":null,"previous_names":["tofira/imagepickerwithcrop"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tofira%2FImagePickerWithCrop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tofira%2FImagePickerWithCrop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tofira%2FImagePickerWithCrop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tofira%2FImagePickerWithCrop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tofira","download_url":"https://codeload.github.com/Tofira/ImagePickerWithCrop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250008293,"owners_count":21359961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T01:01:57.508Z","updated_at":"2025-04-21T06:33:00.128Z","avatar_url":"https://github.com/Tofira.png","language":"Java","readme":"# ImagePickerWithCrop\nA library designated for selecting an image via gallery or camera, with cropping abilities, in an easy way.\n\n![Alt Text](https://github.com/Tofira/ImagePickerWithCrop/blob/master/sampleGif.gif)\n\nSimple sample usage - \n\n```java\n  new PickerBuilder(MainActivity.this, PickerBuilder.SELECT_FROM_CAMERA)\n          .setOnImageReceivedListener(new PickerBuilder.onImageReceivedListener() {\n              @Override\n              public void onImageReceived(Uri imageUri) {\n                  Toast.makeText(MainActivity.this,\"Got image - \" + imageUri,Toast.LENGTH_LONG).show();\n                  imageView.setImageURI(imageUri);\n              }\n          })\n          .start();\n```\n\nA slighly more customized example - \n```java\n  new PickerBuilder(MainActivity.this, PickerBuilder.SELECT_FROM_CAMERA)\n          .setOnImageReceivedListener(new PickerBuilder.onImageReceivedListener() {\n              @Override\n              public void onImageReceived(Uri imageUri) {\n                  Toast.makeText(MainActivity.this,\"Got image - \" + imageUri,Toast.LENGTH_LONG).show();\n                  imageView.setImageURI(imageUri);\n              }\n          })\n          .setImageName(\"testImage\")\n          .setImageFolderName(\"testFolder\")\n          .withTimeStamp(false)\n          .setCropScreenColor(Color.CYAN)\n          .start();\n```\n\n##How to install\nImport the following in your app's `Gradle` file - \n```compile 'com.yalantis:ucrop:2.2.0'```\n\nCopy the following files to your project - \n```java\nCameraPickerManager.java\nGlobalHolder.java\nImagePickerManager.java\nPickerBuilder.java\nPickerManager.java\nTempActivity.java\n```\n\nNext, add the following two Activities to your Manifest file - \n```xml\n  \u003cactivity\n      android:name=\".TempActivity\"\n      android:screenOrientation=\"portrait\"\n      android:theme=\"@style/Theme.AppCompat.Translucent\"/\u003e\n  \u003cactivity\n      android:name=\"com.yalantis.ucrop.UCropActivity\"\n      android:screenOrientation=\"portrait\"\n      android:theme=\"@style/Theme.AppCompat.Light.NoActionBar\"/\u003e\n```\n\nFinally, add the following to your `styles.xml` file - \n```xml\n    \u003cstyle name=\"Theme.AppCompat.Translucent\" parent=\"Theme.AppCompat.NoActionBar\"\u003e\n        \u003citem name=\"android:background\"\u003e#33000000\u003c/item\u003e \u003c!-- Or any transparency or color you need --\u003e\n        \u003citem name=\"android:windowNoTitle\"\u003etrue\u003c/item\u003e\n        \u003citem name=\"android:windowBackground\"\u003e@android:color/transparent\u003c/item\u003e\n        \u003citem name=\"android:colorBackgroundCacheHint\"\u003e@null\u003c/item\u003e\n        \u003citem name=\"android:windowIsTranslucent\"\u003etrue\u003c/item\u003e\n        \u003citem name=\"android:windowAnimationStyle\"\u003e@android:style/Animation\u003c/item\u003e\n    \u003c/style\u003e\n```\n##How to use\n* See the samples above.\n* The picker will get the image from the Camera or the gallery based on the type attribute it receives. It can be one of the following - \n`PickerBuilder.SELECT_FROM_CAMERA` or `PickerBuilder.SELECT_FROM_GALLERY`.\n* The image will be provided through the `onImageReceivedListener` listener.\n* The default image location is `/DCIM/[APP_NAME]/[APP_NAME]_[TIMESTAMP].jpg`, and it can be customized.\n\n##Customization\nThe library offers several customization options - \n* `setCropScreenColor(Color)` - default is the app's primary color.\n* `setImageName(name)`  - default it the app's name.\n* `setImageFolderName(name)`  - default it the app's name.\n* `setCustomizedUcrop(UCrop)` - set your own UCrop, instead of the default conifgured one.\n* `setOnPermissionRefusedListener(PickerBuilder.onPermissionRefusedListener)`\n\n##Credits\nThe library uses the great cropping library \u003ca href=\"https://github.com/Yalantis/uCrop\"\u003eUcrop\u003c/a\u003e.\n","funding_links":[],"categories":["图片"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTofira%2FImagePickerWithCrop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTofira%2FImagePickerWithCrop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTofira%2FImagePickerWithCrop/lists"}