移动开发平台 mPaaS 加载组件

By | 2021年4月23日

AULoadingView 组件提供包含进度图案、加载进度、加载中文案等的加载页。

依赖

参见 管理组件依赖

效果图

接口说明

AULoadingView

  
  1. /**
  2. * 构造方法
  3. * @param context 包含 antu 依赖的页面上下文
  4. */
  5. public AULoadingView(Context context)
  6. /**
  7. * 设置进度
  8. * @param curentProgress 进度
  9. */
  10. public void setCurrentProgress(int curentProgress)

AUPullLoadingView

  
  1. /**
  2. * 构造方法
  3. * @param context 包含 antu 依赖的页面上下文
  4. */
  5. public AUPullLoadingView(Context context)
  6. /**
  7. * 设置进度图案
  8. * @param drawable
  9. */
  10. public void setProgressDrawable(Drawable drawable)
  11. /**
  12. * 设置回弹图案
  13. * @param mIndicatorUpDrawable
  14. */
  15. public void setIndicatorUpDrawable
  16. /**
  17. * 设置加载中文案
  18. * @param loadingText
  19. */
  20. public void setLoadingText(String loadingText)
  21. /**
  22. * 设置拖拽中文案
  23. * @param indicatorText
  24. */
  25. public void setIndicatorText(String indicatorText)

AUDragLoadingView

  
  1. /**
  2. * 构造方法
  3. * @param context 包含 antu 依赖的页面上下文
  4. */
  5. public AUDragLoadingView(Context context)
  6. /**
  7. * 设置加载中文案
  8. * @param text
  9. */
  10. public void setLoadingText(CharSequence text)

代码示例

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) {
  20. Log.e("EmptyPageLoadingActivity",e.getMessage());
  21. }
  22. }
  23. }
  24. }).start();
  25. }

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("修改后的文案...");
  6. }
  7. });

请关注公众号获取更多资料

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注