WaveLoadingView - 帮你轻松实现波浪式加载

jopen 9年前

WaveLoadingView - 帮你轻松实现波浪式加载,提供高度定制(各种姿势),总有一种玩法适合你。

使用说明:

 

第一步

 build.gradle

dependencies {      compile 'me.itangqi.waveloadingview:library:0.1.2'  }


第二步

放入布局中,你可以这样自定义:

<me.itangqi.waveloadingview.WaveLoadingView          android:id="@+id/waveLoadingView"          android:layout_width="wrap_content"          android:layout_height="wrap_content"          app:borderWidth="3"          app:borderColor="@color/colorAccent"          app:progressValue="40"          app:shapeType="circle"          app:waveColor="@color/colorAccent"          app:waveAmplitude="50"          app:titleTop="Top Title"          app:titleTopColor="@color/colorPrimaryText"          app:titleTopSize="20"          app:titleCenter="Center Title"          app:titleCenterColor="@color/colorPrimaryText"          app:titleCenterSize="24"          app:titleBottom="Bottom Title"          app:titleBottomColor="@color/colorPrimaryText"          app:titleBottomSize="20"

  

第三步

你可以在Activity的callbacks中写入一些动画,比如setOnCheckedChangeListener, onProgressChanged, 等等。

WaveLoadingView mWaveLoadingView = (WaveLoadingView) findViewById(R.id.waveLoadingView);      mWaveLoadingView.setShapeType(WaveLoadingView.ShapeType.CIRCLE);      mWaveLoadingView.setTopTitle("Top Title");      mWaveLoadingView.setCenterTitleColor(Color.GRAY);      mWaveLoadingView.setBottomTitleSize(18);      mWaveLoadingView.setProgress(80);      mWaveLoadingView.setBorderWidth(10);      mWaveLoadingView.setAmplitudeRatio(60);      mWaveLoadingView.setWaveColor(Color.GRAY);      mWaveLoadingView.setBorderColor(Color.GRAY);

自定义

想做什么就做什么:

app:borderWidth (integer) Default to be 0  app:borderColor (color)  app:progressValue (integer) Set ProgressValue  app:shapeType (circle/square) Default to be circle  app:waveColor (color)  app:waveAmplitude (integer) Set Wave Amplitude (between 1 and 100)  app:titleTopSize (float)  app:titleCenterSize (float)  app:titleBottomSize (float)  app:titleTopColor (color)  app:titleCenterColor (color)  app:titleBottomColor (color)  app:titleTop (string) default to be ""  app:titleCenter (string)  app:titleBottom (string)

所有的属性都有各自的 getters and setters 来动态改变自己。

Demo

下载

 

灵感来自

 

项目地址: https://github.com/tangqi92/WaveLoadingView