All Projects → henryblue → MiniMusicView

henryblue / MiniMusicView

Licence: Apache-2.0 license
A simple custom music play widget

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to MiniMusicView

Flutter app
🔥🔥🔥本项目包括各种基本控件使用(Text、TextField、Icon、Image、Listview、Gridview、Picker、Stepper、Dialog、Slider、Row、Appbar、Sizebox、BottomSheet、Chip、Dismissible、FlutterLogo、Check、Switch、TabBar、BottomNavigationBar、Sliver等)、豆瓣电影、tubitv、每日一文、和天气、百姓生活、随机诗词、联系人、句子迷、好奇心日报、有道精品课、高德定位、音乐播放器🎵、追书神器等板块
Stars: ✭ 2,140 (+6803.23%)
Mutual labels:  widget, musicplayer
text-style-editor
Text style editor widget for flutter
Stars: ✭ 25 (-19.35%)
Mutual labels:  widget
wui
Collection of GUI widgets for the web
Stars: ✭ 44 (+41.94%)
Mutual labels:  widget
flutter easyloading
✨A clean and lightweight loading/toast widget for Flutter, easy to use without context, support iOS、Android and Web
Stars: ✭ 1,021 (+3193.55%)
Mutual labels:  widget
ProgressBar
Beautiful progress bar for android
Stars: ✭ 62 (+100%)
Mutual labels:  widget
vercel-toast
💬 Framework-agnostic vercel design's toast component (≈1KB Gzipped)
Stars: ✭ 67 (+116.13%)
Mutual labels:  widget
Qt-Timeline-Widget
[Qt控件] 时间轴列表控件
Stars: ✭ 43 (+38.71%)
Mutual labels:  widget
cryptocoins-desklet-cinnamon
Cryptocurrency Ticker (Desklet) for Cinnamon Desktop that displays the current price for thousands of cryptocurrencies, and their daily percent changes.
Stars: ✭ 18 (-41.94%)
Mutual labels:  widget
AndroidUiKit
uikit widget common baseview Adapter faster develop
Stars: ✭ 48 (+54.84%)
Mutual labels:  widget
TagsView
Simple and highly customizable Xamarin.iOS tag list view. Originally inspired by https://github.com/ElaWorkshop/TagListView
Stars: ✭ 20 (-35.48%)
Mutual labels:  widget
notebookJS
notebookJS: seamless JavaScript integration in Python Notebooks
Stars: ✭ 149 (+380.65%)
Mutual labels:  widget
js-year-calendar
A fully customizable year calendar widget
Stars: ✭ 164 (+429.03%)
Mutual labels:  widget
netlify-cms-widget-starter
A boilerplate for creating Netlify CMS widgets.
Stars: ✭ 74 (+138.71%)
Mutual labels:  widget
instagram-widget-by-wpzoom
The easiest way to add a nice Instagram widget on your WordPress site. It just works!
Stars: ✭ 22 (-29.03%)
Mutual labels:  widget
kde-plasmoid-betterinlineclock
Your usual clock widget, just way better and on a single line!
Stars: ✭ 18 (-41.94%)
Mutual labels:  widget
orderable stack
A Flutter orderable stack widget
Stars: ✭ 83 (+167.74%)
Mutual labels:  widget
telekom-data-usage-widget
Telekom Datennutzung Widget für iOS 14
Stars: ✭ 61 (+96.77%)
Mutual labels:  widget
flutter code input
Flutter Code Input
Stars: ✭ 69 (+122.58%)
Mutual labels:  widget
SvgViewerWidgetTWX
Thingworx widget for runtime display and manipulation of a SVG
Stars: ✭ 13 (-58.06%)
Mutual labels:  widget
nl.fokkezb.form
[UNMAINTAINED] Alloy TableView Form Widget
Stars: ✭ 43 (+38.71%)
Mutual labels:  widget

MiniMusicView

A music player widget to add custom layout.

ScreenShot

   

Usage

First you can add gradle dependency with command :

dependencies {
    ......
    compile 'com.henryblue.minimusicview:library:1.0.1'
   }

To add gradle dependency you need to open build.gradle (in your app folder,not in a project folder) then copy and add the dependencies there in the dependencies block;

Use default layout

1.Add MiniMusicView in your layout

    <com.hrb.library.MiniMusicView
        android:id="@+id/mmv_music"
        app:isLoadLayout="true"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

2.set music url and play music

   mMusicView = (MiniMusicView) findViewById(R.id.mmv_music);
   mMusicView.setTitleText("music name");
   mMusicView.setAuthor("singer name");
   mMusicView.startPlayMusic("music url");
   
   // Or through the new way to create view object
   // mMusicView = new MiniMusicView(this);
   // mMusicView.initDefaultView();
   // mMusicView.setTitleText("music name");
   // mMusicView.startPlayMusic("music url");

3.stop play music

    @Override
    protected void onDestroy() {
        mMusicView.stopPlayMusic();
        super.onDestroy();
    }

Achieve the effect of the first picture above.

Use custom layout

1.Add MiniMusicView in your layout

    <com.hrb.library.MiniMusicView
        android:id="@+id/mmv_music"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

2.set layout, music url and play music

   mMusicView = (MiniMusicView) findViewById(R.id.mmv_music);
   View view = View.inflate(CustomActivity.this, R.layout.layout_custom_music, null);
   TextView title = (TextView) view.findViewById(R.id.tv_music_play_title);
   title.setText("music name");
   mMusicView.addView(view);
   mMusicView.startPlayMusic("music url");
   // Or through the new way to create view object
   // mMusicView = new MiniMusicView(this);
   // mMusicView.addView(view);
   // mMusicView.startPlayMusic("music url");

3.you can also set MiniMusicView listener

   mMusicView.setOnMusicStateListener(new MiniMusicView.OnMusicStateListener() {
            @Override
            public void onPrepared(int duration) {
                Log.i(TAG, "start prepare play music");
            }

            @Override
            public void onError() {
                Log.i(TAG, "start play music error");
            }
            
            @Override
            public void onInfo(int what, int extra) {
                Log.i(TAG, "start play_mini_music music info");
            }
            
            @Override
            public void onMusicPlayComplete() {
                Log.i(TAG, "start play music completed");
            }

            @Override
            public void onSeekComplete() {
                Log.i(TAG, "seek play music completed");
            }

            @Override
            public void onProgressUpdate(int duration, int currentPos) {
                Log.i(TAG, "play music progress update");
            }

            @Override
            public void onHeadsetPullOut() {
                Log.i(TAG, "headset pull out");
            }
        });

License

Copyright 2016 henryblue

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].