I have a ListView in my activity. which consists of no of textviews. I performed a drag n drop action on textviews. So i want when i drag one item then the item above & below of it should be higlighted as Tooltip. How can I do it. Please give me answer Thanx
you can draw a drawable with the below code and name it as tooltip.xml
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:top="2dp" android:left="0dp" android:height="25dp" android:width="30dp">
<shape android:shape="rectangle">
<solid android:color="@color/seekbar_color">
</solid>
<corners android:radius="4dp"></corners>
</shape>
</item>
<item android:left="7.5dp" android:height="15dp" android:width="15dp">
<rotate
android:fromDegrees="45"
android:toDegrees="45">
<shape
android:shape="rectangle" >
<solid
android:color="@color/seekbar_color" />
</shape>
</rotate>
</item>
It will look something like this
You can further use it in a textview as a background
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/tooltip"
android:text="0.5x"
android:padding="4dp"
android:gravity="center"
android:textSize="12sp"
android:onClick="SaveSpeedMainClick"
android:id="@+id/textview_activitysave_speed_segment_main"
android:textColor="@color/white"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With