Git Product home page Git Product logo

android-spinkit's Introduction

Android-SpinKit

Android loading animations(I wrote a android edition according SpinKit)

Demo Apk

Preview

Gradle Dependency

dependencies {
   implementation 'com.github.ybq:Android-SpinKit:1.4.0'
}

Usage

  • Xml
<com.github.ybq.android.spinkit.SpinKitView
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/spin_kit"
    style="@style/SpinKitView.Large.Circle"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    app:SpinKit_Color="@color/colorAccent" />         
  • ProgressBar
ProgressBar progressBar = (ProgressBar)findViewById(R.id.progress);
Sprite doubleBounce = new DoubleBounce();
progressBar.setIndeterminateDrawable(doubleBounce);

Style

@style/SpinKitView
@style/SpinKitView.Circle
@style/SpinKitView.Large
@style/SpinKitView.Small
@style/SpinKitView.Small.DoubleBounce   
Style Preview
RotatingPlane RotatingPlane
DoubleBounce DoubleBounce
Wave Wave
WanderingCubes WanderingCubes
Pulse Pulse
ChasingDots ChasingDots
ThreeBounce ThreeBounce
Circle Circle
CubeGrid CubeGrid
FadingCircle FadingCircle
FoldingCube FoldingCube
RotatingCircle RotatingCircle

Acknowledgements

android-spinkit's People

Contributors

ayltai avatar firetrap avatar javichaques avatar littlegnal avatar nikhil-z avatar padi-g avatar songzhw avatar start141 avatar sunbird89629 avatar ybq 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  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

android-spinkit's Issues

Remove unnecessary files

I got compilation error in my project because I have defined supportRtl in my AndroidManifest.xml, which is also defined in SpinKit's AndroidManifest.xml. I have to use tools:replace="android:supportsRtl" as a workaround but I think it is even better if SpinKit library can remove these unnecessary fields or files.

https://jitpack.io/com/github/ybq/Android-SpinKit/1.1.0/build.log build failed

I found that https://jitpack.io/com/github/ybq/Android-SpinKit/1.1.0/build.log show build failed

I know the latest version of Android-SpinKit is V1.2.0 But react-native-spinkit used Android-SpinKit 1.1.0 I have an old react native project which used react-native-spinkit and now it returns an error when compiling it:
Could not find com.github.ybq:Android-SpinKit:1.1.0.
Searched in the following locations:
https://jitpack.io/com/github/ybq/Android-SpinKit/1.1.0/Android-SpinKit-1.1.0.pom

Could you rebuild Android-SpinKit 1.1.0 and upload to https://jitpack.io/com/github/ybq/Android-SpinKit/1.1.0

Thank you very much!

Dont show animation

Hi there,
Dont show animation on the Android 4.3 API 18 (Samsung Galaxy S3)

styles.xml

`

<style name="MyTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="colorPrimary">#ffffff</item>
    <item name="colorPrimaryDark">#FF581C0D</item>
    <item name="colorAccent">#ffffff</item>
   <item name="homeAsUpIndicator">@drawable/ic_home_white_24dp</item>
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>


</style>

<style name="AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

<style name="PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

`

in layout.xml
<com.github.ybq.android.spinkit.SpinKitView xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/spin_kit2" style="@style/SpinKitView.Large.ThreeBounce" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" app:SpinKit_Color="#ffffff" android:layout_alignParentBottom="true" android:layout_marginBottom="30dp" android:layout_centerInParent="true" />

Crash on loading

Crash on my app

"main" tid=1 Runnable
"main" prio=5 tid=1 Runnable
| group="main" sCount=0 dsCount=0 obj=0x7465d9c0 self=0xb7d3b290
| sysTid=18206 nice=-4 cgrp=default sched=0/0 handle=0xb6f65c00
| state=R schedstat=( 0 0 0 ) utm=341 stm=115 core=1 HZ=100
| stack=0xbe5b5000-0xbe5b7000 stackSize=8MB
| held mutexes= "mutator lock"(shared held)
at com.github.ybq.android.spinkit.b.f.d (Sprite.java:127)
at com.github.ybq.android.spinkit.b.f.c (Sprite.java:117)
at com.github.ybq.android.spinkit.b.f$2.a (Sprite.java:434)
at com.github.ybq.android.spinkit.b.f$2.a (Sprite.java:431)
at com.github.ybq.android.spinkit.a.b.a (FloatProperty.java:43)
at com.github.ybq.android.spinkit.a.b.set (FloatProperty.java:29)
at android.animation.PropertyValuesHolder$FloatPropertyValuesHolder.setAnimatedValue (PropertyValuesHolder.java:1292)
at android.animation.ObjectAnimator.animateValue (ObjectAnimator.java:988)
at android.animation.ValueAnimator.animationFrame (ValueAnimator.java:1384)
at android.animation.ValueAnimator.doAnimationFrame (ValueAnimator.java:1427)
at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame (ValueAnimator.java:759)
at android.animation.ValueAnimator$AnimationHandler$1.run (ValueAnimator.java:801)
at android.view.Choreographer$CallbackRecord.run (Choreographer.java:858)
at android.view.Choreographer.doCallbacks (Choreographer.java:670)
at android.view.Choreographer.doFrame (Choreographer.java:603)
at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:844)
at android.os.Handler.handleCallback (Handler.java:739)
at android.os.Handler.dispatchMessage (Handler.java:95)
at android.os.Looper.loop (Looper.java:148)
at android.app.ActivityThread.main (ActivityThread.java:5452)
at java.lang.reflect.Method.invoke! (Native method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:762)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:652)

Changing color dynamically

Great library.
Trying to change color dynamically, but it view just disappears. For example, initially creating a Circle ProgressBar and setting its color to white. Then using button (e.g. btnRed and btnBlue) want to change the color. How should this properly be done??

Thanks

Allow contributors

Hey @ybq ,

I have some minor bug fixes and I would like to contribute to this repository.
Please add me as a contributor so I can commit the code.

P.S: Thanks for this awesome repository.

debug error

You need to use a Theme.AppCompat theme (or descendant) with this activity. wh?,thank you!

Wave animation is not working

Hello, Thank you for these awesome Spin Kits.
I was using Wave. But this is not animating as the wave.
Please take a look at this screenshot. https://ibb.co/jR6Mpo

My XML:

<com.github.ybq.android.spinkit.SpinKitView android:id="@+id/progressBar" style="@style/SpinKitView.Wave" xmlns:app="http://schemas.android.com/apk/res-auto" app:SpinKit_Color="@color/red" app:SpinKit_Style="Wave" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/inputsearchenglishhome" android:layout_marginTop="65dp" android:visibility="visible" />

My Java:

private ProgressBar progressBar; progressBar = (ProgressBar) rootView.findViewById(R.id.progressBar); Wave wave = new Wave(); progressBar.setIndeterminateDrawable(wave);

Set Color Does Not Work On These Drawables

Set color via XML "app:SpinKit_Color="@color/colorAccent"" does not work on the following drawables:

  • RotatingPlane
  • Pulse
  • RotatingCircle

For the above drawables, color defaults to white and setting color does not work.

Set color via XML works for the following drawables:

  • DoubleBounce
  • Wave
  • WanderingCubes
  • ChasingDots
  • ThreeBounce
  • Circle
  • CubeGrid
  • FadingCircle
  • FoldingCube

References Issue #24

Suggestion

@Override public void onPageSelected(int position) { getWindow().getDecorView().setBackgroundColor(colors[position % colors.length]); } in DetialActivity of the sample can be omitted, because you've got the ArgbEvaluator working fine:). If not doing so, this line will take effect immediately after tapping up, which causes an unfriendly flash...You know.

Sync error

/Users/xxx/.gradle/caches/transforms-1/files-1.1/Android-SpinKit-1.1.0.aar/22ef2a52320a448431a0e9bdde5e50fc/res/values/values.xml
Error:(5, 5) error: style attribute 'attr/textSize (aka com.bytedance.ee.bear.list.test:attr/textSize)' not found.

Not showing in Battery saver mode in Android 7+

Android stops any kind of animations in battery saver mode in Android 7+
When my phone is in battery saver mode, i dont see anything in the view. It should atleast show a static 3 balls for ThreeBounce animation. Similarly for other animations too.

Error: more than one library with package name 'android.support.graphics.drawable'

when I use the dependence like this:

 ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 27
        supportLibVersion = "28.0.0"
    }

the project can`t build success.

here is the error from logcat

:app:processDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Error: more than one library with package name 'android.support.graphics.drawable'

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1.954 secs

在android 4.4上有兼容性问题

#71 SIGSEGV(SEGV_MAPERR)
SIGSEGV(SEGV_MAPERR):
#00 pc 00069464 /system/lib/libdvm.so (dvmReportPreNativeInvoke+84) [armeabi-v8]
#1 pc 000652e8 /system/lib/libdvm.so [armeabi-v8]

Android 4.4.4,level 19 联想 TAB 2 A10-70F CPU架构

armeabi-v7a

Animation does not fit correctly

Hi! First, excelent work

But I've a problem, the image don't fill the view correctly

gif

The code:

<com.github.ybq.android.spinkit.SpinKitView
        android:id="@+id/spin_kit"
        style="@style/SpinKitView.Large.FoldingCube"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        app:SpinKit_Color="@android:color/white" />

Hugs

有些style动画在dialog不显示问题

设置view 在dialog中,其中RotatingPlane,Pulse,RotatingCircle,Pulse_Ring这几种style不能显示,其它的style都可以显示。
`
View view = LayoutInflater.from(context).inflate(R.layout.loading_dialog, null);

    TextView loadingText = (TextView) view.findViewById(R.id.loading_dialog_text);

    SpinKitView spinKitView = (SpinKitView) view.findViewById(R.id.spin_kit);

    Style style = Style.values()[position];

    Sprite drawable = SpriteFactory.create(style);

    loadingText.setText(msg);

    final Dialog mLoadingDialog = new Dialog(context, R.style.loading_dialog_style);

    mLoadingDialog.setCancelable(false);

    mLoadingDialog.setContentView(view, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
            LinearLayout.LayoutParams.MATCH_PARENT));

`

screenshot_2018-01-18-15-20-46-461_com bhx spinki

How to place a spinkit inside a button?

The README's Preview section display a Button with a waved SpinKit within.

  1. How can do that?
  2. How can i put the SpinKit animation on the right band of the button?

SpinKitView重复setIndeterminateDrawable后显示空白

在list页面复用(应该是重复setIndeterminateDrawable)SpinKitView时出现显示空白的现象。
如果是在xml里面指定好了Sprite(没有在代码里面重复setIndeterminateDrawable)则不会出现这样的问题

Failed to resolve: com.github.ybq:Android-SpinKit:1.1.0

build.gradle :
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven { url "https://jitpack.io" }

}

}

I tried everything and same issues but I had to open the issue.

SpinKit_Color problem

I have to set SpinKit_Color only by xml file, but it doesn't work for all progressdrawable.
In particular, i have seen the problem in "setIndeterminateDrawable" method, where

if(this.mSprite.getColor() == 0) {
            this.mSprite.setColor(this.mColor);
        }

and so, for some drawable, the color doesn't change

how to clear background color

Hi when the loader is displayed , the whole screen is in white color, how do i remove that color and my app screen should be visible in background.

Please help thanks in advance.

Spinkit in the xml leaves margin

Using this in my XML it leaves the margin at the bottom of the screen even though I have not set any margin.
What might be the problem?

`<?xml version="1.0" encoding="utf-8"?>
 <android.support.constraint.ConstraintLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/app_bg"
      tools:context="com..mobile.abc.SplashActivity">

<ImageView
    android:id="@+id/sample_text"
    android:layout_width="250dp"
    android:layout_height="70dp"
    android:layout_marginEnd="8dp"
    android:layout_marginStart="8dp"
    android:layout_marginTop="150dp"
    android:background="@drawable/splash_text"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent" />

<ImageView
    android:id="@+id/imageView2"
    android:layout_width="216dp"
    android:layout_height="248dp"
    android:layout_marginEnd="8dp"
    android:layout_marginStart="8dp"
    android:layout_marginTop="30dp"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/sample_text"
    app:srcCompat="@drawable/app_icon" />


<com.github.ybq.android.spinkit.SpinKitView xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/loader"
    style="@style/SpinKitView.Large.Wave"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerVertical="true"
    android:layout_gravity="right"
    app:SpinKit_Color="@color/colorAccent" />


  </android.support.constraint.ConstraintLayout>

`

Trouble Styling a Progress Dialog

I am using the wave for my progress dialog but having trouble changing the color of it. I'm pretty sure this is just a personal shortcoming but I was hoping I could get some help! Thank you

SpinKit Not working

I tried to use spinkit version 1.2.0 on my android studio 3.1. I used
implementation 'com.github.ybq:AndroidSpinKit:1.2.0'

It gives me a failed to resolve error. Error message in the gradle build as follows
Failed to resolve: com.github.ybq:AndroidSpinKit:1.2.0

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.