lambiengcode / compose-chatgpt-kotlin-android-chatbot

Compose ChatGPT Kotlin - Android Chatbot using Kotlin + Jetpack Compose + Coroutine + MVVM + Retrofit2 + OpenAI's GPT-3 API. Allow stream response from ChatGPT API.
https://youtube.com/shorts/esLh-n3Ao5U
MIT License
226 stars 33 forks source link

Unable to change markdown's text color | unable to see text from ChatGPT #5

Closed wingsum93 closed 1 year ago

wingsum93 commented 1 year ago
圖片

This issue happen when i use light theme in my phone.

I found it unable to change the text color of Markdown component. The only possible solution is to change the "BackGroundMessageGPT" to other color.

wingsum93 commented 1 year ago
圖片

When i tried other question related to code answer.

Near707 commented 1 year ago

I present you another possible solution, in the path "java/com/chatgptlite/wanted/ui/common/AppDrawer.kt" An 'IconButton' is defined with a sun icon (WbSunny) inside it. When the button is clicked, currently no action is executed as the 'onClick' block is empty. To add functionality to the button, you can add code inside this onClick block.

Assuming you want to switch the app theme between light and dark when you click this button, you can do the following as an example:

Near707 commented 1 year ago

Create a ViewModel to handle the state of the theme:

Viewmodel.txt

Near707 commented 1 year ago

In your 'MainActivity.kt', use the 'ThemeViewModel' to change the theme based on the 'isDarkTheme' value and in your 'AppDrawer.kt' file, use the 'ThemeViewModel' to update the theme's state when clicking the button

wingsum93 commented 1 year ago

@Near707 I do not agree your approach as it is not need to write so many code to to only 1 thing.

Instead try to use local variable in compose (mutable state - boolean) , checkout #6 for detail

lambiengcode commented 1 year ago

Contributions are welcome! @wingsum93 and @Near707, this repo doesn't get much attention so I don't have the motivation to develop it further 😢...Hope it useful for you

wingsum93 commented 1 year ago

Contributions are welcome! @wingsum93 and @Near707, this repo doesn't get much attention so I don't have the motivation to develop it further 😢...Hope it useful for you

There are 2 selling points for this project comparing to other android chatGPT project:

So i think this project is useful for people who may want to develop chatGPT client @lambiengcode @Near707

lambiengcode commented 1 year ago

@wingsum93 Glad to hear about that 😄. This is my first project using Jetpack Compose. I use this project for learning and practice Compose.