Comments (6)
They @Breens-Mbaka, Balloon doesn't apply any Compose theme (Material, Material3, or custom themes), due to providing flexibility to users. So you should apply background color or text color depending on your theme.
balloonContent = {
Box(modifier = Modifier.background(MaterialTheme.colors.background)) {
Text(
color = //
)
}
}
The most recommended way is setting the colors when you build the Balloon.Builder
like the example below:
val background = MaterialTheme.colors.background
val textColor = if (isSystemInDarkTheme()) {
Color.White
} else {
Color.Black
}
val builder = rememberBalloonBuilder {
setBackgroundColor(background)
setTextColor(textColor)
setArrowSize(10)
from balloon.
Thanks @skydoves it has worked. I propose maybe this can be explicitly added to the README if it doesn't exist, so that people who have a challenge like mine will be helped and avoid raising the same issue again. What do you think ?
from balloon.
Hey @Breens-Mbaka, would you describe the details? It would be good if you can contain several code snippets and the result (screenshot). Also, do you use Compose or XML?
from balloon.
The demo project works well in dark theme since I've only used dark theme on my devices.
from balloon.
Hi @skydoves I'm using Compose and the issue comes up when I change from light theme to dark theme.
here is the code and screenshot of the balloon not adapting to the dark theme:
![Screenshot 2024-06-24 at 08 44 19](https://private-user-images.githubusercontent.com/72180010/342215580-4cd999da-4ea8-46a8-a73f-dc744cd10149.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIxMjQ2MjYsIm5iZiI6MTcyMjEyNDMyNiwicGF0aCI6Ii83MjE4MDAxMC8zNDIyMTU1ODAtNGNkOTk5ZGEtNGVhOC00NmE4LWE3M2YtZGM3NDRjZDEwMTQ5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI3VDIzNTIwNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFmMzA3OGVkODc4ZGQ1MzdjYzI4ODRhYzU3OTVhYzM0OWFmZWRmYzA5NDNkMWQ2ZjNhNmNhZjM0ZTk0ZmI2ODEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.-kruk9sYGhjmFPunkh3rTgftNnTVlNrs6rH2cf_CxNU)
![Screenshot 2024-06-24 at 08 51 34](https://private-user-images.githubusercontent.com/72180010/342216728-e775062c-9381-472c-ad12-d91b036a8346.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIxMjQ2MjYsIm5iZiI6MTcyMjEyNDMyNiwicGF0aCI6Ii83MjE4MDAxMC8zNDIyMTY3MjgtZTc3NTA2MmMtOTM4MS00NzJjLWFkMTItZDkxYjAzNmE4MzQ2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI3VDIzNTIwNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVhMzBmZmFkMGI1NGU5M2ZlZjExZTRhNDQ5NTMzZTRiZmNlM2E4MjVmYThiZDdlNGYwNTNlNjg1Y2ZhNzI4Y2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.AAzYnwUx7NQyZjl-0IWnUl3lariWpVFeus55LAW16Ug)
from balloon.
Hey @Breens-Mbaka, thank you for your report and feedback!
from balloon.
Related Issues (20)
- Prevent Balloon on theme changed HOT 1
- Compose: provide the way to get the end of the sequentially showed balloons. Still not working after 1.6.3 HOT 3
- Shadow have its left and right shadow clipped HOT 5
- Getting some stuttering when doing fast scrolling. HOT 1
- The balloon is swallowing keyboard input. HOT 2
- can i set width and height dynamically? HOT 3
- Compose Balloon position is misplace HOT 6
- Compose elements with `fillMaxWidth()` are cut on the edge HOT 4
- Arrow is not showing HOT 9
- Corner radius not set properly HOT 2
- PopupWindow not seen By Appium HOT 4
- Make popup reappear in `onResume` after being dismissed in `onPause` HOT 1
- ArrowOrientation.BOTTOM and END not working in M3 ModalBottomSheet HOT 3
- request a Gaussian Blur overlay HOT 1
- How can I blur the overlay? HOT 1
- Support Compose Multiplatform
- Crash Fatal Exception: java.lang.IllegalArgumentException The width of the balloon must bigger than zero. HOT 7
- Crash: Balloon$showAlignBottom$$inlined$show$1.run error HOT 1
- Support gradient color of overlay padding
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from balloon.