Hprob


Source link: https://github.com/sucong0826/Hprob

Hprob

Overview

Hprob is a Horizontal Progress bar. It is a view showing progress with a number on it. When you want to express a progress or a record, it will be useful. You can customize it with some attributes:

  • The primary color
  • The secondary color
  • A inside padding for a gap
  • Rect or RoundRect for shape
  • Point out the pisition where is the text

Using Hprob

Add HorizontalProgressBar in your layout

<su.hm.hprob.HorizontalProgressBar

android:id="@+id/hpb"

android:layout_width="match_parent"

android:layout_height="wrap_content"

hpb:inside_padding="0dp"

hpb:primary_color="@color/colorAccent"

hpb:primary_thickness="30dp"

hpb:shape="rect"

hpb:text_color="#000000"

hpb:text_enable="true"

hpb:text_size="16sp"
hpb:text_position_v="mid"
 hpb:text_position_h="mid" /> 

Then to find it in your Activity.

HorizontalProgressBar hpb = (HorizontalProgressBar) findViewById(R.id.chipView);
 

When you find it, you can use it to show a percent with a value;

hpb.setPercent(15f);
 

Default suffix char is %, when the percent you set is 15f, "15%" will show. In the meanwhile, you can attach a progress listener to it when the percent value is progressing.

hpb.setProgressListener(new ProgressListener() {

 @Override

 public void onProgress(HorizontalProgressBar progressBar, float percent) {

  Log.i(TAG, percent + "%");

 
}

}
);
 

Version

1.0

Note

The Hprob is very simple customized view. There are some issues still remaing and I try my best to fix them. It is a way that I get the knowleage about View and try to write some simple demos. I hope you could provide some helpful suggestions about it to improve myself. Thanks.

Resources

A collection of useful extension methods for Android.

  • Arguments Bindings
  • Preferences Bindings
  • Resources Bindings

MaterialDialogSearchView is a custom implementation of a Toolbar SearchView in a material design. It is an alternate approach using Material dialogs as SearchView similar to the applications seen on nowadays with this type of SearchView's in the apps like Google play, Google card's, etc.

Android lifecycle safety task with sugar code style.

Collect UncaughtException when your Android App crash.

A floating action buttons which are transformed into toolbar.

A gradle plugin that helps developer migrate to code with Android Studio + Gradle, but build && install with buck.

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