Surface wave shape view--Third party open source--waveview (power, energy, capacity indication)

Source: Internet
Author: User

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.