Overview

WaitingDots

Loading animation

Small library that provides... bouncing dots. This feature is used in number of messaging apps (such as Hangouts or Messenger), and lately in Android TV (for example when connecting to Wifi).

Gradle depedency

    implementation 'com.github.tajchert:WaitingDots:0.6.1'

Add Jitpack in your root build.gradle at the end of repositories:

	allprojects {
		repositories {
			...
			maven { url "https://jitpack.io" }
		}
	}

Example

...
xmlns:dots="http://schemas.android.com/apk/res-auto"
...
<pl.tajchert.waitingdots.DotsTextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/dots"
    android:textSize="45sp"
    android:textColor="@android:color/text_color"
    dots:autoplay="false"
    dots:period="1000"/>

All aditional parameters are optional.

List of useful methods:

dots.stop();
dots.start();

dots.hide();
dots.show();

dots.hideAndStop();
dots.showAndPlay();

dots.isHide();
dots.isPlaying();

Proguard

-dontwarn pl.tajchert.waitingdots.**
-keep public class pl.tajchert.waitingdots.** { public protected private *; }

AndroidX and Kotlin

Kotlin since version 0.6.1. AndroidX since 0.6.0. Last build without AndroidX: 0.5.2.

Thanks goes to:

Polidea - time, atmosphere and motivation to create outstanding things.

Zielony - many tips and initial commit.

Krzysztof Bielicki - nice pull request that optimised performance and added text Appearance support (0.1.0 -> 0.2.0).

Comments
  • Not working on API 22

    Not working on API 22

    Below attached is the code snippet

        private DotsTextView mLoadingDots;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        mLoadingDots = (DotsTextView) findViewById(R.id.dots_text);     
        mLoadingDots.start();
                mLoadingDots.showAndPlay();
    

    in my layout ive added

           <pl.tajchert.sample.DotsTextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/dots_text"
            android:textSize="50sp"
            android:paddingBottom="10dp"
            android:layout_marginLeft="5dp"
            dots:autoplay="true"
            dots:period="250" />
    

    in my build.grade dependencies { compile 'pl.tajchert:waitingdots:0.2.0' }

    changing to 0.1.0 gets it working but the animation is weird it comes from left to right then starts jumping(lagging all the way)

    tested on nexus 5 and moto g1 running 5.1

    bug help wanted 
    opened by vnh1991 5
  • No animation on Nexus Player runing AOSP 5.1.1

    No animation on Nexus Player runing AOSP 5.1.1

    I'm using version 0.2.0 of your library and the dots do not animate. isHide() returns false and isPlaying() returns true. The code I'm using is at https://github.com/thevoiceless/TvBluetoothSetup/tree/waitingDots

    It may be worth noting that I am running AOSP compiled for the device, not the stock software from Google (although they should be the same aside from proprietary Google stuff).

    Let me know if you need more information.

    opened by thevoiceless 5
  • Rendering wtf problem

    Rendering wtf problem

    Hi. This is what happens when I try to use it on my splash screen

    [http://imgur.com/PiDE9GJ](image url)

    Here is my layout.

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:dots="http://schemas.android.com/apk/res-auto"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">
    
            <ImageView
                android:src="@drawable/kr_logo"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_centerHorizontal="true"
                android:id="@+id/imageView" />
    
            <pl.tajchert.sample.DotsTextView
                android:text="Klickrent"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/dots"
                android:textSize="56sp"
                android:textColor="@color/black_overlay"
                dots:autoplay="true"
                dots:period="1000"
                android:layout_below="@+id/imageView"
                android:layout_centerHorizontal="true" />
    
        </RelativeLayout>
    
    </LinearLayout>
    

    And styles are:

    <style name="FullscreenTheme" parent="Theme.AppCompat.Light">
            <item name="android:actionBarStyle">@style/FullscreenActionBarStyle</item>
            <item name="android:windowActionBarOverlay">true</item>
            <item name="android:windowBackground">@null</item>
            <item name="metaButtonBarStyle">?android:attr/buttonBarStyle</item>
            <item name="metaButtonBarButtonStyle">?android:attr/buttonBarButtonStyle</item>
    </style>
    
    opened by ivanfenenko 2
  • Memory Leak

    Memory Leak

    Issue: https://github.com/tajchert/WaitingDots/issues/10

    Using you library in our project (thanks a lot for it) in which we use CanaryLeak I've found two leaks in your code:

    1. There are some anonymous AnimatorUpdateListener defined that holds a reference to the context.
    2. There are some anonymous TypeEvaluator implementations that because they holds references to their parent class and this one to the context leak memory too.
    opened by julioyg 2
  • Workaround for view not being drawn Lollipop and higher

    Workaround for view not being drawn Lollipop and higher

    Fixes #7

    If the SpannableString consists solely of spans, the spans aren't being drawn, or something like that. Adding an Zero Width Space (\u200B) works around this.

    References:

    • http://stackoverflow.com/questions/26399111/android-edittext-how-to-create-an-empty-bullet-paragraph-by-bulletspan
    • http://stackoverflow.com/questions/20069537/replacementspans-draw-method-isnt-called
    opened by dvdmunckhof 0
  • Remove android:allowBackup=

    Remove android:allowBackup="false" from library manifest

    Currently I get a manifest merging error because my app sets android:allowBackup="false" and this conflicts.

    Library projects shouldn't be setting this.

    opened by intrications 0
  • Memory Leak

    Memory Leak

    Using you library in our project (thanks a lot for it) in which we use CanaryLeak I've found two leaks in your code:

    1. There are some anonymous AnimatorUpdateListener defined that holds a reference to the context.
    2. There are some anonymous TypeEvaluator implementations that because they holds references to their parent class and this one to the context leak memory too.
    help wanted 
    opened by julioyg 6
  • Fixes leaks

    Fixes leaks

    Hello,

    I found a few leaks in the library and I fixed them in this PR. The other functionalities stay put, I didn't actually change anything else.

    Best regards

    opened by tiwiz 1
Owner
Michal Tajchert
Mobile Tech Lead, loves Mobile (native&Flutter on daily basis), full stack dev and founder @ Kanarek.app
Michal Tajchert