Exemplo n.º 1
0
 /**
  * Provide a custom view to be displayed.
  *
  * @param view Must not be null
  * @return Current HUD
  */
 public KProgressHUD setCustomView(View view) {
   if (view != null) {
     mProgressDialog.setView(view);
   } else {
     throw new RuntimeException("Custom view must not be null!");
   }
   return this;
 }
Exemplo n.º 2
0
 /**
  * Specify the HUD style (not needed if you use a custom view)
  *
  * @param style One of the KProgressHUD.Style values
  * @return Current HUD
  */
 public KProgressHUD setStyle(Style style) {
   View view = null;
   switch (style) {
     case SPIN_INDETERMINATE:
       view = new SpinView(mContext);
       break;
     case PIE_DETERMINATE:
       view = new PieView(mContext);
       break;
     case ANNULAR_DETERMINATE:
       view = new AnnularView(mContext);
       break;
     case BAR_DETERMINATE:
       view = new BarView(mContext);
       break;
       // No custom view style here, because view will be added later
   }
   mProgressDialog.setView(view);
   return this;
 }