| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import android.content.Intent; |
| | | import android.view.View; |
| | | import android.widget.PopupWindow; |
| | | |
| | | import androidx.lifecycle.Observer; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.base.dialog.UIDialog; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | import com.android.app_base.utils.rxbus.RxBus; |
| | | import com.android.app_base.widget.LinearItemDecoration; |
| | |
| | | binding.recyclerView.addItemDecoration(itemDecoration); |
| | | binding.recyclerView.setAdapter(adapter); |
| | | //右上角操作弹窗 |
| | | mOperatePopupWindow = initPopUpWindow(View.inflate(this,R.layout.pop_operate,null)); |
| | | mOperatePopupWindow = initPopUpWindow(View.inflate(this,R.layout.pop_operate_sta,null)); |
| | | setOnClickListener( |
| | | // mOperatePopupWindow.getContentView().findViewById(R.id.tv_add), |
| | | // mOperatePopupWindow.getContentView().findViewById(R.id.tv_select), |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_from_new_to_old), |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_from_old_to_new), |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_add), |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_select), |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_own_top) |
| | | ); |
| | | // //点击放大镜按钮显示出搜索框 |
| | |
| | | // binding.tvTitle.setText("搜索结果"); |
| | | // hideSoftKeyboard(); |
| | | // }); |
| | | //点击添加按钮跳转到创建家大事记页面 |
| | | // 点击添加按钮跳转到创建家大事记页面 |
| | | // binding.fabAdd.setOnClickListener(new View.OnClickListener() { |
| | | // @Override |
| | | // public void onClick(View v) { |
| | | // AppManager.getAppManager().startActivity(new Intent(getSelfActivity(), MeetingStaDetailActivity.class).putExtra(BaseConfig.EXTRA_TYPE,1)); |
| | | // } |
| | | // }); |
| | | |
| | | // |
| | | // binding.etStartTime.addTextChangedListener(new TextWatcher() { |
| | | // @Override |
| | | // public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
| | |
| | | }); |
| | | adapter.setCheckable(true); |
| | | } |
| | | // else if (integer == 2){ |
| | | // binding.ivOperate.setBackgroundResource(R.drawable.ic_delete_white); |
| | | // binding.ivOperate.setOnClickListener(v -> { |
| | | // new UIDialog.Builder(this) |
| | | // .setTitle("您确定要删除选中的项目吗") |
| | | // .setContent("项目删除后将无法恢复") |
| | | // .setConfirm("确定") |
| | | // .setCancel("取消") |
| | | // .setListener(new UIDialog.OnListener() { |
| | | // @Override |
| | | // public void onConfirm(BaseDialog dialog) { |
| | | // viewModel.deleteCheckList(); |
| | | // } |
| | | // }) |
| | | // .show(); |
| | | // }); |
| | | // } |
| | | else if (integer == 2){ |
| | | binding.ivOperate.setBackgroundResource(R.drawable.ic_delete_white); |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | new UIDialog.Builder(this) |
| | | .setTitle("您确定要删除选中的项目吗") |
| | | .setContent("项目删除后将无法恢复") |
| | | .setConfirm("确定") |
| | | .setCancel("取消") |
| | | .setListener(new UIDialog.OnListener() { |
| | | @Override |
| | | public void onConfirm(BaseDialog dialog) { |
| | | viewModel.deleteCheckList(); |
| | | } |
| | | }) |
| | | .show(); |
| | | }); |
| | | } |
| | | }); |
| | | viewModel.getFinishDeleteListLiveData().observe(this, beans -> { |
| | | for (MeetingStaBean bean : beans) { |
| | |
| | | binding.refreshLayout.finishLoadMore(); |
| | | } |
| | | |
| | | // @Override |
| | | // public void onClick(View v) { |
| | | // int id = v.getId(); |
| | | // if (id == R.id.tv_add){ |
| | | // AppManager.getAppManager().startActivity(new Intent(this, MeetingDetailActivity.class).putExtra(BaseConfig.EXTRA_TYPE,1)); |
| | | // }else if (id == R.id.tv_select){ |
| | | // viewModel.getOperateTypeLiveData().postValue(1); |
| | | // mOperatePopupWindow.dismiss(); |
| | | // } else if (id == R.id.tv_from_new_to_old) { |
| | | @Override |
| | | public void onClick(View v) { |
| | | int id = v.getId(); |
| | | if (id == R.id.tv_add){ |
| | | AppManager.getAppManager().startActivity(new Intent(this, MeetingStaDetailActivity.class).putExtra(BaseConfig.EXTRA_TYPE,1)); |
| | | }else if (id == R.id.tv_select){ |
| | | viewModel.getOperateTypeLiveData().postValue(1); |
| | | mOperatePopupWindow.dismiss(); |
| | | } |
| | | // else if (id == R.id.tv_from_new_to_old) { |
| | | // viewModel.changeOrder(true); |
| | | // mOperatePopupWindow.dismiss(); |
| | | // } else if (id == R.id.tv_from_old_to_new) { |
| | | // } |
| | | // else if (id == R.id.tv_from_old_to_new) { |
| | | // viewModel.changeOrder(false); |
| | | // mOperatePopupWindow.dismiss(); |
| | | // } else if (id == R.id.tv_own_top) { |
| | | // viewModel.ownTop(); |
| | | // mOperatePopupWindow.dismiss(); |
| | | // } |
| | | // } |
| | | else if (id == R.id.tv_own_top) { |
| | | viewModel.ownTop(); |
| | | mOperatePopupWindow.dismiss(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | protected void onDestroy() { |