| | |
| | | import android.widget.Toast;
|
| | |
|
| | | import com.bsk.zhangbo.demoforbsk.R;
|
| | | import cn.com.basic.face.adapter.VisitAdapter;
|
| | | import cn.com.basic.face.base.MainUIBaseFragment;
|
| | | import cn.com.basic.face.adapter.VisitLeftAdapter;
|
| | | import cn.com.basic.face.base.LeftRightBaseFragment;
|
| | | import cn.com.basic.face.base.MainActivity;
|
| | |
|
| | | import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder;
|
| | | import com.camnter.easyrecyclerview.widget.EasyRecyclerView;
|
| | | import com.lidroid.xutils.ViewUtils;
|
| | | import com.lidroid.xutils.view.annotation.ViewInject;
|
| | | import com.lidroid.xutils.view.annotation.event.OnClick;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | /**
|
| | | * Created by Sinoe on 2017/2/23.
|
| | | */
|
| | |
|
| | | public class VisitFragment extends MainUIBaseFragment implements EasyRecyclerViewHolder.OnItemClickListener{
|
| | | private View mViewLeft,mViewRight;
|
| | | private LinearLayout mRowLayout1,mRowLayout2,mRowLayout3,mRowLayout4,mRowLayout5,mRowLayout6,mRowLayout7;
|
| | | private TextView mRow1TextViewLeft,mRow1TextViewRight,mRow2TextViewLeft,mRow2TextViewRight,mRow3TextViewLeft,mRow3TextViewRight,mRow4TextViewLeft,mRow4TextViewRight,
|
| | | mRow5TextViewLeft,mRow5TextViewRight,mRow6TextViewLeft,mRow6TextViewRight,mRow7TextViewLeft,mRow7TextViewRight;
|
| | | private VisitAdapter mAdapter;
|
| | | private EasyRecyclerView mRecyclerView;
|
| | | public class VisitFragment extends LeftRightBaseFragment implements EasyRecyclerViewHolder.OnItemClickListener{
|
| | | private View fragment_visit_left;
|
| | | private View mViewRight;
|
| | | private LinearLayout mRowLayout1;
|
| | | private LinearLayout mRowLayout2;
|
| | | private LinearLayout mRowLayout3;
|
| | | private LinearLayout mRowLayout4;
|
| | | private LinearLayout mRowLayout5;
|
| | | private LinearLayout mRowLayout6;
|
| | | private LinearLayout mRowLayout7;
|
| | | private TextView mRow1TextViewLeft;
|
| | | private TextView mRow1TextViewRight;
|
| | | private TextView mRow2TextViewLeft;
|
| | | private TextView mRow2TextViewRight;
|
| | | private TextView mRow3TextViewLeft;
|
| | | private TextView mRow3TextViewRight;
|
| | | private TextView mRow4TextViewLeft;
|
| | | private TextView mRow4TextViewRight;
|
| | | private TextView mRow5TextViewLeft;
|
| | | private TextView mRow5TextViewRight;
|
| | | private TextView mRow6TextViewLeft;
|
| | | private TextView mRow6TextViewRight;
|
| | | private TextView mRow7TextViewLeft;
|
| | | private TextView mRow7TextViewRight;
|
| | | private VisitLeftAdapter mAdapter;
|
| | | @ViewInject(R.id.fragment_attendance_left_list_view)
|
| | | private EasyRecyclerView fragment_attendance_left_list_view;
|
| | | private int mOldPosition = 0,mNewPosition = 0;
|
| | | public static VisitFragment newInstance(){
|
| | | return new VisitFragment();
|
| | | }
|
| | |
|
| | | @Override
|
| | | public View addLeftLayout() {
|
| | | mViewLeft = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_visit_left,null);
|
| | | mRecyclerView = (EasyRecyclerView) mViewLeft.findViewById(R.id.visitor_manager_recycler);
|
| | | fragment_visit_left = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_visit_left,null);
|
| | | ViewUtils.inject(this, fragment_visit_left);
|
| | |
|
| | | LinearLayoutManager manager = new LinearLayoutManager(getActivity(),LinearLayoutManager.VERTICAL,false);
|
| | | mRecyclerView.setLayoutManager(manager);
|
| | | mAdapter = new VisitAdapter();
|
| | | ViewUtils.inject(this, mViewLeft);
|
| | | return mViewLeft;
|
| | | fragment_attendance_left_list_view.setLayoutManager(manager);
|
| | | mAdapter = new VisitLeftAdapter();
|
| | |
|
| | | return fragment_visit_left;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public View addRightLayout() {
|
| | | mViewRight = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_visit_right,null);
|
| | | mRowLayout1 = (LinearLayout) mViewRight.findViewById(R.id.visitor_manager_row1);
|
| | |
| | | list.add("");
|
| | | }
|
| | | mAdapter.setList(list);
|
| | | mRecyclerView.setAdapter(mAdapter);
|
| | | fragment_attendance_left_list_view.setAdapter(mAdapter);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | mOldPosition = mNewPosition;
|
| | | mAdapter.getItem(position);
|
| | | Toast.makeText(getActivity(),position+"",Toast.LENGTH_SHORT).show();
|
| | | // Log.e("aaaaaaaaaaaaaaaaaa",position+"");
|
| | | //// ((CheckBox)mRecyclerView.getChildAt(position).findViewById(R.id.item_visitor_info_check)).setChecked(true);
|
| | | // CheckBox checkBox = (CheckBox) mRecyclerView.getChildAt(position).findViewById(R.id.item_visitor_info_check);
|
| | | // checkBox.setChecked(true);
|
| | | }
|
| | | }
|
| | |
|
| | | @OnClick(R.id.visitor_manager_back)
|
| | | @OnClick(R.id.fragment_visit_left_back)
|
| | | public void back(View view) {
|
| | | MainActivity.selectPage(0);
|
| | | }
|