You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<itemandroid:id="@+id/menu_camera"android:icon="@drawable/ef_ic_camera_white"android:title="@string/ef_camera"app:showAsAction="always"app:iconTint="?cameraIconTint" <<<< add this line
tools:ignore="AlwaysShowAction" />
Then define the color cameraIconTint in your style.xml. That's it.
Alternatively, you can use vector icons with android:tint color defined in style. Like this:
<vectorxmlns:android="http://schemas.android.com/apk/res/android"android:width="24dp"android:height="24dp"android:tint="?android:textColorPrimary" <<<<< ------ this line
android:viewportWidth="24.0"android:viewportHeight="24.0">
<pathandroid:fillColor="#FFFFFFFF"android:pathData="...." />
</vector>
It's a highly unusual design decision to require custom component just to change color of a UI element. That's usually done with style.xml.
In the #144 you suggest to use custom components, but unfortunately there are no examples on how to do it. Would it be possible to provide some guidance on how to use it beyond what you have in custom_components.md?
I don't see anything related to toolbar styling in interface ImagePickerComponents:
val imageLoader: ImageLoader
val imageFileLoader: ImageFileLoader
val cameraModule: CameraModule
The text was updated successfully, but these errors were encountered:
or-else
changed the title
Option to change camera icon colour #144
Option to change camera icon color
Dec 20, 2022
Just checked: it's not possible to subclass ImagePickerActivity and override onOptionsMenuCreated because ImagePickerLauncher.resultLauncher is private.
The only way to change color of the icon is to fork the project and edit the code which is a shame.
Would like to reopen #144.
I would like to be able to change color of the Camera icon in the toolbar menu.
The change in the code is trivial, specifically, add one line to the menu item in
https://github.com/esafirm/android-image-picker/blob/main/imagepicker/src/main/res/menu/ef_image_picker_menu_main.xml
Then define the color
cameraIconTint
in your style.xml. That's it.Alternatively, you can use vector icons with
android:tint
color defined in style. Like this:It's a highly unusual design decision to require custom component just to change color of a UI element. That's usually done with style.xml.
In the #144 you suggest to use custom components, but unfortunately there are no examples on how to do it. Would it be possible to provide some guidance on how to use it beyond what you have in custom_components.md?
I don't see anything related to toolbar styling in
interface ImagePickerComponents
:The text was updated successfully, but these errors were encountered: