BasoProgressView


Source link: https://github.com/gitsindonesia/baso

Baso Progress View

ProgressBar with button and text below it.

## Sample Usage ### XML Layout #### Without styles.xml ``` ``` #### With styles.xml ``` ``` ``` <style name="BasoCustom"> #FFF Something happened 18sp Try Again Loading @drawable/baso_sample_error 160dp </style> ```

How to start and stop the progress

Start the progress

final BasoProgressView basoProgressView = (BasoProgressView) findViewById(R.id.baso_ProgressView);

 basoProgressView.startProgress();
 

Stop progress and show the button

The button will be automatically visible if you had written baso_finishButtonText on xml layout. Once you have completed the action and you wanted to stop the progress and show a message (or error message), you can just call stop or stopAndError method.

// set message on the TextView or you can set baso_finishText on your xml layout. basoProgressView.setFinishedText("Something happened");
  // stop the progress basoProgressView.stop();
 

Or you can simply call stopAndError.

basoProgressView.stopAndError("Oops. Something happened.");
 

Stop progress and show both image and button

You have to declare baso_finishSrc either on your xml layout or programmatically with setFinishedImageResource method.

basoProgressView.setFinishedImageResource(R.drawable.baso_sample_error);
 basoProgressView.stopAndError("Oops. Something happened.");
 

Complete the progress and make it invisible

Once you have completed the action and you wanted to hide BasoProgressView, you can just call stopAndGone and use startProgress to start progressing again.

basoProgressView.stopAndGone();
 

Set the button click listener

Don't forget to create click listener for the button.

basoProgressView.setOnButtonClickListener(new View.OnClickListener() {

  @Override
  public void onClick(View v) {

basoProgressView.startProgress();

//TODO: your action here such as call api
  
}
 
}
);
 

For complete sample usage, you can take a look at the sample project.

Install

dependencies {

 compile 'id.gits:baso:1.0' 
}
 

About GITS Indonesia

GITS Indonesia has been active in IT Industry since 2010. Since then, we have developed a lot of applications, both initiative projects and client requests. Our developers are familiar with desktop, website, and mobile programming, but we are currently focusing in mobile.

http://gits.co.id

License

Copyright 2016 GITS Indonesia.  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. 

Resources

CloudRail is a free software library which abstracts multiple APIs from different providers into a single and universal interface.

This library is a set of VIEWS (not Preferences) and is aimed to solve this problems:

  • Preferences look ugly on pre-lollipop.
  • Preferences are not flexible. For example, it can be problematic to embed them to another screen (especially for fragment-haters).
  • Preferences don't allow you to show custom selection dialogs.

A simple breadcrumb view based on the design support library's TabLayout.

A widget that can be used to confirm the user's action, unlocking the screen etc. by providing the desired pattern with specified configuration. Widget can be animated in and out.

DroidModel is an android library which provides model abstraction for SQLite database. Trivial database tasks like creating tables, inserting or retrieving are parts of this library.

A library which helps you register Google Cloud Messaging tokens and listen for GCM messages. It can be used to attach multiple providers and seamlessly deliver data and token to all the listeners. This library is very helpful for those you use multiple push notification provider.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes