文档

加载组件

更新时间:

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

效果图

接口说明

AULoadingView

    /**
    * 构造方法
    * @param context 包含 antu 依赖的页面上下文
    */
    public AULoadingView(Context context)
    /**
    * 设置进度
    * @param curentProgress 进度
    */
    public void setCurrentProgress(int curentProgress)

AUPullLoadingView

    /**
     * 构造方法
     * @param context 包含 antu 依赖的页面上下文
     */
    public AUPullLoadingView(Context context)

        /**
     * 设置进度图案
     * @param drawable
     */
    public void setProgressDrawable(Drawable drawable)

    /**
     * 设置回弹图案
     * @param mIndicatorUpDrawable
     */
    public void setIndicatorUpDrawable

    /**
     * 设置加载中文案
     * @param loadingText
     */
    public void setLoadingText(String loadingText)

    /**
     * 设置拖拽中文案
     * @param indicatorText
     */
    public void setIndicatorText(String indicatorText)

AUDragLoadingView

    /**
     * 构造方法
     * @param context 包含 antu 依赖的页面上下文
     */
    public AUDragLoadingView(Context context)
    /**
     * 设置加载中文案
     * @param text
     */
    public void setLoadingText(CharSequence text)

代码示例

AULoadingView

    private AULoadingView mAULoadingView mAULoadingView = (AULoadingView) findViewById(R.id.loadingView);
    private Handler mHandler = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);
            mAULoadingView.setCurrentProgress(mCurrentProgress);
        }
    };
    protected void onResume() {
        super.onResume();
        new Thread(new Runnable() {
            @Override
            public void run() {
                while (mCurrentProgress < 100) {
                    try {
                        Thread.currentThread().sleep(500);
                        mCurrentProgress++;
                        mHandler.sendEmptyMessage(0);
                    } catch (Exception e) {
                        Log.e("EmptyPageLoadingActivity",e.getMessage());
                    }
                }

            }
        }).start();
    }

AUPullLoadingView

    @Override
    public AUPullLoadingView getOverView() {

        mAUPullLoadingView2 = (AUPullLoadingView) LayoutInflater.from(getBaseContext())
                .inflate(R.layout.au_framework_pullrefresh_overview, null);
        return mAUPullLoadingView2;
    }

AUDragLoadingView

    mAUDragLoadingView = (AUDragLoadingView) findViewById(R.id.dragLoadingView);
    findViewById(R.id.modifyLoadingText).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mAUDragLoadingView.setLoadingText("修改后的文案...");
        }
    });
  • 本页导读 (0)
文档反馈