A simple ProgressBar which a function to change it's color.
dependencies {
...
compile 'net.egordmitriev.colorizedprogressbar:colorizedprogressbar:1.0'
}
<net.egordmitriev.colorizedprogressbar.ColorizedProgressBar
android:id="@+id/progressbar"
style="@style/Widget.AppCompat.ProgressBar"
android:indeterminate="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:progressbar_color="#FF0000"/>
A simple LoaderView to fill your screen when something is being processed.
This is a simple, lightweight and customizable loaderview which can be used in your app to show your users that something is being processed and the state of your proces.
Loader view has two built in state layouts. One with a loader and one with an error message along with retry button.
dependencies {
...
compile 'net.egordmitriev.loaderview:loaderview:1.3'
}
<net.egordmitriev.loaderview.LoaderView
android:id="@+id/loaderview"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:state="error"/>
- state - Its used to set loaders initial state. There are only four states available to choose from: (loading, idle, error, extra)
- error_resourceID - Is used to use a custom layout to use when state is error. By default its this layout.
- extra_resourceID - Is used to use a custom layout to use when state is extra. By default its set to null, nothing will be displayed.
- loading_resourceID - Is used to use a custom layout to use when state is loading. By default its this layout.
- idle_resourceID - Is used to use a custom layout to use when state is idle. By default its set to null, nothing will be displayed.
LoaderView loaderView = (LoaderView) findViewById(R.id.loaderview);
loaderView.setState(LoaderView.STATE_ERROR);
loaderView.setListener(new LoaderView.LoaderViewCallback() {
@Override
public void onRetryClick() {
Log.d(TAG, "Retry clicked");
}
});
You can change loaders state using setState and add a listener for retry button in default error layout with setListener.
Copyright 2015 Egor Dmitriev
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.