crisp-im / crisp-sdk-android

:package: Crisp Android SDK, add a chat in any Android app and communicate with your users.
https://docs.crisp.chat/guides/chatbox-sdks/android-sdk/
Other
55 stars 17 forks source link

Api 34, (statusBarColor white), and (windowLightStatusBar false) by default... #171

Closed octasync closed 1 week ago

octasync commented 3 months ago

Api 34 Screenshot: image Api 29 Screenshot: image

Changing default style in manifest application block, nothing changed. Just check this bug, maybe i did something wrong. (Java+Xml)

Doc1faux commented 3 months ago

Hi @quadrowsx and sorry for the late reply, I was quite busy last couple of days ^^" The ChatActivity is completely transparent/translucent but a dim is applied to show the calling activity behind to mimic a BottomSheet behavior as you could have implemented in your own app.

Here is the theme applied to it:

<style name="CrispTheme.NoActionBar"  parent="Theme.Material3.DayNight.NoActionBar">
        <item name="android:backgroundDimEnabled">true</item> <!-- to apply the dim effect -->
        <item name="android:navigationBarColor">?attr/colorSurface</item> <!-- the same as the BottomSheet background -->
        <item name="android:windowLightNavigationBar" tools:targetApi="o_mr1">true</item> <!-- to be compatible with the BottomSheet background -->

        <!-- and to see the calling activity through -->
        <item name="android:statusBarColor">@android:color/transparent</item> 
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:windowIsTranslucent">true</item>
</style>

In a sample app with a minimalist Theme, all is working

values/styles.xml

<style name="AppTheme" parent="Theme.Material3.DayNight">
        <!-- colorSurface is kinda white -->
        <item name="colorPrimary">?attr/colorSurface</item> <!-- used for ActionBar -->
        <item name="colorPrimaryDark">?attr/colorSurface</item>  <!-- used for status bar -->
        <item name="android:windowLightStatusBar" tools:targetApi="m">true</item>
    </style>

values-night/styles.xml

<style name="AppTheme" parent="Theme.Material3.DayNight">
        <!-- colorSurface is kinda black -->
        <item name="colorPrimary">?attr/colorSurface</item>
        <item name="colorPrimaryDark">?attr/colorSurface</item>
         <item name="android:windowLightStatusBar" tools:targetApi="m">false</item>
    </style>

And here is a capture

https://github.com/crisp-im/crisp-sdk-android/assets/2175246/0e3075a1-6ede-40c2-8748-df04076ab41d

However, if you have tested on an emulator, I suggests you to update Android Studio and SDK as the dimming effect was not well working on API 34 emulators, see Google issue tracker - Dialogs of API 34 emulator have no dimmed background .

Hope this will help you.

baptistejamin commented 3 months ago

The ChatActivity is completely transparent/translucent but a dim is applied to show the calling activity behind to mimic a BottomSheet behavior as you could have implemented in your own app.

This is in reference to the Android Chatbox SDK, which can be integrated into an Android app in a few lines of code. The SDK is native and looks identical to the Web-based chatbox.

Doc1faux commented 1 week ago

Hi @octasync, is the solution I have provided you months ago fixed your issue?

I close the issue as it is stale, I let you reopen it if needed ;)