Comments (9)
Could you please rebuild it using the setLifecycleOwner
method?
The lifecycleOwner should be viewlifecycleowner
, not fragment's lifecycle owner.
from balloon.
class InPlayerEmptyFoldersListBalloonFactory : Balloon.Factory() {
override fun create(context: Context, lifecycle: LifecycleOwner?): Balloon {
val textForm = textForm(context) {
setTextResource(R.string.emptylistfolder)
setTextSize(15f)
}
return createBalloon(context) {
setArrowSize(10)
setArrowPosition(0.5f)
setCornerRadius(10f)
setTextForm(textForm)
setArrowOrientation(ArrowOrientation.BOTTOM)
setIconDrawableResource(R.drawable.icon_24dp_warning)
setTextColorResource(R.color.textColor)
setBackgroundColorResource(R.color.colorBalloon)
setPadding(6)
setDismissWhenTouchOutside(true)
setBalloonAnimation(BalloonAnimation.ELASTIC)
setLifecycleOwner(lifecycle)
build()
}
}
}
Here is my factory. I'm using setLifecycleOwner method. What should I change exactly?
from balloon.
Hmm, I think it is caused because the context is already destroyed in the fragment but tried to create or dismiss the balloon. I recommend to use viewLifecycleOwner
or requireActivity()
as a parameter instead of this
, requireContext()
, lifecycleOwner
.
from balloon.
Sorry, I newbie in android, I can't figure out where should I modify exactly.
So I have an instance:
private val inPlayerEmptyFoldersListBalloonFactory by balloon(InPlayerEmptyFoldersListBalloonFactory::class)
and a showing:
binding.fixpointForBalloonToFolders.showAlignTop(inPlayerEmptyFoldersListBalloonFactory!!)
and a factory class:
class InPlayerEmptyFoldersListBalloonFactory : Balloon.Factory() {
override fun create(context: Context, lifecycle: LifecycleOwner?): Balloon {
return createBalloon(context) {
...
setLifecycleOwner(lifecycle)
build()
}
}
}
And I can't modify the constructor or the lifecycle parameter of setLifeCycleOwner.
Thank you for your patience.
from balloon.
Please, can you tell me what should I modify exactly in the methods?
from balloon.
Hi, it will be included in the next release: 34d0b5a
But I think the best way is to dismiss balloon when touched outside.
from balloon.
Hi!
Ok, thank you, I'll check it.
setDismissWhenTouchOutside(true) is in the factory but it's not solve the problem.
As you see on my gif, there will be two "false" balloon from previous page with setDismissWhenTouchOutside(true) and you have to touch outside three times before you can continue to use the app.
Is it not possible that the problem is the animation time? When the balloon start to pop up but it isn't ready yet then it's locking on the screen when you swipe in this exact time.
If the balloon is ready, you can't swipe with the first touch, because the first touch is dismissing the balloon (btw it's embarrassing a little, it will better if the touch would dismiss all balloons and start swiping).
from balloon.
Released a new version 1.2.0
.
Please try using a new version :)
from balloon.
Sorry, I created my own message boxes, which are part of the actual page so it hasn't got swipe or dismiss problems.
from balloon.
Related Issues (20)
- Working with ImageSpan HOT 6
- Check box inside layout custom menu. HOT 1
- Show next and previous item data without dismiss in recyclerview HOT 2
- 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 2
- 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
- request a Gaussian Blur overlay HOT 1
- How can I blur the overlay? HOT 1
- Support Compose Multiplatform
- Balloon content not visible in dark theme HOT 6
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.