An Android library providing to realize wave loading effect.

Overview

WaveLoadingView

Android Arsenal License

WaveLoadingView - An Android library that provides a realistic wave-loading effect.

Sample

sample

Usage

For a working implementation of this project see the sample/ folder.

Step 1

Include the library as a local library project or add the dependency in your build.gradle.

dependencies {
    implementation 'me.itangqi.waveloadingview:library:0.3.5'
    // I have uploaded v0.3.5 on 2017-01-06, if it doesn't take effect or your
    // gradle cannot find it in maven central, you may try v0.3.4.
}

Or

Import the library, then add it to your /settings.gradle and /app/build.gradle. If you don't know how to do this, you can read my blog for help.

Step 2

Include the WaveLoadingView widget in your layout. And you can customize it like this.

<me.itangqi.waveloadingview.WaveLoadingView
    android:id="@+id/waveLoadingView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:wlv_borderColor="@color/colorAccent"
    app:wlv_borderWidth="3dp"
    app:wlv_progressValue="40"
    app:wlv_shapeType="circle"
    app:wlv_round_rectangle="true"
    app:wlv_triangle_direction="north"
    app:wlv_titleCenterStrokeColor="@android:color/holo_blue_dark"
    app:wlv_titleCenterStrokeWidth="3dp"
    app:wlv_titleCenter="Center Title"
    app:wlv_titleCenterColor="@android:color/white"
    app:wlv_titleCenterSize="24sp"
    app:wlv_waveAmplitude="70"
    app:wlv_waveColor="@color/colorAccent"/>   

Step 3

You can write some animation codes to the callbacks such as setOnCheckedChangeListener, onProgressChanged, etc in your Activity.

    WaveLoadingView mWaveLoadingView = (WaveLoadingView) findViewById(R.id.waveLoadingView);
    mWaveLoadingView.setShapeType(WaveLoadingView.ShapeType.CIRCLE);
    mWaveLoadingView.setTopTitle("Top Title");
    mWaveLoadingView.setCenterTitleColor(Color.GRAY);
    mWaveLoadingView.setBottomTitleSize(18);
    mWaveLoadingView.setProgressValue(80);
    mWaveLoadingView.setBorderWidth(10);
    mWaveLoadingView.setAmplitudeRatio(60);
    mWaveLoadingView.setWaveColor(Color.GRAY);
    mWaveLoadingView.setBorderColor(Color.GRAY);
    mWaveLoadingView.setTopTitleStrokeColor(Color.BLUE);
    mWaveLoadingView.setTopTitleStrokeWidth(3);
    mWaveLoadingView.setAnimDuration(3000);
    mWaveLoadingView.pauseAnimation();
    mWaveLoadingView.resumeAnimation();
    mWaveLoadingView.cancelAnimation();
    mWaveLoadingView.startAnimation();

Customization

Please feel free to :)

name format description
wlv_borderWidth dimension Border width, default is 0
wlv_borderColor color Border color
wlv_progressValue integer Pprogress value, default is 50
wlv_shapeType enum Shape type, default is circle
wlv_triangle_direction enum Triangle direction, default is north
wlv_round_rectangle boolean Is round rectangle, default is false
wlv_round_rectangle_x_and_y integer Round Rectangle corners, default is 30
wlv_waveColor color Wave color
wlv_wave_background_Color color Wave background color
wlv_waveAmplitude float Wave amplitude
wlv_titleTop string Top title content, default is null
wlv_titleCenter string Center title content, default is null
wlv_titleBottom string Bottom title content, default is null
wlv_titleTopSize dimension Top title size, default is 18
wlv_titleCenterSize dimension Center title size, default is 22
wlv_titleBottomSize dimension Bottom size, default is 18
wlv_titleTopColor color Top title color
wlv_titleCenterColor color Center title color
wlv_titleBottomColor color Bottom title color
wlv_titleTopStrokeColor color Top title stroke color
wlv_titleCenterStrokeColor color Center title stroke color
wlv_titleBottomStrokeColor color Bottom title stroke color
wlv_titleTopStrokeWidth dimension Top title stroke width
wlv_titleCenterStrokeWidth dimension Center title stroke width
wlv_titleBottomStrokeWidth dimension Bottom title stroke width

All attributes have their respective getters and setters to change them at runtime.

Change Log

0.3.5(2017-01-06)

Update:

  • Support change the frequency of the waves. #13 / #23

0.3.4(2017-01-05)

Update:

  • Support pause/resume wave. #28 / #26

Plan:

  • Support change the frequency of the waves

0.3.3(2016-10-14)

0.3.2(2016-07-29)

Update:

0.3.1(2016-07-23)

Update:

  • Added stroke feature to all titles. Strokes are disabled by default. by shayanzoro

0.3.0 (2016-06-07)

Fixed bugs:

  • How to set match_parent width? #12

0.2.3(2016-05-25)

Update:

  • Support the minSdkVersion to 14

0.2.2(2016-05-23)

Fixed bugs:

  • Default amplitude value #12

0.2.1 (2016-05-21)

Update:

  • Update more shape types like: Rectangle, Round Rectangle, Triangle...etc #7
  • Update build.gradle
  • Update Sample

Plan:

  • Title position fit shape size

0.2.0 (2016-02-17)

Implemented enhancements:

  • Prefix the attributes with "wlv"

Fixed bugs:

  • setProgressValue() increase doesn't conform to logic #8

Update:

  • Update build.gradle
  • Update Sample

0.1.5 (2016-01-14)

Fixed bugs:

  • IllegalArgumentException: width and height must be > 0 while loading Bitmap from View #6

0.1.4 (2015-12-17)

Fixed bugs:

  • setProgressValue() doesn't change the value of mProgressValue #4

0.1.3

Fixed bugs:

  • Attribute "borderWidth" has already been defined #2

Demo

Download

Apps using the WaveLoadingView

Feel free to send me new projects

Community

Looking for contributors, feel free to fork !

Tell me if you're using my library in your application, I'll share it in this README.

Thanks

Inspired by

Contact Me

Born in 1992, now a student of Southeast University, master of Software Engineering. Loving technology, programming, reading and sports.

I will graduate in June 2017, expect the internship or full-time job in Android or iOS.

If you have any questions or want to make friends with me, please feel free to contact me : imtangqi#gmail.com

License

Copyright 2016 Qi Tang

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • How to change the frequency of the waves ?

    How to change the frequency of the waves ?

    This widget is truly beautiful, but i need to lower the frequency of the waves, because there are many things shown on my screen and I need to have a focus somewhere else.

    Is there a way to do it easily ? If not, where can I try to do it ?

    Thanks for your work :-D

    opened by caminin 7
  • Shape types

    Shape types

    Hi again It works fine for me without any bug Thanks for that. @tangqi92 Is it possible to add different shapes like rectangle,Triangle,...etc it will be more compatible and more attractive

    opened by ParhamAhmadi 5
  • Stop or freeze wave

    Stop or freeze wave

    Great View, definitely am going to use it. But is there a way to stop animating or just frees waves or just to level "the water" without waves.

    Again great work,

    Omer

    opened by otatar 3
  • How to change the width and height of the waves?

    How to change the width and height of the waves?

    Hi.

    I need to change the width and height of the square waves but I can't.

    For example, if I set the layout_width to 30dp and layout_height to 100dp,

    the square is drawn the square which has 30dp width and height, not 30dp width and 100dp height.

    Is there any way to set the width and height?

    Thanks for your work. ^_^

    opened by ghost 2
  • Fix a bug that prevents Android Studio to render preview of the view

    Fix a bug that prevents Android Studio to render preview of the view

    Down side is that the current progress value will not show in preview


    This is the very first time I created a pull request in github.. I don't know if this is the correct way.. Forgive me if there's any problem

    opened by Meowzz95 1
  • Errors with setWaveColor and setBorderColor

    Errors with setWaveColor and setBorderColor

    I am able to set the various parameters inside the java code (amplitude, titles, border size, progress value), but when I try to use setWaveColor or setBorderColor, I get for both of them the following error: java.lang.IllegalArgumentException: width and height must be > 0

    Everithing except these errors works fine and I can see correctly the views. So, at the moment, it's not possible for me to change the color of the View depending on some values in the code.

    Thanks

    opened by SixianOne 1
  • java.lang.IllegalArgumentException: bitmap size exceeds 32bits

    java.lang.IllegalArgumentException: bitmap size exceeds 32bits

    java.lang.IllegalArgumentException: bitmap size exceeds 32bits at android.graphics.Bitmap.nativeCreate(Native Method) at android.graphics.Bitmap.createBitmap(Bitmap.java:940) at android.graphics.Bitmap.createBitmap(Bitmap.java:913) at android.graphics.Bitmap.createBitmap(Bitmap.java:880) at me.itangqi.waveloadingview.WaveLoadingView.c(ProGuard:394) at me.itangqi.waveloadingview.WaveLoadingView.onSizeChanged(ProGuard:377) at android.view.View.sizeChange(View.java:16002) at android.view.View.setFrame(View.java:15975) at android.view.View.layout(View.java:15882) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:15886) at android.view.ViewGroup.layout(ViewGroup.java:4932) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1055) at android.view.View.layout(View.java:15886) at android.view.ViewGroup.layout(ViewGroup.java:4932) at android.support.v4.widget.DrawerLayout.onLayout(ProGuard:1193) at android.view.View.layout(View.java:15886) at android.view.ViewGroup.layout(ViewGroup.java:4932) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:15886) at android.view.ViewGroup.layout(ViewGroup.java:4932) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1692) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1534) at android.widget.LinearLayout.onLayout(LinearLayout.java:1443) at android.view.View.layout(View.java:15886) at android.view.ViewGroup.layout(ViewGroup.java:4932) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:15886) at android.view.ViewGroup.layout(ViewGroup.java:4932) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1692) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1534) at android.widget.LinearLayout.onLayout(LinearLayout.java:1443) at android.view.View.layout(View.java:15886) at android.view.ViewGroup.layout(ViewGroup.java:4932) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:15886) at android.view.ViewGroup.layout(ViewGroup.java:4932) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2419) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2132) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1311) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6711) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:813) at android.view.Choreographer.doCallbacks(Choreographer.java:613) at android.view.Choreographer.doFrame(Choreographer.java:583) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:799) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:146) at android.app.ActivityThread.main(ActivityThread.java:5756) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107) at dalvik.system.NativeStart.main(Native Method)

    opened by Firefly822 0
  • Class WaveLoadingView could not be instantiated

    Class WaveLoadingView could not be instantiated

    java.lang.IllegalArgumentException: java.lang.ClassCastException@315ebef1 at sun.reflect.GeneratedMethodAccessor314.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at android.animation.PropertyValuesHolder_Delegate.callMethod(PropertyValuesHolder_Delegate.java:108) at android.animation.PropertyValuesHolder_Delegate.nCallFloatMethod(PropertyValuesHolder_Delegate.java:145) at android.animation.PropertyValuesHolder.nCallFloatMethod(PropertyValuesHolder.java) at android.animation.PropertyValuesHolder.access$400(PropertyValuesHolder.java:38) at android.animation.PropertyValuesHolder$FloatPropertyValuesHolder.setAnimatedValue(PropertyValuesHolder.java:1359) at android.animation.ObjectAnimator.animateValue(ObjectAnimator.java:989) at android.animation.ValueAnimator.setCurrentFraction(ValueAnimator.java:612) at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:578) at android.animation.ValueAnimator.start(ValueAnimator.java:1001) at android.animation.ValueAnimator.start(ValueAnimator.java:1010) at android.animation.ObjectAnimator.start(ObjectAnimator.java:852) at android.animation.AnimatorSet.start(AnimatorSet.java:678) at android.animation.AnimatorSet.onChildAnimatorEnded(AnimatorSet.java:807) at android.animation.AnimatorSet.start(AnimatorSet.java:640) at me.itangqi.waveloadingview.WaveLoadingView.setProgressValue(WaveLoadingView.java:564) at me.itangqi.waveloadingview.WaveLoadingView.init(WaveLoadingView.java:171) at me.itangqi.waveloadingview.WaveLoadingView.(WaveLoadingView.java:137) at me.itangqi.waveloadingview.WaveLoadingView.(WaveLoadingView.java:132) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:475) at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:262) at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:220) at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:186) at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:334) at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:345) at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:245) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:858) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70) at android.view.LayoutInflater.rInflate(LayoutInflater.java:834) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821) at android.view.LayoutInflater.inflate(LayoutInflater.java:518) at android.view.LayoutInflater.inflate(LayoutInflater.java:397) at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:324) at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:429) at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:368) at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:567) at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:549) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:863) at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:549) at com.android.tools.idea.rendering.RenderTask.lambda$inflate$1(RenderTask.java:680) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

    opened by stovberpv 0
  • Will this repository be migrated to maven central ?

    Will this repository be migrated to maven central ?

    JCenter is being sunset and all publishers are supposed to migrate to new host such as Maven Central

    While doing a gradle build following warning is displayed

    Please remove usages ofjcenter()Maven repository from your build scripts and migrate your build to other Maven repositories. This repository is deprecated and it will be shut down in the future. See http://developer.android.com/r/tools/jcenter-end-of-service for more information. Currently detected usages in: root project 'XXX', project ':app' Affected Modules: app

    Following are the notices for the jCenter being sunset. JCenter sunset notice Android Developer Update

    Are there any plans of shifting this repo to mavenCentral or any other host?

    opened by reachvineetjain 1
Owner
Tang
An iOS Engineer @WeChatApp
Tang
Android library to realize the various states and transitions in a ProgressBar.

StateProgressBar StateProgressBar is an Android library to realize the various states and transitions in a ProgressBar. Quick Start Get a feel of how

Kofi Gyan 1.5k Jan 9, 2023
Android loading or progress dialog widget library, provide efficient way to implement iOS like loading dialog and progress wheel

ACProgressLite English Version / 中文版本 An Android loading widget library. Lite and easy to use, strong customizability. Can be used to implement 'iOS'

Cloudist Technology Co., Ltd. 234 Nov 24, 2022
A wave view of android,can be used as progress bar.

WaveView ![Gitter](https://badges.gitter.im/Join Chat.svg) A wave view of android,can be used as progress bar. Screenshot APK demo.apk What can be use

Kai Wang 1.3k Dec 28, 2022
Some beautiful android loading drawable, can be combined with any view as the LoadingView or the ProgressBar. Besides, some Drawable can customize the loading progress too.

LoadingDrawable: Android cool animation collection 前言 CircleRotate源码解析 Fish源码解析 LoadingDrawable is some android animations implement of drawable: a li

dinus_developer 4.1k Dec 27, 2022
Loading layout is a container view that manages easy switching between loading, completed and other states of your screen with a single line.

Loading layout is a container view that manages easy switching between loading, completed and other states of your screen with a single line.

ValarTech 16 Jul 5, 2022
Customizable bouncing dots for smooth loading effect. Mostly used in chat bubbles to indicate the other person is typing.

LoadingDots for Android Customizable bouncing dots view for smooth loading effect. Mostly used in chat bubbles to indicate the other person is typing.

Eyal Biran 162 Dec 2, 2022
A highly configurable library to do loading progress with animated balls

Loading Balls A highly configurable library to do loading progress with animated balls for Android How to use Custom attributes lib:path="triangle" Th

Adrián Lomas 930 Dec 7, 2022
Android loading view

Loading Loading is a poject with kinds of Android loading view. Yan can see the wiki for more detail. RotateLoading BookLoading NewtonCradleLoading Us

null 1.2k Jan 1, 2023
ColoringLoading 4.7 0.0 Java This project provide Coloring Loading View for Android. And this project is not using the image file!

ColoringLoading ![Release](https://img.shields.io/github/release/recruit-lifestyle/ColoringLoading.svg?label=maven version) This project provide Color

Recruit Lifestyle Co. Ltd. 379 Jul 25, 2022
:seedling: A custom loading view for android, just like alipay.

#SmileyLoadingView A custom loading view, just like alipay. Usage Edit your layout XML: <cn.refactor.smileyloadingview.lib.SmileyLoadingView

null 411 Apr 24, 2022
Android loading animations

Android-SpinKit Android loading animations(I wrote a android edition according SpinKit) Demo Apk Preview Gradle Dependency dependencies { implement

ybq 8.4k Jan 5, 2023
KdLoadingView - A Custom Loading View for Android

KdLoadingView This is a circular loading view for android. Motivation In default progress view, its hard to change drawable, color and animation. So t

Saurabh kumar 1 Oct 26, 2022
An animated circle loading view

Animated Circle Loading View A determiante/indetermiante loading view animation. Based on android-watch-loading-animation by Nils Banner. How it looks

José Luis Martín 1.2k Dec 7, 2022
A loading animation based on Floating Action Button

FAB-Loading A loading animation based on Floating Action Button. Usage Include the LoadingView widget in your view: <io.saeid.fabloading.LoadingView

Saeed Masoumi 689 Oct 14, 2022
Some loading GIF .

Android GifLoadingView This project idea is from Link . Thanks for the idea. I like all the animation in that webpage , but it's so hard to develop al

Roger 1.3k Dec 12, 2022
MaterialLoadingProgressBar provide a styled ProgressBar which looks like SwipeRefreshLayout's loading indicator(support-v4 v21+)

MaterialLoadingProgressBar MaterialLoadingProgressBar provide a styled ProgressBar which looks like SwipeRefreshLayout's loading indicator(support-v4

lsjwzh 1.1k Nov 19, 2022
Cool bezier loading view

What's BezierLoadingView ? A cool loading view with Bezier and a smooth circular motion, Demo Features Bezier Circular motion ##Attributes name format

巴掌 828 Oct 10, 2022
a circle progress bar with effect

RingProgress a circle progress bar with effect #Preview ##Usage xml <com.ldoublem.ringPregressLibrary.RingProgress android:id="@+id/ring_prog

ldoublem 629 Nov 14, 2022
[Android] Round Corner Progress Bar Library for Android

RoundCornerProgressBar Round corner is cool. Let's make your progress bar to round corner Colorful progress bar with round corner on progress which yo

Akexorcist 2.3k Dec 31, 2022