• 5.30学习记录


    fragment的修改
    public abstract class BaseFragment extends Fragment {

    protected String TAG = BaseFragment.class.getSimpleName();

    private Unbinder bind;

    protected Context context;

    private Toast mToast = null;

    private static final int DISMISS = 1001;
    private static final int SHOW = 1002;
    private CustomProgressDialog progressDialog = null;

    @SuppressLint("HandlerLeak")
    private Handler mHandler = new Handler() {

    @Override
    public void handleMessage(Message msg) {
    switch (msg.what) {
    case SHOW:
    if (progressDialog != null) {
    progressDialog.setTouchAble((Boolean) msg.obj);
    progressDialog.show();
    }
    break;
    case DISMISS:
    if (progressDialog != null && progressDialog.isShowing()) {
    progressDialog.dismiss();
    }
    break;
    default:
    break;
    }
    }
    };


    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

    View inflate = inflater.inflate(getLayoutId(), container, false);

    bind = ButterKnife.bind(this, inflate);

    context = getActivity();

    initData(savedInstanceState);

    initListener();

    mToast = Toast.makeText(context, "", Toast.LENGTH_SHORT);
    if (progressDialog == null) {
    progressDialog = new CustomProgressDialog(context);
    }
    return inflate;
    }

    public abstract int getLayoutId();

    public abstract void initData(Bundle savedInstanceState);

    public abstract void initListener();

    @Override
    public void onResume() {
    super.onResume();

    if (mToast == null)
    mToast = Toast.makeText(context, "", Toast.LENGTH_SHORT);
    if (progressDialog == null) {
    progressDialog = new CustomProgressDialog(context);
    }
    }
  • 相关阅读:
    Lilo的实现
    通过Bochs分析Lilo启动Linux内核的过程
    Linux内核代码布局
    Linux启动过程的内核代码分析
    Linux启动过程的C语言代码分析
    Linux操作系统中对于NTFS读取目录功能的实现
    Linux初始化的汇编代码
    Linux文件映射的反思
    Xen的概况
    安装debian总结以及编译linux内核
  • 原文地址:https://www.cnblogs.com/blog-wangke/p/14871845.html
Copyright © 2020-2023  润新知