From 55e3f5761aae3dca19b0e417c05043d718891af0 Mon Sep 17 00:00:00 2001 From: xuxiuxi <xuxiuxi@454eff88-639b-444f-9e54-f578c98de674> Date: 星期五, 05 五月 2017 10:47:42 +0800 Subject: [PATCH] --- VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/DeviceFragment.java | 47 ++++++++++++++++++++++------------------------- 1 files changed, 22 insertions(+), 25 deletions(-) diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/DeviceFragment.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/DeviceFragment.java index 401deab..fdf945d 100644 --- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/DeviceFragment.java +++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/DeviceFragment.java @@ -1,5 +1,6 @@ package cn.com.basic.face.fragment; +import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.view.LayoutInflater; @@ -55,6 +56,11 @@ @ViewInject(R.id.fragment_left_right_frame_layout_right) private FrameLayout fragment_left_right_frame_layout_right; + @ViewInject(R.id.fragment_device_right_camera1_brand) + private EditText fragment_device_right_camera1_brand; + @ViewInject(R.id.fragment_device_right_camera1_ip) + private EditText fragment_device_right_camera1_ip; + private View wifiView; private View lanView; private View schoolView; @@ -67,17 +73,28 @@ fragment_device_left_school_check_box.setChecked(false); fragment_device_left_camera1_check_box.setChecked(false); fragment_device_left_camera2_check_box.setChecked(false); + fragment_left_right_frame_layout_right.removeAllViews(); + } + + @Override + protected void initViews(View view, Bundle savedInstanceState) { + super.initViews(view, savedInstanceState); + wifiView = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_device_right_wifi, null); + lanView = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_device_right_lan, null); + schoolView = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_device_right_school, null); + camera1View = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_device_right_camera1, null); + camera2View = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_device_right_camera2, null); + ViewUtils.inject(this, wifiView); + ViewUtils.inject(this, lanView); + ViewUtils.inject(this, schoolView); + ViewUtils.inject(this, camera1View); + ViewUtils.inject(this, camera2View); } @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); - - fragment_left_right_frame_layout_right.removeAllViews(); - if (wifiView == null) { - wifiView = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_device_right_wifi, null); - } fragment_left_right_frame_layout_right.addView(wifiView); } @@ -85,11 +102,6 @@ public void fragment_device_left_lan_check_box_click(View view) { clearAll(); fragment_device_left_lan_check_box.setChecked(true); - - fragment_left_right_frame_layout_right.removeAllViews(); - if (lanView == null) { - lanView = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_device_right_lan, null); - } fragment_left_right_frame_layout_right.addView(lanView); } @@ -97,11 +109,6 @@ public void fragment_device_left_school_check_box_click(View view) { clearAll(); fragment_device_left_school_check_box.setChecked(true); - - fragment_left_right_frame_layout_right.removeAllViews(); - if (schoolView == null) { - schoolView = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_device_right_school, null); - } fragment_left_right_frame_layout_right.addView(schoolView); } @@ -109,11 +116,6 @@ public void fragment_device_left_camera1_check_box_click(View view) { clearAll(); fragment_device_left_camera1_check_box.setChecked(true); - - fragment_left_right_frame_layout_right.removeAllViews(); - if (camera1View == null) { - camera1View = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_device_right_camera1, null); - } fragment_left_right_frame_layout_right.addView(camera1View); } @@ -121,11 +123,6 @@ public void fragment_device_left_camera2_check_box_click(View view) { clearAll(); fragment_device_left_camera2_check_box.setChecked(true); - - fragment_left_right_frame_layout_right.removeAllViews(); - if (camera2View == null) { - camera2View = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_device_right_camera2, null); - } fragment_left_right_frame_layout_right.addView(camera2View); } -- Gitblit v1.8.0