imandolatkia / Android-Animated-Theme-Manager

create your custom themes and change them dynamically with ripple animation
Apache License 2.0
703 stars 64 forks source link

RecyclerView #8

Closed SudoDios closed 3 years ago

SudoDios commented 3 years ago

how to update RecyclerView?

imandolatkia commented 3 years ago

HI @SudoDios, It's a really good question.

1- You should synchronize the RecyclerView theme in Viewholders. I mean in the RecyclerView adapter and inonBindViewHolder method, with the use of ThemeManager. 2- After the theme is changed, if the fragment that contained RecyclerView was displaying, call notifyDataSetChanged() from its adapter.

I will add the sample in a week.

SudoDios commented 3 years ago

Thankful.
I solved this issue that day but I forgot to close this issue 😌

ghost commented 1 year ago

@SudoDios can you share sample?

Ufransa commented 1 year ago

@SudoDios can you share sample?

Hi @FaArIsH ! Di you manage to solve it? I´m also triying to do the same with the action bar if you can help me. Thanks !!

ghost commented 1 year ago

@SudoDios can you share sample?

Hi @FaArIsH ! Di you manage to solve it? I´m also triying to do the same with the action bar if you can help me. Thanks !!

yes but not fully because i dont know how to call notifyDataSetChanged() from main activity i added onclick in child adaptor so when i click the child it get updated

i followed this https://github.com/karimov0147/E-Book-Little-Prince/blob/master/app/src/main/java/com/example/bubook/localStorage/Resources.kt https://github.com/karimov0147/E-Book-Little-Prince/blob/master/app/src/main/java/com/example/bubook/screens/InfoScreen.kt

SudoDios commented 1 year ago

You can solve the problem with the help of observer in everywhere

Ufransa commented 1 year ago

Can you elaborate that a bit more @SudoDios? Thanks !

SudoDios commented 1 year ago

What should I explain? 🧐 This is very easy

ghost commented 1 year ago

i modified my adapter by looking at this code https://github.com/karimov0147/E-Book-Little-Prince/blob/master/app/src/main/java/com/example/bubook/utills/AdapterRV.kt and now i m able to call adapter.notifyDataSetChanged() thanks @karimov0147