GithubHelp home page GithubHelp logo

lsjwzh / materialloadingprogressbar Goto Github PK

View Code? Open in Web Editor NEW
1.1K 45.0 221.0 563 KB

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

License: Apache License 2.0

Java 100.00%

materialloadingprogressbar's Introduction

Android Weekly Android Arsenal

MaterialLoadingProgressBar

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

ProgressBar

Usage

how to import?

add this into gradle

compile('com.lsjwzh:materialloadingprogressbar:0.5.8-RELEASE')

xml:

<com.lsjwzh.widget.materialloadingprogressbar.CircleProgressBar
        android:id="@+id/progressBar"
        android:layout_width="60dp"
        android:layout_height="60dp"/>

options:

<com.lsjwzh.widget.materialloadingprogressbar.CircleProgressBar
        android:id="@+id/progressBar"

        app:mlpb_show_arrow="true"
        app:mlpb_arrow_height="5dp"
        app:mlpb_arrow_width="10dp"
        app:mlpb_enable_circle_background="true"

        app:mlpb_progress_stoke_width="5dp"
        app:mlpb_progress_text_visibility="visible"
        android:layout_width="60dp"
        android:layout_height="60dp"/>

java api:

show arrow

'CircleProgressBar' will not show arrow by default. You can enable arrow drawing like this:

    circleProgressBar.setShowArrow(true);

Disable circle background

There is a white circle background on drawing 'CircleProgressBar' by default. If you need hide the circle background,you can add a xml item

    app:mlpb_enable_circle_background="false"

or set it by java code

   circleProgressBar.setCircleBackgroundEnabled(false);

release notes:

0.5.7:  fix bugs
0.5.6:  fix bugs
0.5.5:  fix bug: android:visibility XML attribute does not work #6

0.5.4:  fix bug: attr progress_color invalid;Restarting Progress bar does not animate #5

0.5.3: 	add default ring color;fix bug:NPE happens when ring color has never been setted.

0.5.2: 	support setColorSchemeColors.

0.5.1:  fix bug: arrow be putting into incorrect position.    

0.5.0: 	support enable/disable circle back ground.    

0.4.0:  fix bug:#1 :progressbar can not hide.    
    	fix bug:#2 :progressbar show full ring when running  too long.
    	
0.3.0:  add showArrow option.

License

Copyright 2014 lsjwzh

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.

materialloadingprogressbar's People

Contributors

amatkivskiy avatar andforce avatar ashqal avatar geometer avatar lsjwzh 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  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

materialloadingprogressbar's Issues

i don't look the arrow

img

using this code
<com.lsjwzh.widget.materialloadingprogressbar.CircleProgressBar
android:id="@+id/progressBar"

    app:mlpb_show_arrow="true"
    app:mlpb_arrow_height="5dp"
    app:mlpb_arrow_width="10dp"
    app:mlpb_enable_circle_background="true"

    app:mlpb_progress_stoke_width="5dp"
    app:mlpb_progress_text_visibility="visible"
    android:layout_width="60dp"
    android:layout_height="60dp"/>

and

circleProgressBar.setShowArrow(true);

animation not work

i write a simple animation with 500 ms duration and set it to progress bar but it disappear immediately without duration effect.

AlphaAnimation fadeOut = new AlphaAnimation(1.0f, 0.0f);
fadeOut.setDuration(500);
circularProgress.startAnimation(fadeOut);

Can't change progress color

Thank you for the library!

I can't change progress color.

    <com.lsjwzh.widget.materialloadingprogressbar.CircleProgressBar
    android:id="@+id/mv_file_progressbar"
    app:mlpb_show_arrow="false"
    app:mlpb_enable_circle_background="true"
    app:mlpb_progress_stoke_width="4dp"
    app:mlpb_progress_text_visibility="visible"
    app:mlpb_progress_color="#566da9"
    app:mlpb_background_color="@android:color/white"
    android:layout_width="40dp"
    android:layout_height="40dp" />

I set progress color, but it still black color.
Android studio 1.2 beta. Dependencies:

    compile 'com.android.support:support-v13:21.0.3'
    compile 'com.lsjwzh:materialloadingprogressbar:0.5.3-RELEASE'

Circle seems to be growing each time I change visibility (android 4.2.1)

Hello,

So i'm testing on a Samsung Galaxy Nexus running 4.2.1

I have a weird issue: I'm using a loading progress bar at the bottom of my listview. I show it when i'm loading more item to the listview, and hide it when i'm finish loading.

Problem is, each time I call setVisibility(View.GONE) and setVisibility(View.VISIBLE), it seems like the loading circle grows.

See attached screenshot for an example of the circle after 5 or 6 times.
screen shot 2015-12-17 at 5 42 59 pm

(I don't see the issue on my Nexus 5 running Lollipop)

animation control from action events

is that possible to add an animation for the start and the end of the loading event. Like the transition from nothing to scaled back to the original size?

A gray dot appeared when "android:layout_width" less than 30.

            android:id="@+id/progressBar"
            app:mlpb_progress_stoke_width="2dp"
            app:mlpb_progress_color="@color/loginFocusedBorder"
            app:mlpb_background_color="@color/white"
            android:layout_width="20dp"
            android:layout_height="20dp"
            android:layout_marginTop="-3dp"
            android:layout_marginRight="-3dp"
            android:visibility="gone"
            android:layout_gravity="right"/>

A gray dot appeared In the upper left corner.

If you keep it running too long..

If you keep it running too long, it breaks. I left it running in the emulator(for hours I guess), and now the circle stays filled for a few seconds on every spin.

2015-02-17 17_11_05-5554_nexus_one_api_21

Restarting Progress bar does not animate

CircleProgressBar.java - Line 365

    public void setVisibility(int visibility) {
        super.setVisibility(visibility);
        if (mProgressDrawable != null) {
            if(visibility!=VISIBLE) {
                mProgressDrawable.stop();
            }else{
             mProgressDrawable.start();
             mProgressDrawable.setVisible(visibility == VISIBLE, false);
            }
        }
    }

Hiding the progressbar

Hi

Nice library!
I'm having trouble making it go away :)

        progressBar.getVisibility(); //value is 0, it's visible
        progressBar.setVisibility(View.GONE);
        progressBar.getVisibility(); //value is 8, still visible!

I'm loading my stuff in an asynctask, and in onProgressUpdate, I want to make the progress indicator go away. But it's still visible.

android:visibility XML attribute does not work

Maybe I'm missing something, but when I do something like:

My build.gradle file:

compile('com.lsjwzh:materialloadingprogressbar:0.5.4-RELEASE')

My XML

<com.lsjwzh.widget.materialloadingprogressbar.CircleProgressBar
                android:id="@+id/ticket_loading_spinner"
                android:visibility="invisible"
                android:layout_width="60dp"
                android:layout_height="60dp"
                android:layout_gravity="center_horizontal|center_vertical"
                app:mlpb_enable_circle_background="true"
                app:mlpb_progress_color="@color/amber_700"
                app:mlpb_progress_stoke_width="5dp"
                app:mlpb_progress_text_visibility="invisible"
                app:mlpb_show_arrow="false" />

My java source

public class TicketActivity {

    // More injections...
    @InjectView(R.id.ticket_loading_spinner) CircleProgressBar mProgress;
    /// ...and more injections...

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.the_layout);
        ButterKnife.inject(this);
        prepareUI();
    }

    // More methods...
}

The CircleProgressBar is showing despite the visibility attribute.

OpenGLRenderer is out of memory OR too many open files error

I am testing on a Samsung GT-S6012 "Duos" device running Android 4.04 API 15
GSM arena link http://www.gsmarena.com/samsung_galaxy_music_duos_s6012-5027.php

And I am getting this after the spinner runs for some time....
The application stops without an error dialog.. and the following is shown
in the log...

This log is of my app using the spinner, although I did another test running the demo for a while and gives me the same type of error. ( the spinners actually become graphically corrupt.. one a black square rotating and the other a red square rotating after some time has elapsed. 20 seconds or so)

some link on the internet suggest that there are too many Async tasks running,
could it be that there are too many Animations.. or perhaps a memory leak.
(Not a nice bug to have though)

D/OpenGLRenderer: GL error from OpenGLRenderer: 0x505
E/OpenGLRenderer: OpenGLRenderer is out of memory!
E/RHEA_BRALLOC: PMEM open failed with error Too many open files
E/RHEA_BRALLOC: MEM allocation failed with error Too many open files
E/RHEA_BRALLOC: PMEM open failed with error Too many open files
E/RHEA_BRALLOC: MEM allocation failed with error Too many open files
D/OpenGLRenderer: GL error from OpenGLRenderer: 0x505
E/OpenGLRenderer: OpenGLRenderer is out of memory!
E/RHEA_BRALLOC: PMEM open failed with error Too many open files
E/RHEA_BRALLOC: MEM allocation failed with error Too many open files
E/RHEA_BRALLOC: PMEM open failed with error Too many open files
E/RHEA_BRALLOC: MEM allocation failed with error Too many open files
D/OpenGLRenderer: GL error from OpenGLRenderer: 0x505
E/OpenGLRenderer: OpenGLRenderer is out of memory!
E/RHEA_BRALLOC: PMEM open failed with error Too many open files
E/RHEA_BRALLOC: MEM allocation failed with error Too many open files
E/RHEA_BRALLOC: PMEM open failed with error Too many open files
E/RHEA_BRALLOC: MEM allocation failed with error Too many open files
D/OpenGLRenderer: GL error from OpenGLRenderer: 0x505
E/OpenGLRenderer: OpenGLRenderer is out of memory!
D/BRCM_EGL: eglMakeCurrent(NULL) Thread: 6509
D/BRCM_EGL: eglDestroySurface() surface: 0x38c8c8, android window 0x26c6a0, Thread: 6509
D/BRCM_EGL: eglCreateWindowSurface() surface: 0x38c8c8, VC surface: 18, Thread: 6509
D/BRCM_EGL: eglMakeCurrent(0x23baf8, 0x38c8c8, 0x38c8c8) Thread: 6509
E/BRCM_EGL: surface_dequeue_buffer surf:0x38c8c8 buffer=0x3e028c handle:0x0 tid=6509
E/BRCM_EGL: Cancelling buffers
E/BRCM_EGL: surface_dequeue_buffer surf:0x38c8c8 buffer=0x3e028c handle:0x0 tid=6509
E/rhea.gralloc: invalid gralloc handle (at 0x0)
A/libc: Fatal signal 11 (SIGSEGV) at 0x00000004 (code=1)

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.