CanHub / Android-Image-Cropper

Image Cropping Library for Android, optimised for Camera / Gallery.
https://canhub.github.io/
Apache License 2.0
1.17k stars 240 forks source link

No toolbar / buttons to confirm the crop #629

Closed rexmtorres closed 1 month ago

rexmtorres commented 1 month ago

I just started using the library. I'm using the 4.5.0 (latest as of this writing). But when I launch it, by default, it just shows the image to be cropped in a white activity devoid of any buttons / toolbar. I've tried the different settings in CropImageOptions, but none of them seem to show any buttons / toolbar.

Here are the settings I've tried:

imageCropper.launch(
    CropImageContractOptions(
        uri = uri,
        cropImageOptions = CropImageOptions(
            cropShape = CropImageView.CropShape.OVAL,
            aspectRatioX = 1,
            aspectRatioY = 1,
            fixAspectRatio = true,
            outputCompressQuality = 75,
            backgroundColor = Color.MAGENTA,
            activityBackgroundColor = Color.BLACK,
            toolbarColor = Color.BLUE,
            toolbarTitleColor = Color.WHITE,
            toolbarBackButtonColor = Color.CYAN,
            toolbarTintColor = Color.RED,
            activityMenuIconColor = Color.GREEN,
            activityMenuTextColor = Color.GREEN,
            showCropLabel = true,
            multiTouchEnabled = true,
            activityTitle = "Hello",
            cropperLabelText = "It's me"
        )
    )
)

As you can see from the screenshot below, there's no toolbar or any button to confirm the crop. The activityTitle also does not show, which seems to indicate that there indeed is no toolbar. Screenshot_1716280613

vanniktech commented 1 month ago

Just roll your own activity.

rexmtorres commented 1 month ago

Then maybe remove those parameters? toolbarXXX, activityMenuXXX would lead people to believe that those actually do something.

Arise commented 5 days ago

Trying to save the world, in your app AndroidManifest.xml, just add:

        <activity android:name="com.canhub.cropper.CropImageActivity"
            android:theme="@style/Base.Theme.AppCompat"/>

Crop tools should then display fine.