GoodieBag / CarouselPicker

A Carousel picker library for android which supports both text and icons . :sparkles:
MIT License
708 stars 101 forks source link

Color #1

Closed Godsmack121Kcamsdog closed 6 years ago

Godsmack121Kcamsdog commented 7 years ago

How to change picker items textColor?

krishanudey commented 7 years ago

Hi @Godsmack121Kcamsdog Currently, we've not implemented the feature, will update in next 2-3 days.

Godsmack121Kcamsdog commented 7 years ago

Okey, that`s great. Please, could you also let the ability to determine TextAlligment using CarouselPicker.TextItem. Or implement the solution via Adapter+ViewHolder with using custom View model.

2017-07-06 17:19 GMT+03:00 Krishanu notifications@github.com:

Hi @Godsmack121Kcamsdog https://github.com/godsmack121kcamsdog Currently, we've not implemented the feature, will update in next 2-3 days.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/GoodieBag/CarouselPicker/issues/1#issuecomment-313409810, or mute the thread https://github.com/notifications/unsubscribe-auth/AWkfSz8DX0tkofTxhK2kXAAKPGinPa7jks5sLOzSgaJpZM4OPp51 .

Astralgr commented 6 years ago

@KoderKrishanu Hello, did you have the time to look into changing text color ?

Godsmack121Kcamsdog commented 6 years ago

Hello! Unfortunately, no. I decided to use simple RecyclerView in my application long time ago. Sorry.

I will try it later, if it may be possible.

24 Сен 2017 г. 10:04 PM пользователь "Marios Bar" notifications@github.com написал:

@KoderKrishanu https://github.com/koderkrishanu Hello, did you have the time to look into changing text color ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/GoodieBag/CarouselPicker/issues/1#issuecomment-331731839, or mute the thread https://github.com/notifications/unsubscribe-auth/AWkfSy0e8lAqIdpo8Ob28k1v8MRK5dicks5slqfVgaJpZM4OPp51 .

Astralgr commented 6 years ago

@Godsmack121Kcamsdog Thanks for the reply managed to do it myself, wasn't so hard at the end. Besides the text and size I can now add color to individual text.

VladyIliev commented 6 years ago

Solved: Copy the CarouselViewAdapter class, and in method instantiateItem(ViewGroup container, int position) add tv.setTextColor(your color here).

Hello911 commented 6 years ago

@VladyIliev , Hi, I used dependecy and compile to use the library. I wanted to change text color, so I created CarouselPicker.java class and modify the instatiateItem() as you said, but afterward, it says "CarouselViewAdapter class is never used". And the text color didn't change.

VladyIliev commented 6 years ago

Don't create a whole new CarouselPicker, you need just the contents of CarouselViewAdapter (it extends PageAdapter). Then, using the carousel (the actual CarouselPicker), use setAdapter() to link your new modified adapter.

Hello911 commented 6 years ago

Do I need to create a new java file called CarouselViewAdapter? I tried to modify CarouselPicker.class, but it is a read-only file. I tried creating my own CarouselPicker.java file but it comflicts with import in.goodiebag.carouselpicker.CarouselPicker; and a lot of syntaxes don't work.

VladyIliev commented 6 years ago

@Hello911 You can create a new class, but you either need to pick a new name of your own, or specify the full package/class path to avoid conflicts (similar to what your imports look like). In my case, I created a nested inner class, because a separate file wouldn't be necessary. For reference, here is the carousel I implemented: https://pastebin.com/J7maWNbe. You should pay attention only to the nested inner class, and the setAdapter() method called within my updateVisibleLocations() method.

Vatican-Cameos commented 6 years ago

Hello, I apologise for the delayed response and delaying this fix. We were knees deep into work in the past year and we were not able to maintain this repository.

This issue has been fixed.
Please update your Gradle file and replace the old implementation with this :
implementation 'com.github.GoodieBag:CarouselPicker:v1.1'

Now you will have access to :
adapter.setTextColor(colorInt) method which will change the text item's textColor.

Please let me know if it works as expected. Will leave the issue open for a day or two before closing this.

Best, Pavan