Introduction

In this article, we are going to create a Wave View in Android using Android Studio. It is a type of library which makes a wave in the UI. By using this, we can show the progress status in percentage. This view is widely used in mobile apps.
Step 1
Create a new project in Android Studio.
Android
Give a name to the project and click "Next".
Android
Select the "Phone and Tablet" option and click "Next".
Android
Select an empty activity and click "Next".
Android
At last, give the activity a name and click on "Finish".
Android
Step 2
Locate the Gradle Scripts>>Build. Gradle 1.
Android
And, type the following dependency in your app's build.gradle.
Android
Then, Click the sync button in the top right corner and repeat this for step 3.
Android
Code copy is here,
  1. maven{
  2. url 'https://jitpack.io'
  3. }
Step 3
Locate the Gradle Scripts>>Build. Gradle 2.
Android
Type the following dependency in your app's build.gradle.
Android
The code copy is here.
  1. compile 'com.github.john990:WaveView:v0.9'
Step 4
Next, go to app >> res >> layout >> activity_main.xml. Select activity page.
Android
Just type the code as following.
Android
The code copy is here.
  1. <SeekBar
  2. android:id="@+id/seekBar"
  3. android:max="100"
  4. android:layout_alignParentBottom="true"
  5. android:layout_width="match_parent"
  6. android:layout_height="wrap_content" />
  7. <com.john.waveview.Wave
  8. android:id="@+id/waveView"
  9. android:layout_above="@id/seekBar"
  10. android:background="#FF702E8C"
  11. android:layout_width="match_parent"
  12. android:layout_height="match_parent"
  13. app:above_wave_color="@android:color/white"
  14. app:blow_wave_color="@android:color/white"
  15. app:wave_height="large"
  16. app:wave_length="large"
  17. app:wave_hz="fast"
  18. />
Step 5
Next, go to app >> java>>Mainactivity.java. Select Mainactivity page.
Android
And just type the code as follows
Android
  1. import com.john.waveview.WaveView;
  2. public class MainActivity extends AppCompatActivity {
  3. @Override
  4. protected void onCreate(Bundle savedInstanceState) {
  5. super.onCreate(savedInstanceState);
  6. setContentView(R.layout.activity_main);
  7. final WaveView waveView =(WaveView)findViewById(R.id.waveView);
  8. SeekBar seekBar =(SeekBar)findViewById(R.id.seekBar);
  9. waveView.setProgress(seekBar.getProgress());
  10. seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
  11. @Override
  12. public void onProgressChanged(SeekBar seekBar, int progress, boolean b) {
  13. waveView.setProgress(progress);
  14. }
  15. @Override
  16. public void onStartTrackingTouch(SeekBar seekBar) {
  17. }
  18. @Override
  19. public void onStopTrackingTouch(SeekBar seekBar) {
  20. }
  21. });
Step 6
Verify the preview.
After the code is applied, the preview will appear like this.
Android
Step 7
Next, go to Android Studio and deploy the application. Select an Emulator or your mobile with USB debugging enabled. Give it a few seconds to make installations and set permissions.
Android
Run the application in your desired emulator (Shift + F10).
Android
Explanation of source code
The source code used in the activitymain.xml file will insert the Wave View into the app and render the animation with attributes given.

Summary

We have just created the app to see how the Wave View works and learned where to use it.
*Support and Share, Thank you*