ChatVoicePlayer icon indicating copy to clipboard operation
ChatVoicePlayer copied to clipboard

app:enableVisualizer="true" doesn't work.

Open Achisyg opened this issue 4 years ago • 12 comments

Hello, I have an issue with Visualizer. When I set app:enableVisualizer="false" progress bar is shown up, but when I set app:showShareButton="true" the recordview is looking like this: Capture

How can I solve this issue?

Achisyg avatar Oct 25 '21 13:10 Achisyg

Have you added these:

app:visualizationPlayedColor="#ff7700"
app:visualizationNotPlayedColor="#727171"

?

sleepynight2024 avatar Nov 05 '21 19:11 sleepynight2024

@JagarYousef Yes, I have added them but nothing is shown up. Is it a library lag? Here are 2 images of what I have added and what is shown both when the app is running and in the preview: Capture1 Capture2

Achisyg avatar Nov 09 '21 23:11 Achisyg

@Achisyg this is expected in the side preview but when you run the app and setAudio you will see the visualizer because it is rendered upon the voice file you gave it.

sleepynight2024 avatar Nov 11 '21 14:11 sleepynight2024

@JagarYousef thanks for your response. Well, when I run the app and set an audio file it is still empty like it is shown in the image above. However, if I set visualizer to false, then the progress bar is shown up as it is expected.

Achisyg avatar Nov 11 '21 14:11 Achisyg

@Achisyg Okay I am working on an update, can you paste your XML implementation here?

sleepynight2024 avatar Nov 11 '21 14:11 sleepynight2024

@JagarYousef of course. You need the xml file of my activity, right?

Achisyg avatar Nov 11 '21 14:11 Achisyg

yes please, it will be easier to debug

sleepynight2024 avatar Nov 11 '21 14:11 sleepynight2024

Here it is: `<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="false" android:padding="8dp" android:id="@+id/messageLayout">

<RelativeLayout
    android:id="@+id/relativo"
    android:layout_width="300dp"
    android:layout_height="wrap_content"
    android:layout_alignParentEnd="true"
    android:layout_alignParentRight="true"
    android:layout_marginTop="3dp"
    android:layout_marginBottom="2dp">


    <de.hdodenhof.circleimageview.CircleImageView
        android:id="@+id/profile_image"
        android:layout_width="40dp"
        android:layout_height="40dp"
        android:layout_alignParentRight="true"
        android:src="@drawable/avatar"
        android:visibility="invisible" />


    <TextView
        android:id="@+id/message"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="false"
        android:layout_marginRight="5dp"
        android:background="@drawable/sent_drawble"
        android:paddingLeft="15dp"
        android:paddingTop="5dp"
        android:paddingRight="7dp"
        android:paddingBottom="5dp"
        android:text="Hello"
        android:textColor="@color/black"
        android:textSize="18sp"
        android:visibility="visible"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />

    <ImageView
        android:id="@+id/feeling"
        android:layout_width="18dp"
        android:layout_height="18dp"
        android:layout_toLeftOf="@id/message"
        android:visibility="invisible"
        app:layout_constraintBottom_toBottomOf="@+id/message"
        app:layout_constraintEnd_toStartOf="@+id/message"
        app:layout_constraintStart_toStartOf="@+id/message"
        app:srcCompat="@drawable/heart" />


    <ImageView
        android:id="@+id/imageSnt"
        android:layout_width="100dp"
        android:layout_height="200dp"
        android:layout_alignParentEnd="true"
        android:background="@drawable/image_shape"
        android:visibility="visible"
        app:srcCompat="@drawable/avatar" />


    <me.jagar.chatvoiceplayerlibrary.VoicePlayerView
        android:id="@+id/voicePlayerView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:visibility="visible"
        app:enableVisualizer="false"
        app:playPauseBackgroundColor="#673AB7"
        app:playPauseCornerRadius="100"
        app:playProgressbarColor="#FFFFFF"
        app:progressTimeColor="#FFFFFF"
        app:seekBarProgressColor="#FFFFFF"
        app:seekBarThumbColor="#FFFFFF"
        app:shareBackgroundColor="#F1760A"
        app:shareCornerRadius="100"
        app:shareText="SHARE ME"
        app:showShareButton="false"
        app:showTiming="true"
        app:timingBackgroundColor="#6A000000"
        app:viewBackground="#F44336"
        app:viewCornerRadius="100"
        app:visualizationNotPlayedColor="#673AB7"
        app:visualizationPlayedColor="#FFFFFF" />

</RelativeLayout>

<TextView
    android:id="@+id/seenDeliverd"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@id/relativo"
    android:layout_alignParentEnd="true"
    android:layout_marginTop="0dp"
    android:layout_marginEnd="9dp"
    android:text="SeenDeliverd" />

</RelativeLayout>`

And here is the preview with visualizer=false: Capture

Achisyg avatar Nov 11 '21 15:11 Achisyg

After changing app:enableVisualizer="false" to app:enableVisualizer="true" it worked in my case as shown.
Did you try with another mp3 file when setAudio?

sleepynight2024 avatar Nov 14 '21 06:11 sleepynight2024

@JagarYousef Yes, I tried it but it still the same problem. This is what I see both in my emulator and my device. Capture

Achisyg avatar Nov 15 '21 09:11 Achisyg

@JagarYousef Hey, the error still exixts. What should I do?

Achisyg2 avatar Sep 12 '22 07:09 Achisyg2

i got the same error and i don't know why, anyway you made a great job man well done

MoatzAtteya avatar Jun 13 '23 06:06 MoatzAtteya