这是我的xml布局:
<LinearLayout
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="90dp"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/lyt_like"
android:gravity="center"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:src="@drawable/save"
android:layout_width="30dp"
android:layout_height="30dp" />
<TextView
android:text="Like"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<View
android:background="@color/bg_screen2"
android:layout_width="1dp"
android:layout_height="match_parent">
</View>
<LinearLayout
android:id="@+id/lyt_love"
android:gravity="center"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:src="@drawable/save"
android:layout_width="30dp"
android:layout_height="30dp" />
<TextView
android:text="Love"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<View
android:background="@color/bg_screen2"
android:layout_width="1dp"
android:layout_height="match_parent">
</View>
<LinearLayout
android:gravity="center"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:src="@drawable/save"
android:layout_width="30dp"
android:layout_height="30dp" />
<TextView
android:text="Sad"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<View
android:background="@color/bg_screen2"
android:layout_width="1dp"
android:layout_height="match_parent">
</View>
</LinearLayout>
<View
android:background="@color/bg_screen2"
android:layout_width="match_parent"
android:layout_height="1dp">
</View>
<LinearLayout
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="90dp"
android:orientation="horizontal">
<LinearLayout
android:gravity="center"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:src="@drawable/save"
android:layout_width="30dp"
android:layout_height="30dp" />
<TextView
android:text="laugh"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<View
android:background="@color/bg_screen2"
android:layout_width="1dp"
android:layout_height="match_parent">
</View>
<LinearLayout
android:gravity="center"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:src="@drawable/save"
android:layout_width="30dp"
android:layout_height="30dp" />
<TextView
android:text="Angry"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<View
android:background="@color/bg_screen2"
android:layout_width="1dp"
android:layout_height="match_parent">
</View>
<LinearLayout
android:gravity="center"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:src="@drawable/save"
android:layout_width="30dp"
android:layout_height="30dp" />
<TextView
android:text="Wow"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<View
android:background="@color/bg_screen2"
android:layout_width="1dp"
android:layout_height="match_parent">
</View>
</LinearLayout>
<View
android:background="@color/bg_screen2"
android:layout_width="match_parent"
android:layout_height="1dp">
</View>
<LinearLayout
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="90dp"
android:orientation="horizontal">
<LinearLayout
android:gravity="center"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:src="@drawable/save"
android:layout_width="30dp"
android:layout_height="30dp" />
<TextView
android:text="Me Too"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<View
android:background="@color/bg_screen2"
android:layout_width="1dp"
android:layout_height="match_parent">
</View>
<LinearLayout
android:gravity="center"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:src="@drawable/save"
android:layout_width="30dp"
android:layout_height="30dp" />
<TextView
android:text="Don't Worry"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<View
android:background="@color/bg_screen2"
android:layout_width="1dp"
android:layout_height="match_parent">
</View>
<LinearLayout
android:gravity="center"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:src="@drawable/save"
android:layout_width="30dp"
android:layout_height="30dp" />
<TextView
android:text="Consult Doctor"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<View
android:background="@color/bg_screen2"
android:layout_width="1dp"
android:layout_height="match_parent">
</View>
</LinearLayout>
答案 0 :(得分:2)
第一种方法
嗨,您可以使用该库Live emojis
第二种方法
您还可以使用Glide库加载gif
Glide.with(this).load(R.raw.sample_gif).into(imageViewTarget);
答案 1 :(得分:1)
您可以在下面查看在Android中创建自定义对话框的教程。
学习了如何创建自定义对话框后,您可以使用https://github.com/airbnb/lottie-android中的p
之类的库。
您可以在其网站https://lottiefiles.com/