Skip to content

Repository files navigation

Android Arsenal

AndroidProgressLayout

If you tired from wrapping your Views with RelativeLayout to add ProgressBar then this small view will help you. It extends from RelativeLayout, so you shouldn't add additional layouts to use it, just think about it as a RelativeLayout with auto added ProgressBar.











Features

  • show/hide progress bar
  • setup background to hide your views when progress bar is showing

Getting started

Add com.github.androidprogresslayout.ProgressLayout to your layout
 <com.github.androidprogresslayout.ProgressLayout
xmlns:android="http://schemas.android.com/apk/res/android"xmlns:progressLayout="http://schemas.android.com/apk/res-auto"android:layout_width="match_parent"android:layout_height="match_parent"android:id="@+id/progress_layout"progressLayout:progressBackground="#33B5E5"progressLayout:progress="false"
>
<WebViewandroid:id="@+id/web_view"android:layout_width="match_parent"android:layout_height="match_parent" />
</com.github.androidprogresslayout.ProgressLayout>

Now you can use progressLayout.progressLayout.showProgress() to show progress bar, progressLayout.showContent() to show content, or progressLayout.showErrorText( ) to show any text.

progressLayout:progress="true|false" indicates, will progress bar visible, after view creation, or not.

webView.setWebViewClient(newWebViewClient() {
@OverridepublicvoidonPageStarted(WebViewview, Stringurl, Bitmapfavicon) {
progressLayout.showProgress();
}
@OverridepublicvoidonPageFinished(WebViewview, Stringurl) {
progressLayout.showContent();
}
@OverridepublicvoidonReceivedError(WebViewview, interrorCode, Stringdescription, StringfailingUrl) {
Log.d(TAG, "onReceivedError: " + errorCode + " : " + description + " : " + failingUrl);
super.onReceivedError(view, errorCode, description, failingUrl);
progressLayout.showErrorText(description);
}
});

Including in your project

 allprojects {
repositories {
jcenter()
}
}
dependencies {
compile 'com.github.androidprogresslayout:library:2.0.2@aar'
}

##Developed By

Anton Krasov - anton.krasov@gmail.com


License

AndroidProgressLayout is made available under the MIT license:

The MIT License (MIT)
Copyright (c) 2014 Anton Krasov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

About

Android View to simplify working with ProgressBar

Resources

Stars

330 stars

Watchers

17 watching

Forks

Releases

Packages

Contributors

Languages