xuxiuxi
2017-04-06 f938403d9e5caa290a22600a54c99a75d1043294
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/VisitFragment.java
@@ -22,97 +22,21 @@
import java.util.List;
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 static VisitFragment instance = new VisitFragment();
    public static VisitFragment getInstance(){ return instance; }
    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();
    }
    public View addLeftLayout() {
        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);
        fragment_attendance_left_list_view.setLayoutManager(manager);
        mAdapter = new VisitLeftAdapter();
        return fragment_visit_left;
    }
    public View addRightLayout() {
        mViewRight = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_visit_right,null);
        mRowLayout1 = (LinearLayout) mViewRight.findViewById(R.id.visitor_manager_row1);
        mRowLayout2 = (LinearLayout) mViewRight.findViewById(R.id.visitor_manager_row2);
        mRowLayout3 = (LinearLayout) mViewRight.findViewById(R.id.visitor_manager_row3);
        mRowLayout4 = (LinearLayout) mViewRight.findViewById(R.id.visitor_manager_row4);
        mRowLayout5 = (LinearLayout) mViewRight.findViewById(R.id.visitor_manager_row5);
        mRowLayout6 = (LinearLayout) mViewRight.findViewById(R.id.visitor_manager_row6);
        mRowLayout7 = (LinearLayout) mViewRight.findViewById(R.id.visitor_manager_row7);
        mRow1TextViewLeft = (TextView) mRowLayout1.findViewById(R.id.visitor_manager_row_title_left);
        mRow1TextViewRight = (TextView) mRowLayout1.findViewById(R.id.visitor_manager_row_title_right);
        mRow1TextViewLeft.setText(R.string.title_name);
        mRow1TextViewRight.setText(R.string.title_phone);
        mRow2TextViewLeft = (TextView) mRowLayout2.findViewById(R.id.visitor_manager_row_title_left);
        mRow2TextViewRight = (TextView) mRowLayout2.findViewById(R.id.visitor_manager_row_title_right);
        mRow2TextViewLeft.setText(R.string.title_sex);
        mRow2TextViewRight.setText(R.string.title_idClass);
        mRow3TextViewLeft = (TextView) mRowLayout3.findViewById(R.id.visitor_manager_row_title_left);
        mRow3TextViewRight = (TextView) mRowLayout3.findViewById(R.id.visitor_manager_row_title_right);
        mRow3TextViewLeft.setText(R.string.title_nation);
        mRow3TextViewRight.setText(R.string.title_idNumber);
        mRow4TextViewLeft = (TextView) mRowLayout4.findViewById(R.id.visitor_manager_row_title_left);
        mRow4TextViewRight = (TextView) mRowLayout4.findViewById(R.id.visitor_manager_row_title_right);
        mRow4TextViewLeft.setText(R.string.title_birthday);
        mRow4TextViewRight.setText(R.string.title_companyName);
        mRow5TextViewLeft = (TextView) mRowLayout5.findViewById(R.id.visitor_manager_row_title_left);
        mRow5TextViewRight = (TextView) mRowLayout5.findViewById(R.id.visitor_manager_row_title_right);
        mRow5TextViewLeft.setText(R.string.title_visitor);
        mRow5TextViewRight.setText(R.string.title_visitor_thing);
        mRow6TextViewLeft = (TextView) mRowLayout6.findViewById(R.id.visitor_manager_row_title_left);
        mRow6TextViewRight = (TextView) mRowLayout6.findViewById(R.id.visitor_manager_row_title_right);
        mRow6TextViewLeft.setText(R.string.title_visitor_department);
        mRow6TextViewRight.setText(R.string.title_visitor_state);
        mRow7TextViewLeft = (TextView) mRowLayout7.findViewById(R.id.visitor_manager_row_title_left);
        mRow7TextViewRight = (TextView) mRowLayout7.findViewById(R.id.visitor_manager_row_title_right);
        mRow7TextViewLeft.setText(R.string.title_visitor_start_time);
        mRow7TextViewRight.setText(R.string.title_visitor_end_time);
        return mViewRight;
    public int[] getLeftRightLayoutIds() {
        return new int[]{R.layout.fragment_visit_left, R.layout.fragment_visit_right};
    }
    @Override
    protected void initListeners() {
        mAdapter = new VisitLeftAdapter();
        mAdapter.setOnItemClickListener(this);
    }