Comments (7)
Just add
new Tooltip.Builder(101).withStyleId(R.style.ToolTipLayoutCustomStyle)
and in your style.xml you can set bold|italic or change textColor too
<style name="ToolTipLayoutCustomStyle">
<item name="ttlm_padding">20dip</item>
<item name="ttlm_strokeColor">#ffe5a000</item>
<item name="ttlm_backgroundColor">#ffe5c700</item>
<item name="ttlm_strokeWeight">1dip</item>
<item name="ttlm_cornerRadius">10dip</item>
<item name="ttlm_overlayStyle">@style/ToolTipOverlayCustomStyle</item>
<item name="android:textAppearance">@style/ToolTipTextStyle</item>
</style>
<style name="ToolTipTextStyle">
<item name="android:textStyle">bold|italic</item>
<item name="android:textColor">@color/black_color</item>
</style>
<style name="ToolTipOverlayCustomStyle">
<item name="android:color">@color/white_color</item>
<item name="ttlm_repeatCount">1</item>
<item name="ttlm_duration">600</item>
<item name="android:alpha">0.2</item>
<item name="android:layout_margin">8dp</item>
</style>
maybe this is missing in README.md
from android-target-tooltip.
It was very late but simple and neat way is just override textcolor only.
<style name="ToolTipLayoutHoianStyle" parent="ToolTipLayoutDefaultStyle">
<item name="android:textAppearance">@style/ToolTipTextStyle</item>
</style>
<style name="ToolTipTextStyle">
<item name="android:textColor">@color/white</item>
</style>
from android-target-tooltip.
The easiest way I have found to change the text color is, as you said, changing the custom view.
It wasn't so difficult.
I just copied the tooltip_textview.xml of this library, added it to my project and added one line of code: android:textColor="@color/myColor"
. Then I have set the custom view to the Builder with this code .withCustomView(R.layout.tooltip_textview, false)
.
from android-target-tooltip.
I just hit this snag as well, where the custom style for the tooltip doesn't seem to respect android:textColor
. Rather than use a custom view and lose the nice pointed arrow that comes with the built-in view, I did the following to make my tooltip's text white:
// Build your tooltip and show it first, then...
final View tooltipView = TooltipManager.getInstance().get(idUsedToCreateTooltip);
final TextView tooltipTextView = (TextView) tooltipView.findViewById(android.R.id.text1);
tooltipTextView.setTextColor(getResources().getColor(android.R.color.white));
from android-target-tooltip.
@Desno365 Can you please share the example using .withCustomView
? For some reason, the tooltip doesn't pick anything else other than the XML attributes that were already there in tooltip_textview
.
from android-target-tooltip.
@rohan20 I'm sorry but I commented on here 4 years ago. I don't even remember for what I used this library.
from android-target-tooltip.
TooltipLayout_ttlm_textStyle
So using:
<style name="ToolTipLayoutDefaultStyle">
<item name="ttlm_padding">30dp</item>
<item name="ttlm_strokeColor">#2B3339</item>
<item name="ttlm_backgroundColor">#2B3339</item>
<item name="ttlm_strokeWeight">1dp</item>
<item name="ttlm_cornerRadius">2dp</item>
<item name="ttlm_arrowRatio">1</item>
<item name="ttlm_elevation">4dp</item>
<item name="ttlm_textStyle">@style/ToolTipTextStyleCustom</item>
</style>
<style name="ToolTipTextStyleCustom" parent="TextAppearance.AppCompat.Small">
<item name="android:textColor">@color/white</item>
<item name="android:textColorHighlight">@color/white</item>
<item name="android:textColorHint">@color/white</item>
<item name="android:textColorLink">@color/white</item>
<item name="android:textSize">24sp</item>
</style>
You will receive an error if you do not have these:
<item name="android:textColorHighlight">@color/white</item>
<item name="android:textColorHint">@color/white</item>
<item name="android:textColorLink">@color/white</item>
since appcompat does not handle those.
Have fun like I had while debugging this.
from android-target-tooltip.
Related Issues (20)
- Gravity.TOP not honored with fitToScreen=True HOT 4
- Not able to click outside HOT 1
- How to have multiple gravity to the tooltip? HOT 1
- Does this work with ConstrainLayout? HOT 1
- There is a problem when Show In Multi Fragments
- Unable to show double values HOT 1
- Fix tooltip issue in RTL layout HOT 4
- How to you use in Java? HOT 2
- not working with status bar
- Missing documentation
- Latest version (2.0.5) not published in Jitpack HOT 1
- Positioning issues when upgrading from 1.x to 2.x
- Positioning Issue: Tip Window appear to be more bottom on Android 11 HOT 6
- Ripple effect is not animated in release build HOT 2
- How to set margin start
- Crashes when loading animation
- Type inference failed at new kotlin version
- Dependencies arent working HOT 1
- Arrow located is wrong on landscape on Samsung S10 API 31 HOT 1
- Stop Floating Animation of tooltip view
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 android-target-tooltip.