Comments (3)
Hey,
The method of moving the tooltip into correct position after content change is subject to recalculate the updated tooltip size and basicly is equivalent to adding a new tooltip.
Have you tried to just remove the existing tooltip and add a new one with the updated content?
If you did tried that and still want an option to update the tooltip content, can you explain in more details how it will help you?
from tooltips.
Hey,
The thing is: I'm currently displaying a tooltip called by an onTextChanged listener. Which means there are alot of updates to the tooltip depending on whats entered inside my app.
Currently I get the tooltip view via the Tooltip manager, edit the text and translate the new X center to the center of the anchor view.
Sidenote: Quick question, do you know how to make your tooltips work inside a popup window?
I'm building up the tips via
EditText currentJoins = popUpView.findViewById(R.id.currentjoins);
EditText maxJoins = popUpView.findViewById(R.id.maxjoins);
ToolTip.Builder currentJoinsBuilder = new ToolTip.Builder(mainLayout.getContext(), currentJoins,
mainLayout,
getString(R.string.help_current_members), ToolTip.POSITION_LEFT_TO);
currentJoinsBuilder.setBackgroundColor(getColor(R.color.btOrange));
currentJoinsBuilder.setTextAppearance(R.style.TooltipTextAppearance);
ToolTip.Builder maxJoinsBuilder = new ToolTip.Builder(mainLayout.getContext(), maxJoins,
mainLayout,
getString(R.string.help_maximum_members), ToolTip.POSITION_RIGHT_TO);
maxJoinsBuilder.setBackgroundColor(getColor(R.color.btOrange));
maxJoinsBuilder.setTextAppearance(R.style.TooltipTextAppearance);
and after the popupwindow is shown:
popupWindow = new PopupWindow(popUpView, width, height, focusable);
popupWindow.setAnimationStyle(R.style.Animation);
//show the popup
popupWindow.showAtLocation(mainLayout, Gravity.CENTER, 0, 0);
mToolTipsManager.show(currentJoinsBuilder.build());
mToolTipsManager.show(maxJoinsBuilder.build());
But it seems to not work sadly. Any ideas?
from tooltips.
As I can understand from your example it seems that using the ToolTips library for your case is not the best choice. You are trying to achive a badge effect more then a tooltip effect. I would recommend you to create the currentJoin
view and maxJoin
view as part of your layout with a drawable as background and then you'll won't have any issue to update the text cause the layout constraints will make sure it will always be centered.
Regarding your sidenote, A quick check reveal that the coordinator finder return wrong values when trying to find the location of the popupWindow
thus placing the tooltip at a wrong position out of visible area.
from tooltips.
Related Issues (20)
- Tooltip view going outside of parent view. HOT 5
- RecyclerView HOT 3
- Tooltips much bigger than tooltip text needs when binding text from viewmodel HOT 6
- Tooltip not shown when calling from onCreate of Activity HOT 1
- Tooltip goes out of the screen. HOT 1
- ToolTip showing but not visible to the screen. HOT 1
- how to set custom tooltip width HOT 1
- Hide ToolTip On Click of Other View HOT 1
- JCenter sunset is announced; please republish library version(s) to Maven Central HOT 1
- Tooltip box size HOT 5
- Any plans to move to MavenCentral as JCenter is sunsetting on May 1st, 2021? HOT 1
- How to add Translation animation? HOT 2
- Tooltip size depending on text length HOT 3
- Can we create a custom view for the tooltip HOT 1
- builder.setTextSize(11); is not avaliable in 1.0.10 HOT 2
- App crash while show tooltip HOT 1
- Tooltip goes behind a cell in recycler view
- Tooltip view going outside
- Issue : Tooltip with RecyclerView
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 tooltips.