B4A Library Music Cover View

A wrapper for this GitHub library https://github.com/andremion/Music-Cover-View

A Subclass of ImageView that 'morphs' into a circle shape and can rotates. Useful to be used as album cover in Music apps.

MusicCoverView
Author:
SMM
Version: 0.02
  • MusicCoverView
    Events:
    • _morphend(mv As MusicCoverView)
    • _rotateend (mv As MusicCoverView)
    • _click
    Fields:
    • ba As BA
    Methods:
    • BringToFront
    • Initialize (EventName As String)
    • Invalidate
    • Invalidate2 (arg0 As Rect)
    • Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • IsInitialized As Boolean
    • Morph
    • RemoveView
    • RequestFocus As Boolean
    • SendToBack
    • SetBackgroundImage (arg0 As Bitmap)
    • SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
    • SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
    • SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
    • Start
    • isRunning As Boolean
    • stop
    Properties:
    • Background As Drawable
    • Color As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • Left As Int
    • Parent As Object [read only]
    • Shape As Int [read only]
    • Tag As Object
    • Top As Int
    • TrackColor As Int
    • Visible As Boolean
    • Width As Int
 

Attachments

Last edited:
Sweet and cool!
Will try it as soon as I have a moment.
 
Can you post a demo app or some code showing how to use the wrapper. Where do I assign the image to use and so forth?
 
Can you post a demo app or some code showing how to use the wrapper. Where do I assign the image to use and so forth?
This is my not very neat sample
Code: Copy
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim mcv As MusicCoverView
End Sub
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
'    Activity.LoadLayout("Layout1")
    mcv.Initialize("mcv")
    Activity.AddView(mcv,0,0,50%x,50%y)
    mcv.SetBackgroundImage(LoadBitmap(File.DirAssets,"ba.png"))
    mcv.Morph
'    mcv.Start
End Sub

Sub mcv_rotateend
    Log("mcv_onRotateEnd")
    mcv.Morph
End Sub

Sub mcv_morphend
    Log("mcv_onMorphEnd")
    mcv.Start

End Sub
Sub mcv_click
    Log("mcv_click")
    mcv.stop
End Sub
 
Hi..
I put it into practice but it did not work .. I am making a mistake.
 

Attachments

I put it into practice but it did not work .. I am making a mistak
i dont see any posted errormessage!?

Edit: Your project is working fine here
 
But it does not move.

The picture is not returning.
 
Last edited:
Rotatable, but the picture does not change into a circle, and has always been a square picture in rotation
 
You guys are right .
I don't know why it does not change into circle .
I will see what I can do
 
I uploaded v2 it does not fix the problem but now you get musiccover object in morphend and rotateend events just as original library so we can try something like this (from sample app)
Code: Copy
@Override
            public void onMorphEnd(MusicCoverView coverView) {
                if (MusicCoverView.SHAPE_CIRCLE == coverView.getShape()) {
                    coverView.start();
                }
which I already tried unsuccessfully :D
 
Back
Top