All Products
Search
Document Center

Loading component

Last Updated: May 25, 2021

AULoadingView provides loading pages containing progress indicator, loading progress, and loading text.

Dependency

See Quick start.

Sample images

API description

AULoadingView

 
  1. /**
  2. * The constructor.
  3. * @param context The page context including the antu dependency.
  4. */
  5. public AULoadingView(Context context)
  6. /**
  7. * Set the progress.
  8. * @param curentProgress The progress.
  9. */
  10. public void setCurrentProgress(int curentProgress)

AUPullLoadingView

 
  1. /**
  2. * The constructor.
  3. * @param context The page context including the antu dependency.
  4. */
  5. public AUPullLoadingView(Context context)
  6. /**
  7. * Set the progress pattern.
  8. * @param drawable
  9. */
  10. public void setProgressDrawable(Drawable drawable)
  11. /**
  12. * Set the bounce pattern.
  13. * @param mIndicatorUpDrawable
  14. */
  15. public void setIndicatorUpDrawable
  16. /**
  17. * Set the loading text.
  18. * @param loadingText
  19. */
  20. public void setLoadingText(String loadingText)
  21. /**
  22. * Set the dragging text.
  23. * @param indicatorText
  24. */
  25. public void setIndicatorText(String indicatorText)

AUDragLoadingView

 
  1. /**
  2. * The constructor.
  3. * @param context The page context including the antu dependency.
  4. */
  5. public AUDragLoadingView(Context context)
  6. /**
  7. * Set the loading text.
  8. * @param text
  9. */
  10. public void setLoadingText(CharSequence text)

Sample code

AULoadingView

 
  1. private AULoadingView mAULoadingView mAULoadingView = (AULoadingView) findViewById(R.id.loadingView);
  2. private Handler mHandler = new Handler() {
  3. @Override
  4. public void handleMessage(Message msg) {
  5. super.handleMessage(msg);
  6. mAULoadingView.setCurrentProgress(mCurrentProgress);
  7. }
  8. };
  9. protected void onResume() {
  10. super.onResume();
  11. new Thread(new Runnable() {
  12. @Override
  13. public void run() {
  14. while (mCurrentProgress < 100) {
  15. try {
  16. Thread.currentThread().sleep(500);
  17. mCurrentProgress++;
  18. mHandler.sendEmptyMessage(0);
  19. } catch (Exception e) { Log.e("EmptyPageLoadingActivity",e.getMessage());
  20. }
  21. }
  22. }
  23. }).start();
  24. }

AUPullLoadingView

 
  1. @Override
  2. public AUPullLoadingView getOverView() {
  3. mAUPullLoadingView2 = (AUPullLoadingView) LayoutInflater.from(getBaseContext())
  4. .inflate(R.layout.au_framework_pullrefresh_overview, null);
  5. return mAUPullLoadingView2;
  6. }

AUDragLoadingView

 
  1. mAUDragLoadingView = (AUDragLoadingView) findViewById(R.id.dragLoadingView);
  2. findViewById(R.id.modifyLoadingText).setOnClickListener(new View.OnClickListener() {
  3. @Override
  4. public void onClick(View v) {
  5. mAUDragLoadingView.setLoadingText("Text after modification...") ;
  6. }
  7. });