# droid-vizu **Repository Path**: ouyangpengdev/droid-vizu ## Basic Information - **Project Name**: droid-vizu - **Description**: Droid-vizu aims to provide customized visualization effects by easily swapping Renderer to get cool effects - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-03-23 - **Last Updated**: 2021-03-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Droid-vizu ![API](https://img.shields.io/badge/API-15%2B-blue.svg?style=flat) ![Download](https://api.bintray.com/packages/wotomas/maven/droid-vizu/images/download.svg) # About **Droid-vizu** aims to provide cool visualization effects for any Android audio project. Maintainable modular design allows users to easily swap Renderer class to get corresponding effects. # Demo (click for audio) [](https://youtu.be/cfoTQodcp9U) [](https://youtu.be/cfoTQodcp9U) [](https://youtu.be/cfoTQodcp9U) # Implement ```gradle repositories { jcenter() } dependencies { compile 'info.kimjihyok:droid-vizu:${droid-vizu}' } ``` ## XML Setup ```XML ``` ## Code Usage Simply Provide RippleVisualizerViw with an prepared Android MediaPlayer and set with a corresponding renderer ```java MediaPlayer mediaPlayer = MediaPlayer.create(getApplicationContext(), R.raw.sound_file); // or any other way to initialize media player are prepare() soundPlayerView = (SoundPlayerView) findViewById(R.id.sound_player_view); soundPlayerView.setMediaPlayer(mediaPlayer); soundPlayerView.setPlayStopListener(new SoundPlayerView.OnMediaControlListener() { @Override public void onPlay() { renderDemoView.play(); } @Override public void onStop() { renderDemoView.stop(); } }); renderDemoView = (RippleVisualizerView) findViewById(R.id.renderer_demo); renderDemoView.setMediaPlayer(mediaPlayer); renderDemoView.setCurrentRenderer(renderer); ``` ## Renderer Information Detailed information about parameters could be found in the source code! ### ColorBarRenderer []() ```java renderDemoView.setCurrentRenderer(new ColorfulBarRenderer(8, PaintUtil.getBarGraphPaint(Color.BLUE) , Color.parseColor("#FF0033") , Color.parseColor("#801AB3")) ``` ### BarRenderer []() ```java new BarRenderer(16, PaintUtil.getBarGraphPaint(Color.WHITE)); ``` ### LineRenderer []() ```java new LineRenderer(PaintUtil.getLinePaint(Color.YELLOW)); ``` ## Stop and Destory ```java // It is required to stop at onStop and to destory at onDestory to prevent memory leak and unexpected events @Override protected void onStop() { super.onStop(); soundPlayerView.onStop(); renderDemoView.stop(); } @Override protected void onDestroy() { super.onDestroy(); soundPlayerView.onDestroy(); renderDemoView.destroy(); } ```