Code Monkey home page Code Monkey logo

sivenwu / waveview Goto Github PK

View Code? Open in Web Editor NEW
185.0 8.0 27.0 1.09 MB

Imitate the Android progress of method, At present support functions:1. waveview to support the dynamic change of progress 2. waveview to support the progress callback Activity or fragments, use mask effect and the property animation 3. waveview to support custom change wave properties, including color wave, wave speed, wave shape of container (currently support circle, rectangular, and mask drawable).

Java 100.00%

waveview's Introduction

WaveView

Thank you for your support!

Imitate the Android progress of method, At present support functions:

  1. waveview to support the dynamic change of progress

  2. waveview to support the progress callback Activity or fragments, use mask effect and the property animation

  3. waveview to support custom change wave properties, including color wave, wave speed, wave shape of container (currently support circle, rectangular, and mask drawable)

Details you can run the Demo and study the source code.

My :

E-mail : [email protected]

Blog : http://www.jianshu.com/users/d388bcf9c4d3/

KeyWord rolling wave ,normal wave.waveview shapes,speed mode,shado...

Demo :

waveview.gif

How to use it?

First

Add repositories and dependencies into your project

    // repositories
    repositories {
      maven { url = 'https://dl.bintray.com/yuancloud/maven/' }
    }

    // dependencies
     compile 'cn.yuancloud.app:wavekit:1.0'

Add a WaveView into your XML

   <com.yuan.waveview.WaveView
            android:id="@+id/waveview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="20dp"
            android:layout_margin="20dp"
            android:layout_below="@id/radio_view_speed"
            app:backgroundColor="@color/white"
            app:progressColor="@color/black"
            app:max="20"
            />

"backgroundColor" is the view color

"progressColor" is the wave color

"max" is the max progress

Second

You can be a series of operations in the Activity or Fragment.such as :

(1) set WaveView Shape

  waveView.setMode(WaveView.MODE_RECT);

(2) set WaveView Color

waveView.setWaveColor(Color.RED);
waveView.setbgColor(Color.WHITE);

(3) set WaveView flowing speed

waveView.setSpeed(WaveView.SPEED_FAST);

(4) set WaveView progress or max

   waveView.setProgress(progress);
   waveView.setMax(100);

Last

How to listen progress of waveView in Activity or Fragmenet?

   waveView.setProgressListener(new WaveView.waveProgressListener() {
            @Override
            public void onPorgress(boolean isDone, long progress, long max) { 
                if (isDone){
                    Toast.makeText(MainActivity.this,"Loading completed!!!",Toast.LENGTH_SHORT).show();
                }
            }
        });

Thank you for your support!

Enjoy ~

waveview's People

Contributors

sivenwu avatar wusy1220 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

waveview's Issues

WaveView appears to have a minimum size

I am show these views to indicate progress and change their height depending on which one needs to be bigger for example if the progress is 10% I put a weight of 1 on the bottom and 9 on the top.

    </LinearLayout>
    <LinearLayout
            android:id="@+id/bottomView"
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:background="@color/colour_white"
            android:alpha=".3"
            android:layout_weight="99">
        <com.yuan.waveview.WaveView
                android:visibility="gone"
                android:id="@+id/waveView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:background="@color/white"
                app:progressColor="@color/black"
                />

    </LinearLayout>

When I added the Wave view this no longer works as it seems there is a minimum height. Have you any intentions of making that dynamic with the parent layout?

Damien

The gradle dependency in readme is not correct

The specified dependency is not correct.
compile 'cn.yuancloud.app:wavekit:1.0'

I changed the part cn.yuancloud.. to com.yuancloud... But it still doesn't work. There should be some other problem.

Android Studio is saying Failed to resolve: com.yuancloud.app:wavekit:1.0 during gradle sync

Progress Value is not saved while rotating and After API Call

I have API call to set Progress Value in my Waveview. But It's not saving the value. I save values to saveInstances but still it's not work. Also I want to mention that while I have 0 value of Progress but still it make a view Initially. Any solution regarding this? I need it as early as possible

question

When the label of the water wave interface is switched back and forth, the ripple pattern is not stable.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.