浏览代码

Firmware Info Data Open / Layout 구성

june9152 6 年之前
父节点
当前提交
e495b1ae5c
共有 2 个文件被更改,包括 106 次插入24 次删除
  1. 40 0
      app/src/main/java/com/example/repeater/MainActivity.java
  2. 66 24
      app/src/main/res/layout/activity_main.xml

+ 40 - 0
app/src/main/java/com/example/repeater/MainActivity.java

@@ -2,6 +2,7 @@ package com.example.repeater;
2 2
 
3 3
 import android.support.v7.app.AppCompatActivity;
4 4
 import android.os.Bundle;
5
+import android.widget.ArrayAdapter;
5 6
 import android.widget.ListView;
6 7
 import android.widget.SimpleAdapter;
7 8
 
@@ -12,9 +13,23 @@ public class MainActivity extends AppCompatActivity {
12 13
     private ArrayList<HashMap<String,String>> Data = new ArrayList<HashMap<String, String>>();
13 14
     private HashMap<String,String> InputData1 = new HashMap<>();
14 15
     private HashMap<String,String> InputData2 = new HashMap<>();
16
+    private HashMap<String,String> InputData3 = new HashMap<>();
17
+    private HashMap<String,String> InputData4 = new HashMap<>();
18
+    private HashMap<String,String> InputData5 = new HashMap<>();
19
+    private HashMap<String,String> InputData6 = new HashMap<>();
20
+    private HashMap<String,String> InputData7 = new HashMap<>();
21
+    private HashMap<String,String> InputData8 = new HashMap<>();
22
+    private HashMap<String,String> InputData9 = new HashMap<>();
23
+    private HashMap<String,String> InputData10 = new HashMap<>();
24
+    private HashMap<String,String> InputData11 = new HashMap<>();
25
+    private HashMap<String,String> InputData12 = new HashMap<>();
26
+
15 27
     private ListView listview_info;
28
+    static final String[] LIST_MENU = {"LIST1", "LIST2", "LIST3"} ;
29
+
16 30
     @Override
17 31
     protected void onCreate(Bundle savedInstanceState) {
32
+
18 33
         super.onCreate(savedInstanceState);
19 34
         setContentView(R.layout.activity_main);
20 35
 
@@ -23,9 +38,34 @@ public class MainActivity extends AppCompatActivity {
23 38
         //데이터 초기화
24 39
         InputData1.put("fw_info","firm info.");
25 40
         Data.add(InputData1);
41
+        InputData2.put("fw_info","FPGA Ver.");
42
+        Data.add(InputData2);
43
+        InputData3.put("fw_info","F/W Ver.");
44
+        Data.add(InputData3);
45
+        InputData4.put("fw_info","Config No.");
46
+        Data.add(InputData4);
47
+        InputData5.put("fw_info","Sub Frame No.");
48
+        Data.add(InputData5);
49
+        InputData6.put("fw_info","CH1 TTG");
50
+        Data.add(InputData6);
51
+        InputData7.put("fw_info","CH1 RTG");
52
+        Data.add(InputData7);
53
+        InputData8.put("fw_info","CH2 TTG");
54
+        Data.add(InputData8);
55
+        InputData9.put("fw_info","CH2 RTG");
56
+        Data.add(InputData9);
57
+        InputData10.put("fw_info","CH2 Polarity");
58
+        Data.add(InputData10);
59
+        InputData11.put("fw_info","CH2 Default");
60
+        Data.add(InputData11);
61
+        InputData12.put("fw_info","Auto Config");
62
+        Data.add(InputData12);
63
+
26 64
         //simpleAdapter 생성
27 65
         SimpleAdapter simpleAdapter = new SimpleAdapter(this,Data,android.R.layout.simple_list_item_2,new String[]{"fw_info"},new int[]{android.R.id.text1});
28 66
         listview_info.setAdapter(simpleAdapter);
67
+//        ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_list_item_2, LIST_MENU) ;
68
+//        listview_info.setAdapter(adapter);
29 69
 
30 70
     }
31 71
 }

+ 66 - 24
app/src/main/res/layout/activity_main.xml

@@ -1,11 +1,14 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2 2
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    xmlns:app="http://schemas.android.com/apk/res-auto"
3 4
     xmlns:tools="http://schemas.android.com/tools"
4 5
     android:layout_width="match_parent"
5 6
     android:layout_height="match_parent"
6 7
     tools:context=".MainActivity"
7 8
     android:orientation="vertical">
8 9
 
10
+
11
+
9 12
     <LinearLayout
10 13
         android:layout_width="match_parent"
11 14
         android:layout_height="wrap_content"
@@ -23,34 +26,72 @@
23 26
             android:layout_width="match_parent"
24 27
             android:layout_height="wrap_content"
25 28
             android:text="Port Open" />
26
-        <LinearLayout
27
-            android:layout_width="match_parent"
28
-            android:layout_height="wrap_content"
29
-            android:orientation="horizontal">
29
+
30
+    </LinearLayout>
31
+
32
+    <LinearLayout
33
+        android:layout_width="match_parent"
34
+        android:layout_height="wrap_content"
35
+        android:orientation="horizontal">
36
+
30 37
         <Button
31
-            android:id="@+id/button2"
32
-            android:layout_width="100dp"
33
-            android:layout_height="100dp"
34
-            android:layout_marginLeft="10dp"
35
-            android:layout_marginBottom="10dp"
36
-            android:text="Control" />
38
+        android:id="@+id/button2"
39
+        android:layout_width="100dp"
40
+        android:layout_height="100dp"
41
+        android:layout_marginLeft="10dp"
42
+        android:layout_marginBottom="10dp"
43
+        android:text="Control" />
37 44
 
38 45
 
39
-            <TextView
40
-                android:id="@+id/textView3"
41
-                android:layout_marginLeft="30dp"
42
-                android:layout_marginTop="20dp"
43
-                android:layout_width="match_parent"
44
-                android:layout_height="match_parent"
45
-                android:text="Status"
46
-                android:textSize="46sp" />
47
-        </LinearLayout>
48 46
         <TextView
49
-            android:id="@+id/textView4"
47
+            android:id="@+id/textView3"
50 48
             android:layout_width="match_parent"
51 49
             android:layout_height="wrap_content"
52
-            android:background="@color/colorPrimary"
53
-            android:text="Alarm  Status" />
50
+            android:layout_marginLeft="30dp"
51
+            android:layout_marginTop="20dp"
52
+            android:text="Status"
53
+            android:textSize="46sp" />
54
+    </LinearLayout>
55
+    <TextView
56
+        android:id="@+id/textView4"
57
+        android:layout_width="match_parent"
58
+        android:layout_height="wrap_content"
59
+        android:background="@color/colorPrimary"
60
+        android:text="Alarm  Status" />
61
+    <LinearLayout
62
+        android:layout_width="match_parent"
63
+        android:layout_height="wrap_content"
64
+        android:orientation="horizontal">
65
+        <TextView
66
+            android:id="@+id/textView5"
67
+            android:layout_width="wrap_content"
68
+            android:layout_height="wrap_content"
69
+            android:text="Lock"
70
+            tools:ignore="HardcodedText" />
71
+
72
+        <ImageView
73
+            android:id="@+id/imageView2"
74
+            android:layout_width="wrap_content"
75
+            android:layout_height="wrap_content"
76
+            android:layout_weight="1"
77
+            app:srcCompat="@android:drawable/presence_invisible"
78
+            android:contentDescription="TODO"
79
+            tools:ignore="ContentDescription,HardcodedText" />
80
+
81
+        <TextView
82
+            android:id="@+id/textView6"
83
+            android:layout_width="wrap_content"
84
+            android:layout_height="wrap_content"
85
+            android:text="PLL"
86
+            tools:ignore="HardcodedText" />
87
+        <ImageView
88
+            android:id="@+id/imageView3"
89
+            android:layout_width="wrap_content"
90
+            android:layout_height="wrap_content"
91
+            android:layout_weight="1"
92
+            app:srcCompat="@android:drawable/presence_invisible"
93
+            android:contentDescription="TODO"
94
+            tools:ignore="ContentDescription,HardcodedText" />
54 95
     </LinearLayout>
55 96
 
56 97
     <LinearLayout
@@ -60,8 +101,9 @@
60 101
 
61 102
         <ListView
62 103
             android:id="@+id/listview_info"
63
-            android:layout_width="match_parent"
64
-            android:layout_height="wrap_content" />
104
+            android:layout_width="wrap_content"
105
+            android:layout_height="wrap_content"
106
+            />
65 107
     </LinearLayout>
66 108
 
67 109
 </LinearLayout>