1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
<RelativeLayout
xmlns:android="
http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/activity_main_redtv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
<com.nhaarman.supertooltips.ToolTipRelativeLayout
android:id="@+id/activity_main_tooltipRelativeLayout"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ToolTipRelativeLayout toolTipRelativeLayout = (ToolTipRelativeLayout) findViewById(R.id.activity_main_tooltipRelativeLayout);
ToolTip toolTip = new ToolTip()
.withText("A beautiful View")
.withColor(Color.RED)
.withShadow()
.withAnimationType(ToolTip.ANIMATIONTYPE_FROMTOP);
myToolTipView = toolTipRelativeLayout.showToolTipForView(toolTip, findViewById(R.id.activity_main_redtv));
myToolTipView.setOnToolTipViewClickedListener(MainActivity.this);
}
|