uCrop icon indicating copy to clipboard operation
uCrop copied to clipboard

Toolbar text and icon color is not getting changed

Open tahir-zahid opened this issue 5 years ago • 5 comments

My app is using different color than white for the text and icons which appears at the top of crop screen. I've tried to change the color using theme color change in style but no success. Can you please guide me how can i change the color of text color which appears on Toolbar here is the code of manifest:

<activity
            android:name="com.yalantis.ucrop.UCropActivity"
            android:screenOrientation="portrait"
            android:theme="@style/uCropStyle"></activity>

here is the style i've applied to chage the color:

<style name="uCropStyle" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="colorPrimaryDark">@color/black</item>
        <item name="colorAccent">@color/black</item>
        <item name="colorPrimary">@color/yellow</item>
        <item name="android:textColor">@color/black</item>
    </style>

tahir-zahid avatar Nov 02 '18 21:11 tahir-zahid

@Tahir-Bitsol Try to customize your activity as in "Customize" chapter.

p1nkydev avatar Mar 18 '19 12:03 p1nkydev

If someone looking at how to change the toolbar text color:

val options = UCrop.Options() 
options.setToolbarWidgetColor([required color])
UCrop.of(sourceUri, destUri)
        .withOptions(options)
        .start(this)

isratmir avatar Jun 07 '19 10:06 isratmir

My app is using different color than white for the text and icons which appears at the top of crop screen. I've tried to change the color using theme color change in style but no success. Can you please guide me how can i change the color of text color which appears on Toolbar here is the code of manifest:

<activity
            android:name="com.yalantis.ucrop.UCropActivity"
            android:screenOrientation="portrait"
            android:theme="@style/uCropStyle"></activity>

here is the style i've applied to chage the color:

<style name="uCropStyle" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="colorPrimaryDark">@color/black</item>
        <item name="colorAccent">@color/black</item>
        <item name="colorPrimary">@color/yellow</item>
        <item name="android:textColor">@color/black</item>
    </style>

Not working for me

sam43 avatar Feb 25 '20 16:02 sam43

Currently we can't dynamic set it, but we can do set the default color and text:

set color:(create the file if not exist)

ourProj/android/app/src/main/res/values/colors.xml <?xml version="1.0" encoding="utf-8"?> <resources> <color name="ucrop_color_blaze_orange">#037ffc</color> </resources>

set toolbar text:(create the file if not exist), pls use your own text

ourProj/android/app/src/main/res/values/strings.xml <resources> <string name="ucrop_rotate">旋轉</string> <string name="ucrop_scale">縮放</string> <string name="ucrop_crop">裁剪</string> </resources>

trick: we can use * or - instead of these tree text, which is more common and no localize issue for these common text.

fdkitlui avatar Nov 26 '20 06:11 fdkitlui

Code to change toolbar color and active widget color

UCrop.Options options = new UCrop.Options(); options.setCompressionQuality(IMAGE_COMPRESSION); options.setToolbarColor(ContextCompat.getColor(this, R.color.colorWhite)); options.setStatusBarColor(ContextCompat.getColor(this, R.color.colorWhite)); options.setActiveControlsWidgetColor(ContextCompat.getColor(this, R.color.colorPrimary));

shami2812 avatar Jun 23 '21 06:06 shami2812