Bläddra i källkod

zmiany do wersj pdstawoej

waldek 5 år sedan
förälder
incheckning
b85003b120
40 ändrade filer med 953 tillägg och 265 borttagningar
  1. 1
    1
      .idea/misc.xml
  2. 6
    1
      app/build.gradle
  3. Binär
      app/debug/app-debug.apk
  4. 0
    1
      app/debug/output.json
  5. 6
    2
      app/src/main/AndroidManifest.xml
  6. Binär
      app/src/main/ic_launcher-playstore.png
  7. 144
    29
      app/src/main/java/com/kfb/kfbv1/GateActivity.java
  8. 8
    2
      app/src/main/java/com/kfb/kfbv1/MainActivity.java
  9. 25
    0
      app/src/main/java/com/kfb/kfbv1/MyItemRecyclerViewAdapter.java
  10. 8
    5
      app/src/main/java/com/kfb/kfbv1/dummy/DummyContent.java
  11. 40
    4
      app/src/main/java/com/kfb/kfbv1/model/KfbGate.java
  12. 129
    13
      app/src/main/java/com/kfb/kfbv1/model/KfbHttpRequest.java
  13. 54
    0
      app/src/main/java/com/kfb/kfbv1/model/KfbKttpRequest2.java
  14. 60
    1
      app/src/main/java/com/kfb/kfbv1/model/KfbMeasure.java
  15. 13
    1
      app/src/main/java/com/kfb/kfbv1/model/KfbModel.java
  16. 22
    4
      app/src/main/java/com/kfb/kfbv1/model/KfbParser.java
  17. 31
    0
      app/src/main/java/com/kfb/kfbv1/model/KfbTablet.java
  18. 31
    20
      app/src/main/java/com/kfb/kfbv1/model/KfbTask.java
  19. 1
    0
      app/src/main/java/com/kfb/kfbv1/model/LogFile.java
  20. 70
    166
      app/src/main/res/drawable/ic_launcher_background.xml
  21. 31
    0
      app/src/main/res/drawable/ic_launcher_doc.xml
  22. 1
    1
      app/src/main/res/drawable/splash.xml
  23. 202
    0
      app/src/main/res/layout/activity_config.xml
  24. 7
    0
      app/src/main/res/layout/activity_gate.xml
  25. 7
    2
      app/src/main/res/layout/activity_main.xml
  26. 37
    7
      app/src/main/res/layout/fragment_item.xml
  27. 14
    0
      app/src/main/res/layout/toolbar.xml
  28. 2
    2
      app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  29. 2
    2
      app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  30. Binär
      app/src/main/res/mipmap-hdpi/ic_launcher.png
  31. Binär
      app/src/main/res/mipmap-hdpi/ic_launcher_round.png
  32. Binär
      app/src/main/res/mipmap-mdpi/ic_launcher.png
  33. Binär
      app/src/main/res/mipmap-mdpi/ic_launcher_round.png
  34. Binär
      app/src/main/res/mipmap-xhdpi/ic_launcher.png
  35. Binär
      app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  36. Binär
      app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  37. Binär
      app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
  38. Binär
      app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  39. Binär
      app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
  40. 1
    1
      app/src/main/res/values/styles.xml

+ 1
- 1
.idea/misc.xml Visa fil

@@ -1,6 +1,6 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <project version="4">
3
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
3
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
4 4
     <output url="file://$PROJECT_DIR$/build/classes" />
5 5
   </component>
6 6
   <component name="ProjectType">

+ 6
- 1
app/build.gradle Visa fil

@@ -24,14 +24,19 @@ android {
24 24
 }
25 25
 
26 26
 dependencies {
27
+    def room_version = "2.2.5"
28
+
29
+
27 30
     implementation fileTree(dir: 'libs', include: ['*.jar'])
31
+    implementation "androidx.room:room-runtime:$room_version"
28 32
 
29 33
     implementation 'com.loopj.android:android-async-http:1.4.9'
30
-
31 34
     implementation 'androidx.appcompat:appcompat:1.1.0'
32 35
     implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
33 36
     testImplementation 'junit:junit:4.12'
34 37
     androidTestImplementation 'androidx.test.ext:junit:1.1.1'
35 38
     androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
36 39
     implementation 'androidx.recyclerview:recyclerview:1.1.0'
40
+    implementation 'com.google.android.material:material:1.1.0'
41
+    annotationProcessor 'androidx.room:room-compiler:2.1.0'
37 42
 }

Binär
app/debug/app-debug.apk Visa fil


+ 0
- 1
app/debug/output.json Visa fil

@@ -1 +0,0 @@
1
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0","enabled":true,"outputFile":"app-debug.apk","fullName":"debug","baseName":"debug","dirName":""},"path":"app-debug.apk","properties":{}}]

+ 6
- 2
app/src/main/AndroidManifest.xml Visa fil

@@ -2,6 +2,9 @@
2 2
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 3
     xmlns:tools="http://schemas.android.com/tools"
4 4
     package="com.kfb.kfbv1">
5
+
6
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
7
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
5 8
     <uses-permission android:name="android.permission.INTERNET" />
6 9
     <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
7 10
     <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
@@ -14,9 +17,9 @@
14 17
 
15 18
     <application
16 19
         android:allowBackup="true"
17
-        android:icon="@mipmap/ic_launcher"
18 20
         android:label="@string/app_name"
19
-        android:roundIcon="@mipmap/ic_launcher_round"
21
+        android:roundIcon="@drawable/ic_launcher_round"
22
+        android:icon="@drawable/ic_launcher_round"
20 23
         android:supportsRtl="true"
21 24
         android:theme="@style/AppTheme">
22 25
         <activity
@@ -30,6 +33,7 @@
30 33
         </activity>
31 34
         <activity android:name=".MainActivity" android:noHistory="true"></activity>
32 35
         <activity android:name=".GateActivity" android:noHistory="true"></activity>
36
+        <activity android:name=".ConfigActivity" android:noHistory="true"></activity>
33 37
     </application>
34 38
 
35 39
 </manifest>

Binär
app/src/main/ic_launcher-playstore.png Visa fil


+ 144
- 29
app/src/main/java/com/kfb/kfbv1/GateActivity.java Visa fil

@@ -1,27 +1,35 @@
1 1
 package com.kfb.kfbv1;
2 2
 
3
+import android.content.Intent;
3 4
 import android.os.Bundle;
4 5
 import android.os.Handler;
5 6
 import android.os.Message;
7
+import android.view.MenuItem;
8
+import android.view.View;
6 9
 import android.view.WindowManager;
7
-import android.widget.TextView;
10
+import android.widget.Button;
11
+import android.widget.ImageButton;
12
+
8 13
 
9 14
 import androidx.appcompat.app.AppCompatActivity;
15
+
16
+import androidx.appcompat.widget.Toolbar;
10 17
 import androidx.recyclerview.widget.LinearLayoutManager;
11 18
 import androidx.recyclerview.widget.RecyclerView;
12 19
 
20
+import com.kfb.kfbv1.db.DbManage;
21
+import com.kfb.kfbv1.db.Urzadzenia;
13 22
 import com.kfb.kfbv1.dummy.DummyContent;
14 23
 
15 24
 import com.kfb.kfbv1.model.KfbGate;
16
-import com.kfb.kfbv1.model.KfbHttpRequest;
17 25
 import com.kfb.kfbv1.model.KfbModel;
18 26
 import com.kfb.kfbv1.model.KfbTask;
19
-
20 27
 import java.util.ArrayList;
21 28
 import java.util.List;
22 29
 
23 30
 public class GateActivity  extends AppCompatActivity
24 31
 {
32
+    private Toolbar toolbar;
25 33
     private MyItemRecyclerViewAdapter listAdapter;
26 34
     private List<DummyContent.DummyItem> ld1 = new ArrayList<DummyContent.DummyItem>() ;
27 35
     private RecyclerView recycler;
@@ -30,11 +38,31 @@ public class GateActivity  extends AppCompatActivity
30 38
         @Override
31 39
         public void handleMessage(Message msg) {
32 40
             if(msg.what==2) {
33
-                DummyContent.DummyItem dr = ld1.get(msg.arg1);
34
-                dr.Temperatura = KfbModel.getData().getGates().getmGate().get(msg.arg1).getmMaxT();
35
-                dr.State = KfbModel.getData().getGates().getmGate().get(msg.arg1).getmStatus();
36
-                dr.Error = KfbModel.getData().getGates().getmGate().get(msg.arg1).getmError();
37
-                listAdapter.notifyDataSetChanged();
41
+                DummyContent.DummyItem dr=null;
42
+                for(int i = 0; i<ld1.size();i++)
43
+                {
44
+                    dr = ld1.get(msg.arg1);
45
+                    if(dr.id== msg.arg1)
46
+                    {
47
+                        break;
48
+                    }
49
+                }
50
+                if(dr!=null) {
51
+                    dr.Temperatura = KfbModel.getData().getGates().getmGate().get(msg.arg1).getmMaxT();
52
+                    dr.State = KfbModel.getData().getGates().getmGate().get(msg.arg1).getmStatus();
53
+                    dr.Error = KfbModel.getData().getGates().getmGate().get(msg.arg1).getmError();
54
+                    dr.imgHis = KfbModel.getData().getGates().getmGate().get(msg.arg1).getmMeasure().getHist();
55
+                    float t=0;
56
+                    if (dr.Temperatura != null) {
57
+                        t = Float.parseFloat(dr.Temperatura);
58
+                    }
59
+                    if (t > 38) {
60
+                         dr.Nok = "NOK";
61
+                    } else {
62
+                        dr.Nok = "OK";
63
+                    }
64
+                    listAdapter.notifyDataSetChanged();
65
+                }
38 66
             }
39 67
             super.handleMessage(msg);
40 68
         }
@@ -45,41 +73,128 @@ public class GateActivity  extends AppCompatActivity
45 73
         setContentView(R.layout.activity_gate);
46 74
         getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
47 75
 
76
+        ImageButton bConf = (ImageButton)findViewById(R.id.idConfig);
77
+        bConf.setOnClickListener(new View.OnClickListener() {
78
+
79
+            public void onClick(View v) {
80
+                onConfigClik(v);
81
+            }
82
+        });
83
+
48 84
         recycler = findViewById(R.id.recview);
49 85
         recycler.setHasFixedSize(true);
50 86
         layoutManager = new LinearLayoutManager(this);
51 87
         recycler.setLayoutManager(layoutManager);
52 88
 
53 89
 
90
+
54 91
         listAdapter = new MyItemRecyclerViewAdapter( ld1,null);
55 92
         recycler.setAdapter(listAdapter);
93
+        DbManage dbRep = new DbManage(getApplicationContext());
94
+        List<Urzadzenia> urzdb = dbRep.getUrzadzeniaAll();
95
+            if(urzdb!=null) {
96
+                KfbModel.getData().clear();
97
+                for(int i=0;i<urzdb.size();i++){
56 98
 
57
-        KfbModel.getData().sendHttp=true;
58
-        KfbGate lGate = new KfbGate();
59
-        lGate.setmAdres("http://192.168.13.15");
60
-      //  lGate.setmAdres("http://p.sorveno.com/pp.html");
61
-        lGate.setmName("Gate 1");
62
-        KfbModel.getData().getGates().AddGate(lGate);
63
-        lGate = new KfbGate();
64
-        lGate.setmAdres("http://192.168.13.16");
65
-        lGate.setmName("Gate 2");
66
-        KfbModel.getData().getGates().AddGate(lGate);
67
-        for (int i =0; i<KfbModel.getData().getGates().getmSize();i++) {
68
-             DummyContent.DummyItem d1 = new DummyContent.DummyItem(String.valueOf(i)  ,KfbModel.getData().getGates().getmGate().get(i).getmName(), "ON", KfbModel.getData().getGates().getmGate().get(i).getmError(), KfbModel.getData().getGates().getmGate().get(i).getmStatus(), "", "", "", KfbModel.getData().getGates().getmGate().get(i).getmMaxT());
69
-            ld1.add(d1);
70
-        }
71
-        KfbModel.getData().handler = handler;
72
-        KfbModel.getData().setmAdapter(listAdapter);
73
-        this.StartMes();
74
-        listAdapter.notifyDataSetChanged();
75
-    }
99
+                    KfbGate lGate = new KfbGate();
100
+                    lGate.setId(urzdb.get(i).ID);
101
+                    lGate.setmAdres(urzdb.get(i).adres);
102
+                    if(i==0) {
103
+                        lGate.setmName("Gate 1");
104
+                    }
105
+                    if(i==1) {
106
+                        lGate.setmName("Gate 2");
107
+                    }
108
+                    if(i==2) {
109
+                        lGate.setmName("Gate 3");
110
+                    }
111
+                    if(i==3) {
112
+                        lGate.setmName("Gate 4");
113
+                    }
114
+                    lGate.setmActive(urzdb.get(i).active);
115
+                    KfbModel.getData().getGates().AddGate(lGate);
116
+                }
117
+            }
118
+                if (KfbModel.getData().getGates().getmSize() == 0) {
119
+                    KfbModel.getData().clear();
120
+                    KfbModel.getData().sendHttp = true;
121
+                    KfbGate lGate = new KfbGate();
122
+                    lGate.setId(0);
123
+                    lGate.setmAdres("http://192.168.1.15:6505");
124
+                    // lGate.setmAdres("http://51.83.130.248:3000");
125
+                    lGate.setmName("Gate 1");
126
+                    lGate.setmActive(true);
127
+                    KfbModel.getData().getGates().AddGate(lGate);
128
+                    Urzadzenia urzdbe = new Urzadzenia();
129
+
130
+                    urzdbe.active = lGate.ismActive();
131
+                    urzdbe.adres = lGate.getmAdres();
132
+                    urzdbe.ID =  lGate.getId();
133
+                    dbRep.insertUrzazenie(urzdbe);
76 134
 
135
+                    lGate = new KfbGate();
136
+                    lGate.setmAdres("http://192.168.1.16:6505");
137
+                    //lGate.setmAdres("http://p.sorveno.com/pp.html");
138
+                    lGate.setmName("Gate 2");
139
+                    lGate.setId(1);
140
+                    lGate.setmActive(true);
141
+                    KfbModel.getData().getGates().AddGate(lGate);
142
+                    urzdbe = new Urzadzenia();
143
+                    urzdbe.active = lGate.ismActive();
144
+                    urzdbe.adres = lGate.getmAdres();
145
+                    urzdbe.ID =  lGate.getId();
146
+                    dbRep.insertUrzazenie(urzdbe);
147
+                    lGate = new KfbGate();
148
+                    lGate.setmAdres("http://192.168.1.17:6505");
149
+                    //lGate.setmAdres("http://p.sorveno.com/pp.html");
150
+                    lGate.setmName("Gate 3");
151
+                    lGate.setId(2);
152
+                    lGate.setmActive(true);
153
+                    KfbModel.getData().getGates().AddGate(lGate);
154
+                    urzdbe = new Urzadzenia();
155
+                    urzdbe.active = lGate.ismActive();
156
+                    urzdbe.adres = lGate.getmAdres();
157
+                    urzdbe.ID =  lGate.getId();
158
+                    dbRep.insertUrzazenie(urzdbe);
159
+                    lGate = new KfbGate();
160
+                    lGate.setmAdres("http://192.168.1.18:6505");
161
+                    //lGate.setmAdres("http://p.sorveno.com/pp.html");
162
+                    lGate.setmName("Gate 4");
163
+                    lGate.setId(3);
164
+                    lGate.setmActive(true);
165
+                    urzdbe = new Urzadzenia();
166
+                    urzdbe.active = lGate.ismActive();
167
+                    urzdbe.adres = lGate.getmAdres();
168
+                    urzdbe.ID =  lGate.getId();
169
+                    dbRep.insertUrzazenie(urzdbe);
170
+                    KfbModel.getData().getGates().AddGate(lGate);
171
+                }
172
+            ld1.clear();
173
+            for (int i = 0; i < KfbModel.getData().getGates().getmSize(); i++) {
174
+                DummyContent.DummyItem d1 = new DummyContent.DummyItem(i, KfbModel.getData().getGates().getmGate().get(i).getmName(), "ON", KfbModel.getData().getGates().getmGate().get(i).getmError(), KfbModel.getData().getGates().getmGate().get(i).getmStatus(), "", "", "", KfbModel.getData().getGates().getmGate().get(i).getmMaxT());
175
+                 if( KfbModel.getData().getGates().getmGate().get(i).ismActive()) {
176
+                     ld1.add(d1);
177
+                 }
178
+            }
179
+            KfbModel.getData().handler = handler;
180
+            KfbModel.getData().setmAdapter(listAdapter);
181
+            this.StartMes();
182
+            listAdapter.notifyDataSetChanged();
183
+    }
184
+private void onConfigClik(View v)
185
+{
186
+    Intent i = new Intent(getApplicationContext(),ConfigActivity.class);
187
+    startActivity(i);
188
+}
77 189
     private void StartMes(){
78 190
         KfbModel.getData().sendHttp= true;
79 191
         KfbTask tr = new KfbTask();
80 192
         Thread T1 = new Thread(tr);
81 193
         T1.start();
82 194
     }
83
-
84
-
195
+    @Override
196
+    protected void onStop() {
197
+        super.onStop();
198
+        KfbModel.getData().sendHttp=false;
199
+    }
85 200
 }

+ 8
- 2
app/src/main/java/com/kfb/kfbv1/MainActivity.java Visa fil

@@ -16,6 +16,8 @@ import android.widget.Button;
16 16
 import android.widget.ProgressBar;
17 17
 import android.widget.TextView;
18 18
 
19
+import com.kfb.kfbv1.db.DbManage;
20
+import com.kfb.kfbv1.db.User;
19 21
 import com.kfb.kfbv1.hotspot.WifiApManager;
20 22
 import com.kfb.kfbv1.model.KfbGate;
21 23
 import com.kfb.kfbv1.model.KfbGates;
@@ -79,6 +81,10 @@ public class MainActivity extends AppCompatActivity {
79 81
        //wifiApManager.setWifiApEnabled(con, true);
80 82
     }
81 83
     private void onLoginClik(View v) {
84
+
85
+        DbManage dbRep = new DbManage(getApplicationContext());
86
+        User us = dbRep.getUser("admin");
87
+
82 88
         Intent i = new Intent(getApplicationContext(),GateActivity.class);
83 89
         startActivity(i);
84 90
 
@@ -93,7 +99,7 @@ public class MainActivity extends AppCompatActivity {
93 99
 
94 100
         KfbGate g1 = new KfbGate();
95 101
         g1.setmName("Test1");
96
-    //    KfbModel.getData().getGates().AddGate(g1);
102
+        KfbModel.getData().getGates().AddGate(g1);
97 103
 
98 104
         T1 = new Thread(tr);
99 105
         T1.start();
@@ -102,7 +108,7 @@ public class MainActivity extends AppCompatActivity {
102 108
     protected void onResume() {
103 109
         super.onResume();
104 110
 
105
-        wifiApManager.showWritePermissionSettings(false);
111
+      //  wifiApManager.showWritePermissionSettings(false);
106 112
     }
107 113
 
108 114
 }

+ 25
- 0
app/src/main/java/com/kfb/kfbv1/MyItemRecyclerViewAdapter.java Visa fil

@@ -3,6 +3,7 @@ package com.kfb.kfbv1;
3 3
 import android.view.LayoutInflater;
4 4
 import android.view.View;
5 5
 import android.view.ViewGroup;
6
+import android.widget.ImageView;
6 7
 import android.widget.TextView;
7 8
 
8 9
 import androidx.recyclerview.widget.RecyclerView;
@@ -39,8 +40,28 @@ public class MyItemRecyclerViewAdapter extends RecyclerView.Adapter<MyItemRecycl
39 40
         holder.Nazwa.setText(mValues.get(position).Nazwa);
40 41
         holder.Status.setText(mValues.get(position).Status);
41 42
         holder.Error.setText(mValues.get(position).Error);
43
+        holder.Error.setTextColor(0XFFFF0000);
42 44
         holder.State.setText(mValues.get(position).State);
45
+        holder.Nok.setText(mValues.get(position).Nok);
46
+        if(mValues.get(position).Nok!=null) {
47
+            if (mValues.get(position).Nok.equals("NOK")) {
48
+                holder.Nok.setTextColor(0XFFFF0000);
49
+            } else {
50
+                holder.Nok.setTextColor(0XFF00FF00);
51
+            }
52
+        }
43 53
         holder.Temperatura.setText(mValues.get(position).Temperatura);
54
+        String t = mValues.get(position).Temperatura;
55
+        if(t!=null) {
56
+            if (Float.parseFloat(t) >= 38.0F) {
57
+                holder.Temperatura.setTextColor(0XFFFF0000);
58
+            } else {
59
+                holder.Temperatura.setTextColor(0XFF00FF00);
60
+            }
61
+        }
62
+        if(mValues.get(position).imgHis!=null) {
63
+            holder.ImgHis.setImageBitmap(mValues.get(position).imgHis);
64
+        }
44 65
         holder.mView.setOnClickListener(new View.OnClickListener() {
45 66
             @Override
46 67
             public void onClick(View v) {
@@ -65,6 +86,8 @@ public class MyItemRecyclerViewAdapter extends RecyclerView.Adapter<MyItemRecycl
65 86
         public final TextView Error;
66 87
         public final TextView State;
67 88
         public final TextView Temperatura;
89
+        public final TextView Nok;
90
+        public final ImageView ImgHis;
68 91
 
69 92
         public DummyContent.DummyItem mItem;
70 93
 
@@ -76,6 +99,8 @@ public class MyItemRecyclerViewAdapter extends RecyclerView.Adapter<MyItemRecycl
76 99
             Error = (TextView) view.findViewById(R.id.idError);
77 100
             State = (TextView) view.findViewById(R.id.idState);
78 101
             Temperatura = (TextView) view.findViewById(R.id.idTemperatura);
102
+            Nok = (TextView) view.findViewById(R.id.idOK);
103
+            ImgHis = (ImageView) view.findViewById(R.id.imgHis);
79 104
         }
80 105
 
81 106
         @Override

+ 8
- 5
app/src/main/java/com/kfb/kfbv1/dummy/DummyContent.java Visa fil

@@ -1,5 +1,7 @@
1 1
 package com.kfb.kfbv1.dummy;
2 2
 
3
+import android.graphics.Bitmap;
4
+
3 5
 import java.util.ArrayList;
4 6
 import java.util.HashMap;
5 7
 import java.util.List;
@@ -21,7 +23,7 @@ public class DummyContent {
21 23
     /**
22 24
      * A map of sample (dummy) items, by ID.
23 25
      */
24
-    public static final Map<String, DummyItem> ITEM_MAP = new HashMap<String, DummyItem>();
26
+    public static final Map<Integer, DummyItem> ITEM_MAP = new HashMap<Integer, DummyItem>();
25 27
 
26 28
     private static final int COUNT = 4;
27 29
 
@@ -38,7 +40,7 @@ public class DummyContent {
38 40
     }
39 41
 
40 42
     private static DummyItem createDummyItem(int position) {
41
-        return new DummyItem(String.valueOf(position), "Test1","ON","ERROR","Empty","1","1","1","23.3");
43
+        return new DummyItem(1, "Test1","ON","ERROR","Empty","1","1","1","23.3");
42 44
     }
43 45
 
44 46
     private static String makeDetails(int position) {
@@ -54,7 +56,7 @@ public class DummyContent {
54 56
      * A dummy item representing a piece of content.
55 57
      */
56 58
     public static class DummyItem {
57
-        public final String id;
59
+        public final int id;
58 60
         public final String Nazwa;
59 61
         public final String Status;
60 62
         public String Error;
@@ -63,8 +65,9 @@ public class DummyContent {
63 65
         public final String s2;
64 66
         public final String s3;
65 67
         public String Temperatura;
66
-
67
-        public DummyItem(String id, String aNazwa,String aStatus,String aError,String aState,String aS1,String aS2,String aS3,String aTemperatura) {
68
+        public Bitmap imgHis;
69
+        public String Nok;
70
+        public DummyItem(int id, String aNazwa,String aStatus,String aError,String aState,String aS1,String aS2,String aS3,String aTemperatura) {
68 71
             this.id = id;
69 72
             this.Nazwa = aNazwa;
70 73
             this.State = aState;

+ 40
- 4
app/src/main/java/com/kfb/kfbv1/model/KfbGate.java Visa fil

@@ -3,13 +3,48 @@ package com.kfb.kfbv1.model;
3 3
 import java.util.ArrayList;
4 4
 
5 5
 public class KfbGate {
6
+    private int Id;
6 7
     private String mName;
7 8
     private String mAdres;
8 9
     private String mMaxT;
9 10
     private String mStatus;
11
+    private String mStat;
10 12
     private String mError;
13
+    private boolean mNoPing;
14
+    private boolean mActive;
15
+    private KfbMeasure mMeasure;
11 16
 
12
-    private ArrayList<KfbMeasure> mMeasure;
17
+    public String getmStat() {
18
+        return mStat;
19
+    }
20
+
21
+    public void setmStat(String mStat) {
22
+        this.mStat = mStat;
23
+    }
24
+
25
+    public boolean ismNoPing() {
26
+        return mNoPing;
27
+    }
28
+
29
+    public void setmNoPing(boolean mNoPing) {
30
+        this.mNoPing = mNoPing;
31
+    }
32
+
33
+    public boolean ismActive() {
34
+        return mActive;
35
+    }
36
+
37
+    public int getId() {
38
+        return Id;
39
+    }
40
+
41
+    public void setId(int id) {
42
+        Id = id;
43
+    }
44
+
45
+    public void setmActive(boolean mActive) {
46
+        this.mActive = mActive;
47
+    }
13 48
 
14 49
     public void setmName(String mName) {
15 50
         this.mName = mName;
@@ -23,7 +58,7 @@ public class KfbGate {
23 58
         return mAdres;
24 59
     }
25 60
 
26
-    public void setmMeasure(ArrayList<KfbMeasure> mMeasure) {
61
+    public void setmMeasure(KfbMeasure mMeasure) {
27 62
         this.mMeasure = mMeasure;
28 63
     }
29 64
 
@@ -31,13 +66,14 @@ public class KfbGate {
31 66
         return mName;
32 67
     }
33 68
 
34
-    public ArrayList<KfbMeasure> getmMeasure() {
69
+    public KfbMeasure getmMeasure() {
35 70
         return mMeasure;
36 71
     }
37 72
 
38 73
     public KfbGate()
39 74
     {
40
-        mMeasure = new ArrayList<KfbMeasure>();
75
+        mMeasure = new KfbMeasure();
76
+        mNoPing = true;
41 77
     }
42 78
 
43 79
     public void setmMaxT(String mMaxT) {

+ 129
- 13
app/src/main/java/com/kfb/kfbv1/model/KfbHttpRequest.java Visa fil

@@ -1,35 +1,44 @@
1 1
 package com.kfb.kfbv1.model;
2 2
 
3
-import android.content.Context;
4
-import android.os.AsyncTask;
3
+import android.os.Handler;
4
+import android.os.Message;
5 5
 import android.util.Log;
6
-import android.widget.Toast;
7 6
 
8 7
 import com.loopj.android.http.AsyncHttpClient;
9 8
 import com.loopj.android.http.AsyncHttpResponseHandler;
10
-import com.loopj.android.http.ResponseHandlerInterface;
9
+import com.loopj.android.http.HttpGet;
11 10
 import com.loopj.android.http.SyncHttpClient;
12 11
 
13
-import java.io.ByteArrayOutputStream;
14
-import java.io.EOFException;
12
+import java.io.BufferedReader;
15 13
 import java.io.IOException;
16
-import java.net.HttpURLConnection;
14
+import java.io.InputStream;
15
+import java.io.InputStreamReader;
16
+import java.net.InetAddress;
17
+import java.net.MalformedURLException;
17 18
 import java.net.URL;
18
-
19
-import javax.net.ssl.HttpsURLConnection;
19
+import java.net.UnknownHostException;
20 20
 
21 21
 import cz.msebera.android.httpclient.Header;
22
+import cz.msebera.android.httpclient.HttpEntity;
23
+import cz.msebera.android.httpclient.HttpResponse;
24
+import cz.msebera.android.httpclient.client.HttpClient;
25
+import cz.msebera.android.httpclient.impl.client.DefaultHttpClient;
26
+
22 27
 
23 28
 public class KfbHttpRequest {
24 29
     private  KfbGate mGate;
25
-    public  String outS;
26
-    private SyncHttpClient client;
30
+    static Handler handler = KfbModel.getData().handler;
31
+    public  static String outS;
32
+    private static String muri;
33
+    private static SyncHttpClient client;
34
+    private static AsyncHttpClient client1= new AsyncHttpClient();
27 35
 
28 36
     public String getTest(String aUrl)
29 37
     {
30 38
         client = new SyncHttpClient();
31 39
         try {
32 40
             String uri = aUrl;
41
+            muri = uri;
33 42
              client.get(uri, new AsyncHttpResponseHandler() {
34 43
                 @Override
35 44
                 public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
@@ -51,7 +60,14 @@ public class KfbHttpRequest {
51 60
                   // KfbModel.getData().textViewout.setText(outS);
52 61
 
53 62
                 }
54
-            });
63
+
64
+                 @Override
65
+                 public void onRetry(int retryNo) {
66
+                     super.onRetry(retryNo);
67
+                     KfbModel.getData().tekser =outS;
68
+                     KfbModel.getData().error = true;
69
+                 }
70
+             });
55 71
             return  outS;
56 72
         }catch (Exception e)
57 73
         {
@@ -59,18 +75,109 @@ public class KfbHttpRequest {
59 75
             return "";
60 76
         }
61 77
     }
78
+    public void checkIP(KfbGate aGate)
79
+    {
80
+        InetAddress in;
81
+        in = null;
82
+        // Definimos la ip de la cual haremos el ping
83
+        try {
84
+            URL u = new URL(aGate.getmAdres());
85
+
86
+            in = InetAddress.getByName(u.getHost());
87
+        } catch (UnknownHostException e) {
88
+            // TODO Auto-generated catch block
89
+            e.printStackTrace();
90
+        } catch (MalformedURLException e) {
91
+            e.printStackTrace();
92
+        }
93
+        // Definimos un tiempo en el cual ha de responder
94
+        try {
95
+            if (in.isReachable(500)) {
96
+            //    info.setText("Responde OK");
97
+                aGate.setmNoPing(false);
98
+            } else {
99
+                LogFile.appendLog("Blad polaczenia  "+ muri);
100
+                aGate.setmNoPing(true);
101
+            }
102
+        } catch (IOException e) {
103
+            // TODO Auto-generated catch block
104
+            aGate.setmNoPing(true);
105
+        }
106
+    }
107
+    public static void getRequest1(KfbGate aGate) {
108
+        HttpClient httpclient = new DefaultHttpClient();
109
+        String uri = aGate.getmAdres();
110
+        muri = uri;
111
+        HttpGet httpget = new HttpGet(muri);
112
+
113
+        // Execute the request
114
+        HttpResponse response;
115
+        try {
116
+            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
+            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
+            if (entity != null) {
126
+
127
+                // A Simple JSON Response Read
128
+                InputStream instream = entity.getContent();
129
+                String result= convertStreamToString(instream);
130
+                outS = result;
131
+                KfbModel.getData().tekser =outS;
132
+                KfbModel.getData().error = false;
133
+             //  LogFile.appendLog("Mam dane ");
134
+                instream.close();
135
+            }
136
+
137
+
138
+        } catch (Exception e) {}
139
+    }
140
+    private static String convertStreamToString(InputStream is) {
141
+        /*
142
+         * To convert the InputStream to String we use the BufferedReader.readLine()
143
+         * method. We iterate until the BufferedReader return null which means
144
+         * there's no more data to read. Each line will appended to a StringBuilder
145
+         * and returned as String.
146
+         */
147
+        BufferedReader reader = new BufferedReader(new InputStreamReader(is));
148
+        StringBuilder sb = new StringBuilder();
149
+
150
+        String line = null;
151
+        try {
152
+            while ((line = reader.readLine()) != null) {
153
+                sb.append(line + "\n");
154
+            }
155
+        } catch (IOException e) {
156
+            e.printStackTrace();
157
+        } finally {
158
+            try {
159
+                is.close();
160
+            } catch (IOException e) {
161
+                e.printStackTrace();
162
+            }
163
+        }
164
+        return sb.toString();
165
+    }
166
+
62 167
     public void getRequest(KfbGate aGate) {
63 168
         mGate = aGate;
64
-
169
+         LogFile.appendLog("Wykonuje polaczenie ");
65 170
         client = new SyncHttpClient();
66 171
         try {
67 172
             String uri = aGate.getmAdres();
173
+            muri = uri;
68 174
          client.get(uri, new AsyncHttpResponseHandler() {
69 175
              @Override
70 176
              public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
71 177
                  outS = new String(responseBody);
72 178
                  KfbModel.getData().tekser =outS;
73 179
                  KfbModel.getData().error = false;
180
+                 LogFile.appendLog("Mam dane ");
74 181
              }
75 182
 
76 183
              @Override
@@ -78,6 +185,15 @@ public class KfbHttpRequest {
78 185
                  outS = "ERROR"+ error.getMessage();
79 186
                  KfbModel.getData().tekser =outS;
80 187
                  KfbModel.getData().error = true;
188
+                 LogFile.appendLog("Blad polaczenia  "+ muri);
189
+             }
190
+             @Override
191
+             public void onRetry(int retryNo) {
192
+                 super.onRetry(retryNo);
193
+                 KfbModel.getData().tekser =outS;
194
+                 KfbModel.getData().error = true;
195
+                 LogFile.appendLog("Ponawiam  "+ retryNo);
196
+
81 197
              }
82 198
          });
83 199
 

+ 54
- 0
app/src/main/java/com/kfb/kfbv1/model/KfbKttpRequest2.java Visa fil

@@ -0,0 +1,54 @@
1
+package com.kfb.kfbv1.model;
2
+
3
+import android.os.AsyncTask;
4
+import android.os.Handler;
5
+import android.os.Message;
6
+
7
+import com.loopj.android.http.AsyncHttpClient;
8
+import com.loopj.android.http.AsyncHttpResponseHandler;
9
+import com.loopj.android.http.SyncHttpClient;
10
+
11
+import cz.msebera.android.httpclient.Header;
12
+
13
+public class KfbKttpRequest2 extends AsyncTask<KfbGate,Void,String> {
14
+    Handler handler = KfbModel.getData().handler;
15
+    KfbParser p = new KfbParser();
16
+    SyncHttpClient client = new SyncHttpClient();
17
+
18
+    @Override
19
+    protected String doInBackground(final KfbGate... g) {
20
+        client.get(g[0].getmAdres(), new AsyncHttpResponseHandler() {
21
+
22
+            @Override
23
+            public void onStart() {
24
+                // called before request is started
25
+            }
26
+
27
+            @Override
28
+            public void onSuccess(int statusCode, Header[] headers, byte[] response) {
29
+                g[0].setmError("");
30
+                int i = g[0].getId();
31
+                String outS = new String(response);
32
+                KfbModel.getData().tekser =outS;
33
+                p.dataParser(KfbModel.getData().tekser, KfbModel.getData().getGates().getmGate().get(i));
34
+                KfbModel.getData().getGates().getmGate().get(i).getmMeasure().CreateBitMap();
35
+                Message msg = handler.obtainMessage();
36
+                msg.what = 2;
37
+                msg.obj = "Pomiar";
38
+                msg.arg1 =  KfbModel.getData().getGates().getmGate().get(i).getId();
39
+                handler.sendMessage(msg);
40
+            }
41
+
42
+            @Override
43
+            public void onFailure(int statusCode, Header[] headers, byte[] errorResponse, Throwable e) {
44
+                // called when response HTTP status is "4XX" (eg. 401, 403, 404)
45
+            }
46
+
47
+            @Override
48
+            public void onRetry(int retryNo) {
49
+                // called when request is retried
50
+            }
51
+        });
52
+        return "";
53
+    }
54
+}

+ 60
- 1
app/src/main/java/com/kfb/kfbv1/model/KfbMeasure.java Visa fil

@@ -1,5 +1,64 @@
1 1
 package com.kfb.kfbv1.model;
2 2
 
3
+import android.graphics.Bitmap;
4
+import android.graphics.Matrix;
5
+
6
+import java.util.HashMap;
7
+
3 8
 public class KfbMeasure {
4
-    private float mTemp;
9
+    public float[] mTemp;
10
+    public int[] mTempI;
11
+    int width = 8;
12
+    int height = 8;
13
+    Bitmap bitmap;
14
+
15
+public KfbMeasure(){
16
+    mTemp = new float[64];
17
+    mTempI = new int[64];
18
+}
19
+
20
+private int mapingColor(float aTemp)
21
+{
22
+    if(aTemp > 45 )
23
+    {
24
+        return 0xFFFFFFFF; //czerwony
25
+    }
26
+    if(aTemp > 38 )
27
+    {
28
+        return 0xFFFF0000; //czerwony
29
+    }
30
+    if(aTemp < 25 )
31
+    {
32
+        return 0xFF000000;
33
+    }
34
+    String f = String.format("%.1f", aTemp);
35
+    return KfbModel.getData().getMapColor().getKolor(f);
36
+}
37
+
38
+public void CreateBitMap()
39
+{
40
+    for(int i = 0 ; i < 64; i++)
41
+    {
42
+        mTempI[i] = this.mapingColor(mTemp[i]);
43
+
44
+        //  mTempI[i] = 0xFFFFFF00;
45
+    }
46
+    bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
47
+    bitmap.setPixels(mTempI, 0, width, 0, 0, width, height);
48
+
49
+    float scaleWidth = ((float) 350) / width;
50
+    float scaleHeight = ((float) 350) / height;
51
+    Matrix matrix = new Matrix();
52
+    // RESIZE THE BIT MAP
53
+    matrix.postScale(scaleWidth, scaleHeight);
54
+
55
+    // "RECREATE" THE NEW BITMAP
56
+    Bitmap resizedBitmap = Bitmap.createBitmap(
57
+            bitmap, 0, 0, width, height, matrix, false);
58
+    bitmap.recycle();
59
+    bitmap = resizedBitmap;
60
+}
61
+public Bitmap getHist(){
62
+    return bitmap;
63
+}
5 64
 }

+ 13
- 1
app/src/main/java/com/kfb/kfbv1/model/KfbModel.java Visa fil

@@ -24,17 +24,20 @@ public class KfbModel {
24 24
     private KfbModel()
25 25
     {
26 26
         mGates = new KfbGates();
27
+        mMapColor = new KfbMapColor();
27 28
     }
28 29
     // data private
29 30
     private KfbGates mGates;
31
+    private KfbTablet mTablets;
30 32
     private MyItemRecyclerViewAdapter mAdapter;
33
+    private KfbMapColor mMapColor;
31 34
     // data
32 35
     public boolean sendHttp;
33 36
     public KfbProgrsBar progresBar;
34 37
     public String  tekser;
35 38
     public boolean error;
36 39
     public Handler handler;
37
- public String url;
40
+    public String url;
38 41
 
39 42
     public MyItemRecyclerViewAdapter getmAdapter() {
40 43
         return mAdapter;
@@ -47,4 +50,13 @@ public class KfbModel {
47 50
     public KfbGates getGates(){
48 51
         return mGates;
49 52
     }
53
+    public KfbTablet getTabletss(){
54
+        return mTablets;
55
+    }
56
+public void clear(){
57
+    mGates = new KfbGates();
58
+}
59
+    public KfbMapColor getMapColor(){
60
+        return mMapColor;
61
+    }
50 62
 }

+ 22
- 4
app/src/main/java/com/kfb/kfbv1/model/KfbParser.java Visa fil

@@ -4,11 +4,29 @@ public class KfbParser {
4 4
     public KfbGate dataParser(String aData,KfbGate aGate)
5 5
     {
6 6
         KfbGate k = aGate;
7
-        int p = aData.lastIndexOf("Tmax =");
8
-        p = p+6;
9
-        String t = aData.substring(p ,p+5);
10
-        k.setmMaxT(t);
7
+        int p  =0;
8
+        String[] aa =null;
9
+        float ff = 0;
10
+        KfbMeasure mm;
11 11
 
12
+        p = aData.lastIndexOf("Dane:");
13
+        p = p+5;
14
+        String t = aData.substring(p ,p+384);
15
+        aa = null;
16
+        aa = t.split(",");
17
+        for(int i=0;i<64;i++)
18
+        {
19
+            ff = Float.parseFloat(aa[i]);
20
+            k.getmMeasure().mTemp[i]=ff;
21
+        }
22
+        p = aData.lastIndexOf("Tmax:");
23
+        p = p+5;
24
+        t = aData.substring(p ,p+5);
25
+        k.setmMaxT(t);
26
+        p = aData.lastIndexOf("Stat:");
27
+        p = p+5;
28
+        t = aData.substring(p ,p+1);
29
+        k.setmStat(t);
12 30
         p = aData.lastIndexOf("status:");
13 31
         p=p+7;
14 32
         t = aData.substring(p ,p+6);

+ 31
- 0
app/src/main/java/com/kfb/kfbv1/model/KfbTablet.java Visa fil

@@ -0,0 +1,31 @@
1
+package com.kfb.kfbv1.model;
2
+
3
+import java.util.ArrayList;
4
+
5
+public class KfbTablet {
6
+    private int mSize;
7
+    private ArrayList<KfbGate> mGate;
8
+
9
+    public KfbTablet()
10
+    {
11
+        mGate = new ArrayList<KfbGate>();
12
+        mSize = 0;
13
+    }
14
+
15
+    public void AddTablet(KfbGate aGate){
16
+        mGate.add(aGate);
17
+        mSize++;
18
+    }
19
+
20
+    public void setmTablet(ArrayList<KfbGate> mGate) {
21
+        this.mGate = mGate;
22
+    }
23
+
24
+    public int getmSize() {
25
+        return mSize;
26
+    }
27
+
28
+    public ArrayList<KfbGate> getmGate() {
29
+        return mGate;
30
+    }
31
+}

+ 31
- 20
app/src/main/java/com/kfb/kfbv1/model/KfbTask.java Visa fil

@@ -16,9 +16,10 @@ public class KfbTask  implements Runnable {
16 16
         if(KfbModel.getData().tekser!=null)
17 17
         {
18 18
             KfbParser p = new KfbParser();
19
-           // if(KfbModel.getData().error==false) {
20
-          //      p.dataParser(KfbModel.getData().tekser, KfbModel.getData().getGates().getmGate().get(0));
21
-          //  }
19
+            if(KfbModel.getData().error==false) {
20
+                p.dataParser(KfbModel.getData().tekser, KfbModel.getData().getGates().getmGate().get(0));
21
+
22
+            }
22 23
             Message msg = handler.obtainMessage();
23 24
             msg.what = 1;
24 25
             msg.obj = "tekst";
@@ -30,25 +31,35 @@ public class KfbTask  implements Runnable {
30 31
         while(KfbModel.getData().sendHttp==true)
31 32
         {
32 33
             KfbParser p = new KfbParser();
34
+
33 35
             for (int i = 0 ;i<KfbModel.getData().getGates().getmSize();i++)
34 36
             {
35
-                HttpKfb.getRequest(KfbModel.getData().getGates().getmGate().get(i));
36
-                if(KfbModel.getData().error==false) {
37
-                    p.dataParser(KfbModel.getData().tekser, KfbModel.getData().getGates().getmGate().get(i));
38
-                    Message msg = handler.obtainMessage();
39
-                    msg.what = 2;
40
-                    msg.obj = "Pomiar";
41
-                    msg.arg1 = i;
42
-                    handler.sendMessage(msg);
43
-                }
44
-                else
45
-                {
46
-                    KfbModel.getData().getGates().getmGate().get(i).setmError("ERROR");
47
-                    Message msg = handler.obtainMessage();
48
-                    msg.what = 2;
49
-                    msg.obj = "Pomiar";
50
-                    msg.arg1 = i;
51
-                    handler.sendMessage(msg);
37
+                if(KfbModel.getData().getGates().getmGate().get(i).ismActive()==true) {
38
+                    if (KfbModel.getData().getGates().getmGate().get(i).ismNoPing() == true) {
39
+                        HttpKfb.checkIP(KfbModel.getData().getGates().getmGate().get(i));
40
+                    } else {
41
+                        HttpKfb.getRequest1(KfbModel.getData().getGates().getmGate().get(i));
42
+
43
+
44
+                        if (KfbModel.getData().error == false) {
45
+                            KfbModel.getData().getGates().getmGate().get(i).setmError("");
46
+                            p.dataParser(KfbModel.getData().tekser, KfbModel.getData().getGates().getmGate().get(i));
47
+                            KfbModel.getData().getGates().getmGate().get(i).getmMeasure().CreateBitMap();
48
+                            Message msg = handler.obtainMessage();
49
+                            msg.what = 2;
50
+                            msg.obj = "Pomiar";
51
+                            msg.arg1 =  KfbModel.getData().getGates().getmGate().get(i).getId();
52
+                            handler.sendMessage(msg);
53
+                        } else {
54
+                            KfbModel.getData().getGates().getmGate().get(i).setmNoPing(true);
55
+                            KfbModel.getData().getGates().getmGate().get(i).setmError("ERROR");
56
+                            Message msg = handler.obtainMessage();
57
+                            msg.what = 2;
58
+                            msg.obj = "Pomiar";
59
+                            msg.arg1 = KfbModel.getData().getGates().getmGate().get(i).getId();
60
+                            handler.sendMessage(msg);
61
+                        }
62
+                    }
52 63
                 }
53 64
             }
54 65
             try {

+ 1
- 0
app/src/main/java/com/kfb/kfbv1/model/LogFile.java Visa fil

@@ -32,6 +32,7 @@ public class LogFile {
32 32
             {
33 33
                 // TODO Auto-generated catch block
34 34
                 e.printStackTrace();
35
+
35 36
             }
36 37
         }
37 38
         try

+ 70
- 166
app/src/main/res/drawable/ic_launcher_background.xml Visa fil

@@ -1,170 +1,74 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
3
-    android:width="108dp"
2
+<vector
4 3
     android:height="108dp"
4
+    android:width="108dp"
5
+    android:viewportHeight="108"
5 6
     android:viewportWidth="108"
6
-    android:viewportHeight="108">
7
-    <path
8
-        android:fillColor="#3DDC84"
9
-        android:pathData="M0,0h108v108h-108z" />
10
-    <path
11
-        android:fillColor="#00000000"
12
-        android:pathData="M9,0L9,108"
13
-        android:strokeWidth="0.8"
14
-        android:strokeColor="#33FFFFFF" />
15
-    <path
16
-        android:fillColor="#00000000"
17
-        android:pathData="M19,0L19,108"
18
-        android:strokeWidth="0.8"
19
-        android:strokeColor="#33FFFFFF" />
20
-    <path
21
-        android:fillColor="#00000000"
22
-        android:pathData="M29,0L29,108"
23
-        android:strokeWidth="0.8"
24
-        android:strokeColor="#33FFFFFF" />
25
-    <path
26
-        android:fillColor="#00000000"
27
-        android:pathData="M39,0L39,108"
28
-        android:strokeWidth="0.8"
29
-        android:strokeColor="#33FFFFFF" />
30
-    <path
31
-        android:fillColor="#00000000"
32
-        android:pathData="M49,0L49,108"
33
-        android:strokeWidth="0.8"
34
-        android:strokeColor="#33FFFFFF" />
35
-    <path
36
-        android:fillColor="#00000000"
37
-        android:pathData="M59,0L59,108"
38
-        android:strokeWidth="0.8"
39
-        android:strokeColor="#33FFFFFF" />
40
-    <path
41
-        android:fillColor="#00000000"
42
-        android:pathData="M69,0L69,108"
43
-        android:strokeWidth="0.8"
44
-        android:strokeColor="#33FFFFFF" />
45
-    <path
46
-        android:fillColor="#00000000"
47
-        android:pathData="M79,0L79,108"
48
-        android:strokeWidth="0.8"
49
-        android:strokeColor="#33FFFFFF" />
50
-    <path
51
-        android:fillColor="#00000000"
52
-        android:pathData="M89,0L89,108"
53
-        android:strokeWidth="0.8"
54
-        android:strokeColor="#33FFFFFF" />
55
-    <path
56
-        android:fillColor="#00000000"
57
-        android:pathData="M99,0L99,108"
58
-        android:strokeWidth="0.8"
59
-        android:strokeColor="#33FFFFFF" />
60
-    <path
61
-        android:fillColor="#00000000"
62
-        android:pathData="M0,9L108,9"
63
-        android:strokeWidth="0.8"
64
-        android:strokeColor="#33FFFFFF" />
65
-    <path
66
-        android:fillColor="#00000000"
67
-        android:pathData="M0,19L108,19"
68
-        android:strokeWidth="0.8"
69
-        android:strokeColor="#33FFFFFF" />
70
-    <path
71
-        android:fillColor="#00000000"
72
-        android:pathData="M0,29L108,29"
73
-        android:strokeWidth="0.8"
74
-        android:strokeColor="#33FFFFFF" />
75
-    <path
76
-        android:fillColor="#00000000"
77
-        android:pathData="M0,39L108,39"
78
-        android:strokeWidth="0.8"
79
-        android:strokeColor="#33FFFFFF" />
80
-    <path
81
-        android:fillColor="#00000000"
82
-        android:pathData="M0,49L108,49"
83
-        android:strokeWidth="0.8"
84
-        android:strokeColor="#33FFFFFF" />
85
-    <path
86
-        android:fillColor="#00000000"
87
-        android:pathData="M0,59L108,59"
88
-        android:strokeWidth="0.8"
89
-        android:strokeColor="#33FFFFFF" />
90
-    <path
91
-        android:fillColor="#00000000"
92
-        android:pathData="M0,69L108,69"
93
-        android:strokeWidth="0.8"
94
-        android:strokeColor="#33FFFFFF" />
95
-    <path
96
-        android:fillColor="#00000000"
97
-        android:pathData="M0,79L108,79"
98
-        android:strokeWidth="0.8"
99
-        android:strokeColor="#33FFFFFF" />
100
-    <path
101
-        android:fillColor="#00000000"
102
-        android:pathData="M0,89L108,89"
103
-        android:strokeWidth="0.8"
104
-        android:strokeColor="#33FFFFFF" />
105
-    <path
106
-        android:fillColor="#00000000"
107
-        android:pathData="M0,99L108,99"
108
-        android:strokeWidth="0.8"
109
-        android:strokeColor="#33FFFFFF" />
110
-    <path
111
-        android:fillColor="#00000000"
112
-        android:pathData="M19,29L89,29"
113
-        android:strokeWidth="0.8"
114
-        android:strokeColor="#33FFFFFF" />
115
-    <path
116
-        android:fillColor="#00000000"
117
-        android:pathData="M19,39L89,39"
118
-        android:strokeWidth="0.8"
119
-        android:strokeColor="#33FFFFFF" />
120
-    <path
121
-        android:fillColor="#00000000"
122
-        android:pathData="M19,49L89,49"
123
-        android:strokeWidth="0.8"
124
-        android:strokeColor="#33FFFFFF" />
125
-    <path
126
-        android:fillColor="#00000000"
127
-        android:pathData="M19,59L89,59"
128
-        android:strokeWidth="0.8"
129
-        android:strokeColor="#33FFFFFF" />
130
-    <path
131
-        android:fillColor="#00000000"
132
-        android:pathData="M19,69L89,69"
133
-        android:strokeWidth="0.8"
134
-        android:strokeColor="#33FFFFFF" />
135
-    <path
136
-        android:fillColor="#00000000"
137
-        android:pathData="M19,79L89,79"
138
-        android:strokeWidth="0.8"
139
-        android:strokeColor="#33FFFFFF" />
140
-    <path
141
-        android:fillColor="#00000000"
142
-        android:pathData="M29,19L29,89"
143
-        android:strokeWidth="0.8"
144
-        android:strokeColor="#33FFFFFF" />
145
-    <path
146
-        android:fillColor="#00000000"
147
-        android:pathData="M39,19L39,89"
148
-        android:strokeWidth="0.8"
149
-        android:strokeColor="#33FFFFFF" />
150
-    <path
151
-        android:fillColor="#00000000"
152
-        android:pathData="M49,19L49,89"
153
-        android:strokeWidth="0.8"
154
-        android:strokeColor="#33FFFFFF" />
155
-    <path
156
-        android:fillColor="#00000000"
157
-        android:pathData="M59,19L59,89"
158
-        android:strokeWidth="0.8"
159
-        android:strokeColor="#33FFFFFF" />
160
-    <path
161
-        android:fillColor="#00000000"
162
-        android:pathData="M69,19L69,89"
163
-        android:strokeWidth="0.8"
164
-        android:strokeColor="#33FFFFFF" />
165
-    <path
166
-        android:fillColor="#00000000"
167
-        android:pathData="M79,19L79,89"
168
-        android:strokeWidth="0.8"
169
-        android:strokeColor="#33FFFFFF" />
7
+    xmlns:android="http://schemas.android.com/apk/res/android">
8
+    <path android:fillColor="#3DDC84"
9
+          android:pathData="M0,0h108v108h-108z"/>
10
+    <path android:fillColor="#00000000" android:pathData="M9,0L9,108"
11
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
12
+    <path android:fillColor="#00000000" android:pathData="M19,0L19,108"
13
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
14
+    <path android:fillColor="#00000000" android:pathData="M29,0L29,108"
15
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
16
+    <path android:fillColor="#00000000" android:pathData="M39,0L39,108"
17
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
18
+    <path android:fillColor="#00000000" android:pathData="M49,0L49,108"
19
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
20
+    <path android:fillColor="#00000000" android:pathData="M59,0L59,108"
21
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
22
+    <path android:fillColor="#00000000" android:pathData="M69,0L69,108"
23
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
24
+    <path android:fillColor="#00000000" android:pathData="M79,0L79,108"
25
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
26
+    <path android:fillColor="#00000000" android:pathData="M89,0L89,108"
27
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
28
+    <path android:fillColor="#00000000" android:pathData="M99,0L99,108"
29
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
30
+    <path android:fillColor="#00000000" android:pathData="M0,9L108,9"
31
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
32
+    <path android:fillColor="#00000000" android:pathData="M0,19L108,19"
33
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
34
+    <path android:fillColor="#00000000" android:pathData="M0,29L108,29"
35
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
36
+    <path android:fillColor="#00000000" android:pathData="M0,39L108,39"
37
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
38
+    <path android:fillColor="#00000000" android:pathData="M0,49L108,49"
39
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
40
+    <path android:fillColor="#00000000" android:pathData="M0,59L108,59"
41
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
42
+    <path android:fillColor="#00000000" android:pathData="M0,69L108,69"
43
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
44
+    <path android:fillColor="#00000000" android:pathData="M0,79L108,79"
45
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
46
+    <path android:fillColor="#00000000" android:pathData="M0,89L108,89"
47
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
48
+    <path android:fillColor="#00000000" android:pathData="M0,99L108,99"
49
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
50
+    <path android:fillColor="#00000000" android:pathData="M19,29L89,29"
51
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
52
+    <path android:fillColor="#00000000" android:pathData="M19,39L89,39"
53
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
54
+    <path android:fillColor="#00000000" android:pathData="M19,49L89,49"
55
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
56
+    <path android:fillColor="#00000000" android:pathData="M19,59L89,59"
57
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
58
+    <path android:fillColor="#00000000" android:pathData="M19,69L89,69"
59
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
60
+    <path android:fillColor="#00000000" android:pathData="M19,79L89,79"
61
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
62
+    <path android:fillColor="#00000000" android:pathData="M29,19L29,89"
63
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
64
+    <path android:fillColor="#00000000" android:pathData="M39,19L39,89"
65
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
66
+    <path android:fillColor="#00000000" android:pathData="M49,19L49,89"
67
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
68
+    <path android:fillColor="#00000000" android:pathData="M59,19L59,89"
69
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
70
+    <path android:fillColor="#00000000" android:pathData="M69,19L69,89"
71
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
72
+    <path android:fillColor="#00000000" android:pathData="M79,19L79,89"
73
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
170 74
 </vector>

+ 31
- 0
app/src/main/res/drawable/ic_launcher_doc.xml Visa fil

@@ -0,0 +1,31 @@
1
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
2
+    xmlns:aapt="http://schemas.android.com/aapt"
3
+    android:width="108dp"
4
+    android:height="108dp"
5
+    android:viewportWidth="108"
6
+    android:viewportHeight="108">
7
+    <path
8
+        android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
9
+        <aapt:attr name="android:fillColor">
10
+            <gradient
11
+                android:startY="49.59793"
12
+                android:startX="42.9492"
13
+                android:endY="92.4963"
14
+                android:endX="85.84757"
15
+                android:type="linear">
16
+                <item
17
+                    android:color="#44000000"
18
+                    android:offset="0.0" />
19
+                <item
20
+                    android:color="#00000000"
21
+                    android:offset="1.0" />
22
+            </gradient>
23
+        </aapt:attr>
24
+    </path>
25
+    <path
26
+        android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
27
+        android:fillColor="#FFFFFF"
28
+        android:fillType="nonZero"
29
+        android:strokeWidth="1"
30
+        android:strokeColor="#00000000"/>
31
+</vector>

+ 1
- 1
app/src/main/res/drawable/splash.xml Visa fil

@@ -3,5 +3,5 @@
3 3
     android:opacity="opaque"><item android:drawable="@android:color/holo_purple" /><item>
4 4
     <bitmap
5 5
         android:gravity="center"
6
-        android:src="@drawable/logo" />
6
+        android:src="@drawable/ekranstartowy" />
7 7
 </item></layer-list>

+ 202
- 0
app/src/main/res/layout/activity_config.xml Visa fil

@@ -0,0 +1,202 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<androidx.constraintlayout.widget.ConstraintLayout
3
+    xmlns:android="http://schemas.android.com/apk/res/android"
4
+    xmlns:app="http://schemas.android.com/apk/res-auto"
5
+    xmlns:tools="http://schemas.android.com/tools"
6
+    android:layout_width="match_parent"
7
+    android:layout_height="match_parent"
8
+    tools:context=".ConfigActivity">
9
+
10
+    <Switch
11
+        android:id="@+id/t3s"
12
+        android:layout_width="wrap_content"
13
+        android:layout_height="wrap_content"
14
+        android:layout_marginStart="16dp"
15
+        android:layout_marginTop="16dp"
16
+        android:text="Tab3"
17
+        app:layout_constraintStart_toStartOf="parent"
18
+        app:layout_constraintTop_toBottomOf="@+id/g3s" />
19
+
20
+    <ImageButton
21
+        android:id="@+id/back"
22
+        android:layout_width="wrap_content"
23
+        android:layout_height="wrap_content"
24
+        android:layout_marginStart="8dp"
25
+        android:layout_marginTop="5dp"
26
+        app:layout_constraintStart_toStartOf="parent"
27
+        app:layout_constraintTop_toTopOf="parent"
28
+        app:srcCompat="@android:drawable/ic_menu_revert" />
29
+
30
+    <Switch
31
+        android:id="@+id/g1s"
32
+        android:layout_width="wrap_content"
33
+        android:layout_height="wrap_content"
34
+        android:layout_marginStart="16dp"
35
+        android:layout_marginTop="108dp"
36
+        android:text="Gate1"
37
+        app:layout_constraintStart_toStartOf="parent"
38
+        app:layout_constraintTop_toTopOf="parent" />
39
+
40
+    <Switch
41
+        android:id="@+id/g2s"
42
+        android:layout_width="wrap_content"
43
+        android:layout_height="wrap_content"
44
+        android:layout_marginStart="16dp"
45
+        android:layout_marginTop="16dp"
46
+        android:text="Gate2"
47
+        app:layout_constraintStart_toStartOf="parent"
48
+        app:layout_constraintTop_toBottomOf="@+id/t1s" />
49
+
50
+    <Switch
51
+        android:id="@+id/g3s"
52
+        android:layout_width="wrap_content"
53
+        android:layout_height="wrap_content"
54
+        android:layout_marginStart="16dp"
55
+        android:layout_marginTop="10dp"
56
+        android:text="Gate3"
57
+        app:layout_constraintStart_toStartOf="parent"
58
+        app:layout_constraintTop_toBottomOf="@+id/t2s" />
59
+
60
+    <Switch
61
+        android:id="@+id/g4s"
62
+        android:layout_width="wrap_content"
63
+        android:layout_height="wrap_content"
64
+        android:layout_marginStart="16dp"
65
+        android:layout_marginTop="20dp"
66
+        android:text="Gate4"
67
+        app:layout_constraintStart_toStartOf="parent"
68
+        app:layout_constraintTop_toBottomOf="@+id/t3s" />
69
+
70
+    <Switch
71
+        android:id="@+id/t1s"
72
+        android:layout_width="wrap_content"
73
+        android:layout_height="wrap_content"
74
+        android:layout_marginStart="16dp"
75
+        android:layout_marginTop="10dp"
76
+        android:text="Tab1"
77
+        app:layout_constraintStart_toStartOf="parent"
78
+        app:layout_constraintTop_toBottomOf="@+id/g1s" />
79
+
80
+    <Switch
81
+        android:id="@+id/t2s"
82
+        android:layout_width="wrap_content"
83
+        android:layout_height="wrap_content"
84
+        android:layout_marginStart="16dp"
85
+        android:layout_marginTop="24dp"
86
+        android:text="Tab2"
87
+        app:layout_constraintStart_toStartOf="parent"
88
+        app:layout_constraintTop_toBottomOf="@+id/g2s" />
89
+
90
+    <Switch
91
+        android:id="@+id/t4s"
92
+        android:layout_width="wrap_content"
93
+        android:layout_height="wrap_content"
94
+        android:layout_marginStart="16dp"
95
+        android:layout_marginTop="24dp"
96
+        android:text="Tab4"
97
+        app:layout_constraintStart_toStartOf="parent"
98
+        app:layout_constraintTop_toBottomOf="@+id/g4s" />
99
+
100
+    <Button
101
+        android:id="@+id/idSave"
102
+        android:layout_width="wrap_content"
103
+        android:layout_height="wrap_content"
104
+        android:layout_marginStart="201dp"
105
+        android:layout_marginTop="469dp"
106
+        android:text="Zapisz"
107
+        app:layout_constraintStart_toStartOf="parent"
108
+        app:layout_constraintTop_toTopOf="parent" />
109
+
110
+    <EditText
111
+        android:id="@+id/g1t"
112
+        android:layout_width="292dp"
113
+        android:layout_height="43dp"
114
+        android:layout_marginStart="140dp"
115
+        android:layout_marginTop="91dp"
116
+        android:ems="10"
117
+        android:gravity="start|top"
118
+        android:inputType="textMultiLine"
119
+        app:layout_constraintStart_toStartOf="parent"
120
+        app:layout_constraintTop_toTopOf="parent" />
121
+
122
+    <EditText
123
+        android:id="@+id/t1t"
124
+        android:layout_width="292dp"
125
+        android:layout_height="44dp"
126
+        android:layout_marginStart="140dp"
127
+        android:ems="10"
128
+        android:gravity="start|top"
129
+        android:inputType="textMultiLine"
130
+        app:layout_constraintStart_toStartOf="parent"
131
+        app:layout_constraintTop_toBottomOf="@+id/g1t" />
132
+
133
+    <EditText
134
+        android:id="@+id/g2t"
135
+        android:layout_width="292dp"
136
+        android:layout_height="42dp"
137
+        android:layout_marginStart="140dp"
138
+        android:layout_marginTop="-1dp"
139
+        android:ems="10"
140
+        android:gravity="start|top"
141
+        android:inputType="textMultiLine"
142
+        app:layout_constraintStart_toStartOf="parent"
143
+        app:layout_constraintTop_toBottomOf="@+id/t1t" />
144
+
145
+    <EditText
146
+        android:id="@+id/t2t"
147
+        android:layout_width="292dp"
148
+        android:layout_height="42dp"
149
+        android:layout_marginStart="140dp"
150
+        android:layout_marginTop="-1dp"
151
+        android:ems="10"
152
+        android:gravity="start|top"
153
+        android:inputType="textMultiLine"
154
+        app:layout_constraintStart_toStartOf="parent"
155
+        app:layout_constraintTop_toBottomOf="@+id/g2t" />
156
+
157
+    <EditText
158
+        android:id="@+id/g3t"
159
+        android:layout_width="292dp"
160
+        android:layout_height="41dp"
161
+        android:layout_marginStart="140dp"
162
+        android:layout_marginTop="-1dp"
163
+        android:ems="10"
164
+        android:gravity="start|top"
165
+        android:inputType="textMultiLine"
166
+        app:layout_constraintStart_toStartOf="parent"
167
+        app:layout_constraintTop_toBottomOf="@+id/t2t" />
168
+
169
+    <EditText
170
+        android:id="@+id/t3t"
171
+        android:layout_width="292dp"
172
+        android:layout_height="wrap_content"
173
+        android:layout_marginStart="140dp"
174
+        android:ems="10"
175
+        android:gravity="start|top"
176
+        android:inputType="textMultiLine"
177
+        app:layout_constraintStart_toStartOf="parent"
178
+        app:layout_constraintTop_toBottomOf="@+id/g3t" />
179
+
180
+    <EditText
181
+        android:id="@+id/g4t"
182
+        android:layout_width="292dp"
183
+        android:layout_height="wrap_content"
184
+        android:layout_marginStart="140dp"
185
+        android:ems="10"
186
+        android:gravity="start|top"
187
+        android:inputType="textMultiLine"
188
+        app:layout_constraintStart_toStartOf="parent"
189
+        app:layout_constraintTop_toBottomOf="@+id/t3t" />
190
+
191
+    <EditText
192
+        android:id="@+id/t4t"
193
+        android:layout_width="292dp"
194
+        android:layout_height="wrap_content"
195
+        android:layout_marginStart="140dp"
196
+        android:ems="10"
197
+        android:gravity="start|top"
198
+        android:inputType="textMultiLine"
199
+        app:layout_constraintStart_toStartOf="parent"
200
+        app:layout_constraintTop_toBottomOf="@+id/g4t" />
201
+
202
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 7
- 0
app/src/main/res/layout/activity_gate.xml Visa fil

@@ -6,10 +6,17 @@
6 6
     android:layout_height="match_parent"
7 7
     tools:context=".GateActivity">
8 8
 
9
+    <include
10
+        android:id="@+id/toolbar"
11
+        layout="@layout/toolbar"
12
+        app:layout_constraintStart_toStartOf="parent"
13
+        app:layout_constraintTop_toTopOf="parent" />
14
+
9 15
     <androidx.recyclerview.widget.RecyclerView
10 16
         android:id="@+id/recview"
11 17
         android:layout_width="598dp"
12 18
         android:layout_height="1022dp"
19
+        android:layout_marginTop="65dp"
13 20
         app:layout_constraintStart_toStartOf="parent"
14 21
         app:layout_constraintTop_toTopOf="parent" />
15 22
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 7
- 2
app/src/main/res/layout/activity_main.xml Visa fil

@@ -81,6 +81,7 @@
81 81
         android:layout_marginStart="36dp"
82 82
         android:layout_marginTop="207dp"
83 83
         android:text="Adres"
84
+        android:visibility="invisible"
84 85
         app:layout_constraintStart_toStartOf="parent"
85 86
         app:layout_constraintTop_toBottomOf="@+id/textView2" />
86 87
 
@@ -92,7 +93,8 @@
92 93
         android:layout_marginTop="115dp"
93 94
         android:ems="10"
94 95
         android:inputType="textPersonName"
95
-        android:text="http://"
96
+        android:text="http://p.sorveno.com/pp.html"
97
+        android:visibility="invisible"
96 98
         app:layout_constraintStart_toEndOf="@+id/textView3"
97 99
         app:layout_constraintTop_toBottomOf="@+id/login" />
98 100
 
@@ -105,6 +107,7 @@
105 107
         android:ems="10"
106 108
         android:gravity="start|top"
107 109
         android:inputType="textMultiLine"
110
+        android:visibility="invisible"
108 111
         app:layout_constraintStart_toStartOf="parent"
109 112
         app:layout_constraintTop_toBottomOf="@+id/editText" />
110 113
 
@@ -115,8 +118,10 @@
115 118
         android:layout_marginStart="456dp"
116 119
         android:layout_marginTop="37dp"
117 120
         android:text="Wykonaj"
121
+        android:visibility="invisible"
118 122
         app:layout_constraintStart_toStartOf="parent"
119
-        app:layout_constraintTop_toBottomOf="@+id/editText4" />
123
+        app:layout_constraintTop_toBottomOf="@+id/editText4"
124
+        tools:visibility="invisible" />
120 125
 
121 126
 
122 127
 

+ 37
- 7
app/src/main/res/layout/fragment_item.xml Visa fil

@@ -41,11 +41,13 @@
41 41
             app:layout_constraintTop_toTopOf="parent" />
42 42
 
43 43
         <ImageView
44
-            android:id="@+id/imageView7"
44
+            android:id="@+id/imgHis"
45 45
             android:layout_width="150dp"
46 46
             android:layout_height="199dp"
47 47
             android:layout_marginStart="64dp"
48
+            android:adjustViewBounds="true"
48 49
             android:contentDescription=" "
50
+            android:scaleType="centerInside"
49 51
             android:visibility="visible"
50 52
             app:layout_constraintStart_toEndOf="@+id/idTemperatura"
51 53
             app:layout_constraintTop_toTopOf="parent"
@@ -69,7 +71,7 @@
69 71
             android:layout_height="wrap_content"
70 72
             android:layout_marginStart="26dp"
71 73
             android:layout_marginTop="27dp"
72
-            android:text="Step 1"
74
+            android:text="Stan"
73 75
             app:layout_constraintStart_toStartOf="parent"
74 76
             app:layout_constraintTop_toBottomOf="@+id/idState" />
75 77
 
@@ -80,8 +82,10 @@
80 82
             android:layout_marginStart="26dp"
81 83
             android:layout_marginTop="10dp"
82 84
             android:text="Step 2"
85
+            android:visibility="invisible"
83 86
             app:layout_constraintStart_toStartOf="parent"
84
-            app:layout_constraintTop_toBottomOf="@+id/textView27" />
87
+            app:layout_constraintTop_toBottomOf="@+id/textView27"
88
+            tools:visibility="invisible" />
85 89
 
86 90
         <TextView
87 91
             android:id="@+id/textView29"
@@ -90,6 +94,7 @@
90 94
             android:layout_marginStart="26dp"
91 95
             android:layout_marginTop="10dp"
92 96
             android:text="Step 3"
97
+            android:visibility="invisible"
93 98
             app:layout_constraintStart_toStartOf="parent"
94 99
             app:layout_constraintTop_toBottomOf="@+id/textView28" />
95 100
 
@@ -99,32 +104,36 @@
99 104
             android:layout_height="30dp"
100 105
             android:layout_marginStart="148dp"
101 106
             android:layout_marginTop="52dp"
102
-            android:visibility="visible"
107
+            android:visibility="invisible"
103 108
             app:layout_constraintStart_toStartOf="parent"
104 109
             app:layout_constraintTop_toBottomOf="@+id/textView24"
105 110
             app:srcCompat="@drawable/emot"
106 111
             tools:srcCompat="@tools:sample/avatars"
107
-            tools:visibility="visible" />
112
+            tools:visibility="invisible" />
108 113
 
109 114
         <ImageView
110 115
             android:id="@+id/imageView9"
111 116
             android:layout_width="31dp"
112 117
             android:layout_height="30dp"
113 118
             android:layout_marginStart="148dp"
119
+            android:visibility="invisible"
114 120
             app:layout_constraintStart_toStartOf="parent"
115 121
             app:layout_constraintTop_toBottomOf="@+id/imageView10"
116 122
             app:srcCompat="@drawable/emot"
117
-            tools:srcCompat="@tools:sample/avatars" />
123
+            tools:srcCompat="@tools:sample/avatars"
124
+            tools:visibility="invisible" />
118 125
 
119 126
         <ImageView
120 127
             android:id="@+id/imageView10"
121 128
             android:layout_width="31dp"
122 129
             android:layout_height="30dp"
123 130
             android:layout_marginStart="148dp"
131
+            android:visibility="invisible"
124 132
             app:layout_constraintStart_toStartOf="parent"
125 133
             app:layout_constraintTop_toBottomOf="@+id/imageView8"
126 134
             app:srcCompat="@drawable/emot"
127
-            tools:srcCompat="@tools:sample/avatars" />
135
+            tools:srcCompat="@tools:sample/avatars"
136
+            tools:visibility="invisible" />
128 137
 
129 138
         <TextView
130 139
             android:id="@+id/idTemperatura"
@@ -166,6 +175,27 @@
166 175
             android:text="Error"
167 176
             app:layout_constraintStart_toEndOf="@+id/idStatus"
168 177
             app:layout_constraintTop_toTopOf="parent" />
178
+
179
+        <TextView
180
+            android:id="@+id/idOK"
181
+            android:layout_width="63dp"
182
+            android:layout_height="22dp"
183
+            android:layout_marginStart="72dp"
184
+            android:layout_marginTop="88dp"
185
+            app:layout_constraintStart_toStartOf="parent"
186
+            app:layout_constraintTop_toTopOf="parent" />
187
+
188
+        <ToggleButton
189
+            android:id="@+id/mikrofon"
190
+            android:layout_width="wrap_content"
191
+            android:layout_height="wrap_content"
192
+            android:layout_marginStart="200dp"
193
+            android:layout_marginTop="145dp"
194
+            android:button="@android:drawable/ic_btn_speak_now"
195
+            android:text="ToggleButton"
196
+            android:textOff="OFF"
197
+            app:layout_constraintStart_toStartOf="parent"
198
+            app:layout_constraintTop_toTopOf="parent" />
169 199
     </androidx.constraintlayout.widget.ConstraintLayout>
170 200
 
171 201
 </LinearLayout>

+ 14
- 0
app/src/main/res/layout/toolbar.xml Visa fil

@@ -0,0 +1,14 @@
1
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
+    xmlns:app="http://schemas.android.com/apk/res-auto"
3
+    android:layout_width="match_parent"
4
+    android:layout_height="match_parent"
5
+    android:fitsSystemWindows="true"
6
+    android:orientation="vertical">
7
+
8
+    <ImageButton
9
+        android:id="@+id/idConfig"
10
+        android:layout_width="wrap_content"
11
+        android:layout_height="wrap_content"
12
+        android:layout_gravity="right"
13
+        app:srcCompat="@android:drawable/ic_menu_preferences" />
14
+</LinearLayout>

+ 2
- 2
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml Visa fil

@@ -1,5 +1,5 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2 2
 <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3
-    <background android:drawable="@drawable/ic_launcher_background" />
4
-    <foreground android:drawable="@drawable/ic_launcher_foreground" />
3
+    <background android:drawable="@drawable/ic_launcher_background"/>
4
+    <foreground android:drawable="@drawable/ic_launcher_foreground"/>
5 5
 </adaptive-icon>

+ 2
- 2
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml Visa fil

@@ -1,5 +1,5 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2 2
 <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3
-    <background android:drawable="@drawable/ic_launcher_background" />
4
-    <foreground android:drawable="@drawable/ic_launcher_foreground" />
3
+    <background android:drawable="@drawable/ic_launcher_background"/>
4
+    <foreground android:drawable="@drawable/ic_launcher_foreground"/>
5 5
 </adaptive-icon>

Binär
app/src/main/res/mipmap-hdpi/ic_launcher.png Visa fil


Binär
app/src/main/res/mipmap-hdpi/ic_launcher_round.png Visa fil


Binär
app/src/main/res/mipmap-mdpi/ic_launcher.png Visa fil


Binär
app/src/main/res/mipmap-mdpi/ic_launcher_round.png Visa fil


Binär
app/src/main/res/mipmap-xhdpi/ic_launcher.png Visa fil


Binär
app/src/main/res/mipmap-xhdpi/ic_launcher_round.png Visa fil


Binär
app/src/main/res/mipmap-xxhdpi/ic_launcher.png Visa fil


Binär
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png Visa fil


Binär
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png Visa fil


Binär
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png Visa fil


+ 1
- 1
app/src/main/res/values/styles.xml Visa fil

@@ -1,7 +1,7 @@
1 1
 <resources>
2 2
 
3 3
     <!-- Base application theme. -->
4
-    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
4
+    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
5 5
         <!-- Customize your theme here. -->
6 6
         <item name="colorPrimary">@color/colorPrimary</item>
7 7
         <item name="colorPrimaryDark">@color/colorPrimaryDark</item>