帮酷LOGO
  • 显示原文与译文双语对照的内容
文章标签:播放器  play  音乐  Android 音乐播放器  VIEW  音乐播放器  
Custom android music player view.

  • 源代码名称:InteractivePlayerView
  • 源代码网址:http://www.github.com/iammert/InteractivePlayerView
  • InteractivePlayerView源代码文档
  • InteractivePlayerView源代码下载
  • Git URL:
    git://www.github.com/iammert/InteractivePlayerView.git
  • Git Clone代码到本地:
    git clone http://www.github.com/iammert/InteractivePlayerView
  • Subversion代码到本地:
    $ svn co --depth empty http://www.github.com/iammert/InteractivePlayerView
    Checked out revision 1.
    $ cd repo
    $ svn up trunk
  • InteractivePlayerView

    Join the chat at https://gitter.im/iammert/InteractivePlayerViewAndroid Arsenal

    自定义android音乐播放器视图。

    屏幕

    在youtube的youtube上查看它。

    用户定义的用法( XML )

    在xml文件中定义它。

     <co.mobiwise.library.InteractivePlayerView
     android:id="@+id/ipv"android:layout_width="230dp"android:layout_height="230dp"app:imageCover="@drawable/imagetest"app:emptyColor="#aaffffff"app:loadedColor="#fff44336"app:selectedAction1="@drawable/shuffle_selected"app:selectedAction2="@drawable/like_selected"app:selectedAction3="@drawable/replay_selected"app:unselectedAction1="@drawable/shuffle_unselected"app:unselectedAction2="@drawable/like_unselected"app:unselectedAction3="@drawable/replay_unselected"/>

    重要: 我设计洗牌,像我的演示应用的图标和重放图标。 你可以使用平面 icon 网站创建你的。 或者,如果你想使用我的而不是创建新的icon 集,那么你可以从这里下载我的操作集( 从这里开始) 。

    查找视图并设置必要的值。

    InteractivePlayerView ipv = (InteractivePlayerView) findViewById(R.id.ipv);
    ipv.setMax(123); // music duration in seconds.ipv.setOnActionClickedListener(newOnActionClickedListener() {
     @OverridepublicvoidonActionClicked(intid) {
     switch (id){
     case1://Called when 1. action is clicked.break;
     case2://Called when 2. action is clicked.break;
     case3://Called when 3. action is clicked.break;
     default:break;
     }
     }
     });

    开始和停止取决于你的球员。

    ipv.start();
    ipv.stop();
    用户定义的用法( Java )
    ipv.setCoverDrawable(R.drawable.imagetest);
    ipv.setActionOneImage(R.drawable.shuffle_selected, R.drawable.shuffle_unselected);
    ipv.setActionTwoImage(R.drawable.like_selected, R.drawable.like_unselected);
    ipv.setActionThreeImage(R.drawable.replay_selected, R.drawable.replay_unselected);
    ipv.setProgressEmptyColor(Color.GRAY);
    ipv.setProgressEmptyColor(Color.BLACK);
    有用的方法
    //Loads image from url (By Picasso)ipv.setCoverURL("http://abc.xyz/1.png");
    //edit your current progressipv.setProgress(12);int currentProgress = ipv.getProgress();
    //Check if any action selected or not. Or edit.boolean isSelected = ipv.isAction1Selected();
    ipv.setAction1Selected(true);
    //Check if ipv is playingipv.isPlaying();
    导入

    项目 build.gradle

    repositories {
     maven {
     url"https://jitpack.io"
     }
    }

    模块 build.gradle

    dependencies {
     compile 'com.github.iammert:InteractivePlayerView:f4f6490290'
    }
    设计

    这里是原始的设计工具。

    使用的

    的毕加索。

    许可证

    Copyright 2015 Mert Şimşek.
    Licensed under the Apache License, Version 2.0 (the"License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
     http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an"AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.


    文章标签:VIEW  play  播放器  音乐  音乐播放器  Android 音乐播放器  

    Copyright © 2011 HelpLib All rights reserved.    知识分享协议 京ICP备05059198号-3  |  如果智培  |  酷兔英语