How to create a helpful tooltip in Android [closed

2019-01-30 19:03发布

I would like to create a tooltip like thing in Android to help show my users what something is, as people have told me they don't know what it is. For an idea of what i'm after here is a drawing:

Diagram

5条回答
The star\"
2楼-- · 2019-01-30 19:35

There are several libraries available that will assist you in implementing tooltips in Android.

I recommend the Android Tooltip library which you can find on Github

Example usage:

Tooltip.make(this,
    new Builder(101)
    .anchor(aView, Gravity.BOTTOM)
    .closePolicy(new ClosePolicy()
        .insidePolicy(true, false)
        .outsidePolicy(true, false), 3000)
    .activateDelay(800)
    .showDelay(300)
    .text(R.string.hello_world)
    .maxWidth(500)
    .withArrow(true)
    .withOverlay(true)
    floatingAnimation(AnimationBuilder.DEFAULT)
    .build()
).show();
查看更多
Deceive 欺骗
3楼-- · 2019-01-30 19:39

For anyone just joining us from searching this.

This is a better Holo solution https://gist.github.com/romannurik/3982005

查看更多
Juvenile、少年°
4楼-- · 2019-01-30 19:51
Ridiculous、
5楼-- · 2019-01-30 19:57

You could use android-formidable-validation's .betterSetError() feature, customising the ErrorPopup balloon's background drawable and the error exclamation mark icon that gets set as the drawableRight in the EditText. To fine tune to your requirements you'd need to play with the code that lays out the ErrorPopup.

查看更多
虎瘦雄心在
6楼-- · 2019-01-30 19:58

This is the QuickAction UI pattern. Take a look at:

  1. GreenDroid, a collection of Android widgets - namely the QuickAction... widgets such as QuickActionBar, QuickActionGrid etc
  2. How to create a QuickAction dialog in Android
查看更多
登录 后发表回答