すぐに吹き出しがつくれちゃうAndoridのUIライブラリ、BubbleViewを試す。
いつもの
compile 'com.lguipeng.bubbleview:library:1.0.0'
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" xmlns:app="http://schemas.android.com/apk/res-auto" tools:context=".MainActivity"> <com.github.library.bubbleview.BubbleTextVew android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello BubbleTextVew" android:padding="10dp" android:textColor="@android:color/white" app:arrowWidth="8dp" app:angle="2dp" app:arrowHeight="10dp" app:arrowPosition="14dp" app:arrowLocation= "right" app:bubbleColor="#7EC0EE"/> <com.github.library.bubbleview.BubbleTextVew android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello BubbleTextVew" android:padding="10dp" android:textColor="@android:color/white" app:arrowWidth="8dp" app:angle="2dp" app:arrowHeight="10dp" app:arrowPosition="14dp" app:arrowLocation= "left" app:bubbleColor="#000000"/> <com.github.library.bubbleview.BubbleTextVew android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello BubbleTextVew" android:padding="10dp" android:textColor="@android:color/white" app:arrowWidth="20dp" app:angle="10dp" app:arrowHeight="30dp" app:arrowPosition="14dp" app:arrowLocation= "top" app:bubbleColor="#777"/> <com.github.library.bubbleview.BubbleTextVew android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello BubbleTextVew" android:padding="10dp" android:textColor="@android:color/white" app:arrowWidth="8dp" app:angle="10dp" app:arrowHeight="10dp" app:arrowPosition="14dp" app:arrowLocation= "bottom" app:bubbleColor="#F5A9D0"/> </LinearLayout>
吹き出しの先端は、”app:arrowLocation”で指定できる。
- top
- left
- right
- bottom
吹き出しの太さや高さも設定でき、角を丸くしたりもできる。