| | |
| | | import android.view.LayoutInflater;
|
| | | import android.view.View;
|
| | | import android.widget.CheckBox;
|
| | | import android.widget.EditText;
|
| | | import android.widget.RadioButton;
|
| | | import android.widget.RelativeLayout;
|
| | | import android.widget.TextView;
|
| | | import android.widget.Toast;
|
| | |
|
| | | import com.bsk.zhangbo.demoforbsk.R;
|
| | | import cn.com.basic.face.base.LeftRightBaseFragment;
|
| | | import cn.com.basic.face.base.MainActivity;
|
| | |
|
| | | 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 DeviceFragment extends LeftRightBaseFragment {
|
| | | private View mViewLeft,mViewRight;
|
| | | private RelativeLayout mLayoutWifi,mLayoutLandline,mLayoutSchool,mLayoutCamera1,mLayoutCamera2;
|
| | | private TextView mTvWifi,mTvLandline,mTvSchool,mTvCamera1,mTvCamera2;
|
| | | private CheckBox mCheckWifi,mCheckLandline,mCheckSchool,mCheckCamera1,mCheckCamera2;
|
| | | private List<CheckBox> listCheck = new ArrayList<>();
|
| | | public static DeviceFragment newInstance() {
|
| | | return new DeviceFragment();
|
| | |
|
| | | @ViewInject(R.id.fragment_device_left_wifi_check_box)
|
| | | private RadioButton fragment_device_left_wifi_check_box;
|
| | | @ViewInject(R.id.fragment_device_left_search)
|
| | | private EditText fragment_device_left_search;
|
| | | @ViewInject(R.id.fragment_device_left_lan_check_box)
|
| | | private RadioButton fragment_device_left_lan_check_box;
|
| | | @ViewInject(R.id.fragment_device_left_school_check_box)
|
| | | private RadioButton fragment_device_left_school_check_box;
|
| | | @ViewInject(R.id.fragment_device_left_camera1_check_box)
|
| | | private RadioButton fragment_device_left_camera1_check_box;
|
| | | @ViewInject(R.id.fragment_device_left_camera2_check_box)
|
| | | private RadioButton fragment_device_left_camera2_check_box;
|
| | |
|
| | | private static DeviceFragment instance = new DeviceFragment();
|
| | | public static DeviceFragment getInstance() {
|
| | | return instance;
|
| | | }
|
| | |
|
| | | public View addLeftLayout() {
|
| | | mViewLeft = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_device_left,null);
|
| | | ViewUtils.inject(this, mViewLeft);
|
| | | return mViewLeft;
|
| | | @OnClick(R.id.fragment_device_left_wifi_relative_layout)
|
| | | public void fragment_device_left_wifi_relative_layout_click(View view) { fragment_device_left_wifi_check_box_click(view); }
|
| | | @OnClick(R.id.fragment_device_left_lan_relative_layout)
|
| | | public void fragment_device_left_lan_relative_layout_click(View view) { fragment_device_left_lan_check_box_click(view); }
|
| | | @OnClick(R.id.fragment_device_left_school_relative_layout)
|
| | | public void fragment_device_left_school_relative_layout_click(View view) { fragment_device_left_school_check_box_click(view); }
|
| | | @OnClick(R.id.fragment_device_left_camera1_relative_layout)
|
| | | public void fragment_device_left_camera1_relative_layout_click(View view) { fragment_device_left_camera1_check_box_click(view); }
|
| | | @OnClick(R.id.fragment_device_left_camera2_relative_layout)
|
| | | public void fragment_device_left_camera2_relative_layout_click(View view) { fragment_device_left_camera2_check_box_click(view); }
|
| | |
|
| | | public void clearAll() {
|
| | | fragment_device_left_wifi_check_box.setChecked(false);
|
| | | fragment_device_left_lan_check_box.setChecked(false);
|
| | | fragment_device_left_school_check_box.setChecked(false);
|
| | | fragment_device_left_camera1_check_box.setChecked(false);
|
| | | fragment_device_left_camera2_check_box.setChecked(false);
|
| | | }
|
| | |
|
| | | public View addRightLayout() {
|
| | | mViewRight = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_device_right,null);
|
| | | return mViewRight;
|
| | | @OnClick(R.id.fragment_device_left_wifi_check_box)
|
| | | public void fragment_device_left_wifi_check_box_click(View view) {
|
| | | clearAll();
|
| | | fragment_device_left_wifi_check_box.setChecked(true);
|
| | | }
|
| | |
|
| | | @OnClick(R.id.fragment_device_left_lan_check_box)
|
| | | public void fragment_device_left_lan_check_box_click(View view) {
|
| | | clearAll();
|
| | | fragment_device_left_lan_check_box.setChecked(true);
|
| | | }
|
| | |
|
| | | @OnClick(R.id.fragment_device_left_school_check_box)
|
| | | public void fragment_device_left_school_check_box_click(View view) {
|
| | | clearAll();
|
| | | fragment_device_left_school_check_box.setChecked(true);
|
| | | }
|
| | |
|
| | | @OnClick(R.id.fragment_device_left_camera1_check_box)
|
| | | public void fragment_device_left_camera1_check_box_click(View view) {
|
| | | clearAll();
|
| | | fragment_device_left_camera1_check_box.setChecked(true);
|
| | | }
|
| | |
|
| | | @OnClick(R.id.fragment_device_left_camera2_check_box)
|
| | | public void fragment_device_left_camera2_check_box_click(View view) {
|
| | | clearAll();
|
| | | fragment_device_left_camera2_check_box.setChecked(true);
|
| | | }
|
| | |
|
| | | public int[] getLeftRightLayoutIds() {
|
| | | return new int[]{R.layout.fragment_device_left, R.layout.fragment_device_right};
|
| | | }
|
| | |
|
| | | @OnClick(R.id.fragment_device_back)
|
| | | public void back(View view){
|
| | | MainActivity.selectPage(0);
|
| | | }
|
| | |
|
| | | @OnClick(R.id.fragment_device_right_delete)
|
| | | public void fragment_device_right_delete_click(View view) {
|
| | |
|
| | | }
|
| | |
|
| | | @OnClick(R.id.fragment_device_right_add)
|
| | | public void fragment_device_right_add_click(View view) {
|
| | |
|
| | | }
|
| | |
|
| | | @OnClick(R.id.fragment_device_right_save)
|
| | | public void fragment_device_right_save_click(View view) {
|
| | |
|
| | | }
|
| | |
|
| | | }
|