Как сделать настраиваемый диалог оповещения включенным эмодзи с анимацией - PullRequest
0 голосов
/ 04 июня 2019

вот мой макет 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>

, но это не похоже на то, что я хотел, поэтому, пожалуйста, помогите мне и смайликам в запуске анимации.I want to make similar like this

Ответы [ 2 ]

2 голосов
/ 04 июня 2019

Первый метод

Привет, ты можешь использовать библиотеку для этого Live emojis

Второй метод

Вы также можете использовать библиотеку Glide для загрузки gif

Glide.with(this).load(R.raw.sample_gif).into(imageViewTarget);
1 голос
/ 04 июня 2019
  1. Ниже приведено руководство по созданию настраиваемого диалогового окна в Android.

    Создание собственного диалогового окна .

  2. Узнав, как создать настраиваемое диалоговое окно, вы можете использовать библиотеку, например Lottie из https://github.com/airbnb/lottie-android.

  3. Вы можете найти анимацию для Лотти на их сайте https://lottiefiles.com/

...