| | |
| | | * 本fragment有两种问题状态,已整改{@link Constant#UNCHANGED}和未整改{@link Constant#CHANGED} |
| | | */ |
| | | public class ProblemChangeFragment extends Fragment { |
| | | //<editor-fold desc="全局变量"> |
| | | public static final String ARG_PARAM1 = "problems"; |
| | | public static final String ARG_PARAM2 = "fragmentType"; |
| | | public static final int REQUEST_CODE_SUBMIT = 11; |
| | | |
| | | private CommonApplication application; |
| | | private ArrayList<ProblemlistVo> problemlistVos; |
| | | private ArrayList<ProblemlistVo> problemlistVos = new ArrayList<>(); |
| | | private String fragmentType; |
| | | private MediafileDao mediafileDao; |
| | | private Unbinder unbinder; |
| | | //</editor-fold> |
| | | |
| | | //<editor-fold desc="constructor"> |
| | | public ProblemChangeFragment() { |
| | | // Required empty public constructor |
| | | } |
| | |
| | | fragment.setArguments(args); |
| | | return fragment; |
| | | } |
| | | //</editor-fold> |
| | | |
| | | //<editor-fold desc="lifecycle"> |
| | | @Override |
| | | public void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | |
| | | unbinder.unbind(); |
| | | } |
| | | } |
| | | //</editor-fold> |
| | | |
| | | //<editor-fold desc="初始化数据库"> |
| | | //初始化数据库 |
| | | private void initDataBase() { |
| | | DaoSession daoSession = application.getDaoSession(); |
| | | mediafileDao = daoSession.getMediafileDao(); |
| | | } |
| | | //</editor-fold> |
| | | |
| | | //<editor-fold desc="initView"> |
| | | //initView |
| | | @BindView(R.id.rv_content) RecyclerView rv_rank_content; |
| | | @BindView(R.id.image_problem_complete) ImageView image_problem_complete; |
| | | AllRecyclerViewAdapter<ProblemlistVo> adapter; |
| | |
| | | } |
| | | |
| | | } |
| | | //</editor-fold> |
| | | |
| | | //<editor-fold desc="点击事件"> |
| | | //点击事件 |
| | | class OnProblemDetailClickListener implements View.OnClickListener { |
| | | |
| | | private ProblemlistVo problemlistVo; |
| | |
| | | startActivityForResult(intent, REQUEST_CODE_SUBMIT, optionsCompat.toBundle()); |
| | | } |
| | | } |
| | | //</editor-fold> |
| | | |
| | | //<editor-fold desc="更新列表"> |
| | | //更新列表 |
| | | public void notifyDataSetChanged() { |
| | | // this.problemlistVos.clear(); |
| | | // this.problemlistVos.addAll(p); |
| | |
| | | } |
| | | adapter.notifyDataSetChanged(); |
| | | } |
| | | //</editor-fold> |
| | | } |