瀏覽代碼

zmiany do wersj pdstawoej

waldek 5 年之前
父節點
當前提交
6c2d8a1966
共有 33 個檔案被更改,包括 2756 行新增219 行删除
  1. 21
    12
      app/src/main/AndroidManifest.xml
  2. 6
    3
      app/src/main/java/com/kfb/kfbv1/ConfigActivity.java
  3. 1009
    7
      app/src/main/java/com/kfb/kfbv1/GateActivity.java
  4. 131
    65
      app/src/main/java/com/kfb/kfbv1/MainActivity.java
  5. 3
    2
      app/src/main/java/com/kfb/kfbv1/MyAcessPoint.java
  6. 38
    0
      app/src/main/java/com/kfb/kfbv1/MyItemRecyclerViewAdapter.java
  7. 52
    0
      app/src/main/java/com/kfb/kfbv1/PinActivity.java
  8. 2
    0
      app/src/main/java/com/kfb/kfbv1/SplashActivity.java
  9. 2
    1
      app/src/main/java/com/kfb/kfbv1/db/DbAbstractManage.java
  10. 21
    0
      app/src/main/java/com/kfb/kfbv1/db/DbManage.java
  11. 17
    0
      app/src/main/java/com/kfb/kfbv1/db/Pomiar.java
  12. 25
    0
      app/src/main/java/com/kfb/kfbv1/db/PomiarDao.java
  13. 154
    0
      app/src/main/java/com/kfb/kfbv1/media/KfbINtercom.java
  14. 6
    0
      app/src/main/java/com/kfb/kfbv1/model/KfbConstans.java
  15. 3
    1
      app/src/main/java/com/kfb/kfbv1/model/KfbGate.java
  16. 175
    9
      app/src/main/java/com/kfb/kfbv1/model/KfbHttpRequest.java
  17. 18
    0
      app/src/main/java/com/kfb/kfbv1/model/KfbJsonStatus.java
  18. 19
    0
      app/src/main/java/com/kfb/kfbv1/model/KfbJsonTemperatura.java
  19. 26
    0
      app/src/main/java/com/kfb/kfbv1/model/KfbMeasure.java
  20. 4
    0
      app/src/main/java/com/kfb/kfbv1/model/KfbModel.java
  21. 13
    2
      app/src/main/java/com/kfb/kfbv1/model/KfbParser.java
  22. 23
    1
      app/src/main/java/com/kfb/kfbv1/model/KfbTask.java
  23. 43
    0
      app/src/main/java/com/kfb/kfbv1/model/KfbTaskTablet.java
  24. 173
    0
      app/src/main/java/com/kfb/kfbv1/shttp/KfbHttp.java
  25. 二進制
      app/src/main/res/drawable/logo.png
  26. 87
    0
      app/src/main/res/layout/activity_gate1.xml
  27. 149
    0
      app/src/main/res/layout/activity_gate2.xml
  28. 209
    0
      app/src/main/res/layout/activity_gate3.xml
  29. 271
    0
      app/src/main/res/layout/activity_gate4.xml
  30. 12
    114
      app/src/main/res/layout/activity_main.xml
  31. 39
    0
      app/src/main/res/layout/activity_pin.xml
  32. 2
    2
      app/src/main/res/layout/fragment_item.xml
  33. 3
    0
      app/src/main/res/layout/fragment_item_list.xml

+ 21
- 12
app/src/main/AndroidManifest.xml 查看文件

@@ -4,36 +4,45 @@
4 4
     package="com.kfb.kfbv1">
5 5
 
6 6
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
7
-    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
7
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
8 8
     <uses-permission android:name="android.permission.INTERNET" />
9
-    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
10
-    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
11
-    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
12
-    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
13
-    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
9
+    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
10
+    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
11
+    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
12
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
13
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
14 14
     <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
15
-    <uses-permission android:name="android.permission.WRITE_SETTINGS"
15
+    <uses-permission android:name="android.permission.RECORD_AUDIO" />
16
+    <uses-permission
17
+        android:name="android.permission.WRITE_SETTINGS"
16 18
         tools:ignore="ProtectedPermissions" />
17 19
 
18 20
     <application
19 21
         android:allowBackup="true"
22
+        android:icon="@drawable/ic_launcher_round"
20 23
         android:label="@string/app_name"
21 24
         android:roundIcon="@drawable/ic_launcher_round"
22
-        android:icon="@drawable/ic_launcher_round"
23 25
         android:supportsRtl="true"
24 26
         android:theme="@style/AppTheme">
27
+        <activity android:name=".PinActivity"  android:noHistory="true" ></activity>
25 28
         <activity
26 29
             android:name=".SplashActivity"
27
-            android:theme="@style/SplashScreenTheme">
30
+            android:theme="@style/SplashScreenTheme"></activity>
31
+        <activity
32
+            android:name=".MainActivity"
33
+            android:noHistory="true">
28 34
             <intent-filter>
29 35
                 <action android:name="android.intent.action.MAIN" />
30 36
 
31 37
                 <category android:name="android.intent.category.LAUNCHER" />
32 38
             </intent-filter>
33 39
         </activity>
34
-        <activity android:name=".MainActivity" android:noHistory="true"></activity>
35
-        <activity android:name=".GateActivity" android:noHistory="true"></activity>
36
-        <activity android:name=".ConfigActivity" android:noHistory="true"></activity>
40
+        <activity
41
+            android:name=".GateActivity"
42
+            android:noHistory="true" />
43
+        <activity
44
+            android:name=".ConfigActivity"
45
+            android:noHistory="true" />
37 46
     </application>
38 47
 
39 48
 </manifest>

+ 6
- 3
app/src/main/java/com/kfb/kfbv1/ConfigActivity.java 查看文件

@@ -1,6 +1,7 @@
1 1
 package com.kfb.kfbv1;
2 2
 
3 3
 import android.content.Intent;
4
+import android.content.pm.ActivityInfo;
4 5
 import android.os.Bundle;
5 6
 import android.view.View;
6 7
 import android.widget.Button;
@@ -21,8 +22,8 @@ public class ConfigActivity  extends AppCompatActivity {
21 22
     protected void onCreate(Bundle savedInstanceState) {
22 23
         super.onCreate(savedInstanceState);
23 24
         setContentView(R.layout.activity_config);
24
-
25
-        ImageButton btn = (ImageButton) findViewById(R.id.back);
25
+        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
26
+        ImageButton btn = findViewById(R.id.back);
26 27
         btn.setOnClickListener(new View.OnClickListener() {
27 28
 
28 29
             public void onClick(View v) {
@@ -81,11 +82,12 @@ public class ConfigActivity  extends AppCompatActivity {
81 82
             t1 = (TextView) findViewById(R.id.t4t);
82 83
             t1.setText(urzdb.adres);
83 84
         }
85
+        dbRep.close();
84 86
     }
85 87
 
86 88
     private void onBack(View v)
87 89
     {
88
-        Intent intent = new Intent(this, GateActivity.class);
90
+        Intent intent = new Intent(this, MainActivity.class);
89 91
         startActivityForResult(intent,1);
90 92
         finish();
91 93
     }
@@ -211,6 +213,7 @@ public class ConfigActivity  extends AppCompatActivity {
211 213
             urzdb.active = s1.isChecked();
212 214
             dbRep.updateUrzazenie(urzdb);
213 215
         }
216
+        dbRep.close();
214 217
         this.onBack(v);
215 218
     }
216 219
 }

+ 1009
- 7
app/src/main/java/com/kfb/kfbv1/GateActivity.java
文件差異過大導致無法顯示
查看文件


+ 131
- 65
app/src/main/java/com/kfb/kfbv1/MainActivity.java 查看文件

@@ -4,6 +4,7 @@ import androidx.appcompat.app.AppCompatActivity;
4 4
 
5 5
 import android.content.Context;
6 6
 import android.content.Intent;
7
+import android.content.pm.ActivityInfo;
7 8
 import android.net.wifi.WifiConfiguration;
8 9
 import android.net.wifi.WifiEnterpriseConfig;
9 10
 import android.os.AsyncTask;
@@ -13,10 +14,12 @@ import android.os.Message;
13 14
 import android.view.View;
14 15
 import android.view.WindowManager;
15 16
 import android.widget.Button;
17
+import android.widget.ImageButton;
16 18
 import android.widget.ProgressBar;
17 19
 import android.widget.TextView;
18 20
 
19 21
 import com.kfb.kfbv1.db.DbManage;
22
+import com.kfb.kfbv1.db.Urzadzenia;
20 23
 import com.kfb.kfbv1.db.User;
21 24
 import com.kfb.kfbv1.hotspot.WifiApManager;
22 25
 import com.kfb.kfbv1.model.KfbGate;
@@ -25,84 +28,147 @@ import com.kfb.kfbv1.model.KfbHttpRequest;
25 28
 import com.kfb.kfbv1.model.KfbModel;
26 29
 import com.kfb.kfbv1.model.KfbTask;
27 30
 
31
+import java.util.List;
32
+
28 33
 
29 34
 public class MainActivity extends AppCompatActivity {
30 35
     private WifiApManager wifiApManager;
31 36
     private ProgressBar progressBar;
32
-    private final Handler handler = new Handler(){
33
-        @Override
34
-        public void handleMessage(Message msg) {
35
-            if(msg.what==1) {
36
-                TextView outtt = (TextView) findViewById(R.id.editText4);
37
-              //  if(KfbModel.getData().error==false) {
38
-              //      outtt.setText(KfbModel.getData().getGates().getmGate().get(0).getmMaxT()+
39
-              //              "status=" + KfbModel.getData().getGates().getmGate().get(0).getmStatus() );
40
-              //  }
41
-               // else{
42
-                    outtt.setText(KfbModel.getData().tekser);
43
-              //  }
44
-                KfbModel.getData().progresBar.dismiss();
45
-            }
46
-            super.handleMessage(msg);
47
-        }
48
-    };
37
+
49 38
     private KfbTask tr = new KfbTask();
50 39
     private Thread T1 = null;
51 40
    @Override
52 41
     protected void onCreate(Bundle savedInstanceState) {
53 42
         super.onCreate(savedInstanceState);
54 43
         setContentView(R.layout.activity_main);
44
+       setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
55 45
         getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
56
-        Button btn1 = (Button) findViewById(R.id.button);
57
-        btn1.setOnClickListener(new View.OnClickListener() {
58
-
59
-            public void onClick(View v) {
60
-                try {
61
-                    onSendClik(v);
62
-                } catch (InterruptedException e) {
63
-                    e.printStackTrace();
64
-                }
65
-            }
66
-        });
67
-
68
-        Button btn = (Button) findViewById(R.id.login);
69
-        btn.setOnClickListener(new View.OnClickListener() {
70
-
71
-            public void onClick(View v) {
72
-                onLoginClik(v);
73
-            }
74
-        });
75
-
76
-       wifiApManager = new WifiApManager(this);
77
-       // force to show the settings page for demonstration purpose of this method
78
-      // wifiApManager.showWritePermissionSettings(true);
79
-      //WifiConfiguration con = new WifiConfiguration();
80
-       //con.SSID = "KFB_SaFE";
81
-       //wifiApManager.setWifiApEnabled(con, true);
82
-    }
83
-    private void onLoginClik(View v) {
84 46
 
85
-        DbManage dbRep = new DbManage(getApplicationContext());
86
-        User us = dbRep.getUser("admin");
87
-
88
-        Intent i = new Intent(getApplicationContext(),GateActivity.class);
47
+       getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
48
+               WindowManager.LayoutParams.FLAG_FULLSCREEN);
49
+       View decorView = getWindow().getDecorView();
50
+       int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
51
+       decorView.setSystemUiVisibility(uiOptions);
52
+
53
+
54
+       ImageButton btn1 = (ImageButton) findViewById(R.id.idbConfig);
55
+       btn1.setOnClickListener(new View.OnClickListener() {
56
+
57
+           public void onClick(View v) {
58
+               onSendClik(v);
59
+           }
60
+       });
61
+       DbManage dbRep = new DbManage(getApplicationContext());
62
+       List<Urzadzenia> urzdb = dbRep.getUrzadzeniaAll();
63
+       if(urzdb!=null) {
64
+           KfbModel.getData().clear();
65
+           for(int i=0;i<urzdb.size();i++){
66
+
67
+               KfbGate lGate = new KfbGate();
68
+               lGate.setId(urzdb.get(i).ID);
69
+               lGate.setmAdres(urzdb.get(i).adres);
70
+               if(i==0) {
71
+                   lGate.setmName("Gate 1");
72
+               }
73
+               if(i==1) {
74
+                   lGate.setmName("Gate 2");
75
+               }
76
+               if(i==2) {
77
+                   lGate.setmName("Gate 3");
78
+               }
79
+               if(i==3) {
80
+                   lGate.setmName("Gate 4");
81
+               }
82
+               if(i<4) {
83
+                   lGate.setmActive(urzdb.get(i).active);
84
+                   KfbModel.getData().getGates().AddGate(lGate);
85
+               }
86
+               else
87
+               {
88
+                   lGate.setmActive(urzdb.get(i).active);
89
+                   KfbModel.getData().getTabletss().AddTablet(lGate);
90
+               }
91
+           }
92
+       }
93
+       if (KfbModel.getData().getGates().getmSize() == 0) {
94
+           KfbModel.getData().clear();
95
+           KfbModel.getData().sendHttp = true;
96
+           KfbGate lGate = new KfbGate();
97
+           lGate.setId(0);
98
+           lGate.setmAdres("http://192.168.1.15:6505");
99
+           // lGate.setmAdres("http://51.83.130.248:3000");
100
+           lGate.setmName("Gate 1");
101
+           lGate.setmActive(true);
102
+           KfbModel.getData().getGates().AddGate(lGate);
103
+           Urzadzenia urzdbe = new Urzadzenia();
104
+
105
+           urzdbe.active = lGate.ismActive();
106
+           urzdbe.adres = lGate.getmAdres();
107
+           urzdbe.ID =  lGate.getId();
108
+           dbRep.insertUrzazenie(urzdbe);
109
+
110
+           lGate = new KfbGate();
111
+           lGate.setmAdres("http://192.168.1.16:6505");
112
+           //lGate.setmAdres("http://p.sorveno.com/pp.html");
113
+           lGate.setmName("Gate 2");
114
+           lGate.setId(1);
115
+           lGate.setmActive(true);
116
+           KfbModel.getData().getGates().AddGate(lGate);
117
+           urzdbe = new Urzadzenia();
118
+           urzdbe.active = lGate.ismActive();
119
+           urzdbe.adres = lGate.getmAdres();
120
+           urzdbe.ID =  lGate.getId();
121
+           dbRep.insertUrzazenie(urzdbe);
122
+           lGate = new KfbGate();
123
+           lGate.setmAdres("http://192.168.1.17:6505");
124
+           //lGate.setmAdres("http://p.sorveno.com/pp.html");
125
+           lGate.setmName("Gate 3");
126
+           lGate.setId(2);
127
+           lGate.setmActive(true);
128
+           KfbModel.getData().getGates().AddGate(lGate);
129
+           urzdbe = new Urzadzenia();
130
+           urzdbe.active = lGate.ismActive();
131
+           urzdbe.adres = lGate.getmAdres();
132
+           urzdbe.ID =  lGate.getId();
133
+           dbRep.insertUrzazenie(urzdbe);
134
+           lGate = new KfbGate();
135
+           lGate.setmAdres("http://192.168.1.18:6505");
136
+           //lGate.setmAdres("http://p.sorveno.com/pp.html");
137
+           lGate.setmName("Gate 4");
138
+           lGate.setId(3);
139
+           lGate.setmActive(true);
140
+           urzdbe = new Urzadzenia();
141
+           urzdbe.active = lGate.ismActive();
142
+           urzdbe.adres = lGate.getmAdres();
143
+           urzdbe.ID =  lGate.getId();
144
+           dbRep.insertUrzazenie(urzdbe);
145
+           KfbModel.getData().getGates().AddGate(lGate);
146
+       }
147
+       dbRep.close();
148
+       KfbModel.getData().s1 = true;
149
+       Thread t1 = new Thread(new Runnable() {
150
+           @Override
151
+           public void run() {
152
+               try {
153
+
154
+                   Thread.sleep(3000);
155
+               } catch (InterruptedException e) {
156
+                   e.printStackTrace();
157
+               }
158
+               if(KfbModel.getData().s1==true) {
159
+                   Intent i = new Intent(getApplicationContext(), GateActivity.class);
160
+                   startActivity(i);
161
+               }
162
+           }
163
+       });
164
+       t1.start();
165
+
166
+   }
167
+
168
+    private void onSendClik(View v)   {
169
+        KfbModel.getData().s1 = false;
170
+        Intent i = new Intent(getApplicationContext(),PinActivity.class);
89 171
         startActivity(i);
90
-
91
-    }
92
-    private void onSendClik(View v) throws InterruptedException {
93
-        KfbModel.getData().progresBar = new KfbProgrsBar(this);
94
-        KfbModel.getData().progresBar.show();
95
-        TextView url = (TextView)findViewById(R.id.editText);
96
-        KfbModel.getData().tekser = null;
97
-        KfbModel.getData().handler = handler;
98
-        KfbModel.getData().url = url.getText().toString();
99
-
100
-        KfbGate g1 = new KfbGate();
101
-        g1.setmName("Test1");
102
-        KfbModel.getData().getGates().AddGate(g1);
103
-
104
-        T1 = new Thread(tr);
105
-        T1.start();
106 172
     }
107 173
     @Override
108 174
     protected void onResume() {

+ 3
- 2
app/src/main/java/com/kfb/kfbv1/MyAcessPoint.java 查看文件

@@ -42,11 +42,12 @@ public class MyAcessPoint {
42 42
     }
43 43
 
44 44
     public WifiConfiguration getWifiApConfiguration() {
45
-        try {
45
+     /*   try {
46 46
             return (WifiConfiguration) wifiApConfigurationMethod.invoke(mWifiManager, null);
47 47
         } catch (Exception e) {
48 48
             return null;
49
-        }
49
+        }*/
50
+     return null;
50 51
     }
51 52
 
52 53
     public int getWifiApState() {

+ 38
- 0
app/src/main/java/com/kfb/kfbv1/MyItemRecyclerViewAdapter.java 查看文件

@@ -1,14 +1,19 @@
1 1
 package com.kfb.kfbv1;
2 2
 
3
+import android.content.ContentProviderClient;
3 4
 import android.view.LayoutInflater;
4 5
 import android.view.View;
5 6
 import android.view.ViewGroup;
7
+import android.widget.Button;
6 8
 import android.widget.ImageView;
7 9
 import android.widget.TextView;
10
+import android.widget.ToggleButton;
8 11
 
9 12
 import androidx.recyclerview.widget.RecyclerView;
10 13
 
11 14
 import com.kfb.kfbv1.dummy.DummyContent;
15
+import com.kfb.kfbv1.media.KfbINtercom;
16
+import com.kfb.kfbv1.model.KfbModel;
12 17
 
13 18
 import java.util.List;
14 19
 
@@ -20,6 +25,7 @@ import java.util.List;
20 25
 public class MyItemRecyclerViewAdapter extends RecyclerView.Adapter<MyItemRecyclerViewAdapter.ViewHolder> {
21 26
 
22 27
     private final List<DummyContent.DummyItem> mValues;
28
+    private KfbINtercom kfbinter;
23 29
     private final ItemFragment.OnListFragmentInteractionListener mListener;
24 30
 
25 31
     public MyItemRecyclerViewAdapter(List<DummyContent.DummyItem> items, ItemFragment.OnListFragmentInteractionListener listener) {
@@ -50,6 +56,36 @@ public class MyItemRecyclerViewAdapter extends RecyclerView.Adapter<MyItemRecycl
50 56
                 holder.Nok.setTextColor(0XFF00FF00);
51 57
             }
52 58
         }
59
+        holder.Mic.setOnClickListener(new View.OnClickListener() {
60
+            @Override
61
+            public void onClick(View v) {
62
+                if(holder.Mic.isChecked())
63
+                {
64
+                    kfbinter =  new KfbINtercom();
65
+                    if(holder.mItem.id==0)
66
+                    {
67
+                        kfbinter.setTable(KfbModel.getData().getTabletss().getmGate().get(0));
68
+                    }
69
+                    if(holder.mItem.id==1)
70
+                    {
71
+                        kfbinter.setTable(KfbModel.getData().getTabletss().getmGate().get(1));
72
+                    }
73
+                    if(holder.mItem.id==2)
74
+                    {
75
+                        kfbinter.setTable(KfbModel.getData().getTabletss().getmGate().get(2));
76
+                    }
77
+                    if(holder.mItem.id==3)
78
+                    {
79
+                        kfbinter.setTable(KfbModel.getData().getTabletss().getmGate().get(3));
80
+                    }
81
+                    kfbinter.startStreaming();
82
+                }
83
+                else{
84
+                    kfbinter.stopStreaming();
85
+                }
86
+
87
+            }
88
+        });
53 89
         holder.Temperatura.setText(mValues.get(position).Temperatura);
54 90
         String t = mValues.get(position).Temperatura;
55 91
         if(t!=null) {
@@ -88,6 +124,7 @@ public class MyItemRecyclerViewAdapter extends RecyclerView.Adapter<MyItemRecycl
88 124
         public final TextView Temperatura;
89 125
         public final TextView Nok;
90 126
         public final ImageView ImgHis;
127
+        public ToggleButton Mic;
91 128
 
92 129
         public DummyContent.DummyItem mItem;
93 130
 
@@ -101,6 +138,7 @@ public class MyItemRecyclerViewAdapter extends RecyclerView.Adapter<MyItemRecycl
101 138
             Temperatura = (TextView) view.findViewById(R.id.idTemperatura);
102 139
             Nok = (TextView) view.findViewById(R.id.idOK);
103 140
             ImgHis = (ImageView) view.findViewById(R.id.imgHis);
141
+            Mic = (ToggleButton) view.findViewById(R.id.mikrofon);
104 142
         }
105 143
 
106 144
         @Override

+ 52
- 0
app/src/main/java/com/kfb/kfbv1/PinActivity.java 查看文件

@@ -0,0 +1,52 @@
1
+package com.kfb.kfbv1;
2
+
3
+import androidx.appcompat.app.AppCompatActivity;
4
+
5
+import android.content.Intent;
6
+import android.content.pm.ActivityInfo;
7
+import android.os.Bundle;
8
+import android.view.View;
9
+import android.view.WindowManager;
10
+import android.widget.Button;
11
+import android.widget.TextView;
12
+import android.widget.Toast;
13
+
14
+import com.kfb.kfbv1.model.KfbConstans;
15
+
16
+public class PinActivity extends AppCompatActivity {
17
+
18
+    @Override
19
+    protected void onCreate(Bundle savedInstanceState) {
20
+        super.onCreate(savedInstanceState);
21
+        setContentView(R.layout.activity_pin);
22
+        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
23
+        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
24
+        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
25
+                WindowManager.LayoutParams.FLAG_FULLSCREEN);
26
+        View decorView = getWindow().getDecorView();
27
+        int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
28
+        decorView.setSystemUiVisibility(uiOptions);
29
+
30
+        Button im = (Button)findViewById(R.id.idOkPin);
31
+        im.setOnClickListener(new View.OnClickListener() {
32
+
33
+            public void onClick(View v) {
34
+                onCheckPIN(v);
35
+            }
36
+        });
37
+    }
38
+    private void onCheckPIN(View v)
39
+    {
40
+        TextView t = findViewById(R.id.idPin);
41
+        if(t.getText().toString().equals(KfbConstans.PIN))
42
+        {
43
+            Intent i = new Intent(getApplicationContext(),ConfigActivity.class);
44
+            startActivity(i);
45
+            finish();
46
+        }
47
+        else
48
+        {
49
+            Toast.makeText(getApplicationContext(), "Błędny PIN podaj poprawny", Toast.LENGTH_SHORT).show();
50
+        }
51
+    }
52
+}

+ 2
- 0
app/src/main/java/com/kfb/kfbv1/SplashActivity.java 查看文件

@@ -2,6 +2,7 @@ package com.kfb.kfbv1;
2 2
 
3 3
 import android.content.Context;
4 4
 import android.content.Intent;
5
+import android.content.pm.ActivityInfo;
5 6
 import android.net.wifi.WifiConfiguration;
6 7
 import android.net.wifi.WifiManager;
7 8
 import android.os.Bundle;
@@ -16,6 +17,7 @@ public class SplashActivity extends AppCompatActivity {
16 17
 
17 18
     protected void onCreate(Bundle savedInstanceState) {
18 19
         super.onCreate(savedInstanceState);
20
+        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
19 21
         startActivity(new Intent(SplashActivity.this, MainActivity.class));
20 22
         try {
21 23
 

+ 2
- 1
app/src/main/java/com/kfb/kfbv1/db/DbAbstractManage.java 查看文件

@@ -8,12 +8,13 @@ import androidx.room.RoomDatabase;
8 8
 import androidx.sqlite.db.SupportSQLiteOpenHelper;
9 9
 
10 10
 
11
-@Database(entities = {User.class,Urzadzenia.class}, version = 2, exportSchema = false)
11
+@Database(entities = {User.class,Urzadzenia.class,Pomiar.class}, version = 4, exportSchema = false)
12 12
 public abstract class DbAbstractManage extends RoomDatabase {
13 13
     private static DbAbstractManage INSTANCE;
14 14
     public static final String DB_NAME = "kfbk.db";
15 15
     public abstract UserDao daoUsers();
16 16
     public abstract UrzadzenieDao daoUrzazenie();
17
+    public abstract PomiarDao daoPomiar();
17 18
 
18 19
 
19 20
 

+ 21
- 0
app/src/main/java/com/kfb/kfbv1/db/DbManage.java 查看文件

@@ -25,6 +25,21 @@ public class DbManage {
25 25
                 .build();
26 26
     }
27 27
 
28
+    public  List<Pomiar> getPomiarAll() {
29
+        return db.daoPomiar().getAll() ;
30
+    }
31
+
32
+    public void insertPomiar(final Pomiar pom)
33
+    {
34
+        new AsyncTask<Void, Void, Void>() {
35
+            @Override
36
+            protected Void doInBackground(Void... voids) {
37
+                db.daoPomiar().insertAll(pom);
38
+                return null;
39
+            }
40
+        }.execute();
41
+    }
42
+
28 43
     public  List<Urzadzenia> getUrzadzeniaAll() {
29 44
         return db.daoUrzazenie().getAll() ;
30 45
     }
@@ -52,6 +67,7 @@ public class DbManage {
52 67
                 return null;
53 68
             }
54 69
         }.execute();
70
+
55 71
     }
56 72
 
57 73
     public void insertTask(String login,
@@ -95,4 +111,9 @@ public class DbManage {
95 111
     public  List<User> getUsers() {
96 112
         return db.daoUsers().getAll() ;
97 113
     }
114
+
115
+    public void close()
116
+    {
117
+         //  db.close();
118
+    }
98 119
 }

+ 17
- 0
app/src/main/java/com/kfb/kfbv1/db/Pomiar.java 查看文件

@@ -0,0 +1,17 @@
1
+package com.kfb.kfbv1.db;
2
+
3
+import androidx.annotation.NonNull;
4
+import androidx.room.Entity;
5
+import androidx.room.PrimaryKey;
6
+
7
+@Entity(tableName = "pomiar")
8
+public class Pomiar {
9
+    @PrimaryKey
10
+    @NonNull
11
+    public String stamp;
12
+    public String gate;
13
+    public String datep;
14
+    public String temperatura;
15
+    public String skladowe;
16
+}
17
+

+ 25
- 0
app/src/main/java/com/kfb/kfbv1/db/PomiarDao.java 查看文件

@@ -0,0 +1,25 @@
1
+package com.kfb.kfbv1.db;
2
+
3
+import androidx.room.Dao;
4
+import androidx.room.Delete;
5
+import androidx.room.Insert;
6
+import androidx.room.Query;
7
+import androidx.room.Update;
8
+
9
+import java.util.List;
10
+@Dao
11
+public interface PomiarDao {
12
+        @Query("SELECT * FROM pomiar")
13
+        List<Pomiar> getAll();
14
+
15
+        @Query("SELECT * FROM pomiar WHERE stamp IN (:stamp)")
16
+        Pomiar loadAllByIds(String stamp);
17
+
18
+        @Insert
19
+        void insertAll(Pomiar pomiar);
20
+
21
+        @Delete
22
+        void delete(Pomiar pomiar);
23
+        @Update
24
+        void update(Pomiar pomiar);
25
+}

+ 154
- 0
app/src/main/java/com/kfb/kfbv1/media/KfbINtercom.java 查看文件

@@ -0,0 +1,154 @@
1
+package com.kfb.kfbv1.media;
2
+
3
+import android.media.AudioFormat;
4
+import android.media.AudioManager;
5
+import android.media.AudioRecord;
6
+import android.media.AudioTrack;
7
+import android.media.MediaRecorder;
8
+import android.util.Log;
9
+
10
+import com.kfb.kfbv1.model.KfbGate;
11
+
12
+import java.io.IOException;
13
+import java.net.DatagramPacket;
14
+import java.net.DatagramSocket;
15
+import java.net.InetAddress;
16
+import java.net.SocketException;
17
+import java.net.URL;
18
+import java.net.UnknownHostException;
19
+
20
+public class KfbINtercom {
21
+    private KfbGate tablet;
22
+    AudioRecord recorder;
23
+    public byte[] buffer;
24
+    public static DatagramSocket socket;
25
+    private AudioTrack speaker;
26
+    private int port=50005;
27
+    private int sampleRate = 8000;      //How much will be ideal?
28
+    private int channelConfig = AudioFormat.CHANNEL_CONFIGURATION_MONO;
29
+    private int audioFormat = AudioFormat.ENCODING_PCM_16BIT;
30
+
31
+    private boolean status = true;
32
+    public void setTable(KfbGate aTablet)
33
+    {
34
+        tablet = aTablet;
35
+    }
36
+    public void startReceiving() {
37
+
38
+        Thread receiveThread = new Thread(new Runnable() {
39
+
40
+            @Override
41
+            public void run() {
42
+
43
+                try {
44
+
45
+                    DatagramSocket socket = new DatagramSocket(50005);
46
+                    Log.d("VR", "Socket Created");
47
+
48
+
49
+                    byte[] buffer = new byte[256];
50
+
51
+
52
+                    //minimum buffer size. need to be careful. might cause problems. try setting manually if any problems faced
53
+                    int minBufSize = AudioRecord.getMinBufferSize(sampleRate, channelConfig, audioFormat);
54
+
55
+                    speaker = new AudioTrack(AudioManager.STREAM_MUSIC, sampleRate, channelConfig, audioFormat, minBufSize, AudioTrack.MODE_STREAM);
56
+
57
+                    speaker.play();
58
+
59
+                    while (status == true) {
60
+                        try {
61
+
62
+
63
+                            DatagramPacket packet = new DatagramPacket(buffer, buffer.length);
64
+                            socket.receive(packet);
65
+                            Log.d("VR", "Packet Received");
66
+
67
+                            //reading content from packet
68
+                            buffer = packet.getData();
69
+                            Log.d("VR", "Packet data read into buffer");
70
+
71
+                            //sending data to the Audiotrack obj i.e. speaker
72
+                            speaker.write(buffer, 0, minBufSize);
73
+                            Log.d("VR", "Writing buffer content to speaker");
74
+
75
+                        } catch (IOException e) {
76
+                            Log.e("VR", "IOException");
77
+                        }
78
+                    }
79
+
80
+
81
+                } catch (SocketException e) {
82
+                    Log.e("VR", "SocketException");
83
+                }
84
+
85
+
86
+            }
87
+
88
+        });
89
+        receiveThread.start();
90
+    }
91
+    public void startStreaming() {
92
+        Thread streamThread = new Thread(new Runnable() {
93
+
94
+            @Override
95
+            public void run() {
96
+                try {
97
+
98
+
99
+                    int minBufSize = AudioRecord.getMinBufferSize(sampleRate, channelConfig, audioFormat);
100
+                    DatagramSocket socket = new DatagramSocket();
101
+                    Log.d("VS", "Socket Created");
102
+
103
+                    byte[] buffer = new byte[minBufSize];
104
+
105
+                    Log.d("VS","Buffer created of size " + minBufSize);
106
+                    DatagramPacket packet;
107
+                //    URL u = new URL(tablet.getmAdres());
108
+                    final InetAddress destination = InetAddress.getByName(tablet.getmAdres());
109
+                    Log.d("VS", "Address retrieved");
110
+
111
+
112
+                    recorder = new AudioRecord(MediaRecorder.AudioSource.MIC,sampleRate,channelConfig,audioFormat,minBufSize);
113
+                    Log.d("VS", "Recorder initialized");
114
+
115
+                    recorder.startRecording();
116
+                    status = true;
117
+
118
+                    while(status == true) {
119
+
120
+
121
+                        //reading data from MIC into buffer
122
+                        minBufSize = recorder.read(buffer, 0, buffer.length);
123
+
124
+                        //putting buffer in the packet
125
+                        packet = new DatagramPacket (buffer,buffer.length,destination,port);
126
+
127
+                        socket.send(packet);
128
+
129
+
130
+                    }
131
+
132
+
133
+
134
+                } catch(UnknownHostException e) {
135
+                    Log.e("VS", "UnknownHostException");
136
+                } catch (IOException e) {
137
+                    Log.e("VS", "IOException");
138
+                }
139
+
140
+
141
+            }
142
+
143
+        });
144
+        streamThread.start();
145
+    }
146
+public void stopStreaming(){
147
+        status = false;
148
+         recorder.release();
149
+}
150
+public void stopReceiving()
151
+{
152
+    status = false;
153
+}
154
+}

+ 6
- 0
app/src/main/java/com/kfb/kfbv1/model/KfbConstans.java 查看文件

@@ -0,0 +1,6 @@
1
+package com.kfb.kfbv1.model;
2
+
3
+public class KfbConstans {
4
+    public static String PIN = "1234";
5
+    public static String PINGATE = "1234";
6
+}

+ 3
- 1
app/src/main/java/com/kfb/kfbv1/model/KfbGate.java 查看文件

@@ -13,7 +13,7 @@ public class KfbGate {
13 13
     private boolean mNoPing;
14 14
     private boolean mActive;
15 15
     private KfbMeasure mMeasure;
16
-
16
+    public int StanTab;
17 17
     public String getmStat() {
18 18
         return mStat;
19 19
     }
@@ -74,6 +74,8 @@ public class KfbGate {
74 74
     {
75 75
         mMeasure = new KfbMeasure();
76 76
         mNoPing = true;
77
+        mStatus ="";
78
+        StanTab = 0;
77 79
     }
78 80
 
79 81
     public void setmMaxT(String mMaxT) {

+ 175
- 9
app/src/main/java/com/kfb/kfbv1/model/KfbHttpRequest.java 查看文件

@@ -4,6 +4,9 @@ import android.os.Handler;
4 4
 import android.os.Message;
5 5
 import android.util.Log;
6 6
 
7
+import com.google.gson.Gson;
8
+import com.kfb.kfbv1.db.DbManage;
9
+import com.kfb.kfbv1.db.Pomiar;
7 10
 import com.loopj.android.http.AsyncHttpClient;
8 11
 import com.loopj.android.http.AsyncHttpResponseHandler;
9 12
 import com.loopj.android.http.HttpGet;
@@ -17,6 +20,7 @@ import java.net.InetAddress;
17 20
 import java.net.MalformedURLException;
18 21
 import java.net.URL;
19 22
 import java.net.UnknownHostException;
23
+import java.sql.Date;
20 24
 
21 25
 import cz.msebera.android.httpclient.Header;
22 26
 import cz.msebera.android.httpclient.HttpEntity;
@@ -97,13 +101,180 @@ public class KfbHttpRequest {
97 101
                 aGate.setmNoPing(false);
98 102
             } else {
99 103
                 LogFile.appendLog("Blad polaczenia  "+ muri);
100
-                aGate.setmNoPing(true);
104
+                aGate.setmNoPing(false);
101 105
             }
102 106
         } catch (IOException e) {
103 107
             // TODO Auto-generated catch block
104 108
             aGate.setmNoPing(true);
105 109
         }
106 110
     }
111
+    public static void getTabletStatus(KfbGate aGate) {
112
+        HttpClient httpclient = new DefaultHttpClient();
113
+        String uri = aGate.getmAdres();
114
+        uri="http://"+uri+":9999/kfb?status";
115
+        HttpGet httpget = new HttpGet(uri);
116
+
117
+        // Execute the request
118
+        HttpResponse response;
119
+        try {
120
+            response = httpclient.execute(httpget);
121
+            HttpEntity entity = response.getEntity();
122
+            if (entity != null) {
123
+
124
+                // A Simple JSON Response Read
125
+                InputStream instream = entity.getContent();
126
+                String result= convertStreamToString(instream);
127
+                KfbJsonStatus st = new Gson().fromJson(result,KfbJsonStatus.class);
128
+                if(st.getStatus().equals("POMIAR_OK"))
129
+                {
130
+                    if(aGate.getId()==4) {
131
+                    KfbModel.getData().getGates().getmGate().get(0).StanTab = 3;
132
+                }
133
+                    if(aGate.getId()==5) {
134
+                        KfbModel.getData().getGates().getmGate().get(1).StanTab = 3;
135
+                    }
136
+                    if(aGate.getId()==6) {
137
+                        KfbModel.getData().getGates().getmGate().get(2).StanTab = 3;
138
+                    }
139
+                    if(aGate.getId()==7) {
140
+                        KfbModel.getData().getGates().getmGate().get(3).StanTab = 3;
141
+                    }
142
+                }
143
+                if(st.getStatus().equals("POMIAR_NOK"))
144
+                {
145
+                    if(aGate.getId()==4) {
146
+                        KfbModel.getData().getGates().getmGate().get(0).StanTab = 4;
147
+                    }
148
+                    if(aGate.getId()==5) {
149
+                        KfbModel.getData().getGates().getmGate().get(1).StanTab = 4;
150
+                    }
151
+                    if(aGate.getId()==6) {
152
+                        KfbModel.getData().getGates().getmGate().get(2).StanTab = 4;
153
+                    }
154
+                    if(aGate.getId()==7) {
155
+                        KfbModel.getData().getGates().getmGate().get(3).StanTab = 4;
156
+                    }
157
+                }
158
+                if(st.getStatus().equals("STANDBY"))
159
+                {
160
+                    if( KfbModel.getData().getGates().getmGate().get(0).StanTab!=5) {
161
+                        if (aGate.getId() == 4) {
162
+                            KfbModel.getData().getGates().getmGate().get(0).StanTab = 1;
163
+                        }
164
+                    }
165
+                    if( KfbModel.getData().getGates().getmGate().get(1).StanTab!=5) {
166
+                        if (aGate.getId() == 5) {
167
+                            KfbModel.getData().getGates().getmGate().get(1).StanTab = 1;
168
+                        }
169
+                    }
170
+                    if( KfbModel.getData().getGates().getmGate().get(2).StanTab!=5) {
171
+                        if (aGate.getId() == 6) {
172
+                            KfbModel.getData().getGates().getmGate().get(2).StanTab = 1;
173
+                        }
174
+                    }
175
+                    if( KfbModel.getData().getGates().getmGate().get(3).StanTab!=5) {
176
+                        if (aGate.getId() == 7) {
177
+                            KfbModel.getData().getGates().getmGate().get(3).StanTab = 1;
178
+                        }
179
+                    }
180
+                }
181
+                if(st.getStatus().equals("LOCK"))
182
+                {
183
+                    if(aGate.getId()==4) {
184
+                        KfbModel.getData().getGates().getmGate().get(0).StanTab = 5;
185
+                    }
186
+                    if(aGate.getId()==5) {
187
+                        KfbModel.getData().getGates().getmGate().get(1).StanTab = 5;
188
+                    }
189
+                    if(aGate.getId()==6) {
190
+                        KfbModel.getData().getGates().getmGate().get(2).StanTab = 5;
191
+                    }
192
+                    if(aGate.getId()==7) {
193
+                        KfbModel.getData().getGates().getmGate().get(3).StanTab = 5;
194
+                    }
195
+                }
196
+                instream.close();
197
+            }
198
+
199
+
200
+        } catch (Exception e) {
201
+
202
+        }
203
+    }
204
+    public static void getTabletUnlock(KfbGate aGate) {
205
+        HttpClient httpclient = new DefaultHttpClient();
206
+        String uri = aGate.getmAdres();
207
+        uri="http://"+uri+":9999/kfb?lock";
208
+        HttpGet httpget = new HttpGet(uri);
209
+
210
+        // Execute the request
211
+        HttpResponse response;
212
+        try {
213
+            response = httpclient.execute(httpget);
214
+            HttpEntity entity = response.getEntity();
215
+            if (entity != null) {
216
+
217
+                // A Simple JSON Response Read
218
+                InputStream instream = entity.getContent();
219
+                String result= convertStreamToString(instream);
220
+                instream.close();
221
+            }
222
+
223
+
224
+        } catch (Exception e) {
225
+
226
+        }
227
+    }
228
+    public static void getTabletTemp(KfbGate aGate) {
229
+        HttpClient httpclient = new DefaultHttpClient();
230
+        String uri = aGate.getmAdres();
231
+        uri="http://"+uri+":9999/kfb?temperatura";
232
+        HttpGet httpget = new HttpGet(uri);
233
+
234
+        // Execute the request
235
+        HttpResponse response;
236
+        try {
237
+            response = httpclient.execute(httpget);
238
+            HttpEntity entity = response.getEntity();
239
+            if (entity != null) {
240
+
241
+                // A Simple JSON Response Read
242
+                InputStream instream = entity.getContent();
243
+                String result= convertStreamToString(instream);
244
+                KfbJsonTemperatura st = new Gson().fromJson(result,KfbJsonTemperatura.class);
245
+                if(st.status.equals("EMPTY")==true)
246
+                {
247
+
248
+                } else {
249
+                    Pomiar p = new Pomiar();
250
+                    p.temperatura = st.temperatura;
251
+                    if (aGate.getId() == 4) {
252
+                        p.gate = KfbModel.getData().getGates().getmGate().get(0).getmName();
253
+                    }
254
+                    if (aGate.getId() == 5) {
255
+                        p.gate = KfbModel.getData().getGates().getmGate().get(1).getmName();
256
+                    }
257
+                    if (aGate.getId() == 6) {
258
+                        p.gate = KfbModel.getData().getGates().getmGate().get(2).getmName();
259
+                    }
260
+                    if (aGate.getId() == 7) {
261
+                        p.gate = KfbModel.getData().getGates().getmGate().get(3).getmName();
262
+                    }
263
+                    p.datep = st.timestamp;
264
+                    Long tsLong = System.currentTimeMillis();
265
+                    p.stamp = tsLong.toString();
266
+                    p.skladowe = st.skladowe;
267
+                    DbManage dbRep = new DbManage(KfbModel.getData().context);
268
+                    dbRep.insertPomiar(p);
269
+                }
270
+                instream.close();
271
+            }
272
+
273
+
274
+        } catch (Exception e) {
275
+
276
+        }
277
+    }
107 278
     public static void getRequest1(KfbGate aGate) {
108 279
         HttpClient httpclient = new DefaultHttpClient();
109 280
         String uri = aGate.getmAdres();
@@ -114,14 +285,7 @@ public class KfbHttpRequest {
114 285
         HttpResponse response;
115 286
         try {
116 287
             response = httpclient.execute(httpget);
117
-            // Examine the response status
118
-            //Log.i("Praeda",response.getStatusLine().toString());
119
-
120
-            // Get hold of the response entity
121 288
             HttpEntity entity = response.getEntity();
122
-            // If the response does not enclose an entity, there is no need
123
-            // to worry about connection release
124
-
125 289
             if (entity != null) {
126 290
 
127 291
                 // A Simple JSON Response Read
@@ -135,7 +299,9 @@ public class KfbHttpRequest {
135 299
             }
136 300
 
137 301
 
138
-        } catch (Exception e) {}
302
+        } catch (Exception e) {
303
+            KfbModel.getData().error = true;
304
+        }
139 305
     }
140 306
     private static String convertStreamToString(InputStream is) {
141 307
         /*

+ 18
- 0
app/src/main/java/com/kfb/kfbv1/model/KfbJsonStatus.java 查看文件

@@ -0,0 +1,18 @@
1
+package com.kfb.kfbv1.model;
2
+
3
+import com.google.gson.annotations.Expose;
4
+import com.google.gson.annotations.SerializedName;
5
+
6
+public class KfbJsonStatus {
7
+    @SerializedName("status")
8
+    @Expose
9
+    public String status;
10
+
11
+    public void setStatus(String status) {
12
+        this.status = status;
13
+    }
14
+
15
+    public String getStatus() {
16
+        return status;
17
+    }
18
+}

+ 19
- 0
app/src/main/java/com/kfb/kfbv1/model/KfbJsonTemperatura.java 查看文件

@@ -0,0 +1,19 @@
1
+package com.kfb.kfbv1.model;
2
+
3
+import com.google.gson.annotations.Expose;
4
+import com.google.gson.annotations.SerializedName;
5
+
6
+public class KfbJsonTemperatura {
7
+    @SerializedName("status")
8
+    @Expose
9
+    public String status;
10
+    @SerializedName("temperatura")
11
+    @Expose
12
+    public String temperatura;
13
+    @SerializedName("timestamp")
14
+    @Expose
15
+    public String timestamp;
16
+    @SerializedName("skladowe")
17
+    @Expose
18
+    public String skladowe;
19
+}

+ 26
- 0
app/src/main/java/com/kfb/kfbv1/model/KfbMeasure.java 查看文件

@@ -11,10 +11,33 @@ public class KfbMeasure {
11 11
     int width = 8;
12 12
     int height = 8;
13 13
     Bitmap bitmap;
14
+    Bitmap szara;
14 15
 
15 16
 public KfbMeasure(){
16 17
     mTemp = new float[64];
17 18
     mTempI = new int[64];
19
+
20
+    for(int i = 0 ; i < 64; i++)
21
+    {
22
+        mTempI[i] =  0xFF808080;
23
+
24
+        //  mTempI[i] = 0xFFFFFF00;
25
+    }
26
+    szara = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
27
+    szara.setPixels(mTempI, 0, width, 0, 0, width, height);
28
+
29
+    float scaleWidth = ((float) 350) / width;
30
+    float scaleHeight = ((float) 350) / height;
31
+    Matrix matrix = new Matrix();
32
+    // RESIZE THE BIT MAP
33
+    matrix.postScale(scaleWidth, scaleHeight);
34
+
35
+    // "RECREATE" THE NEW BITMAP
36
+    Bitmap resizedBitmap = Bitmap.createBitmap(
37
+            szara, 0, 0, width, height, matrix, false);
38
+    szara.recycle();
39
+    szara = resizedBitmap;
40
+
18 41
 }
19 42
 
20 43
 private int mapingColor(float aTemp)
@@ -61,4 +84,7 @@ public void CreateBitMap()
61 84
 public Bitmap getHist(){
62 85
     return bitmap;
63 86
 }
87
+    public Bitmap getHistSzara(){
88
+        return szara;
89
+    }
64 90
 }

+ 4
- 0
app/src/main/java/com/kfb/kfbv1/model/KfbModel.java 查看文件

@@ -1,5 +1,6 @@
1 1
 package com.kfb.kfbv1.model;
2 2
 
3
+import android.content.Context;
3 4
 import android.os.Handler;
4 5
 import android.widget.ProgressBar;
5 6
 import android.widget.TextView;
@@ -25,6 +26,7 @@ public class KfbModel {
25 26
     {
26 27
         mGates = new KfbGates();
27 28
         mMapColor = new KfbMapColor();
29
+        mTablets = new KfbTablet();
28 30
     }
29 31
     // data private
30 32
     private KfbGates mGates;
@@ -38,6 +40,8 @@ public class KfbModel {
38 40
     public boolean error;
39 41
     public Handler handler;
40 42
     public String url;
43
+    public boolean s1;
44
+    public Context context;
41 45
 
42 46
     public MyItemRecyclerViewAdapter getmAdapter() {
43 47
         return mAdapter;

+ 13
- 2
app/src/main/java/com/kfb/kfbv1/model/KfbParser.java 查看文件

@@ -1,5 +1,7 @@
1 1
 package com.kfb.kfbv1.model;
2 2
 
3
+import android.util.Log;
4
+
3 5
 public class KfbParser {
4 6
     public KfbGate dataParser(String aData,KfbGate aGate)
5 7
     {
@@ -8,9 +10,17 @@ public class KfbParser {
8 10
         String[] aa =null;
9 11
         float ff = 0;
10 12
         KfbMeasure mm;
11
-
12
-        p = aData.lastIndexOf("Dane:");
13
+if (aData==null) {
14
+    return null;
15
+}
16
+       p = aData.lastIndexOf("Dane:");
13 17
         p = p+5;
18
+        int len = aData.length();
19
+        int pp = p+384;
20
+        if(pp> len )
21
+        {
22
+            return null;
23
+        }
14 24
         String t = aData.substring(p ,p+384);
15 25
         aa = null;
16 26
         aa = t.split(",");
@@ -31,6 +41,7 @@ public class KfbParser {
31 41
         p=p+7;
32 42
         t = aData.substring(p ,p+6);
33 43
         k.setmStatus(t);
44
+        Log.i("Stan",t);
34 45
         return k;
35 46
     }
36 47
 }

+ 23
- 1
app/src/main/java/com/kfb/kfbv1/model/KfbTask.java 查看文件

@@ -45,12 +45,34 @@ public class KfbTask  implements Runnable {
45 45
                             KfbModel.getData().getGates().getmGate().get(i).setmError("");
46 46
                             p.dataParser(KfbModel.getData().tekser, KfbModel.getData().getGates().getmGate().get(i));
47 47
                             KfbModel.getData().getGates().getmGate().get(i).getmMeasure().CreateBitMap();
48
+
49
+                            if(  KfbModel.getData().getGates().getmGate().get(i).StanTab<1)
50
+                            {
51
+                                KfbModel.getData().getGates().getmGate().get(i).StanTab = 1;
52
+                            }else if(KfbModel.getData().getGates().getmGate().get(i).StanTab==1)
53
+                            {
54
+                                if(KfbModel.getData().getGates().getmGate().get(i).getmStatus().equals(" empty"))
55
+                                {
56
+                                        KfbModel.getData().getGates().getmGate().get(i).StanTab = 1;
57
+                                 }
58
+                                if(KfbModel.getData().getGates().getmGate().get(i).getmStatus().equals(" occup"))
59
+                                {
60
+                                    KfbModel.getData().getGates().getmGate().get(i).StanTab = 2;
61
+                                }
62
+                            }else if(KfbModel.getData().getGates().getmGate().get(i).StanTab==3)
63
+                            {
64
+                                if(KfbModel.getData().getGates().getmGate().get(i).getmStatus().equals(" empty"))
65
+                                {
66
+                                    KfbModel.getData().getGates().getmGate().get(i).StanTab = 1;
67
+                                }
68
+                            }
48 69
                             Message msg = handler.obtainMessage();
49 70
                             msg.what = 2;
50 71
                             msg.obj = "Pomiar";
51 72
                             msg.arg1 =  KfbModel.getData().getGates().getmGate().get(i).getId();
52 73
                             handler.sendMessage(msg);
53 74
                         } else {
75
+                            KfbModel.getData().getGates().getmGate().get(i).StanTab = 0;
54 76
                             KfbModel.getData().getGates().getmGate().get(i).setmNoPing(true);
55 77
                             KfbModel.getData().getGates().getmGate().get(i).setmError("ERROR");
56 78
                             Message msg = handler.obtainMessage();
@@ -63,7 +85,7 @@ public class KfbTask  implements Runnable {
63 85
                 }
64 86
             }
65 87
             try {
66
-                Thread.sleep(250);
88
+                Thread.sleep(100);
67 89
             } catch (InterruptedException e) {
68 90
                 e.printStackTrace();
69 91
             }

+ 43
- 0
app/src/main/java/com/kfb/kfbv1/model/KfbTaskTablet.java 查看文件

@@ -0,0 +1,43 @@
1
+package com.kfb.kfbv1.model;
2
+
3
+import android.os.Handler;
4
+import android.os.Message;
5
+
6
+public class KfbTaskTablet  implements Runnable{
7
+    @Override
8
+    public void run() {
9
+        Handler handler = KfbModel.getData().handler;
10
+        while(KfbModel.getData().sendHttp==true) {
11
+            for(int i =0;i<KfbModel.getData().getTabletss().getmSize();i++)
12
+            {
13
+                KfbGate tabl = KfbModel.getData().getTabletss().getmGate().get(i);
14
+                if(tabl.ismActive()==true)
15
+                {
16
+                    KfbHttpRequest.getTabletStatus(tabl);
17
+                    Message msg = handler.obtainMessage();
18
+                    msg.what = 2;
19
+                    msg.obj = "Pomiar";
20
+                    if(tabl.getId()==4) {
21
+                        msg.arg1 = KfbModel.getData().getGates().getmGate().get(0).getId();
22
+                    }
23
+                    if(tabl.getId()==5) {
24
+                        msg.arg1 = KfbModel.getData().getGates().getmGate().get(1).getId();
25
+                    }
26
+                    if(tabl.getId()==6) {
27
+                        msg.arg1 = KfbModel.getData().getGates().getmGate().get(2).getId();
28
+                    }
29
+                    if(tabl.getId()==7) {
30
+                        msg.arg1 = KfbModel.getData().getGates().getmGate().get(3).getId();
31
+                    }
32
+                //    handler.sendMessage(msg);
33
+                    KfbHttpRequest.getTabletTemp(tabl);
34
+                }
35
+            }
36
+            try {
37
+                Thread.sleep(100);
38
+            } catch (InterruptedException e) {
39
+                e.printStackTrace();
40
+            }
41
+        }
42
+    }
43
+}

+ 173
- 0
app/src/main/java/com/kfb/kfbv1/shttp/KfbHttp.java 查看文件

@@ -0,0 +1,173 @@
1
+package com.kfb.kfbv1.shttp;
2
+
3
+import android.os.Environment;
4
+import android.util.Log;
5
+
6
+import com.kfb.kfbv1.db.DbManage;
7
+import com.kfb.kfbv1.db.Pomiar;
8
+import com.kfb.kfbv1.model.KfbModel;
9
+
10
+
11
+import org.nanohttpd.protocols.http.IHTTPSession;
12
+import org.nanohttpd.protocols.http.NanoHTTPD;
13
+import org.nanohttpd.protocols.http.response.IStatus;
14
+import org.nanohttpd.protocols.http.response.Response;
15
+import org.nanohttpd.protocols.http.response.Status;
16
+
17
+import java.io.BufferedReader;
18
+import java.io.File;
19
+import java.io.FileInputStream;
20
+import java.io.FileReader;
21
+import java.io.IOException;
22
+import java.io.InputStream;
23
+import java.util.List;
24
+
25
+
26
+
27
+
28
+public class KfbHttp extends NanoHTTPD {
29
+    public static final String  MIME_PNG = "image/png";
30
+    private static final int PORT = 9999;
31
+    public KfbHttp() throws IOException {
32
+        super(PORT);
33
+        start();
34
+    }
35
+    @Override
36
+    public Response serve(IHTTPSession session) {
37
+String uri = session.getUri();
38
+String html ="";
39
+        if(uri.equals("/administracja")==true)
40
+        {
41
+            try {
42
+                // Opening file from SD Card
43
+                File root = Environment.getExternalStorageDirectory();
44
+                FileReader index = new FileReader(root.getAbsolutePath() +
45
+                        "/DCIM/www/index.html");
46
+                BufferedReader reader = new BufferedReader(index);
47
+                String line = "";
48
+                while ((line = reader.readLine()) != null) {
49
+                    html += line;
50
+                }
51
+
52
+
53
+            } catch(IOException ioe) {
54
+                Log.w("Httpd", ioe.toString());
55
+            }
56
+        }else
57
+        {
58
+            if(uri.equals("/admin.html")==true)
59
+            {
60
+                String pas="";
61
+                String log="";
62
+               boolean isLogin= session.getParameters().containsKey("login");
63
+               if(isLogin==true)
64
+               {
65
+                    log = session.getParameters().get("login").get(0);
66
+               }
67
+               boolean isPass = session.getParameters().containsKey("password");
68
+                if(isPass==true)
69
+                {
70
+                     pas = session.getParameters().get("password").get(0);
71
+                }
72
+
73
+                if(log.equals("admin")==true && pas.equals("admin")==true)
74
+                {
75
+
76
+                   try {
77
+                        // Opening file from SD Card
78
+                        File root = Environment.getExternalStorageDirectory();
79
+                        FileReader index = new FileReader(root.getAbsolutePath() +
80
+                                "/DCIM/www/"+uri);
81
+                        BufferedReader reader = new BufferedReader(index);
82
+                        String line = "";
83
+                        while ((line = reader.readLine()) != null) {
84
+                            html += line;
85
+                        }
86
+
87
+
88
+                    } catch(IOException ioe) {
89
+                        Log.w("Httpd", ioe.toString());
90
+                    }
91
+                    return Response.newFixedLengthResponse(html);
92
+                }
93
+                else
94
+                {
95
+                    try {
96
+                        // Opening file from SD Card
97
+                        File root = Environment.getExternalStorageDirectory();
98
+                        FileReader index = new FileReader(root.getAbsolutePath() +
99
+                                "/DCIM/www/index.html");
100
+                        BufferedReader reader = new BufferedReader(index);
101
+                        String line = "";
102
+                        while ((line = reader.readLine()) != null) {
103
+                            html += line;
104
+                        }
105
+
106
+
107
+                    } catch(IOException ioe) {
108
+                        Log.w("Httpd", ioe.toString());
109
+                    }
110
+                    return Response.newFixedLengthResponse(html);
111
+                }
112
+            }else {
113
+                try {
114
+                    if (uri.contains(".png") == true) {
115
+
116
+                        File root = Environment.getExternalStorageDirectory();
117
+                        //FileReader index = new FileReader(root.getAbsolutePath() +
118
+                        //        "/DCIM/www" + uri);
119
+
120
+                        FileInputStream fis = new FileInputStream(root.getAbsolutePath() +
121
+                                "/DCIM/www" + uri);
122
+                        //declaration of MIME_PNG in NanoHTTPD Core
123
+                        long fileSize = new File(root.getAbsolutePath() +
124
+                                "/DCIM/www" + uri).length();
125
+
126
+                        byte[] allBytes = new byte[(int) fileSize];
127
+
128
+                        fis.read(allBytes);
129
+
130
+                        return Response.newFixedLengthResponse(Status.OK, MIME_PNG, allBytes);
131
+
132
+                    } else {
133
+                        // Opening file from SD Card
134
+                        File root = Environment.getExternalStorageDirectory();
135
+                        FileReader index = new FileReader(root.getAbsolutePath() +
136
+                                "/DCIM/www" + uri);
137
+                        BufferedReader reader = new BufferedReader(index);
138
+                        String line = "";
139
+                        while ((line = reader.readLine()) != null) {
140
+                            html += line;
141
+                        }
142
+                    }
143
+
144
+                } catch (IOException ioe) {
145
+                    Log.w("Httpd", ioe.toString());
146
+                }
147
+            }
148
+        }
149
+
150
+if(uri.equals("/kfb")==true)
151
+{
152
+    DbManage dbRep = new DbManage(KfbModel.getData().context);
153
+    List<Pomiar> lp = dbRep.getPomiarAll();
154
+
155
+    html = "<!DOCTYPE HTML> <html><style> body { min-width: 300px; margin: auto; font-family: Helvetica, Tahoma;  font-size: 14pt;  font-style: normal;  font-variant: normal; background:#fff } a {text-decoration: none;color:#0170C0  } div { display: table; margin-right: auto;   margin-left: auto; padding:2px; } h3 { font-family: Helvetica, Tahoma, Verdana; font-size: 18pt; font-weight: normal;color:#000; } h4 { font-family: Helvetica, Tahoma, Verdana; font-size: 16pt; font-weight: normal;color:#848484; text-align:center; } td {text-align:left ;padding:10px; border: 2px solid #848484;  padding:12px; font-size: 14px; } tr,th {padding:13px 10px 10px 10px; font-size:12pt;font-weight:normal} </style> <BODY> <table style=\"margin: 30px;\"><TR><TH>Bramka</TH><TH>Data</TH><TH>Temperatura</TH><TH>Składowe</TH></TR>";
156
+    for(int i = 0;i< lp.size();i++)
157
+    {
158
+            html = html + "<TR><TD>" + lp.get(i).gate + "</TD><TD>" + lp.get(i).datep + "</TD><TD>" + lp.get(i).temperatura + "</TD><TD>" + lp.get(i).skladowe + "</TD></TR>";
159
+    }
160
+    html= html+"</table></BODY></html>";
161
+
162
+  //  html = "<!DOCTYPE HTML> <html><table style=\"border-width: 1px; border-style: solid; border-color: black\"><TR><TH>Bramka</TH><TH>Data</TH><TH>Temperatura</TH><TH>Składowe</TH></TR>";
163
+  //  for(int i = 0;i< lp.size();i++)
164
+  //  {
165
+  //      html= html+"<TR><TD>"+lp.get(i).gate+"</TD><TD>"+lp.get(i).datep+"</TD><TD>"+lp.get(i).temperatura+"</TD><TD>"+lp.get(i).skladowe+"</TD></TR>";
166
+  //  }
167
+  //  html= html+"</table></html>";
168
+}
169
+
170
+
171
+        return Response.newFixedLengthResponse(html);
172
+    }
173
+}

二進制
app/src/main/res/drawable/logo.png 查看文件


+ 87
- 0
app/src/main/res/layout/activity_gate1.xml 查看文件

@@ -0,0 +1,87 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    xmlns:app="http://schemas.android.com/apk/res-auto"
4
+    xmlns:tools="http://schemas.android.com/tools"
5
+    android:layout_width="match_parent"
6
+    android:layout_height="match_parent"
7
+    android:orientation="horizontal">
8
+
9
+    <androidx.constraintlayout.widget.ConstraintLayout
10
+        android:layout_width="match_parent"
11
+        android:layout_height="match_parent">
12
+
13
+        <ImageView
14
+            android:id="@+id/imageView7"
15
+            android:layout_width="1272dp"
16
+            android:layout_height="69dp"
17
+            app:layout_constraintBottom_toBottomOf="parent"
18
+            app:layout_constraintStart_toStartOf="parent"
19
+            app:srcCompat="@drawable/logo" />
20
+
21
+        <LinearLayout
22
+            android:id="@+id/u1"
23
+            android:layout_width="188dp"
24
+            android:layout_height="543dp"
25
+            android:layout_marginStart="544dp"
26
+            android:layout_marginTop="140dp"
27
+            android:orientation="vertical"
28
+            android:visibility="visible"
29
+            app:layout_constraintStart_toStartOf="parent"
30
+            app:layout_constraintTop_toTopOf="parent">
31
+
32
+            <ImageView
33
+                android:id="@+id/imageView3"
34
+                android:layout_width="match_parent"
35
+                android:layout_height="wrap_content"
36
+                android:paddingTop="10dp"
37
+                android:paddingBottom="10dp"
38
+                app:srcCompat="@drawable/g1" />
39
+
40
+            <ImageView
41
+                android:id="@+id/g1sta"
42
+                android:layout_width="match_parent"
43
+                android:layout_height="wrap_content"
44
+                android:paddingTop="10dp"
45
+                android:paddingBottom="10dp"
46
+                app:srcCompat="@drawable/off" />
47
+
48
+            <ImageView
49
+                android:id="@+id/g1tekst"
50
+                android:layout_width="match_parent"
51
+                android:layout_height="wrap_content"
52
+                android:paddingTop="20dp"
53
+                android:paddingBottom="20dp"
54
+                app:srcCompat="@drawable/txt_off" />
55
+
56
+            <ImageView
57
+                android:id="@+id/g1hist"
58
+                android:layout_width="150dp"
59
+                android:layout_height="190dp"
60
+                android:layout_centerHorizontal="true"
61
+                android:layout_centerVertical="true"
62
+                android:layout_marginHorizontal="25dp"
63
+                android:paddingTop="10dp"
64
+                android:paddingBottom="10dp"
65
+                app:srcCompat="@drawable/emot" />
66
+
67
+            <EditText
68
+                android:id="@+id/g1pin"
69
+                android:layout_width="match_parent"
70
+                android:layout_height="wrap_content"
71
+                android:ems="10"
72
+                android:inputType="numberPassword"
73
+                android:visibility="invisible" />
74
+
75
+            <ImageButton
76
+                android:id="@+id/g1mic"
77
+                android:layout_width="match_parent"
78
+                android:layout_height="wrap_content"
79
+                android:paddingTop="10dp"
80
+                android:paddingBottom="10dp"
81
+                android:background="@null"
82
+                app:srcCompat="@drawable/mic_off" />
83
+
84
+        </LinearLayout>
85
+    </androidx.constraintlayout.widget.ConstraintLayout>
86
+
87
+</LinearLayout>

+ 149
- 0
app/src/main/res/layout/activity_gate2.xml 查看文件

@@ -0,0 +1,149 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    xmlns:app="http://schemas.android.com/apk/res-auto"
4
+    xmlns:tools="http://schemas.android.com/tools"
5
+    android:layout_width="match_parent"
6
+    android:layout_height="match_parent"
7
+    android:orientation="horizontal">
8
+
9
+    <androidx.constraintlayout.widget.ConstraintLayout
10
+        android:layout_width="match_parent"
11
+        android:layout_height="match_parent">
12
+
13
+        <ImageView
14
+            android:id="@+id/imageView7"
15
+            android:layout_width="1272dp"
16
+            android:layout_height="69dp"
17
+            app:layout_constraintBottom_toBottomOf="parent"
18
+            app:layout_constraintStart_toStartOf="parent"
19
+            app:srcCompat="@drawable/logo" />
20
+
21
+        <LinearLayout
22
+            android:id="@+id/u1"
23
+            android:layout_width="188dp"
24
+            android:layout_height="543dp"
25
+            android:layout_marginStart="400dp"
26
+            android:layout_marginTop="140dp"
27
+            android:orientation="vertical"
28
+            android:visibility="visible"
29
+            app:layout_constraintStart_toStartOf="parent"
30
+            app:layout_constraintTop_toTopOf="parent">
31
+
32
+            <ImageView
33
+                android:id="@+id/imageView3"
34
+                android:layout_width="match_parent"
35
+                android:layout_height="wrap_content"
36
+                android:paddingTop="10dp"
37
+                android:paddingBottom="10dp"
38
+                app:srcCompat="@drawable/g1" />
39
+
40
+            <ImageView
41
+                android:id="@+id/g1sta"
42
+                android:layout_width="match_parent"
43
+                android:layout_height="wrap_content"
44
+                android:paddingTop="10dp"
45
+                android:paddingBottom="10dp"
46
+                app:srcCompat="@drawable/off" />
47
+
48
+            <ImageView
49
+                android:id="@+id/g1tekst"
50
+                android:layout_width="match_parent"
51
+                android:layout_height="wrap_content"
52
+                android:paddingTop="20dp"
53
+                android:paddingBottom="20dp"
54
+                app:srcCompat="@drawable/txt_off" />
55
+
56
+            <ImageView
57
+                android:id="@+id/g1hist"
58
+                android:layout_width="150dp"
59
+                android:layout_height="190dp"
60
+                android:layout_centerHorizontal="true"
61
+                android:layout_centerVertical="true"
62
+                android:layout_marginHorizontal="25dp"
63
+                android:paddingTop="10dp"
64
+                android:paddingBottom="10dp"
65
+                app:srcCompat="@drawable/emot" />
66
+            <EditText
67
+                android:id="@+id/g1pin"
68
+                android:layout_width="match_parent"
69
+                android:layout_height="wrap_content"
70
+                android:ems="10"
71
+                android:inputType="numberPassword"
72
+                android:visibility="invisible" />
73
+            <ImageButton
74
+                android:id="@+id/g1mic"
75
+                android:layout_width="match_parent"
76
+                android:layout_height="wrap_content"
77
+                android:background="@null"
78
+                android:paddingTop="10dp"
79
+                android:paddingBottom="10dp"
80
+                app:srcCompat="@drawable/mic_off" />
81
+
82
+        </LinearLayout>
83
+
84
+        <LinearLayout
85
+            android:id="@+id/u2"
86
+            android:layout_width="188dp"
87
+            android:layout_height="543dp"
88
+            android:layout_marginStart="700dp"
89
+            android:layout_marginTop="140dp"
90
+            android:orientation="vertical"
91
+            android:visibility="visible"
92
+            app:layout_constraintStart_toStartOf="parent"
93
+            app:layout_constraintTop_toTopOf="parent">
94
+
95
+            <ImageView
96
+                android:id="@+id/imageView23"
97
+                android:layout_width="match_parent"
98
+                android:layout_height="wrap_content"
99
+                android:paddingTop="10dp"
100
+                android:paddingBottom="10dp"
101
+                app:srcCompat="@drawable/g2" />
102
+
103
+            <ImageView
104
+                android:id="@+id/g1sta2"
105
+                android:layout_width="match_parent"
106
+                android:layout_height="wrap_content"
107
+                android:paddingTop="10dp"
108
+                android:paddingBottom="10dp"
109
+                app:srcCompat="@drawable/off" />
110
+
111
+            <ImageView
112
+                android:id="@+id/g1tekst2"
113
+                android:layout_width="match_parent"
114
+                android:layout_height="wrap_content"
115
+                android:paddingTop="20dp"
116
+                android:paddingBottom="20dp"
117
+                app:srcCompat="@drawable/txt_off" />
118
+
119
+            <ImageView
120
+                android:id="@+id/g1hist2"
121
+                android:layout_width="150dp"
122
+                android:layout_height="190dp"
123
+                android:layout_centerHorizontal="true"
124
+                android:layout_centerVertical="true"
125
+                android:layout_marginHorizontal="25dp"
126
+                android:paddingTop="10dp"
127
+                android:paddingBottom="10dp"
128
+                app:srcCompat="@drawable/emot" />
129
+            <EditText
130
+                android:id="@+id/g2pin"
131
+                android:layout_width="match_parent"
132
+                android:layout_height="wrap_content"
133
+                android:ems="10"
134
+                android:inputType="numberPassword"
135
+                android:visibility="invisible" />
136
+            <ImageButton
137
+                android:id="@+id/g1mic2"
138
+                android:layout_width="match_parent"
139
+                android:layout_height="wrap_content"
140
+                android:background="@null"
141
+                android:paddingTop="10dp"
142
+                android:paddingBottom="10dp"
143
+                app:srcCompat="@drawable/mic_off" />
144
+
145
+        </LinearLayout>
146
+
147
+    </androidx.constraintlayout.widget.ConstraintLayout>
148
+
149
+</LinearLayout>

+ 209
- 0
app/src/main/res/layout/activity_gate3.xml 查看文件

@@ -0,0 +1,209 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    xmlns:app="http://schemas.android.com/apk/res-auto"
4
+    xmlns:tools="http://schemas.android.com/tools"
5
+    android:layout_width="match_parent"
6
+    android:layout_height="match_parent"
7
+    android:orientation="horizontal">
8
+
9
+    <androidx.constraintlayout.widget.ConstraintLayout
10
+        android:layout_width="match_parent"
11
+        android:layout_height="match_parent">
12
+
13
+        <ImageView
14
+            android:id="@+id/imageView7"
15
+            android:layout_width="1272dp"
16
+            android:layout_height="69dp"
17
+            app:layout_constraintBottom_toBottomOf="parent"
18
+            app:layout_constraintStart_toStartOf="parent"
19
+            app:srcCompat="@drawable/logo" />
20
+
21
+        <LinearLayout
22
+            android:id="@+id/u1"
23
+            android:layout_width="188dp"
24
+            android:layout_height="543dp"
25
+            android:layout_marginStart="300dp"
26
+            android:layout_marginTop="140dp"
27
+            android:orientation="vertical"
28
+            android:visibility="visible"
29
+            app:layout_constraintStart_toStartOf="parent"
30
+            app:layout_constraintTop_toTopOf="parent">
31
+
32
+            <ImageView
33
+                android:id="@+id/imageView3"
34
+                android:layout_width="match_parent"
35
+                android:layout_height="wrap_content"
36
+                android:paddingTop="10dp"
37
+                android:paddingBottom="10dp"
38
+                app:srcCompat="@drawable/g1" />
39
+
40
+            <ImageView
41
+                android:id="@+id/g1sta"
42
+                android:layout_width="match_parent"
43
+                android:layout_height="wrap_content"
44
+                android:paddingTop="10dp"
45
+                android:paddingBottom="10dp"
46
+                app:srcCompat="@drawable/off" />
47
+
48
+            <ImageView
49
+                android:id="@+id/g1tekst"
50
+                android:layout_width="match_parent"
51
+                android:layout_height="wrap_content"
52
+                android:paddingTop="20dp"
53
+                android:paddingBottom="20dp"
54
+                app:srcCompat="@drawable/txt_off" />
55
+
56
+            <ImageView
57
+                android:id="@+id/g1hist"
58
+                android:layout_width="150dp"
59
+                android:layout_height="190dp"
60
+                android:layout_centerHorizontal="true"
61
+                android:layout_centerVertical="true"
62
+                android:layout_marginHorizontal="25dp"
63
+                android:paddingTop="10dp"
64
+                android:paddingBottom="10dp"
65
+                app:srcCompat="@drawable/emot" />
66
+            <EditText
67
+                android:id="@+id/g1pin"
68
+                android:layout_width="match_parent"
69
+                android:layout_height="wrap_content"
70
+                android:ems="10"
71
+                android:inputType="numberPassword"
72
+                android:visibility="invisible" />
73
+            <ImageButton
74
+                android:id="@+id/g1mic"
75
+                android:layout_width="match_parent"
76
+                android:layout_height="wrap_content"
77
+                android:paddingTop="10dp"
78
+                android:paddingBottom="10dp"
79
+                android:background="@null"
80
+                app:srcCompat="@drawable/mic_off" />
81
+
82
+        </LinearLayout>
83
+        <LinearLayout
84
+            android:id="@+id/u2"
85
+            android:layout_width="188dp"
86
+            android:layout_height="543dp"
87
+            android:layout_marginStart="550dp"
88
+            android:layout_marginTop="140dp"
89
+            android:orientation="vertical"
90
+            android:visibility="visible"
91
+            app:layout_constraintStart_toStartOf="parent"
92
+            app:layout_constraintTop_toTopOf="parent">
93
+
94
+            <ImageView
95
+                android:id="@+id/imageView23"
96
+                android:layout_width="match_parent"
97
+                android:layout_height="wrap_content"
98
+                android:paddingTop="10dp"
99
+                android:paddingBottom="10dp"
100
+                app:srcCompat="@drawable/g2" />
101
+
102
+            <ImageView
103
+                android:id="@+id/g1sta2"
104
+                android:layout_width="match_parent"
105
+                android:layout_height="wrap_content"
106
+                android:paddingTop="10dp"
107
+                android:paddingBottom="10dp"
108
+                app:srcCompat="@drawable/off" />
109
+
110
+            <ImageView
111
+                android:id="@+id/g1tekst2"
112
+                android:layout_width="match_parent"
113
+                android:layout_height="wrap_content"
114
+                android:paddingTop="20dp"
115
+                android:paddingBottom="20dp"
116
+                app:srcCompat="@drawable/txt_off" />
117
+
118
+            <ImageView
119
+                android:id="@+id/g1hist2"
120
+                android:layout_width="150dp"
121
+                android:layout_height="190dp"
122
+                android:layout_centerHorizontal="true"
123
+                android:layout_centerVertical="true"
124
+                android:layout_marginHorizontal="25dp"
125
+                android:paddingTop="10dp"
126
+                android:paddingBottom="10dp"
127
+                app:srcCompat="@drawable/emot" />
128
+            <EditText
129
+                android:id="@+id/g2pin"
130
+                android:layout_width="match_parent"
131
+                android:layout_height="wrap_content"
132
+                android:ems="10"
133
+                android:inputType="numberPassword"
134
+                android:visibility="invisible" />
135
+            <ImageButton
136
+                android:id="@+id/g1mic2"
137
+                android:layout_width="match_parent"
138
+                android:layout_height="wrap_content"
139
+                android:paddingTop="10dp"
140
+                android:paddingBottom="10dp"
141
+                android:background="@null"
142
+                app:srcCompat="@drawable/mic_off" />
143
+
144
+        </LinearLayout>
145
+        <LinearLayout
146
+            android:id="@+id/u3"
147
+            android:layout_width="188dp"
148
+            android:layout_height="543dp"
149
+            android:layout_marginStart="800dp"
150
+            android:layout_marginTop="140dp"
151
+            android:orientation="vertical"
152
+            android:visibility="visible"
153
+            app:layout_constraintStart_toStartOf="parent"
154
+            app:layout_constraintTop_toTopOf="parent">
155
+
156
+            <ImageView
157
+                android:id="@+id/imageView33"
158
+                android:layout_width="match_parent"
159
+                android:layout_height="wrap_content"
160
+                android:paddingTop="10dp"
161
+                android:paddingBottom="10dp"
162
+                app:srcCompat="@drawable/g3" />
163
+
164
+            <ImageView
165
+                android:id="@+id/g1sta3"
166
+                android:layout_width="match_parent"
167
+                android:layout_height="wrap_content"
168
+                android:paddingTop="10dp"
169
+                android:paddingBottom="10dp"
170
+                app:srcCompat="@drawable/off" />
171
+
172
+            <ImageView
173
+                android:id="@+id/g1tekst3"
174
+                android:layout_width="match_parent"
175
+                android:layout_height="wrap_content"
176
+                android:paddingTop="20dp"
177
+                android:paddingBottom="20dp"
178
+                app:srcCompat="@drawable/txt_off" />
179
+
180
+            <ImageView
181
+                android:id="@+id/g1hist3"
182
+                android:layout_width="150dp"
183
+                android:layout_height="190dp"
184
+                android:layout_centerHorizontal="true"
185
+                android:layout_centerVertical="true"
186
+                android:layout_marginHorizontal="25dp"
187
+                android:paddingTop="10dp"
188
+                android:paddingBottom="10dp"
189
+                app:srcCompat="@drawable/emot" />
190
+            <EditText
191
+                android:id="@+id/g3pin"
192
+                android:layout_width="match_parent"
193
+                android:layout_height="wrap_content"
194
+                android:ems="10"
195
+                android:inputType="numberPassword"
196
+                android:visibility="invisible" />
197
+            <ImageButton
198
+                android:id="@+id/g1mic3"
199
+                android:layout_width="match_parent"
200
+                android:layout_height="wrap_content"
201
+                android:paddingTop="10dp"
202
+                android:paddingBottom="10dp"
203
+                android:background="@null"
204
+                app:srcCompat="@drawable/mic_off" />
205
+
206
+        </LinearLayout>
207
+    </androidx.constraintlayout.widget.ConstraintLayout>
208
+
209
+</LinearLayout>

+ 271
- 0
app/src/main/res/layout/activity_gate4.xml 查看文件

@@ -0,0 +1,271 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    xmlns:app="http://schemas.android.com/apk/res-auto"
4
+    xmlns:tools="http://schemas.android.com/tools"
5
+    android:layout_width="match_parent"
6
+    android:layout_height="match_parent"
7
+    android:orientation="horizontal">
8
+
9
+    <androidx.constraintlayout.widget.ConstraintLayout
10
+        android:layout_width="match_parent"
11
+        android:layout_height="match_parent">
12
+
13
+        <ImageView
14
+            android:id="@+id/imageView7"
15
+            android:layout_width="1272dp"
16
+            android:layout_height="69dp"
17
+            app:layout_constraintBottom_toBottomOf="parent"
18
+            app:layout_constraintStart_toStartOf="parent"
19
+            app:srcCompat="@drawable/logo" />
20
+
21
+        <LinearLayout
22
+            android:id="@+id/u1"
23
+            android:layout_width="188dp"
24
+            android:layout_height="543dp"
25
+            android:layout_marginStart="250dp"
26
+            android:layout_marginTop="140dp"
27
+            android:orientation="vertical"
28
+            android:visibility="visible"
29
+            app:layout_constraintStart_toStartOf="parent"
30
+            app:layout_constraintTop_toTopOf="parent">
31
+
32
+            <ImageView
33
+                android:id="@+id/imageView3"
34
+                android:layout_width="match_parent"
35
+                android:layout_height="wrap_content"
36
+                android:paddingTop="10dp"
37
+                android:paddingBottom="10dp"
38
+                app:srcCompat="@drawable/g1" />
39
+
40
+            <ImageView
41
+                android:id="@+id/g1sta"
42
+                android:layout_width="match_parent"
43
+                android:layout_height="wrap_content"
44
+                android:paddingTop="10dp"
45
+                android:paddingBottom="10dp"
46
+                app:srcCompat="@drawable/off" />
47
+
48
+            <ImageView
49
+                android:id="@+id/g1tekst"
50
+                android:layout_width="match_parent"
51
+                android:layout_height="wrap_content"
52
+                android:paddingTop="20dp"
53
+                android:paddingBottom="20dp"
54
+                app:srcCompat="@drawable/txt_off" />
55
+
56
+            <ImageView
57
+                android:id="@+id/g1hist"
58
+                android:layout_width="150dp"
59
+                android:layout_height="190dp"
60
+                android:layout_centerHorizontal="true"
61
+                android:layout_centerVertical="true"
62
+                android:layout_marginHorizontal="25dp"
63
+                android:paddingTop="10dp"
64
+                android:paddingBottom="10dp"
65
+                app:srcCompat="@drawable/emot" />
66
+            <EditText
67
+                android:id="@+id/g1pin"
68
+                android:layout_width="match_parent"
69
+                android:layout_height="wrap_content"
70
+                android:ems="10"
71
+                android:inputType="numberPassword"
72
+                android:visibility="invisible" />
73
+            <ImageButton
74
+                android:id="@+id/g1mic"
75
+                android:layout_width="match_parent"
76
+                android:layout_height="wrap_content"
77
+                android:paddingTop="10dp"
78
+                android:paddingBottom="10dp"
79
+                android:background="@null"
80
+                app:srcCompat="@drawable/mic_off" />
81
+
82
+        </LinearLayout>
83
+        <LinearLayout
84
+            android:id="@+id/u2"
85
+            android:layout_width="188dp"
86
+            android:layout_height="543dp"
87
+            android:layout_marginStart="450dp"
88
+            android:layout_marginTop="140dp"
89
+            android:orientation="vertical"
90
+            android:visibility="visible"
91
+            app:layout_constraintStart_toStartOf="parent"
92
+            app:layout_constraintTop_toTopOf="parent">
93
+
94
+            <ImageView
95
+                android:id="@+id/imageView23"
96
+                android:layout_width="match_parent"
97
+                android:layout_height="wrap_content"
98
+                android:paddingTop="10dp"
99
+                android:paddingBottom="10dp"
100
+                app:srcCompat="@drawable/g2" />
101
+
102
+            <ImageView
103
+                android:id="@+id/g1sta2"
104
+                android:layout_width="match_parent"
105
+                android:layout_height="wrap_content"
106
+                android:paddingTop="10dp"
107
+                android:paddingBottom="10dp"
108
+                app:srcCompat="@drawable/off" />
109
+
110
+            <ImageView
111
+                android:id="@+id/g1tekst2"
112
+                android:layout_width="match_parent"
113
+                android:layout_height="wrap_content"
114
+                android:paddingTop="20dp"
115
+                android:paddingBottom="20dp"
116
+                app:srcCompat="@drawable/txt_off" />
117
+
118
+            <ImageView
119
+                android:id="@+id/g1hist2"
120
+                android:layout_width="150dp"
121
+                android:layout_height="190dp"
122
+                android:layout_centerHorizontal="true"
123
+                android:layout_centerVertical="true"
124
+                android:layout_marginHorizontal="25dp"
125
+                android:paddingTop="10dp"
126
+                android:paddingBottom="10dp"
127
+                app:srcCompat="@drawable/emot" />
128
+            <EditText
129
+                android:id="@+id/g2pin"
130
+                android:layout_width="match_parent"
131
+                android:layout_height="wrap_content"
132
+                android:ems="10"
133
+                android:inputType="numberPassword"
134
+                android:visibility="invisible" />
135
+            <ImageButton
136
+                android:id="@+id/g1mic2"
137
+                android:layout_width="match_parent"
138
+                android:layout_height="wrap_content"
139
+                android:paddingTop="10dp"
140
+                android:paddingBottom="10dp"
141
+                android:background="@null"
142
+                app:srcCompat="@drawable/mic_off" />
143
+
144
+        </LinearLayout>
145
+        <LinearLayout
146
+            android:id="@+id/u3"
147
+            android:layout_width="188dp"
148
+            android:layout_height="543dp"
149
+            android:layout_marginStart="650dp"
150
+            android:layout_marginTop="140dp"
151
+            android:orientation="vertical"
152
+            android:visibility="visible"
153
+            app:layout_constraintStart_toStartOf="parent"
154
+            app:layout_constraintTop_toTopOf="parent">
155
+
156
+            <ImageView
157
+                android:id="@+id/imageView33"
158
+                android:layout_width="match_parent"
159
+                android:layout_height="wrap_content"
160
+                android:paddingTop="10dp"
161
+                android:paddingBottom="10dp"
162
+                app:srcCompat="@drawable/g3" />
163
+
164
+            <ImageView
165
+                android:id="@+id/g1sta3"
166
+                android:layout_width="match_parent"
167
+                android:layout_height="wrap_content"
168
+                android:paddingTop="10dp"
169
+                android:paddingBottom="10dp"
170
+                app:srcCompat="@drawable/off" />
171
+
172
+            <ImageView
173
+                android:id="@+id/g1tekst3"
174
+                android:layout_width="match_parent"
175
+                android:layout_height="wrap_content"
176
+                android:paddingTop="20dp"
177
+                android:paddingBottom="20dp"
178
+                app:srcCompat="@drawable/txt_off" />
179
+
180
+            <ImageView
181
+                android:id="@+id/g1hist3"
182
+                android:layout_width="150dp"
183
+                android:layout_height="190dp"
184
+                android:layout_centerHorizontal="true"
185
+                android:layout_centerVertical="true"
186
+                android:layout_marginHorizontal="25dp"
187
+                android:paddingTop="10dp"
188
+                android:paddingBottom="10dp"
189
+                app:srcCompat="@drawable/emot" />
190
+            <EditText
191
+                android:id="@+id/g3pin"
192
+                android:layout_width="match_parent"
193
+                android:layout_height="wrap_content"
194
+                android:ems="10"
195
+                android:inputType="numberPassword"
196
+                android:visibility="invisible" />
197
+            <ImageButton
198
+                android:id="@+id/g1mic3"
199
+                android:layout_width="match_parent"
200
+                android:layout_height="wrap_content"
201
+                android:paddingTop="10dp"
202
+                android:paddingBottom="10dp"
203
+                android:background="@null"
204
+                app:srcCompat="@drawable/mic_off" />
205
+
206
+        </LinearLayout>
207
+        <LinearLayout
208
+            android:id="@+id/u4"
209
+            android:layout_width="188dp"
210
+            android:layout_height="543dp"
211
+            android:layout_marginStart="850dp"
212
+            android:layout_marginTop="140dp"
213
+            android:orientation="vertical"
214
+            android:visibility="visible"
215
+            app:layout_constraintStart_toStartOf="parent"
216
+            app:layout_constraintTop_toTopOf="parent">
217
+
218
+            <ImageView
219
+                android:id="@+id/imageView43"
220
+                android:layout_width="match_parent"
221
+                android:layout_height="wrap_content"
222
+                android:paddingTop="10dp"
223
+                android:paddingBottom="10dp"
224
+                app:srcCompat="@drawable/g4" />
225
+
226
+            <ImageView
227
+                android:id="@+id/g1sta4"
228
+                android:layout_width="match_parent"
229
+                android:layout_height="wrap_content"
230
+                android:paddingTop="10dp"
231
+                android:paddingBottom="10dp"
232
+                app:srcCompat="@drawable/off" />
233
+
234
+            <ImageView
235
+                android:id="@+id/g1tekst4"
236
+                android:layout_width="match_parent"
237
+                android:layout_height="wrap_content"
238
+                android:paddingTop="20dp"
239
+                android:paddingBottom="20dp"
240
+                app:srcCompat="@drawable/txt_off" />
241
+
242
+            <ImageView
243
+                android:id="@+id/g1hist4"
244
+                android:layout_width="150dp"
245
+                android:layout_height="190dp"
246
+                android:layout_centerHorizontal="true"
247
+                android:layout_centerVertical="true"
248
+                android:layout_marginHorizontal="25dp"
249
+                android:paddingTop="10dp"
250
+                android:paddingBottom="10dp"
251
+                app:srcCompat="@drawable/emot" />
252
+            <EditText
253
+                android:id="@+id/g4pin"
254
+                android:layout_width="match_parent"
255
+                android:layout_height="wrap_content"
256
+                android:ems="10"
257
+                android:inputType="numberPassword"
258
+                android:visibility="invisible" />
259
+            <ImageButton
260
+                android:id="@+id/g1mic4"
261
+                android:layout_width="match_parent"
262
+                android:layout_height="wrap_content"
263
+                android:paddingTop="10dp"
264
+                android:paddingBottom="10dp"
265
+                android:background="@null"
266
+                app:srcCompat="@drawable/mic_off" />
267
+
268
+        </LinearLayout>
269
+    </androidx.constraintlayout.widget.ConstraintLayout>
270
+
271
+</LinearLayout>

+ 12
- 114
app/src/main/res/layout/activity_main.xml 查看文件

@@ -6,123 +6,21 @@
6 6
     android:layout_height="match_parent"
7 7
     tools:context=".MainActivity">
8 8
 
9
-    <TextView
10
-        android:id="@+id/textView"
11
-        android:layout_width="wrap_content"
12
-        android:layout_height="wrap_content"
13
-        android:layout_marginStart="45dp"
14
-        android:layout_marginTop="50dp"
15
-        android:text="Login"
16
-        app:layout_constraintStart_toStartOf="parent"
17
-        app:layout_constraintTop_toBottomOf="@+id/imageView" />
18
-
19
-    <TextView
20
-        android:id="@+id/textView2"
21
-        android:layout_width="wrap_content"
22
-        android:layout_height="wrap_content"
23
-        android:layout_marginStart="45dp"
24
-        android:layout_marginTop="50dp"
25
-        android:text="Hasło"
26
-        app:layout_constraintStart_toStartOf="parent"
27
-        app:layout_constraintTop_toBottomOf="@+id/textView" />
28
-
29
-    <EditText
30
-        android:id="@+id/editText2"
31
-        android:layout_width="wrap_content"
32
-        android:layout_height="wrap_content"
33
-        android:layout_marginStart="106dp"
34
-        android:layout_marginTop="35dp"
35
-        android:layout_marginBottom="24dp"
36
-        android:ems="10"
37
-        android:inputType="textPersonName"
38
-        android:text="admin"
39
-        app:layout_constraintBottom_toTopOf="@+id/editText3"
40
-        app:layout_constraintStart_toEndOf="@+id/textView"
41
-        app:layout_constraintTop_toBottomOf="@+id/imageView" />
42
-
43
-    <EditText
44
-        android:id="@+id/editText3"
45
-        android:layout_width="wrap_content"
46
-        android:layout_height="wrap_content"
47
-        android:layout_marginStart="104dp"
48
-        android:layout_marginTop="1dp"
49
-        android:layout_marginBottom="16dp"
50
-        android:ems="10"
51
-        android:inputType="textPassword"
52
-        app:layout_constraintBottom_toTopOf="@+id/login"
53
-        app:layout_constraintStart_toEndOf="@+id/textView2"
54
-        app:layout_constraintTop_toBottomOf="@+id/editText2" />
55
-
56
-    <Button
57
-        android:id="@+id/login"
58
-        android:layout_width="wrap_content"
59
-        android:layout_height="wrap_content"
60
-        android:layout_marginStart="374dp"
61
-        android:layout_marginTop="16dp"
62
-        android:text="Zaloguj"
63
-        app:layout_constraintStart_toStartOf="parent"
64
-        app:layout_constraintTop_toBottomOf="@+id/editText3" />
65
-
66 9
     <ImageView
67 10
         android:id="@+id/imageView"
68
-        android:layout_width="586dp"
69
-        android:layout_height="70dp"
70
-        android:layout_marginBottom="48dp"
71
-        app:layout_constraintBottom_toTopOf="@+id/textView"
72
-        app:layout_constraintEnd_toEndOf="parent"
11
+        android:layout_width="1282dp"
12
+        android:layout_height="798dp"
73 13
         app:layout_constraintStart_toStartOf="parent"
74 14
         app:layout_constraintTop_toTopOf="parent"
75
-        app:srcCompat="@drawable/logo" />
76
-
77
-    <TextView
78
-        android:id="@+id/textView3"
79
-        android:layout_width="wrap_content"
80
-        android:layout_height="wrap_content"
81
-        android:layout_marginStart="36dp"
82
-        android:layout_marginTop="207dp"
83
-        android:text="Adres"
84
-        android:visibility="invisible"
15
+        app:srcCompat="@drawable/s1" />
16
+
17
+    <ImageButton
18
+        android:id="@+id/idbConfig"
19
+        android:layout_width="102dp"
20
+        android:layout_height="106dp"
21
+        android:layout_marginStart="16dp"
22
+        android:layout_marginTop="28dp"
85 23
         app:layout_constraintStart_toStartOf="parent"
86
-        app:layout_constraintTop_toBottomOf="@+id/textView2" />
87
-
88
-    <EditText
89
-        android:id="@+id/editText"
90
-        android:layout_width="493dp"
91
-        android:layout_height="46dp"
92
-        android:layout_marginStart="13dp"
93
-        android:layout_marginTop="115dp"
94
-        android:ems="10"
95
-        android:inputType="textPersonName"
96
-        android:text="http://p.sorveno.com/pp.html"
97
-        android:visibility="invisible"
98
-        app:layout_constraintStart_toEndOf="@+id/textView3"
99
-        app:layout_constraintTop_toBottomOf="@+id/login" />
100
-
101
-    <EditText
102
-        android:id="@+id/editText4"
103
-        android:layout_width="546dp"
104
-        android:layout_height="181dp"
105
-        android:layout_marginStart="28dp"
106
-        android:layout_marginTop="41dp"
107
-        android:ems="10"
108
-        android:gravity="start|top"
109
-        android:inputType="textMultiLine"
110
-        android:visibility="invisible"
111
-        app:layout_constraintStart_toStartOf="parent"
112
-        app:layout_constraintTop_toBottomOf="@+id/editText" />
113
-
114
-    <Button
115
-        android:id="@+id/button"
116
-        android:layout_width="wrap_content"
117
-        android:layout_height="wrap_content"
118
-        android:layout_marginStart="456dp"
119
-        android:layout_marginTop="37dp"
120
-        android:text="Wykonaj"
121
-        android:visibility="invisible"
122
-        app:layout_constraintStart_toStartOf="parent"
123
-        app:layout_constraintTop_toBottomOf="@+id/editText4"
124
-        tools:visibility="invisible" />
125
-
126
-
127
-
24
+        app:layout_constraintTop_toTopOf="parent"
25
+        app:srcCompat="@drawable/setup" />
128 26
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 39
- 0
app/src/main/res/layout/activity_pin.xml 查看文件

@@ -0,0 +1,39 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    xmlns:app="http://schemas.android.com/apk/res-auto"
4
+    xmlns:tools="http://schemas.android.com/tools"
5
+    android:layout_width="match_parent"
6
+    android:layout_height="match_parent"
7
+    tools:context=".PinActivity">
8
+
9
+    <ImageView
10
+        android:id="@+id/imageView2"
11
+        android:layout_width="1277dp"
12
+        android:layout_height="798dp"
13
+        app:layout_constraintStart_toStartOf="parent"
14
+        app:layout_constraintTop_toTopOf="parent"
15
+        app:srcCompat="@drawable/pin"
16
+        tools:srcCompat="@drawable/pin" />
17
+
18
+    <EditText
19
+        android:id="@+id/idPin"
20
+        android:layout_width="160dp"
21
+        android:layout_height="76dp"
22
+        android:layout_marginStart="560dp"
23
+        android:layout_marginTop="392dp"
24
+        android:ems="10"
25
+        android:inputType="numberPassword"
26
+        app:layout_constraintStart_toStartOf="parent"
27
+        app:layout_constraintTop_toTopOf="parent" />
28
+
29
+    <Button
30
+        android:id="@+id/idOkPin"
31
+        android:layout_width="118dp"
32
+        android:layout_height="50dp"
33
+        android:layout_marginStart="580dp"
34
+        android:layout_marginTop="500dp"
35
+        android:text="Zatwierdz"
36
+        app:layout_constraintStart_toStartOf="parent"
37
+        app:layout_constraintTop_toTopOf="parent" />
38
+
39
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 2
- 2
app/src/main/res/layout/fragment_item.xml 查看文件

@@ -2,12 +2,12 @@
2 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
-    android:layout_width="wrap_content"
5
+    android:layout_width="600dp"
6 6
     android:layout_height="wrap_content"
7 7
     android:orientation="horizontal">
8 8
 
9 9
     <androidx.constraintlayout.widget.ConstraintLayout
10
-        android:layout_width="1123dp"
10
+        android:layout_width="600dp"
11 11
         android:layout_height="200dp">
12 12
 
13 13
         <TextView

+ 3
- 0
app/src/main/res/layout/fragment_item_list.xml 查看文件

@@ -10,4 +10,7 @@
10 10
     android:layout_marginRight="16dp"
11 11
     app:layoutManager="LinearLayoutManager"
12 12
     tools:context=".ItemFragment"
13
+    android:scrollbars="horizontal"
14
+    android:layout_centerVertical="true"
15
+    android:layout_centerHorizontal="true"
13 16
     tools:listitem="@layout/fragment_item" />