app/src/main/java/net/nashlegend/sourcewall/view/common/LoadingView.java

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

package net.nashlegend.sourcewall.view.common;

import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ProgressBar;

import net.nashlegend.sourcewall.R;

/**
 * Created by NashLegend on 2014/12/26 0026
 */
public class LoadingView extends FrameLayout {
    ProgressBar progressBar;
    ImageButton loadingButton;
    ReloadListener reloadListener;

    public LoadingView(Context context) {
        super(context);
        initView(context);
    }

    public LoadingView(Context context, AttributeSet attrs) {
        super(context, attrs);
        initView(context);
    }

    public LoadingView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    public LoadingView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    private void initView(Context context) {
        LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        inflater.inflate(R.layout.layout_loading, this);
        progressBar = (ProgressBar) findViewById(R.id.progress_loading);
        loadingButton = (ImageButton) findViewById(R.id.button_reload);
        loadingButton.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                if (reloadListener != null) {
                    progressBar.setVisibility(VISIBLE);
                    loadingButton.setVisibility(GONE);
                    reloadListener.reload();
                }
            }
        });
    }

    public void setReloadListener(ReloadListener listener) {
        this.reloadListener = listener;
后面还有 27 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。