Giphy / giphy-android-sdk

Home of the GIPHY SDK Android example app, along with Android SDK documentation, issue tracking, & release notes.
https://developers.giphy.com/
Mozilla Public License 2.0
94 stars 37 forks source link

Text color appears black in Dark Theme. #199

Closed sonusinha-ptw closed 1 year ago

sonusinha-ptw commented 1 year ago

🐛 Bug Report

Searching for something without the Internet error text showing up (Oh No! something went wrong) in Black Color. can we have control over it, how can I change the color of this text.? Screenshot_1683723635

ALexanderLonsky commented 1 year ago

Hey @sonusinha-ptw, Thanks for flagging this issue! We're working on a new release that will offer a wider range of colors for customization. There's version available now, so you can give it a try:

implementation "com.giphy.sdk:ui:2.3.5-rc2"

It's a staging version and requires to add:

allprojects {
    repositories {
        maven("https://oss.sonatype.org/content/repositories/staging")
        mavenCentral()
    }
}

Additionally, it resolves the issue with the error message.

To customize colors you need to use GPHTheme.Custom

var settings = GPHSettings(theme = GPHTheme.Custom)

Then modify the required colors in this way:

GPHCustomTheme.apply {
            val currentNightMode = this@DemoActivity?.let {
                this@DemoActivity.resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK
            }
            val lightMode = (listOf(Configuration.UI_MODE_NIGHT_NO, Configuration.UI_MODE_NIGHT_UNDEFINED).contains(currentNightMode))

            if (lightMode) {
                defaultTextColor= 0xFF5C5C5C.toInt()
            } else {
                defaultTextColor= 0xFFFFFFFF.toInt()
            }
        }

If you need any clarification, please let me know.

ALexanderLonsky commented 1 year ago

Update:

https://github.com/Giphy/giphy-android-sdk/issues/200#issuecomment-1545883072

ALexanderLonsky commented 1 year ago

The new version has been released.