仿网易音乐播放器MaterialMusicPlayerView

仿网易音乐播放器MaterialMusicPlayerView_第1张图片
QQ截图20161121155255.png

先看下XML文件

   
     
   
      
   
    
   

再看下MainActivity文件

public class MainActivity extends Activity {    
  MaterialMusicPlayerView mpv;    
    @Override  
  protected void onCreate(Bundle savedInstanceState) {    
      super.onCreate(savedInstanceState);      
      setContentView(R.layout.activity_main);      
      mpv = (MaterialMusicPlayerView) findViewById(R.id.mpv);       
      mpv.setCoverURL("http://ww2.sinaimg.cn/large/610dc034gw1f9zjk8iaz2j20u011hgsc.jpg");     
      mpv.setTimeColor(R.color.color_gray);    
      //音乐播放时间300s      
     mpv.setMax(300);     
     mpv.setOnClickListener(new View.OnClickListener() {    
      @Override       
      public void onClick(View v) {         
        if (mpv.isRotating())              
          mpv.stop();             
       else                  
           mpv.start();        
       }      
  });   
 }}

请去github下载详细代码:
https://github.com/amineghabi/Material_MusicPlayerView

你可能感兴趣的:(仿网易音乐播放器MaterialMusicPlayerView)