-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added API to set typeface, text appearances and animation #23
Conversation
…StyleRes int textAppearance)` API to allow library consumer to set text size color style and other attibutes. The typeface API allows the library consumers to set custom font to conform to branding look. [REMOVED] `setTextSize()` and `setTextColor()` API as it was redundant and covered by the new `setTextAppearance(@StyleRes int textAppearance)` API. [ADDED] Custom font https://fonts.google.com/specimen/Pacifico?selection.family=Pacifico to show case the `setTypeface(Typeface typeface)` API. Included the license in the assets directory.
Allow text appearance customization with README updated. This fixes tomergoldst#22
…more inclusive than `String` and `Spannable`. [REMOVED] Redundant `ToolTip.Builder()` with `Spannable` message after the API update, and updated code accordingly. [ADDED] First time tooltip message with span to showcase the possibility. [ADDED] `@Nullable` and `@NonNull` to be future proof _(kotlin tsk tsk)_.
…se_charsequence Allow spanable text on tooltip.
@tomergoldst I also improved a bit on the existing API which I want to make another PR. Take a look at hossain-khan#2 if you think this is okay, I will make the PR. Screenshot reference |
API changes were done in #2
…ager.setToolTipAnimator()`
Added New API to set custom animator for tooltip view.
Hey @amardeshbd, |
Hi @tomergoldst, |
@@ -27,9 +27,10 @@ | |||
/** | |||
* Created by Tomer on 18/06/2016. | |||
*/ | |||
class AnimationUtils { | |||
class AnimationUtils implements ToolTipAnimator { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you changed the meaning of this class please change the name of the class to represent this new meaning to DefaultToolTipAnimator
tipView.setVisibility(View.INVISIBLE); | ||
tipView.setGravity(toolTip.getTextGravity()); | ||
tipView.setTextAppearance(toolTip.getContext(), toolTip.getTextAppearanceStyle()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void setTextAppearance (Context context, int resId) is deprecated since api 23 please use approprite constructor
[ADDED] Documentation on setting the custom animator.
Address PR comments.
@tomergoldst Addressed PR comments. :-) |
Hey @tomergoldst thanks for the modern library for showing tooltip on UI.
While trying to use the library, I felt few limitations on how much can be customized for the tooltip view. I understand that you have a recommendation to use https://github.com/tomergoldst/hoverview if fully custom view is required.
But I believe with following customization changes, this library can be very useful as is. Efforts have been made to keep the original look and feel with some minor improvements. Comments to fix/improve any area is welcome.
FYI: Screenshots and animation images has been added on hossain-khan#1 to help you on #1
Changelog
Part 1
setTypeface(Typeface typeface)
andsetTextAppearance(@StyleRes int textAppearance)
API to allow library consumer to set text size color style and other attibutes. The typeface API allows the library consumers to set custom font to conform to branding look.setTextSize()
andsetTextColor()
API as it was redundant and covered by the newsetTextAppearance(@StyleRes int textAppearance)
API.setTypeface(Typeface typeface)
API. Included the license in the assets directory.Part 2
ToolTip.Builder()
withCharSequence
message that is more inclusive thanString
andSpannable
.ToolTip.Builder()
withSpannable
message after the API update, and updated code accordingly.@Nullable
and@NonNull
to be future proof (kotlin tsk tsk).Part 3
ToolTipsManager.setToolTipAnimator()
This PR also covers changes from #22
Screencast