Network Connection Indicator

Additional

Language
Java
Version
v1.0 (Jun 6, 2016)
Created
Feb 24, 2016
Updated
Mar 31, 2017 (Retired)
Owner
Stu Stirling (StuStirling)
Contributor
Stu Stirling (StuStirling)
1
Activity
Badge
Generate
Download
Source code
APK file

Advertising

Connection Indicator

A very small library to implement a connection indicator view. These connections may be GPS, Network or other loading indicators.

This is only an initial version of the library and I will be making improvements as I go.

At the moment there aren't any attribute setters in code. All attributes must be set via XML.

<com.stustirling.connectionindicator.ConnectionIndicatorView
                android:layout_width="60dp"
                android:layout_height="wrap_content"
                android:id="@+id/indicator"
                android:layout_centerHorizontal="true"
                android:layout_marginBottom="2dp"
                connection_indicator:emptyBarColor="@color/greyColor"
                connection_indicator:solidSearchBarColor="@color/whiteColor"
                connection_indicator:bars="4"
                connection_indicator:animType="incremental"
                connection_indicator:connectionLevels="4"/>

There are two animTypes:

  • flash = Alternates between connection level of 0 and max.
  • incremental = Each bar is turned solid in turn until all are solid and then it goes back to 0.

To begin search mode:

indicatorView.startSearching();

To stop searching:

indicatorView.stopSearching();

To display a certain "connection level" call the following:

indicatorView.displayConnectionLevel( 2 );