Skip to content

Commit

Permalink
Fix progressbar radius
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhoanglam committed Sep 22, 2016
1 parent b90ee88 commit 08060c3
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 20 deletions.
12 changes: 6 additions & 6 deletions README.md
Expand Up @@ -2,9 +2,9 @@
An extension of RelativeLayout that helps show loading, empty and error layout.

## Screenshot
<img src="https://cloud.githubusercontent.com/assets/4979755/18380044/bab54c72-769f-11e6-8427-cdf6d3920b1c.png" height="683" width="384">
<img src="https://cloud.githubusercontent.com/assets/4979755/18380045/bb1fb300-769f-11e6-89b1-5fd3742385f1.png" height="683" width="384">
<img src="https://cloud.githubusercontent.com/assets/4979755/18380046/bb5f49a2-769f-11e6-8112-0f46b8c0d526.png" height="683" width="384">
<img src="https://cloud.githubusercontent.com/assets/4979755/18741168/db29b992-80d7-11e6-9a6a-36b626b003bf.png" height="683" width="384">
<img src="https://cloud.githubusercontent.com/assets/4979755/18741171/db86bb42-80d7-11e6-9d6f-c7a00b2b9b27.png" height="683" width="384">
<img src="https://cloud.githubusercontent.com/assets/4979755/18741169/db7879ec-80d7-11e6-9158-a4ff89b78e79.png" height="683" width="384">
## Download
Add to your module's build.gradle:
```java
Expand All @@ -17,7 +17,7 @@ allprojects {
and:
```java
dependencies {
compile 'com.github.nguyenhoanglam:ProgressLayout:1.0.0'
compile 'com.github.nguyenhoanglam:ProgressLayout:1.0.1'
}
```
## How to use
Expand Down Expand Up @@ -105,8 +105,8 @@ dependencies {
app:errorImageHeight="200dp"
app:errorImageWidth="200dp"
app:loadingProgressBarColor="@color/teal"
app:loadingProgressBarRadius="100dp"
app:loadingProgressBarSpinWidth="8dp"/>
app:loadingProgressBarRadius="200dp"
app:loadingProgressBarSpinWidth="10dp"/>
```
##License
Copyright 2016 Nguyen Hoang Lam
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'com.android.tools.build:gradle:2.2.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
Expand Up @@ -297,7 +297,8 @@ private void setLoadingView() {

loadingStateProgressBar = (ProgressWheel) view.findViewById(R.id.loadingStateProgressBar);

loadingStateProgressBar.setCircleRadius(loadingStateProgressBarRadius);
loadingStateProgressBar.getLayoutParams().width = loadingStateProgressBarRadius;
loadingStateProgressBar.getLayoutParams().height = loadingStateProgressBarRadius;
loadingStateProgressBar.setBarWidth(loadingStateProgressBarSpinWidth);

if (loadingStateProgressBarColor != Color.TRANSPARENT) {
Expand Down
3 changes: 2 additions & 1 deletion progresslayout/src/main/res/layout/progress_loading_view.xml
Expand Up @@ -3,7 +3,8 @@
xmlns:wheel="http://schemas.android.com/apk/res-auto"
android:id="@+id/loadingStateRelativeLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:padding="@dimen/spacing_small">

<com.nguyenhoanglam.progresslayout.ProgressWheel
android:id="@+id/loadingStateProgressBar"
Expand Down
18 changes: 9 additions & 9 deletions sample/src/main/java/com/nguyenhoanglam/sample/MainActivity.java
Expand Up @@ -39,15 +39,15 @@ public void onClick(View view) {
},skipIds);


// Show progress layout, hide all main views
progressLayout.showLoading();
progressLayout.showEmpty(ContextCompat.getDrawable(this, R.drawable.ic_empty), "Empty data");
progressLayout.showError(ContextCompat.getDrawable(this, R.drawable.ic_no_connection), "No connection", "RETRY", new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(MainActivity.this, "Reloading...", Toast.LENGTH_SHORT).show();
}
});
// Show progress layout, hide all main views
// progressLayout.showLoading();
// progressLayout.showEmpty(ContextCompat.getDrawable(this, R.drawable.ic_empty), "Empty data");
// progressLayout.showError(ContextCompat.getDrawable(this, R.drawable.ic_no_connection), "No connection", "RETRY", new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// Toast.makeText(MainActivity.this, "Reloading...", Toast.LENGTH_SHORT).show();
// }
// });

}
}
Binary file modified sample/src/main/res/drawable/ic_empty.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions sample/src/main/res/layout/activity_main.xml
Expand Up @@ -15,8 +15,8 @@
app:errorImageHeight="200dp"
app:errorImageWidth="200dp"
app:loadingProgressBarColor="@color/teal"
app:loadingProgressBarRadius="100dp"
app:loadingProgressBarSpinWidth="8dp">
app:loadingProgressBarRadius="200dp"
app:loadingProgressBarSpinWidth="10dp">

<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
Expand Down

0 comments on commit 08060c3

Please sign in to comment.