예제 #1
0
 private XiuInfo getXiuInfoByInputText(String inputText) {
   final XiuInfo xiuInfo = new XiuInfo();
   xiuInfo.setTask_name(inputText);
   xiuInfo.setCreate_time(String.valueOf(System.currentTimeMillis()));
   xiuInfo.setTask_id(UUIDGenerator.getUUID());
   xiuInfo.setShowType(XiuInfo.TYPE_MODIFIABLE);
   xiuInfo.setUid(GlobalDataHolder.getInstance(getActivity()).getUid());
   return xiuInfo;
 }
예제 #2
0
  @Override
  protected View getContentView(LayoutInflater inflater, ViewGroup container) {
    final View view = inflater.inflate(R.layout.fragment_xiu_layout, container, false);

    setLeftContentIcon(R.drawable.back_icon_selector);
    setCenterText(getString(R.string.tab_xiu_tip));
    mXiuInfos = GlobalDataHolder.getInstance(getActivity()).getXiuInfo();

    // set mAdapter
    mAdapter = new XiuPageAdapter(getActivity());
    mAdapter.setItems(mXiuInfos);

    mSwipeMenuListView = (SwipeMenuListView) view.findViewById(R.id.swipeListView);

    // set creator
    mSwipeMenuListView.setMenuCreator(this);
    mSwipeMenuListView.setOnMenuItemClickListener(this);
    mSwipeMenuListView.setOnItemClickListener(this);

    // add headerview and footerview
    final RelativeLayout headerView = new RelativeLayout(getActivity());
    headerView.setLayoutParams(
        new SwipeMenuListView.LayoutParams(
            SwipeMenuListView.LayoutParams.MATCH_PARENT,
            getResources().getDimensionPixelSize(R.dimen.xiu_list_header)));
    headerView.setBackgroundColor(0xffefeff4);
    mSwipeMenuListView.addHeaderView(headerView);

    final View footerView = inflater.inflate(R.layout.xiu_footer_view, container, false);
    footerView.setLayoutParams(
        new SwipeMenuListView.LayoutParams(
            SwipeMenuListView.LayoutParams.MATCH_PARENT,
            SwipeMenuListView.LayoutParams.WRAP_CONTENT));
    mSwipeMenuListView.addFooterView(footerView);
    footerView.findViewById(R.id.add_wrapper).setOnClickListener(this);

    mSwipeMenuListView.setAdapter(mAdapter);

    return view;
  }