File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed
java/io/github/douglasjunior/androidSimpleTooltip/sample Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 3535import android .widget .Button ;
3636import android .widget .EditText ;
3737
38+ import io .github .douglasjunior .androidSimpleTooltip .OverlayView ;
3839import io .github .douglasjunior .androidSimpleTooltip .SimpleTooltip ;
3940import io .github .douglasjunior .androidSimpleTooltip .SimpleTooltipUtils ;
4041
@@ -67,6 +68,7 @@ protected void onCreate(Bundle savedInstanceState) {
6768 findViewById (R .id .btn_custom_arrow ).setOnClickListener (this );
6869 findViewById (R .id .btn_dialog ).setOnClickListener (this );
6970 findViewById (R .id .btn_center ).setOnClickListener (this );
71+ findViewById (R .id .btn_overlay_rect ).setOnClickListener (this );
7072 }
7173
7274 @ Override
@@ -253,6 +255,17 @@ public void onClick(View v) {
253255 .gravity (Gravity .CENTER )
254256 .build ()
255257 .show ();
258+ } else if (v .getId () == R .id .btn_overlay_rect ) {
259+ new SimpleTooltip .Builder (this )
260+ .anchorView (v )
261+ .text (R .string .btn_overlay_rect )
262+ .gravity (Gravity .END )
263+ .animated (true )
264+ .transparentOverlay (false )
265+ .highlightShape (OverlayView .HIGHLIGHT_SHAPE_RECTANGULAR )
266+ .overlayOffset (0 )
267+ .build ()
268+ .show ();
256269 }
257270 }
258271}
Original file line number Diff line number Diff line change 113113 android : layout_height =" wrap_content"
114114 android : layout_gravity =" end"
115115 android : text =" @string/btn_center" />
116+
117+ <Button
118+ android : id =" @+id/btn_overlay_rect"
119+ android : layout_width =" wrap_content"
120+ android : layout_height =" wrap_content"
121+ android : layout_gravity =" start"
122+ android : text =" @string/btn_overlay_rect" />
116123 </LinearLayout >
117124 </ScrollView >
118125
Original file line number Diff line number Diff line change 1919 <string name =" btn_close" >Close</string >
2020 <string name =" btn_dialog" >Inside dialog</string >
2121 <string name =" btn_center" >Screen center</string >
22+ <string name =" btn_overlay_rect" >Overlay Rect</string >
2223
2324</resources >
You can’t perform that action at this time.
0 commit comments