ChatVoicePlayer
ChatVoicePlayer copied to clipboard
app:enableVisualizer="true" doesn't work.
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:
How can I solve this issue?
Have you added these:
app:visualizationPlayedColor="#ff7700"
app:visualizationNotPlayedColor="#727171"
?
@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:
@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.
@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 Okay I am working on an update, can you paste your XML implementation here?
@JagarYousef of course. You need the xml file of my activity, right?
yes please, it will be easier to debug
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:
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?
@JagarYousef Yes, I tried it but it still the same problem. This is what I see both in my emulator and my device.
@JagarYousef Hey, the error still exixts. What should I do?
i got the same error and i don't know why, anyway you made a great job man well done