소스 검색

Action Bar Remove / Intro logo Add / List View Add / Toggle Button Add

Layout 작업 만 진행중
june9152 6 년 전
부모
커밋
dd6b601cc6

+ 8 - 0
.idea/dictionaries/parkyj.xml

@@ -0,0 +1,8 @@
1
+<component name="ProjectDictionaryState">
2
+  <dictionary name="parkyj">
3
+    <words>
4
+      <w>bluecell</w>
5
+      <w>listview</w>
6
+    </words>
7
+  </dictionary>
8
+</component>

+ 3 - 4
app/src/main/AndroidManifest.xml

@@ -8,9 +8,9 @@
8 8
         android:label="@string/app_name"
9 9
         android:roundIcon="@mipmap/ic_launcher_round"
10 10
         android:supportsRtl="true"
11
-        android:theme="@style/AppTheme">
12
-        <activity android:name=".IntroActivity"></activity>
13
-        <activity android:name=".MainActivity">
11
+        android:theme="@style/Theme.AppCompat.Light.NoActionBar">
12
+        <activity android:name=".MainActivity"></activity>
13
+        <activity android:name=".IntroActivity">
14 14
             <intent-filter>
15 15
                 <action android:name="android.intent.action.MAIN" />
16 16
 
@@ -18,5 +18,4 @@
18 18
             </intent-filter>
19 19
         </activity>
20 20
     </application>
21
-
22 21
 </manifest>

+ 19 - 1
app/src/main/java/com/example/repeater/MainActivity.java

@@ -2,12 +2,30 @@ package com.example.repeater;
2 2
 
3 3
 import android.support.v7.app.AppCompatActivity;
4 4
 import android.os.Bundle;
5
+import android.widget.ListView;
6
+import android.widget.SimpleAdapter;
5 7
 
6
-public class MainActivity extends AppCompatActivity {
8
+import java.util.ArrayList;
9
+import java.util.HashMap;
7 10
 
11
+public class MainActivity extends AppCompatActivity {
12
+    private ArrayList<HashMap<String,String>> Data = new ArrayList<HashMap<String, String>>();
13
+    private HashMap<String,String> InputData1 = new HashMap<>();
14
+    private HashMap<String,String> InputData2 = new HashMap<>();
15
+    private ListView listview_info;
8 16
     @Override
9 17
     protected void onCreate(Bundle savedInstanceState) {
10 18
         super.onCreate(savedInstanceState);
11 19
         setContentView(R.layout.activity_main);
20
+
21
+        listview_info =(ListView)findViewById(R.id.listview_info);
22
+
23
+        //데이터 초기화
24
+        InputData1.put("fw_info","firm info.");
25
+        Data.add(InputData1);
26
+        //simpleAdapter 생성
27
+        SimpleAdapter simpleAdapter = new SimpleAdapter(this,Data,android.R.layout.simple_list_item_2,new String[]{"fw_info"},new int[]{android.R.id.text1});
28
+        listview_info.setAdapter(simpleAdapter);
29
+
12 30
     }
13 31
 }

BIN
app/src/main/res/drawable-v24/bluecell_logo.png


+ 11 - 2
app/src/main/res/layout/activity_intro.xml

@@ -1,9 +1,18 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2
-<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 3
     xmlns:app="http://schemas.android.com/apk/res-auto"
4 4
     xmlns:tools="http://schemas.android.com/tools"
5 5
     android:layout_width="match_parent"
6 6
     android:layout_height="match_parent"
7
+    android:orientation="vertical"
7 8
     tools:context=".IntroActivity">
8 9
 
9
-</android.support.constraint.ConstraintLayout>
10
+    <ImageView
11
+        android:id="@+id/imageView6"
12
+        android:layout_width="360dp"
13
+        android:layout_height="80dp"
14
+        android:layout_marginStart="40dp"
15
+        android:layout_marginTop="250dp"
16
+        app:srcCompat="@drawable/bluecell_logo"
17
+        android:layout_marginLeft="40dp" />
18
+</LinearLayout>

+ 60 - 11
app/src/main/res/layout/activity_main.xml

@@ -1,18 +1,67 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2
-<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
-    xmlns:app="http://schemas.android.com/apk/res-auto"
2
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
4 3
     xmlns:tools="http://schemas.android.com/tools"
5 4
     android:layout_width="match_parent"
6 5
     android:layout_height="match_parent"
7
-    tools:context=".MainActivity">
6
+    tools:context=".MainActivity"
7
+    android:orientation="vertical">
8 8
 
9
-    <TextView
10
-        android:layout_width="wrap_content"
9
+    <LinearLayout
10
+        android:layout_width="match_parent"
11 11
         android:layout_height="wrap_content"
12
-        android:text="Hello World!"
13
-        app:layout_constraintBottom_toBottomOf="parent"
14
-        app:layout_constraintLeft_toLeftOf="parent"
15
-        app:layout_constraintRight_toRightOf="parent"
16
-        app:layout_constraintTop_toTopOf="parent" />
12
+        android:orientation="vertical">
17 13
 
18
-</android.support.constraint.ConstraintLayout>
14
+        <TextView
15
+            android:id="@+id/textView2"
16
+            android:layout_width="match_parent"
17
+            android:layout_height="wrap_content"
18
+            android:background="@color/colorPrimary"
19
+            android:text="Repeater" />
20
+
21
+        <ToggleButton
22
+            android:id="@+id/button"
23
+            android:layout_width="match_parent"
24
+            android:layout_height="wrap_content"
25
+            android:text="Port Open" />
26
+        <LinearLayout
27
+            android:layout_width="match_parent"
28
+            android:layout_height="wrap_content"
29
+            android:orientation="horizontal">
30
+        <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" />
37
+
38
+
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
+        <TextView
49
+            android:id="@+id/textView4"
50
+            android:layout_width="match_parent"
51
+            android:layout_height="wrap_content"
52
+            android:background="@color/colorPrimary"
53
+            android:text="Alarm  Status" />
54
+    </LinearLayout>
55
+
56
+    <LinearLayout
57
+        android:layout_width="match_parent"
58
+        android:layout_height="wrap_content"
59
+        android:orientation="vertical">
60
+
61
+        <ListView
62
+            android:id="@+id/listview_info"
63
+            android:layout_width="match_parent"
64
+            android:layout_height="wrap_content" />
65
+    </LinearLayout>
66
+
67
+</LinearLayout>