ProgressHUD is a lightweight and easy-to-use HUD for InAiR.
Download the latest AAR or grab via Gradle:
repositories {
maven {
url "https://raw.githubusercontent.com/seespace/maven/master/"
}
}
dependencies {
compile 'co.seespace.extra:progresshud:1.0.1'
}
or Maven:
<!-- repository -->
<repositories>
<repository>
<id>seespace-mvn-repo</id>
<url>https://raw.githubusercontent.com/seespace/maven/master/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<!-- dependency -->
<dependency>
<groupId>co.seespace.extra</groupId>
<artifactId>progresshud</artifactId>
<version>1.0.1</version>
</dependency>
UIProgressHUD.with(context)
.show();
UIProgressHUD.with(context)
.show("Logging In…");
Alternatively, you can use Android String Resources:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="logging_in">Logging In…</string>
</resources>
UIProgressHUD.with(context)
.show(R.string.logging_in);
Drawable customIndicator;
UIProgressHUD.with(context)
.show(customIndicator);
Use Android Drawable Resources instead:
UIProgressHUD.with(context)
.show(R.drawable.loadingIndicator);
Easy, as you might guess:
UIProgressHUD.with(context)
.show(R.drawable.loadingIndicator, R.string.logging_in);
UIProgressHUD.with(context)
.showSuccess("Done");
UIProgressHUD.with(context)
.showError(R.string.error_message);
Simply call dissmiss()
UIProgressHUD.with(context)
.dismiss();
Note: Unless you set a timeout, the HUD never get dismissed. You have to explicitly call dissmiss()
.
This snippet code will show "Hello" in 3 seconds then automatically dismiss.
UIProgressHUD.with(context)
.show("Hello")
.in(3000);
This will show "Hello"
in 3 seconds then show "I'm ProgressHUD"
in 1 second then finally dismiss.
UIProgressHUD.with(context)
.show("Hello")
.in(3000)
.then()
.show("I'm ProgressHUD")
.in(1000);
Note: You can use as many show()
, in()
, then()
as possible.
- Bug reporting: file an issue in this repo
- Discussions/questions: create new topic at InAiR Developer Forums
The MIT License
Copyright (c) 2014, SeeSpace. All rights reserved.
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.