This kind of waveview in some common application development, with the surface wave waveform image Vivid Display mobile phone also remaining how much electricity, the storage capacity is still how much, the comparison image is vivid.
Waveview on GitHub on the project homepage is: Https://github.com/john990/WaveView
Code:
Activity_main.xml:
1 <Framelayoutxmlns:android= "Http://schemas.android.com/apk/res/android"2 Xmlns:wave= "Http://schemas.android.com/apk/res-auto"3 Android:layout_width= "Match_parent"4 Android:layout_height= "Match_parent" >5 6 <!--Wave:above_wave_color -7 <!--Wave:blow_wave_color defines the color of the waveform, below the top waveform plane -8 <!--Wave_height Define the height of the wave -9 <!--the wave_hz defines the frequency of the wave fluctuations in hertz. -Ten <!--Wave_length defines the length of the wave - One <!--wave:progress is an integer value, with 0-100,100 representing the highest-level wave, and 0 for the lowest wave - A - <Com.john.waveview.WaveView - Android:id= "@+id/wave_view" the Android:layout_width= "Match_parent" - Android:layout_height= "Match_parent" - Android:background= "#1565C0" - Wave:blow_wave_color= "#1A237E" + wave:progress= "$" - Wave:wave_height= "Large" + wave:wave_hz= "normal" A Wave:wave_length= "Middle" /> at - <SeekBar - Android:id= "@+id/seek_bar" - Android:layout_width= "Match_parent" - Android:layout_height= "Wrap_content" - android:layout_gravity= "Bottom|center_horizontal" in Android:layout_marginbottom= "20DP" - android:progress= "$" /> to + </Framelayout>
Mainactivity:
1 PackageCom.zzw.testwaveview;2 3 Importandroid.app.Activity;4 ImportAndroid.os.Bundle;5 ImportAndroid.widget.SeekBar;6 7 ImportCom.john.waveview.WaveView;8 9 Public classMainactivityextendsActivity {Ten One PrivateSeekBar SeekBar; A PrivateWaveview Waveview; - - Public voidonCreate (Bundle savedinstancestate) { the Super. OnCreate (savedinstancestate); - Setcontentview (r.layout.activity_main); - -SeekBar =(SeekBar) Findviewbyid (R.id.seek_bar); +Waveview =(Waveview) Findviewbyid (R.id.wave_view); - +Seekbar.setonseekbarchangelistener (NewSeekbar.onseekbarchangelistener () { A @Override at Public voidOnprogresschanged (SeekBar SeekBar,intProgress, - BooleanFromuser) { - waveview.setprogress (progress); - } - - @Override in Public voidOnstarttrackingtouch (SeekBar SeekBar) { - to } + - @Override the Public voidOnstoptrackingtouch (SeekBar SeekBar) { * $ }Panax Notoginseng }); - } the}
Surface wave shape view--Third party open source--waveview (power, energy, capacity indication)