waldek 5 年前
父节点
当前提交
6f8060d964
共有 68 个文件被更改,包括 62075 次插入0 次删除
  1. 14
    0
      .gitignore
  2. 116
    0
      .idea/codeStyles/Project.xml
  3. 20
    0
      .idea/gradle.xml
  4. 9
    0
      .idea/misc.xml
  5. 12
    0
      .idea/runConfigurations.xml
  6. 6
    0
      .idea/vcs.xml
  7. 1
    0
      app/.gitignore
  8. 37
    0
      app/build.gradle
  9. 二进制
      app/debug/app-debug.apk
  10. 1
    0
      app/debug/output.json
  11. 21
    0
      app/proguard-rules.pro
  12. 27
    0
      app/src/androidTest/java/com/kfb/kfbv1/ExampleInstrumentedTest.java
  13. 35
    0
      app/src/main/AndroidManifest.xml
  14. 85
    0
      app/src/main/java/com/kfb/kfbv1/GateActivity.java
  15. 101
    0
      app/src/main/java/com/kfb/kfbv1/ItemFragment.java
  16. 49
    0
      app/src/main/java/com/kfb/kfbv1/KfbProgrsBar.java
  17. 63
    0
      app/src/main/java/com/kfb/kfbv1/MyAcessPoint.java
  18. 86
    0
      app/src/main/java/com/kfb/kfbv1/MyItemRecyclerViewAdapter.java
  19. 29
    0
      app/src/main/java/com/kfb/kfbv1/SplashActivity.java
  20. 85
    0
      app/src/main/java/com/kfb/kfbv1/dummy/DummyContent.java
  21. 48
    0
      app/src/main/java/com/kfb/kfbv1/hotspot/ClientScanResult.java
  22. 11
    0
      app/src/main/java/com/kfb/kfbv1/hotspot/FinishScanListener.java
  23. 5
    0
      app/src/main/java/com/kfb/kfbv1/hotspot/WIFI_AP_STATE.java
  24. 215
    0
      app/src/main/java/com/kfb/kfbv1/hotspot/WifiApManager.java
  25. 66
    0
      app/src/main/java/com/kfb/kfbv1/model/KfbGate.java
  26. 31
    0
      app/src/main/java/com/kfb/kfbv1/model/KfbGates.java
  27. 92
    0
      app/src/main/java/com/kfb/kfbv1/model/KfbHttpRequest.java
  28. 5
    0
      app/src/main/java/com/kfb/kfbv1/model/KfbMeasure.java
  29. 50
    0
      app/src/main/java/com/kfb/kfbv1/model/KfbModel.java
  30. 18
    0
      app/src/main/java/com/kfb/kfbv1/model/KfbParser.java
  31. 61
    0
      app/src/main/java/com/kfb/kfbv1/model/KfbTask.java
  32. 8
    0
      app/src/main/res/drawable-v24/circle_shape.xml
  33. 17
    0
      app/src/main/res/drawable-v24/circular_progress_bar.xml
  34. 30
    0
      app/src/main/res/drawable-v24/ic_launcher_foreground.xml
  35. 二进制
      app/src/main/res/drawable/emot.png
  36. 170
    0
      app/src/main/res/drawable/ic_launcher_background.xml
  37. 二进制
      app/src/main/res/drawable/logo.png
  38. 二进制
      app/src/main/res/drawable/pp.png
  39. 7
    0
      app/src/main/res/drawable/splash.xml
  40. 15
    0
      app/src/main/res/layout/activity_gate.xml
  41. 123
    0
      app/src/main/res/layout/activity_main.xml
  42. 171
    0
      app/src/main/res/layout/fragment_item.xml
  43. 13
    0
      app/src/main/res/layout/fragment_item_list.xml
  44. 30
    0
      app/src/main/res/layout/progres.xml
  45. 5
    0
      app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  46. 5
    0
      app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  47. 二进制
      app/src/main/res/mipmap-hdpi/ic_launcher.png
  48. 二进制
      app/src/main/res/mipmap-hdpi/ic_launcher_round.png
  49. 二进制
      app/src/main/res/mipmap-mdpi/ic_launcher.png
  50. 二进制
      app/src/main/res/mipmap-mdpi/ic_launcher_round.png
  51. 二进制
      app/src/main/res/mipmap-xhdpi/ic_launcher.png
  52. 二进制
      app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  53. 二进制
      app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  54. 二进制
      app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
  55. 二进制
      app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  56. 二进制
      app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
  57. 6
    0
      app/src/main/res/values/colors.xml
  58. 3
    0
      app/src/main/res/values/strings.xml
  59. 21
    0
      app/src/main/res/values/styles.xml
  60. 17
    0
      app/src/test/java/com/kfb/kfbv1/ExampleUnitTest.java
  61. 29
    0
      build.gradle
  62. 20
    0
      gradle.properties
  63. 二进制
      gradle/wrapper/gradle-wrapper.jar
  64. 6
    0
      gradle/wrapper/gradle-wrapper.properties
  65. 172
    0
      gradlew
  66. 84
    0
      gradlew.bat
  67. 2
    0
      settings.gradle
  68. 59722
    0
      test.patch

+ 14
- 0
.gitignore 查看文件

1
+*.iml
2
+.gradle
3
+/local.properties
4
+/.idea/caches
5
+/.idea/libraries
6
+/.idea/modules.xml
7
+/.idea/workspace.xml
8
+/.idea/navEditor.xml
9
+/.idea/assetWizardSettings.xml
10
+.DS_Store
11
+/build
12
+/captures
13
+.externalNativeBuild
14
+.cxx

+ 116
- 0
.idea/codeStyles/Project.xml 查看文件

1
+<component name="ProjectCodeStyleConfiguration">
2
+  <code_scheme name="Project" version="173">
3
+    <codeStyleSettings language="XML">
4
+      <indentOptions>
5
+        <option name="CONTINUATION_INDENT_SIZE" value="4" />
6
+      </indentOptions>
7
+      <arrangement>
8
+        <rules>
9
+          <section>
10
+            <rule>
11
+              <match>
12
+                <AND>
13
+                  <NAME>xmlns:android</NAME>
14
+                  <XML_ATTRIBUTE />
15
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
16
+                </AND>
17
+              </match>
18
+            </rule>
19
+          </section>
20
+          <section>
21
+            <rule>
22
+              <match>
23
+                <AND>
24
+                  <NAME>xmlns:.*</NAME>
25
+                  <XML_ATTRIBUTE />
26
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
27
+                </AND>
28
+              </match>
29
+              <order>BY_NAME</order>
30
+            </rule>
31
+          </section>
32
+          <section>
33
+            <rule>
34
+              <match>
35
+                <AND>
36
+                  <NAME>.*:id</NAME>
37
+                  <XML_ATTRIBUTE />
38
+                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
39
+                </AND>
40
+              </match>
41
+            </rule>
42
+          </section>
43
+          <section>
44
+            <rule>
45
+              <match>
46
+                <AND>
47
+                  <NAME>.*:name</NAME>
48
+                  <XML_ATTRIBUTE />
49
+                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
50
+                </AND>
51
+              </match>
52
+            </rule>
53
+          </section>
54
+          <section>
55
+            <rule>
56
+              <match>
57
+                <AND>
58
+                  <NAME>name</NAME>
59
+                  <XML_ATTRIBUTE />
60
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
61
+                </AND>
62
+              </match>
63
+            </rule>
64
+          </section>
65
+          <section>
66
+            <rule>
67
+              <match>
68
+                <AND>
69
+                  <NAME>style</NAME>
70
+                  <XML_ATTRIBUTE />
71
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
72
+                </AND>
73
+              </match>
74
+            </rule>
75
+          </section>
76
+          <section>
77
+            <rule>
78
+              <match>
79
+                <AND>
80
+                  <NAME>.*</NAME>
81
+                  <XML_ATTRIBUTE />
82
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
83
+                </AND>
84
+              </match>
85
+              <order>BY_NAME</order>
86
+            </rule>
87
+          </section>
88
+          <section>
89
+            <rule>
90
+              <match>
91
+                <AND>
92
+                  <NAME>.*</NAME>
93
+                  <XML_ATTRIBUTE />
94
+                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
95
+                </AND>
96
+              </match>
97
+              <order>ANDROID_ATTRIBUTE_ORDER</order>
98
+            </rule>
99
+          </section>
100
+          <section>
101
+            <rule>
102
+              <match>
103
+                <AND>
104
+                  <NAME>.*</NAME>
105
+                  <XML_ATTRIBUTE />
106
+                  <XML_NAMESPACE>.*</XML_NAMESPACE>
107
+                </AND>
108
+              </match>
109
+              <order>BY_NAME</order>
110
+            </rule>
111
+          </section>
112
+        </rules>
113
+      </arrangement>
114
+    </codeStyleSettings>
115
+  </code_scheme>
116
+</component>

+ 20
- 0
.idea/gradle.xml 查看文件

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="GradleMigrationSettings" migrationVersion="1" />
4
+  <component name="GradleSettings">
5
+    <option name="linkedExternalProjectsSettings">
6
+      <GradleProjectSettings>
7
+        <option name="testRunner" value="PLATFORM" />
8
+        <option name="distributionType" value="DEFAULT_WRAPPED" />
9
+        <option name="externalProjectPath" value="$PROJECT_DIR$" />
10
+        <option name="modules">
11
+          <set>
12
+            <option value="$PROJECT_DIR$" />
13
+            <option value="$PROJECT_DIR$/app" />
14
+          </set>
15
+        </option>
16
+        <option name="resolveModulePerSourceSet" value="false" />
17
+      </GradleProjectSettings>
18
+    </option>
19
+  </component>
20
+</project>

+ 9
- 0
.idea/misc.xml 查看文件

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

+ 12
- 0
.idea/runConfigurations.xml 查看文件

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="RunConfigurationProducerService">
4
+    <option name="ignoredProducers">
5
+      <set>
6
+        <option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
7
+        <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
8
+        <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
9
+      </set>
10
+    </option>
11
+  </component>
12
+</project>

+ 6
- 0
.idea/vcs.xml 查看文件

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="VcsDirectoryMappings">
4
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+  </component>
6
+</project>

+ 1
- 0
app/.gitignore 查看文件

1
+/build

+ 37
- 0
app/build.gradle 查看文件

1
+apply plugin: 'com.android.application'
2
+
3
+android {
4
+    compileSdkVersion 29
5
+    buildToolsVersion "29.0.3"
6
+
7
+    defaultConfig {
8
+        applicationId "com.kfb.kfbv1"
9
+        minSdkVersion 26
10
+        targetSdkVersion 29
11
+        versionCode 1
12
+        versionName "1.0"
13
+
14
+        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
15
+    }
16
+
17
+    buildTypes {
18
+        release {
19
+            minifyEnabled false
20
+            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21
+        }
22
+    }
23
+
24
+}
25
+
26
+dependencies {
27
+    implementation fileTree(dir: 'libs', include: ['*.jar'])
28
+
29
+    implementation 'com.loopj.android:android-async-http:1.4.9'
30
+
31
+    implementation 'androidx.appcompat:appcompat:1.1.0'
32
+    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
33
+    testImplementation 'junit:junit:4.12'
34
+    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
35
+    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
36
+    implementation 'androidx.recyclerview:recyclerview:1.1.0'
37
+}

二进制
app/debug/app-debug.apk 查看文件


+ 1
- 0
app/debug/output.json 查看文件

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":{}}]

+ 21
- 0
app/proguard-rules.pro 查看文件

1
+# Add project specific ProGuard rules here.
2
+# You can control the set of applied configuration files using the
3
+# proguardFiles setting in build.gradle.
4
+#
5
+# For more details, see
6
+#   http://developer.android.com/guide/developing/tools/proguard.html
7
+
8
+# If your project uses WebView with JS, uncomment the following
9
+# and specify the fully qualified class name to the JavaScript interface
10
+# class:
11
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12
+#   public *;
13
+#}
14
+
15
+# Uncomment this to preserve the line number information for
16
+# debugging stack traces.
17
+#-keepattributes SourceFile,LineNumberTable
18
+
19
+# If you keep the line number information, uncomment this to
20
+# hide the original source file name.
21
+#-renamesourcefileattribute SourceFile

+ 27
- 0
app/src/androidTest/java/com/kfb/kfbv1/ExampleInstrumentedTest.java 查看文件

1
+package com.kfb.kfbv1;
2
+
3
+import android.content.Context;
4
+
5
+import androidx.test.platform.app.InstrumentationRegistry;
6
+import androidx.test.ext.junit.runners.AndroidJUnit4;
7
+
8
+import org.junit.Test;
9
+import org.junit.runner.RunWith;
10
+
11
+import static org.junit.Assert.*;
12
+
13
+/**
14
+ * Instrumented test, which will execute on an Android device.
15
+ *
16
+ * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
17
+ */
18
+@RunWith(AndroidJUnit4.class)
19
+public class ExampleInstrumentedTest {
20
+    @Test
21
+    public void useAppContext() {
22
+        // Context of the app under test.
23
+        Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24
+
25
+        assertEquals("com.kfb.kfbv1", appContext.getPackageName());
26
+    }
27
+}

+ 35
- 0
app/src/main/AndroidManifest.xml 查看文件

1
+<?xml version="1.0" encoding="utf-8"?>
2
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+    xmlns:tools="http://schemas.android.com/tools"
4
+    package="com.kfb.kfbv1">
5
+    <uses-permission android:name="android.permission.INTERNET" />
6
+    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
7
+    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
8
+    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
9
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
10
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
11
+    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
12
+    <uses-permission android:name="android.permission.WRITE_SETTINGS"
13
+        tools:ignore="ProtectedPermissions" />
14
+
15
+    <application
16
+        android:allowBackup="true"
17
+        android:icon="@mipmap/ic_launcher"
18
+        android:label="@string/app_name"
19
+        android:roundIcon="@mipmap/ic_launcher_round"
20
+        android:supportsRtl="true"
21
+        android:theme="@style/AppTheme">
22
+        <activity
23
+            android:name=".SplashActivity"
24
+            android:theme="@style/SplashScreenTheme">
25
+            <intent-filter>
26
+                <action android:name="android.intent.action.MAIN" />
27
+
28
+                <category android:name="android.intent.category.LAUNCHER" />
29
+            </intent-filter>
30
+        </activity>
31
+        <activity android:name=".MainActivity" android:noHistory="true"></activity>
32
+        <activity android:name=".GateActivity" android:noHistory="true"></activity>
33
+    </application>
34
+
35
+</manifest>

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

1
+package com.kfb.kfbv1;
2
+
3
+import android.os.Bundle;
4
+import android.os.Handler;
5
+import android.os.Message;
6
+import android.view.WindowManager;
7
+import android.widget.TextView;
8
+
9
+import androidx.appcompat.app.AppCompatActivity;
10
+import androidx.recyclerview.widget.LinearLayoutManager;
11
+import androidx.recyclerview.widget.RecyclerView;
12
+
13
+import com.kfb.kfbv1.dummy.DummyContent;
14
+
15
+import com.kfb.kfbv1.model.KfbGate;
16
+import com.kfb.kfbv1.model.KfbHttpRequest;
17
+import com.kfb.kfbv1.model.KfbModel;
18
+import com.kfb.kfbv1.model.KfbTask;
19
+
20
+import java.util.ArrayList;
21
+import java.util.List;
22
+
23
+public class GateActivity  extends AppCompatActivity
24
+{
25
+    private MyItemRecyclerViewAdapter listAdapter;
26
+    private List<DummyContent.DummyItem> ld1 = new ArrayList<DummyContent.DummyItem>() ;
27
+    private RecyclerView recycler;
28
+    private RecyclerView.LayoutManager layoutManager;
29
+    private final Handler handler = new Handler(){
30
+        @Override
31
+        public void handleMessage(Message msg) {
32
+            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();
38
+            }
39
+            super.handleMessage(msg);
40
+        }
41
+    };
42
+    @Override
43
+    protected void onCreate(Bundle savedInstanceState) {
44
+        super.onCreate(savedInstanceState);
45
+        setContentView(R.layout.activity_gate);
46
+        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
47
+
48
+        recycler = findViewById(R.id.recview);
49
+        recycler.setHasFixedSize(true);
50
+        layoutManager = new LinearLayoutManager(this);
51
+        recycler.setLayoutManager(layoutManager);
52
+
53
+
54
+        listAdapter = new MyItemRecyclerViewAdapter( ld1,null);
55
+        recycler.setAdapter(listAdapter);
56
+
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
+    }
76
+
77
+    private void StartMes(){
78
+        KfbModel.getData().sendHttp= true;
79
+        KfbTask tr = new KfbTask();
80
+        Thread T1 = new Thread(tr);
81
+        T1.start();
82
+    }
83
+
84
+
85
+}

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

1
+package com.kfb.kfbv1;
2
+
3
+import android.content.Context;
4
+import android.os.Bundle;
5
+import android.view.LayoutInflater;
6
+import android.view.View;
7
+import android.view.ViewGroup;
8
+
9
+import androidx.fragment.app.Fragment;
10
+import androidx.recyclerview.widget.GridLayoutManager;
11
+import androidx.recyclerview.widget.LinearLayoutManager;
12
+import androidx.recyclerview.widget.RecyclerView;
13
+
14
+import com.kfb.kfbv1.dummy.DummyContent;
15
+
16
+public class ItemFragment extends Fragment {
17
+
18
+    // TODO: Customize parameter argument names
19
+    private static final String ARG_COLUMN_COUNT = "column-count";
20
+    // TODO: Customize parameters
21
+    private int mColumnCount = 1;
22
+    private OnListFragmentInteractionListener mListener;
23
+
24
+    /**
25
+     * Mandatory empty constructor for the fragment manager to instantiate the
26
+     * fragment (e.g. upon screen orientation changes).
27
+     */
28
+    public ItemFragment() {
29
+    }
30
+
31
+    // TODO: Customize parameter initialization
32
+    @SuppressWarnings("unused")
33
+    public static ItemFragment newInstance(int columnCount) {
34
+        ItemFragment fragment = new ItemFragment();
35
+        Bundle args = new Bundle();
36
+        args.putInt(ARG_COLUMN_COUNT, columnCount);
37
+        fragment.setArguments(args);
38
+        return fragment;
39
+    }
40
+
41
+    @Override
42
+    public void onCreate(Bundle savedInstanceState) {
43
+        super.onCreate(savedInstanceState);
44
+
45
+        if (getArguments() != null) {
46
+            mColumnCount = getArguments().getInt(ARG_COLUMN_COUNT);
47
+        }
48
+    }
49
+
50
+    @Override
51
+    public View onCreateView(LayoutInflater inflater, ViewGroup container,
52
+                             Bundle savedInstanceState) {
53
+        View view = inflater.inflate(R.layout.fragment_item_list, container, false);
54
+
55
+        // Set the adapter
56
+        if (view instanceof RecyclerView) {
57
+            Context context = view.getContext();
58
+            RecyclerView recyclerView = (RecyclerView) view;
59
+            if (mColumnCount <= 1) {
60
+                recyclerView.setLayoutManager(new LinearLayoutManager(context));
61
+            } else {
62
+                recyclerView.setLayoutManager(new GridLayoutManager(context, mColumnCount));
63
+            }
64
+            recyclerView.setAdapter(new MyItemRecyclerViewAdapter(DummyContent.ITEMS, mListener));
65
+        }
66
+        return view;
67
+    }
68
+
69
+
70
+    @Override
71
+    public void onAttach(Context context) {
72
+        super.onAttach(context);
73
+        if (context instanceof OnListFragmentInteractionListener) {
74
+            mListener = (OnListFragmentInteractionListener) context;
75
+        } else {
76
+            throw new RuntimeException(context.toString()
77
+                    + " must implement OnListFragmentInteractionListener");
78
+        }
79
+    }
80
+
81
+    @Override
82
+    public void onDetach() {
83
+        super.onDetach();
84
+        mListener = null;
85
+    }
86
+
87
+    /**
88
+     * This interface must be implemented by activities that contain this
89
+     * fragment to allow an interaction in this fragment to be communicated
90
+     * to the activity and potentially other fragments contained in that
91
+     * activity.
92
+     * <p/>
93
+     * See the Android Training lesson <a href=
94
+     * "http://developer.android.com/training/basics/fragments/communicating.html"
95
+     * >Communicating with Other Fragments</a> for more information.
96
+     */
97
+    public interface OnListFragmentInteractionListener {
98
+        // TODO: Update argument type and name
99
+        void onListFragmentInteraction(DummyContent.DummyItem item);
100
+    }
101
+}

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

1
+package com.kfb.kfbv1;
2
+
3
+import android.app.Dialog;
4
+import android.app.ProgressDialog;
5
+import android.content.Context;
6
+import android.graphics.drawable.ColorDrawable;
7
+import android.os.Handler;
8
+import android.widget.ProgressBar;
9
+
10
+import com.kfb.kfbv1.model.KfbModel;
11
+
12
+public class KfbProgrsBar extends Dialog {
13
+    private ProgressBar progressBar;
14
+    private int pStatus = 0;
15
+    private Handler handler = new Handler();
16
+    public KfbProgrsBar(Context context) {
17
+        super(context);
18
+        getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
19
+        setContentView(R.layout.progres);
20
+
21
+        progressBar = (ProgressBar) findViewById(R.id.progressBar);
22
+
23
+        new Thread(new Runnable() {
24
+            @Override
25
+            public void run() {
26
+                while (pStatus <= 100) {
27
+                    if(pStatus==100)
28
+                    {
29
+                        pStatus = 0;
30
+                    }
31
+                    handler.post(new Runnable() {
32
+                        @Override
33
+                        public void run() {
34
+                            progressBar.setProgress(pStatus);
35
+
36
+                        }
37
+                    });
38
+                    try {
39
+                        Thread.sleep(100);
40
+                    } catch (InterruptedException e) {
41
+                        e.printStackTrace();
42
+                    }
43
+                    pStatus++;
44
+                }
45
+            }
46
+        }).start();
47
+
48
+    }
49
+}

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

1
+package com.kfb.kfbv1;
2
+
3
+import android.content.Context;
4
+import android.net.wifi.WifiConfiguration;
5
+import android.net.wifi.WifiManager;
6
+import android.os.Handler;
7
+import android.util.Log;
8
+
9
+import androidx.core.util.Preconditions;
10
+
11
+import java.lang.reflect.InvocationTargetException;
12
+import java.lang.reflect.Method;
13
+
14
+
15
+
16
+public class MyAcessPoint {
17
+
18
+    private static final int WIFI_AP_STATE_FAILED = 4;
19
+    private WifiManager mWifiManager = null;
20
+    private final String TAG = "Wifi Access Manager";
21
+    private Method wifiControlMethod;
22
+    private Method wifiApConfigurationMethod;
23
+    private Method wifiApState;
24
+
25
+    public MyAcessPoint(Context context) throws SecurityException, NoSuchMethodException {
26
+        mWifiManager = (WifiManager)context.getSystemService(Context.WIFI_SERVICE);
27
+        wifiControlMethod = mWifiManager.getClass().getMethod("setWifiApEnabled", WifiConfiguration.class, boolean.class);
28
+        wifiApConfigurationMethod = mWifiManager.getClass().getMethod("getWifiApConfiguration", null);
29
+        wifiApState = mWifiManager.getClass().getMethod("getWifiApState");
30
+    }
31
+
32
+    public boolean setWifiApState(WifiConfiguration config, boolean enabled) {
33
+        try {
34
+            if (enabled) {
35
+                mWifiManager.setWifiEnabled(!enabled);
36
+            }
37
+            return (Boolean) wifiControlMethod.invoke(mWifiManager, config, enabled);
38
+        } catch (Exception e) {
39
+            Log.e(TAG, "", e);
40
+            return false;
41
+        }
42
+    }
43
+
44
+    public WifiConfiguration getWifiApConfiguration() {
45
+        try {
46
+            return (WifiConfiguration) wifiApConfigurationMethod.invoke(mWifiManager, null);
47
+        } catch (Exception e) {
48
+            return null;
49
+        }
50
+    }
51
+
52
+    public int getWifiApState() {
53
+        try {
54
+            return (Integer) wifiApState.invoke(mWifiManager);
55
+        } catch (Exception e) {
56
+            Log.e(TAG, "", e);
57
+            return WIFI_AP_STATE_FAILED;
58
+        }
59
+    }
60
+}
61
+
62
+
63
+

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

1
+package com.kfb.kfbv1;
2
+
3
+import android.view.LayoutInflater;
4
+import android.view.View;
5
+import android.view.ViewGroup;
6
+import android.widget.TextView;
7
+
8
+import androidx.recyclerview.widget.RecyclerView;
9
+
10
+import com.kfb.kfbv1.dummy.DummyContent;
11
+
12
+import java.util.List;
13
+
14
+/**
15
+ * {@link RecyclerView.Adapter} that can display a {@link DummyItem} and makes a call to the
16
+ * specified {@link OnListFragmentInteractionListener}.
17
+ * TODO: Replace the implementation with code for your data type.
18
+ */
19
+public class MyItemRecyclerViewAdapter extends RecyclerView.Adapter<MyItemRecyclerViewAdapter.ViewHolder> {
20
+
21
+    private final List<DummyContent.DummyItem> mValues;
22
+    private final ItemFragment.OnListFragmentInteractionListener mListener;
23
+
24
+    public MyItemRecyclerViewAdapter(List<DummyContent.DummyItem> items, ItemFragment.OnListFragmentInteractionListener listener) {
25
+        mValues = items;
26
+        mListener = listener;
27
+    }
28
+
29
+    @Override
30
+    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
31
+        View view = LayoutInflater.from(parent.getContext())
32
+                .inflate(R.layout.fragment_item, parent, false);
33
+        return new ViewHolder(view);
34
+    }
35
+
36
+    @Override
37
+    public void onBindViewHolder(final ViewHolder holder, int position) {
38
+        holder.mItem = mValues.get(position);
39
+        holder.Nazwa.setText(mValues.get(position).Nazwa);
40
+        holder.Status.setText(mValues.get(position).Status);
41
+        holder.Error.setText(mValues.get(position).Error);
42
+        holder.State.setText(mValues.get(position).State);
43
+        holder.Temperatura.setText(mValues.get(position).Temperatura);
44
+        holder.mView.setOnClickListener(new View.OnClickListener() {
45
+            @Override
46
+            public void onClick(View v) {
47
+                if (null != mListener) {
48
+                    // Notify the active callbacks interface (the activity, if the
49
+                    // fragment is attached to one) that an item has been selected.
50
+                    mListener.onListFragmentInteraction(holder.mItem);
51
+                }
52
+            }
53
+        });
54
+    }
55
+
56
+    @Override
57
+    public int getItemCount() {
58
+        return mValues.size();
59
+    }
60
+
61
+    public class ViewHolder extends RecyclerView.ViewHolder {
62
+        public final View mView;
63
+        public final TextView Nazwa;
64
+        public final TextView Status;
65
+        public final TextView Error;
66
+        public final TextView State;
67
+        public final TextView Temperatura;
68
+
69
+        public DummyContent.DummyItem mItem;
70
+
71
+        public ViewHolder(View view) {
72
+            super(view);
73
+            mView = view;
74
+            Nazwa = (TextView) view.findViewById(R.id.idNazwa);
75
+            Status = (TextView) view.findViewById(R.id.idStatus);
76
+            Error = (TextView) view.findViewById(R.id.idError);
77
+            State = (TextView) view.findViewById(R.id.idState);
78
+            Temperatura = (TextView) view.findViewById(R.id.idTemperatura);
79
+        }
80
+
81
+        @Override
82
+        public String toString() {
83
+            return super.toString() + " '" + Nazwa.getText() + "'";
84
+        }
85
+    }
86
+}

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

1
+package com.kfb.kfbv1;
2
+
3
+import android.content.Context;
4
+import android.content.Intent;
5
+import android.net.wifi.WifiConfiguration;
6
+import android.net.wifi.WifiManager;
7
+import android.os.Bundle;
8
+
9
+import androidx.appcompat.app.AppCompatActivity;
10
+
11
+
12
+
13
+import java.lang.reflect.Method;
14
+
15
+public class SplashActivity extends AppCompatActivity {
16
+
17
+    protected void onCreate(Bundle savedInstanceState) {
18
+        super.onCreate(savedInstanceState);
19
+        startActivity(new Intent(SplashActivity.this, MainActivity.class));
20
+        try {
21
+
22
+            Thread.sleep(3000);
23
+        } catch (InterruptedException e) {
24
+            e.printStackTrace();
25
+        }
26
+        finish();
27
+    }
28
+
29
+}

+ 85
- 0
app/src/main/java/com/kfb/kfbv1/dummy/DummyContent.java 查看文件

1
+package com.kfb.kfbv1.dummy;
2
+
3
+import java.util.ArrayList;
4
+import java.util.HashMap;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+/**
9
+ * Helper class for providing sample content for user interfaces created by
10
+ * Android template wizards.
11
+ * <p>
12
+ * TODO: Replace all uses of this class before publishing your app.
13
+ */
14
+public class DummyContent {
15
+
16
+    /**
17
+     * An array of sample (dummy) items.
18
+     */
19
+    public static final List<DummyItem> ITEMS = new ArrayList<DummyItem>();
20
+
21
+    /**
22
+     * A map of sample (dummy) items, by ID.
23
+     */
24
+    public static final Map<String, DummyItem> ITEM_MAP = new HashMap<String, DummyItem>();
25
+
26
+    private static final int COUNT = 4;
27
+
28
+    static {
29
+        // Add some sample items.
30
+        for (int i = 1; i <= COUNT; i++) {
31
+            addItem(createDummyItem(i));
32
+        }
33
+    }
34
+
35
+    private static void addItem(DummyItem item) {
36
+        ITEMS.add(item);
37
+        ITEM_MAP.put(item.id, item);
38
+    }
39
+
40
+    private static DummyItem createDummyItem(int position) {
41
+        return new DummyItem(String.valueOf(position), "Test1","ON","ERROR","Empty","1","1","1","23.3");
42
+    }
43
+
44
+    private static String makeDetails(int position) {
45
+        StringBuilder builder = new StringBuilder();
46
+        builder.append("Details about Item: ").append(position);
47
+        for (int i = 0; i < position; i++) {
48
+            builder.append("\nMore details information here.");
49
+        }
50
+        return builder.toString();
51
+    }
52
+
53
+    /**
54
+     * A dummy item representing a piece of content.
55
+     */
56
+    public static class DummyItem {
57
+        public final String id;
58
+        public final String Nazwa;
59
+        public final String Status;
60
+        public String Error;
61
+        public String State;
62
+        public final String s1;
63
+        public final String s2;
64
+        public final String s3;
65
+        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
+            this.id = id;
69
+            this.Nazwa = aNazwa;
70
+            this.State = aState;
71
+            this.Status = aStatus;
72
+            this.Error  = aError;
73
+            this.s1  =aS1;
74
+            this.s2= aS2;
75
+            this.s3 = aS3;
76
+            this.Temperatura = aTemperatura;
77
+        }
78
+
79
+        @Override
80
+        public String toString() {
81
+            return Nazwa;
82
+        }
83
+    }
84
+}
85
+

+ 48
- 0
app/src/main/java/com/kfb/kfbv1/hotspot/ClientScanResult.java 查看文件

1
+package com.kfb.kfbv1.hotspot;
2
+
3
+public class ClientScanResult {
4
+    private String IpAddr;
5
+    private String HWAddr;
6
+    private String Device;
7
+    private boolean isReachable;
8
+
9
+    public ClientScanResult(String ipAddr, String hWAddr, String device, boolean isReachable) {
10
+        super();
11
+        this.IpAddr = ipAddr;
12
+        this.HWAddr = hWAddr;
13
+        this.Device = device;
14
+        this.isReachable = isReachable;
15
+    }
16
+
17
+    public String getIpAddr() {
18
+        return IpAddr;
19
+    }
20
+
21
+    public void setIpAddr(String ipAddr) {
22
+        IpAddr = ipAddr;
23
+    }
24
+
25
+    public String getHWAddr() {
26
+        return HWAddr;
27
+    }
28
+
29
+    public void setHWAddr(String hWAddr) {
30
+        HWAddr = hWAddr;
31
+    }
32
+
33
+    public String getDevice() {
34
+        return Device;
35
+    }
36
+
37
+    public void setDevice(String device) {
38
+        Device = device;
39
+    }
40
+
41
+    public boolean isReachable() {
42
+        return isReachable;
43
+    }
44
+
45
+    public void setReachable(boolean isReachable) {
46
+        this.isReachable = isReachable;
47
+    }
48
+}

+ 11
- 0
app/src/main/java/com/kfb/kfbv1/hotspot/FinishScanListener.java 查看文件

1
+package com.kfb.kfbv1.hotspot;
2
+
3
+import java.util.ArrayList;
4
+
5
+public interface FinishScanListener {
6
+    /**
7
+     * Interface called when the scan method finishes. Network operations should not execute on UI thread
8
+     * @param clients
9
+     */
10
+    public void onFinishScan(ArrayList<ClientScanResult> clients);
11
+}

+ 5
- 0
app/src/main/java/com/kfb/kfbv1/hotspot/WIFI_AP_STATE.java 查看文件

1
+package com.kfb.kfbv1.hotspot;
2
+
3
+public enum WIFI_AP_STATE {
4
+    WIFI_AP_STATE_DISABLING, WIFI_AP_STATE_DISABLED, WIFI_AP_STATE_ENABLING, WIFI_AP_STATE_ENABLED, WIFI_AP_STATE_FAILED
5
+}

+ 215
- 0
app/src/main/java/com/kfb/kfbv1/hotspot/WifiApManager.java 查看文件

1
+package com.kfb.kfbv1.hotspot;
2
+/*
3
+ * Copyright 2013 WhiteByte (Nick Russler, Ahmet Yueksektepe).
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+import java.io.BufferedReader;
18
+import java.io.FileReader;
19
+import java.io.IOException;
20
+import java.lang.reflect.Method;
21
+import java.net.InetAddress;
22
+import java.util.ArrayList;
23
+
24
+import android.content.Context;
25
+import android.content.Intent;
26
+import android.net.Uri;
27
+import android.net.wifi.WifiConfiguration;
28
+import android.net.wifi.WifiManager;
29
+import android.os.Build;
30
+import android.os.Handler;
31
+import android.provider.Settings;
32
+import android.util.Log;
33
+
34
+public class WifiApManager {
35
+    private final WifiManager mWifiManager;
36
+    private Context context;
37
+
38
+    public WifiApManager(Context context) {
39
+        this.context = context;
40
+        mWifiManager = (WifiManager) this.context.getSystemService(Context.WIFI_SERVICE);
41
+    }
42
+
43
+    /**
44
+     * Show write permission settings page to user if necessary or forced
45
+     * @param force show settings page even when rights are already granted
46
+     */
47
+    public void showWritePermissionSettings(boolean force) {
48
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
49
+            if (force || !Settings.System.canWrite(this.context)) {
50
+                Intent intent = new Intent(android.provider.Settings.ACTION_MANAGE_WRITE_SETTINGS);
51
+                intent.setData(Uri.parse("package:" + this.context.getPackageName()));
52
+                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
53
+                this.context.startActivity(intent);
54
+            }
55
+        }
56
+    }
57
+
58
+    /**
59
+     * Start AccessPoint mode with the specified
60
+     * configuration. If the radio is already running in
61
+     * AP mode, update the new configuration
62
+     * Note that starting in access point mode disables station
63
+     * mode operation
64
+     *
65
+     * @param wifiConfig SSID, security and channel details as part of WifiConfiguration
66
+     * @return {@code true} if the operation succeeds, {@code false} otherwise
67
+     */
68
+    public boolean setWifiApEnabled(WifiConfiguration wifiConfig, boolean enabled) {
69
+        try {
70
+            if (enabled) { // disable WiFi in any case
71
+                mWifiManager.setWifiEnabled(false);
72
+            }
73
+
74
+            Method method = mWifiManager.getClass().getMethod("setWifiApEnabled", WifiConfiguration.class, boolean.class);
75
+            return (Boolean) method.invoke(mWifiManager, wifiConfig, enabled);
76
+        } catch (Exception e) {
77
+            Log.e(this.getClass().toString(), "", e);
78
+            return false;
79
+        }
80
+    }
81
+
82
+    /**
83
+     * Gets the Wi-Fi enabled state.
84
+     *
85
+     * @return {@link WIFI_AP_STATE}
86
+     * @see #isWifiApEnabled()
87
+     */
88
+    public WIFI_AP_STATE getWifiApState() {
89
+        try {
90
+            Method method = mWifiManager.getClass().getMethod("getWifiApState");
91
+
92
+            int tmp = ((Integer) method.invoke(mWifiManager));
93
+
94
+            // Fix for Android 4
95
+            if (tmp >= 10) {
96
+                tmp = tmp - 10;
97
+            }
98
+
99
+            return WIFI_AP_STATE.class.getEnumConstants()[tmp];
100
+        } catch (Exception e) {
101
+            Log.e(this.getClass().toString(), "", e);
102
+            return WIFI_AP_STATE.WIFI_AP_STATE_FAILED;
103
+        }
104
+    }
105
+
106
+    /**
107
+     * Return whether Wi-Fi AP is enabled or disabled.
108
+     *
109
+     * @return {@code true} if Wi-Fi AP is enabled
110
+     * @hide Dont open yet
111
+     * @see #getWifiApState()
112
+     */
113
+    public boolean isWifiApEnabled() {
114
+        return getWifiApState() == WIFI_AP_STATE.WIFI_AP_STATE_ENABLED;
115
+    }
116
+
117
+    /**
118
+     * Gets the Wi-Fi AP Configuration.
119
+     *
120
+     * @return AP details in {@link WifiConfiguration}
121
+     */
122
+    public WifiConfiguration getWifiApConfiguration() {
123
+        try {
124
+            Method method = mWifiManager.getClass().getMethod("getWifiApConfiguration");
125
+            return (WifiConfiguration) method.invoke(mWifiManager);
126
+        } catch (Exception e) {
127
+            Log.e(this.getClass().toString(), "", e);
128
+            return null;
129
+        }
130
+    }
131
+
132
+    /**
133
+     * Sets the Wi-Fi AP Configuration.
134
+     *
135
+     * @return {@code true} if the operation succeeded, {@code false} otherwise
136
+     */
137
+    public boolean setWifiApConfiguration(WifiConfiguration wifiConfig) {
138
+        try {
139
+            Method method = mWifiManager.getClass().getMethod("setWifiApConfiguration", WifiConfiguration.class);
140
+            return (Boolean) method.invoke(mWifiManager, wifiConfig);
141
+        } catch (Exception e) {
142
+            Log.e(this.getClass().toString(), "", e);
143
+            return false;
144
+        }
145
+    }
146
+
147
+    /**
148
+     * Gets a list of the clients connected to the Hotspot, reachable timeout is 300
149
+     *
150
+     * @param onlyReachables  {@code false} if the list should contain unreachable (probably disconnected) clients, {@code true} otherwise
151
+     * @param finishListener, Interface called when the scan method finishes
152
+     */
153
+    public void getClientList(boolean onlyReachables, FinishScanListener finishListener) {
154
+        getClientList(onlyReachables, 300, finishListener);
155
+    }
156
+
157
+    /**
158
+     * Gets a list of the clients connected to the Hotspot
159
+     *
160
+     * @param onlyReachables   {@code false} if the list should contain unreachable (probably disconnected) clients, {@code true} otherwise
161
+     * @param reachableTimeout Reachable Timout in miliseconds
162
+     * @param finishListener,  Interface called when the scan method finishes
163
+     */
164
+    public void getClientList(final boolean onlyReachables, final int reachableTimeout, final FinishScanListener finishListener) {
165
+        Runnable runnable = new Runnable() {
166
+            public void run() {
167
+
168
+                BufferedReader br = null;
169
+                final ArrayList<ClientScanResult> result = new ArrayList<ClientScanResult>();
170
+
171
+                try {
172
+                    br = new BufferedReader(new FileReader("/proc/net/arp"));
173
+                    String line;
174
+                    while ((line = br.readLine()) != null) {
175
+                        String[] splitted = line.split(" +");
176
+
177
+                        if ((splitted != null) && (splitted.length >= 4)) {
178
+                            // Basic sanity check
179
+                            String mac = splitted[3];
180
+
181
+                            if (mac.matches("..:..:..:..:..:..")) {
182
+                                boolean isReachable = InetAddress.getByName(splitted[0]).isReachable(reachableTimeout);
183
+
184
+                                if (!onlyReachables || isReachable) {
185
+                                    result.add(new ClientScanResult(splitted[0], splitted[3], splitted[5], isReachable));
186
+                                }
187
+                            }
188
+                        }
189
+                    }
190
+                } catch (Exception e) {
191
+                    Log.e(this.getClass().toString(), e.toString());
192
+                } finally {
193
+                    try {
194
+                        br.close();
195
+                    } catch (IOException e) {
196
+                        Log.e(this.getClass().toString(), e.getMessage());
197
+                    }
198
+                }
199
+
200
+                // Get a handler that can be used to post to the main thread
201
+                Handler mainHandler = new Handler(context.getMainLooper());
202
+                Runnable myRunnable = new Runnable() {
203
+                    @Override
204
+                    public void run() {
205
+                        finishListener.onFinishScan(result);
206
+                    }
207
+                };
208
+                mainHandler.post(myRunnable);
209
+            }
210
+        };
211
+
212
+        Thread mythread = new Thread(runnable);
213
+        mythread.start();
214
+    }
215
+}

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

1
+package com.kfb.kfbv1.model;
2
+
3
+import java.util.ArrayList;
4
+
5
+public class KfbGate {
6
+    private String mName;
7
+    private String mAdres;
8
+    private String mMaxT;
9
+    private String mStatus;
10
+    private String mError;
11
+
12
+    private ArrayList<KfbMeasure> mMeasure;
13
+
14
+    public void setmName(String mName) {
15
+        this.mName = mName;
16
+    }
17
+
18
+    public void setmAdres(String mAdres) {
19
+        this.mAdres = mAdres;
20
+    }
21
+
22
+    public String getmAdres() {
23
+        return mAdres;
24
+    }
25
+
26
+    public void setmMeasure(ArrayList<KfbMeasure> mMeasure) {
27
+        this.mMeasure = mMeasure;
28
+    }
29
+
30
+    public String getmName() {
31
+        return mName;
32
+    }
33
+
34
+    public ArrayList<KfbMeasure> getmMeasure() {
35
+        return mMeasure;
36
+    }
37
+
38
+    public KfbGate()
39
+    {
40
+        mMeasure = new ArrayList<KfbMeasure>();
41
+    }
42
+
43
+    public void setmMaxT(String mMaxT) {
44
+        this.mMaxT = mMaxT;
45
+    }
46
+
47
+    public String getmError() {
48
+        return mError;
49
+    }
50
+
51
+    public void setmError(String mError) {
52
+        this.mError = mError;
53
+    }
54
+
55
+    public void setmStatus(String mStatus) {
56
+        this.mStatus = mStatus;
57
+    }
58
+
59
+    public String getmMaxT() {
60
+        return mMaxT;
61
+    }
62
+
63
+    public String getmStatus() {
64
+        return mStatus;
65
+    }
66
+}

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

1
+package com.kfb.kfbv1.model;
2
+
3
+import java.util.ArrayList;
4
+
5
+public class KfbGates {
6
+    private int mSize;
7
+    private ArrayList<KfbGate> mGate;
8
+
9
+    public KfbGates()
10
+    {
11
+        mGate = new ArrayList<KfbGate>();
12
+        mSize = 0;
13
+    }
14
+
15
+   public void AddGate(KfbGate aGate){
16
+        mGate.add(aGate);
17
+        mSize++;
18
+   }
19
+
20
+    public void setmGate(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
+}

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

1
+package com.kfb.kfbv1.model;
2
+
3
+import android.content.Context;
4
+import android.os.AsyncTask;
5
+import android.util.Log;
6
+import android.widget.Toast;
7
+
8
+import com.loopj.android.http.AsyncHttpClient;
9
+import com.loopj.android.http.AsyncHttpResponseHandler;
10
+import com.loopj.android.http.ResponseHandlerInterface;
11
+import com.loopj.android.http.SyncHttpClient;
12
+
13
+import java.io.ByteArrayOutputStream;
14
+import java.io.EOFException;
15
+import java.io.IOException;
16
+import java.net.HttpURLConnection;
17
+import java.net.URL;
18
+
19
+import javax.net.ssl.HttpsURLConnection;
20
+
21
+import cz.msebera.android.httpclient.Header;
22
+
23
+public class KfbHttpRequest {
24
+    private  KfbGate mGate;
25
+    public  String outS;
26
+    private SyncHttpClient client;
27
+
28
+    public String getTest(String aUrl)
29
+    {
30
+        client = new SyncHttpClient();
31
+        try {
32
+            String uri = aUrl;
33
+             client.get(uri, new AsyncHttpResponseHandler() {
34
+                @Override
35
+                public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
36
+                    outS = new String(responseBody);
37
+                    KfbModel.getData().tekser =outS;
38
+                    KfbModel.getData().error = false;
39
+                    //KfbModel.getData().progresok=true;
40
+
41
+                  //  KfbModel.getData().textViewout.setText(outS);
42
+                }
43
+
44
+                @Override
45
+                public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {
46
+                    outS = "ERROR"+ error.getMessage();
47
+                    KfbModel.getData().tekser =outS;
48
+                    KfbModel.getData().error = true;
49
+                   // KfbModel.getData().progresok=true;
50
+
51
+                  // KfbModel.getData().textViewout.setText(outS);
52
+
53
+                }
54
+            });
55
+            return  outS;
56
+        }catch (Exception e)
57
+        {
58
+            Log.e("HttpClient",e.getMessage());
59
+            return "";
60
+        }
61
+    }
62
+    public void getRequest(KfbGate aGate) {
63
+        mGate = aGate;
64
+
65
+        client = new SyncHttpClient();
66
+        try {
67
+            String uri = aGate.getmAdres();
68
+         client.get(uri, new AsyncHttpResponseHandler() {
69
+             @Override
70
+             public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
71
+                 outS = new String(responseBody);
72
+                 KfbModel.getData().tekser =outS;
73
+                 KfbModel.getData().error = false;
74
+             }
75
+
76
+             @Override
77
+             public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {
78
+                 outS = "ERROR"+ error.getMessage();
79
+                 KfbModel.getData().tekser =outS;
80
+                 KfbModel.getData().error = true;
81
+             }
82
+         });
83
+
84
+
85
+        }catch (Exception e)
86
+        {
87
+            Log.e("HttpClient",e.getMessage());
88
+        }
89
+    }
90
+}
91
+
92
+

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

1
+package com.kfb.kfbv1.model;
2
+
3
+public class KfbMeasure {
4
+    private float mTemp;
5
+}

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

1
+package com.kfb.kfbv1.model;
2
+
3
+import android.os.Handler;
4
+import android.widget.ProgressBar;
5
+import android.widget.TextView;
6
+
7
+import com.kfb.kfbv1.KfbProgrsBar;
8
+import com.kfb.kfbv1.MyItemRecyclerViewAdapter;
9
+
10
+
11
+
12
+public class KfbModel {
13
+    private static KfbModel mmodel;
14
+
15
+    public static KfbModel getData()
16
+    {
17
+        if(mmodel==null)
18
+        {
19
+            mmodel = new KfbModel();
20
+        }
21
+        return mmodel;
22
+    }
23
+
24
+    private KfbModel()
25
+    {
26
+        mGates = new KfbGates();
27
+    }
28
+    // data private
29
+    private KfbGates mGates;
30
+    private MyItemRecyclerViewAdapter mAdapter;
31
+    // data
32
+    public boolean sendHttp;
33
+    public KfbProgrsBar progresBar;
34
+    public String  tekser;
35
+    public boolean error;
36
+    public Handler handler;
37
+ public String url;
38
+
39
+    public MyItemRecyclerViewAdapter getmAdapter() {
40
+        return mAdapter;
41
+    }
42
+
43
+    public void setmAdapter(MyItemRecyclerViewAdapter mAdapter) {
44
+        this.mAdapter = mAdapter;
45
+    }
46
+
47
+    public KfbGates getGates(){
48
+        return mGates;
49
+    }
50
+}

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

1
+package com.kfb.kfbv1.model;
2
+
3
+public class KfbParser {
4
+    public KfbGate dataParser(String aData,KfbGate aGate)
5
+    {
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);
11
+
12
+        p = aData.lastIndexOf("status:");
13
+        p=p+7;
14
+        t = aData.substring(p ,p+6);
15
+        k.setmStatus(t);
16
+        return k;
17
+    }
18
+}

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

1
+package com.kfb.kfbv1.model;
2
+
3
+import android.os.Handler;
4
+import android.os.Message;
5
+import android.view.View;
6
+import android.widget.TextView;
7
+
8
+import com.kfb.kfbv1.R;
9
+
10
+public class KfbTask  implements Runnable {
11
+    @Override
12
+    public void run() {
13
+        Handler handler = KfbModel.getData().handler;
14
+        KfbHttpRequest HttpKfb = new KfbHttpRequest();
15
+        HttpKfb.getTest(KfbModel.getData().url);
16
+        if(KfbModel.getData().tekser!=null)
17
+        {
18
+            KfbParser p = new KfbParser();
19
+           // if(KfbModel.getData().error==false) {
20
+          //      p.dataParser(KfbModel.getData().tekser, KfbModel.getData().getGates().getmGate().get(0));
21
+          //  }
22
+            Message msg = handler.obtainMessage();
23
+            msg.what = 1;
24
+            msg.obj = "tekst";
25
+            msg.arg1 = 1;
26
+            handler.sendMessage(msg);
27
+        }
28
+
29
+
30
+        while(KfbModel.getData().sendHttp==true)
31
+        {
32
+            KfbParser p = new KfbParser();
33
+            for (int i = 0 ;i<KfbModel.getData().getGates().getmSize();i++)
34
+            {
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);
52
+                }
53
+            }
54
+            try {
55
+                Thread.sleep(250);
56
+            } catch (InterruptedException e) {
57
+                e.printStackTrace();
58
+            }
59
+        }
60
+    }
61
+}

+ 8
- 0
app/src/main/res/drawable-v24/circle_shape.xml 查看文件

1
+<?xml version="1.0" encoding="utf-8"?>
2
+<shape xmlns:android = "http://schemas.android.com/apk/res/android"
3
+    android:innerRadiusRatio= "2.5"
4
+    android:shape= "ring"
5
+    android:thickness= "1dp"
6
+    android:useLevel= "false" >
7
+    <solid android:color= "#CCC" />
8
+</shape>

+ 17
- 0
app/src/main/res/drawable-v24/circular_progress_bar.xml 查看文件

1
+<?xml version="1.0" encoding="utf-8"?>
2
+<rotate xmlns:android = "http://schemas.android.com/apk/res/android"
3
+    android:fromDegrees= "270"
4
+    android:toDegrees= "270" >
5
+    <shape
6
+        android:innerRadiusRatio= "2.5"
7
+        android:shape= "ring"
8
+        android:thickness= "1dp"
9
+        android:useLevel= "true" > <!-- this line fixes the issue for lollipop api 21 -->
10
+        <gradient
11
+            android:angle= "0"
12
+            android:endColor= "#007DD6"
13
+            android:startColor= "#007DD6"
14
+            android:type= "sweep"
15
+            android:useLevel= "false" />
16
+    </shape>
17
+</rotate>

+ 30
- 0
app/src/main/res/drawable-v24/ic_launcher_foreground.xml 查看文件

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 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">
8
+        <aapt:attr name="android:fillColor">
9
+            <gradient
10
+                android:endX="85.84757"
11
+                android:endY="92.4963"
12
+                android:startX="42.9492"
13
+                android:startY="49.59793"
14
+                android:type="linear">
15
+                <item
16
+                    android:color="#44000000"
17
+                    android:offset="0.0" />
18
+                <item
19
+                    android:color="#00000000"
20
+                    android:offset="1.0" />
21
+            </gradient>
22
+        </aapt:attr>
23
+    </path>
24
+    <path
25
+        android:fillColor="#FFFFFF"
26
+        android:fillType="nonZero"
27
+        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"
28
+        android:strokeWidth="1"
29
+        android:strokeColor="#00000000" />
30
+</vector>

二进制
app/src/main/res/drawable/emot.png 查看文件


+ 170
- 0
app/src/main/res/drawable/ic_launcher_background.xml 查看文件

1
+<?xml version="1.0" encoding="utf-8"?>
2
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
3
+    android:width="108dp"
4
+    android:height="108dp"
5
+    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" />
170
+</vector>

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


二进制
app/src/main/res/drawable/pp.png 查看文件


+ 7
- 0
app/src/main/res/drawable/splash.xml 查看文件

1
+<?xml version="1.0" encoding="utf-8"?>
2
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
3
+    android:opacity="opaque"><item android:drawable="@android:color/holo_purple" /><item>
4
+    <bitmap
5
+        android:gravity="center"
6
+        android:src="@drawable/logo" />
7
+</item></layer-list>

+ 15
- 0
app/src/main/res/layout/activity_gate.xml 查看文件

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=".GateActivity">
8
+
9
+    <androidx.recyclerview.widget.RecyclerView
10
+        android:id="@+id/recview"
11
+        android:layout_width="598dp"
12
+        android:layout_height="1022dp"
13
+        app:layout_constraintStart_toStartOf="parent"
14
+        app:layout_constraintTop_toTopOf="parent" />
15
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 123
- 0
app/src/main/res/layout/activity_main.xml 查看文件

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=".MainActivity">
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
+    <ImageView
67
+        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"
73
+        app:layout_constraintStart_toStartOf="parent"
74
+        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
+        app:layout_constraintStart_toStartOf="parent"
85
+        app:layout_constraintTop_toBottomOf="@+id/textView2" />
86
+
87
+    <EditText
88
+        android:id="@+id/editText"
89
+        android:layout_width="493dp"
90
+        android:layout_height="46dp"
91
+        android:layout_marginStart="13dp"
92
+        android:layout_marginTop="115dp"
93
+        android:ems="10"
94
+        android:inputType="textPersonName"
95
+        android:text="http://"
96
+        app:layout_constraintStart_toEndOf="@+id/textView3"
97
+        app:layout_constraintTop_toBottomOf="@+id/login" />
98
+
99
+    <EditText
100
+        android:id="@+id/editText4"
101
+        android:layout_width="546dp"
102
+        android:layout_height="181dp"
103
+        android:layout_marginStart="28dp"
104
+        android:layout_marginTop="41dp"
105
+        android:ems="10"
106
+        android:gravity="start|top"
107
+        android:inputType="textMultiLine"
108
+        app:layout_constraintStart_toStartOf="parent"
109
+        app:layout_constraintTop_toBottomOf="@+id/editText" />
110
+
111
+    <Button
112
+        android:id="@+id/button"
113
+        android:layout_width="wrap_content"
114
+        android:layout_height="wrap_content"
115
+        android:layout_marginStart="456dp"
116
+        android:layout_marginTop="37dp"
117
+        android:text="Wykonaj"
118
+        app:layout_constraintStart_toStartOf="parent"
119
+        app:layout_constraintTop_toBottomOf="@+id/editText4" />
120
+
121
+
122
+
123
+</androidx.constraintlayout.widget.ConstraintLayout>

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

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="wrap_content"
6
+    android:layout_height="wrap_content"
7
+    android:orientation="horizontal">
8
+
9
+    <androidx.constraintlayout.widget.ConstraintLayout
10
+        android:layout_width="1123dp"
11
+        android:layout_height="200dp">
12
+
13
+        <TextView
14
+            android:id="@+id/idNazwa"
15
+            android:layout_width="wrap_content"
16
+            android:layout_height="wrap_content"
17
+            android:layout_marginStart="26dp"
18
+            android:layout_marginTop="10dp"
19
+            android:text="Gate 1"
20
+            app:layout_constraintStart_toStartOf="parent"
21
+            app:layout_constraintTop_toTopOf="parent" />
22
+
23
+        <TextView
24
+            android:id="@+id/textView24"
25
+            android:layout_width="wrap_content"
26
+            android:layout_height="wrap_content"
27
+            android:layout_marginStart="22dp"
28
+            android:layout_marginTop="10dp"
29
+            android:text="Status"
30
+            app:layout_constraintStart_toEndOf="@+id/idNazwa"
31
+            app:layout_constraintTop_toTopOf="parent" />
32
+
33
+        <TextView
34
+            android:id="@+id/idStatus"
35
+            android:layout_width="wrap_content"
36
+            android:layout_height="wrap_content"
37
+            android:layout_marginStart="25dp"
38
+            android:layout_marginTop="10dp"
39
+            android:text="ON"
40
+            app:layout_constraintStart_toEndOf="@+id/textView24"
41
+            app:layout_constraintTop_toTopOf="parent" />
42
+
43
+        <ImageView
44
+            android:id="@+id/imageView7"
45
+            android:layout_width="150dp"
46
+            android:layout_height="199dp"
47
+            android:layout_marginStart="64dp"
48
+            android:contentDescription=" "
49
+            android:visibility="visible"
50
+            app:layout_constraintStart_toEndOf="@+id/idTemperatura"
51
+            app:layout_constraintTop_toTopOf="parent"
52
+            app:srcCompat="@drawable/emot"
53
+            tools:srcCompat="@drawable/pp"
54
+            tools:visibility="visible" />
55
+
56
+        <TextView
57
+            android:id="@+id/idState"
58
+            android:layout_width="wrap_content"
59
+            android:layout_height="wrap_content"
60
+            android:layout_marginStart="26dp"
61
+            android:layout_marginTop="16dp"
62
+            android:text="Empty"
63
+            app:layout_constraintStart_toStartOf="parent"
64
+            app:layout_constraintTop_toBottomOf="@+id/idNazwa" />
65
+
66
+        <TextView
67
+            android:id="@+id/textView27"
68
+            android:layout_width="wrap_content"
69
+            android:layout_height="wrap_content"
70
+            android:layout_marginStart="26dp"
71
+            android:layout_marginTop="27dp"
72
+            android:text="Step 1"
73
+            app:layout_constraintStart_toStartOf="parent"
74
+            app:layout_constraintTop_toBottomOf="@+id/idState" />
75
+
76
+        <TextView
77
+            android:id="@+id/textView28"
78
+            android:layout_width="wrap_content"
79
+            android:layout_height="wrap_content"
80
+            android:layout_marginStart="26dp"
81
+            android:layout_marginTop="10dp"
82
+            android:text="Step 2"
83
+            app:layout_constraintStart_toStartOf="parent"
84
+            app:layout_constraintTop_toBottomOf="@+id/textView27" />
85
+
86
+        <TextView
87
+            android:id="@+id/textView29"
88
+            android:layout_width="wrap_content"
89
+            android:layout_height="wrap_content"
90
+            android:layout_marginStart="26dp"
91
+            android:layout_marginTop="10dp"
92
+            android:text="Step 3"
93
+            app:layout_constraintStart_toStartOf="parent"
94
+            app:layout_constraintTop_toBottomOf="@+id/textView28" />
95
+
96
+        <ImageView
97
+            android:id="@+id/imageView8"
98
+            android:layout_width="31dp"
99
+            android:layout_height="30dp"
100
+            android:layout_marginStart="148dp"
101
+            android:layout_marginTop="52dp"
102
+            android:visibility="visible"
103
+            app:layout_constraintStart_toStartOf="parent"
104
+            app:layout_constraintTop_toBottomOf="@+id/textView24"
105
+            app:srcCompat="@drawable/emot"
106
+            tools:srcCompat="@tools:sample/avatars"
107
+            tools:visibility="visible" />
108
+
109
+        <ImageView
110
+            android:id="@+id/imageView9"
111
+            android:layout_width="31dp"
112
+            android:layout_height="30dp"
113
+            android:layout_marginStart="148dp"
114
+            app:layout_constraintStart_toStartOf="parent"
115
+            app:layout_constraintTop_toBottomOf="@+id/imageView10"
116
+            app:srcCompat="@drawable/emot"
117
+            tools:srcCompat="@tools:sample/avatars" />
118
+
119
+        <ImageView
120
+            android:id="@+id/imageView10"
121
+            android:layout_width="31dp"
122
+            android:layout_height="30dp"
123
+            android:layout_marginStart="148dp"
124
+            app:layout_constraintStart_toStartOf="parent"
125
+            app:layout_constraintTop_toBottomOf="@+id/imageView8"
126
+            app:srcCompat="@drawable/emot"
127
+            tools:srcCompat="@tools:sample/avatars" />
128
+
129
+        <TextView
130
+            android:id="@+id/idTemperatura"
131
+            android:layout_width="90dp"
132
+            android:layout_height="51dp"
133
+            android:layout_marginStart="116dp"
134
+            android:layout_marginTop="5dp"
135
+            android:text="34"
136
+            android:textSize="36sp"
137
+            app:layout_constraintStart_toEndOf="@+id/imageView8"
138
+            app:layout_constraintTop_toBottomOf="@+id/textView31" />
139
+
140
+        <Button
141
+            android:id="@+id/button2"
142
+            android:layout_width="wrap_content"
143
+            android:layout_height="wrap_content"
144
+            android:layout_marginStart="112dp"
145
+            android:layout_marginTop="8dp"
146
+            android:text="Wykonaj"
147
+            app:layout_constraintStart_toEndOf="@+id/imageView9"
148
+            app:layout_constraintTop_toBottomOf="@+id/idTemperatura" />
149
+
150
+        <TextView
151
+            android:id="@+id/textView31"
152
+            android:layout_width="wrap_content"
153
+            android:layout_height="wrap_content"
154
+            android:layout_marginStart="228dp"
155
+            android:layout_marginTop="60dp"
156
+            android:text="Max temp"
157
+            app:layout_constraintStart_toEndOf="@+id/idState"
158
+            app:layout_constraintTop_toTopOf="parent" />
159
+
160
+        <TextView
161
+            android:id="@+id/idError"
162
+            android:layout_width="wrap_content"
163
+            android:layout_height="wrap_content"
164
+            android:layout_marginStart="72dp"
165
+            android:layout_marginTop="10dp"
166
+            android:text="Error"
167
+            app:layout_constraintStart_toEndOf="@+id/idStatus"
168
+            app:layout_constraintTop_toTopOf="parent" />
169
+    </androidx.constraintlayout.widget.ConstraintLayout>
170
+
171
+</LinearLayout>

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

1
+<?xml version="1.0" encoding="utf-8"?>
2
+<androidx.recyclerview.widget.RecyclerView 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:id="@+id/list"
6
+    android:name="com.kfb.kfbmes.ItemFragment"
7
+    android:layout_width="match_parent"
8
+    android:layout_height="match_parent"
9
+    android:layout_marginLeft="16dp"
10
+    android:layout_marginRight="16dp"
11
+    app:layoutManager="LinearLayoutManager"
12
+    tools:context=".ItemFragment"
13
+    tools:listitem="@layout/fragment_item" />

+ 30
- 0
app/src/main/res/layout/progres.xml 查看文件

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
+    android:theme="@style/Theme.Transparent"
8
+    android:background="@android:color/transparent">
9
+
10
+    <ProgressBar
11
+        android:id="@+id/progressBar"
12
+        style="?android:attr/progressBarStyleHorizontal"
13
+        android:layout_width="200dp"
14
+        android:layout_height="200dp"
15
+        android:layout_centerInParent="true"
16
+        android:layout_marginStart="88dp"
17
+        android:layout_marginTop="220dp"
18
+        android:background="@drawable/circle_shape"
19
+        android:indeterminate="false"
20
+        android:max="100"
21
+        android:progress="65"
22
+        android:progressDrawable="@drawable/circular_progress_bar"
23
+        app:layout_constraintBottom_toBottomOf="parent"
24
+        app:layout_constraintEnd_toEndOf="parent"
25
+        app:layout_constraintHorizontal_bias="0.5"
26
+        app:layout_constraintStart_toStartOf="parent"
27
+        app:layout_constraintTop_toTopOf="parent"
28
+        tools:visibility="visible" />
29
+
30
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 5
- 0
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml 查看文件

1
+<?xml version="1.0" encoding="utf-8"?>
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" />
5
+</adaptive-icon>

+ 5
- 0
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml 查看文件

1
+<?xml version="1.0" encoding="utf-8"?>
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" />
5
+</adaptive-icon>

二进制
app/src/main/res/mipmap-hdpi/ic_launcher.png 查看文件


二进制
app/src/main/res/mipmap-hdpi/ic_launcher_round.png 查看文件


二进制
app/src/main/res/mipmap-mdpi/ic_launcher.png 查看文件


二进制
app/src/main/res/mipmap-mdpi/ic_launcher_round.png 查看文件


二进制
app/src/main/res/mipmap-xhdpi/ic_launcher.png 查看文件


二进制
app/src/main/res/mipmap-xhdpi/ic_launcher_round.png 查看文件


二进制
app/src/main/res/mipmap-xxhdpi/ic_launcher.png 查看文件


二进制
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png 查看文件


二进制
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png 查看文件


二进制
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png 查看文件


+ 6
- 0
app/src/main/res/values/colors.xml 查看文件

1
+<?xml version="1.0" encoding="utf-8"?>
2
+<resources>
3
+    <color name="colorPrimary">#6200EE</color>
4
+    <color name="colorPrimaryDark">#3700B3</color>
5
+    <color name="colorAccent">#03DAC5</color>
6
+</resources>

+ 3
- 0
app/src/main/res/values/strings.xml 查看文件

1
+<resources>
2
+    <string name="app_name">KFBv1</string>
3
+</resources>

+ 21
- 0
app/src/main/res/values/styles.xml 查看文件

1
+<resources>
2
+
3
+    <!-- Base application theme. -->
4
+    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
5
+        <!-- Customize your theme here. -->
6
+        <item name="colorPrimary">@color/colorPrimary</item>
7
+        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
8
+        <item name="colorAccent">@color/colorAccent</item>
9
+    </style>
10
+    <style name="SplashScreenTheme" parent = "Theme.AppCompat.NoActionBar">
11
+        <item  name="android:windowBackground">@drawable/splash</item>
12
+    </style>
13
+    <style name="Theme.Transparent" parent="android:Theme">
14
+        <item name="android:windowIsTranslucent">true</item>
15
+        <item name="android:windowBackground">@android:color/transparent</item>
16
+        <item name="android:windowContentOverlay">@null</item>
17
+        <item name="android:windowNoTitle">true</item>
18
+        <item name="android:windowIsFloating">true</item>
19
+        <item name="android:backgroundDimEnabled">false</item>
20
+    </style>
21
+</resources>

+ 17
- 0
app/src/test/java/com/kfb/kfbv1/ExampleUnitTest.java 查看文件

1
+package com.kfb.kfbv1;
2
+
3
+import org.junit.Test;
4
+
5
+import static org.junit.Assert.*;
6
+
7
+/**
8
+ * Example local unit test, which will execute on the development machine (host).
9
+ *
10
+ * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
11
+ */
12
+public class ExampleUnitTest {
13
+    @Test
14
+    public void addition_isCorrect() {
15
+        assertEquals(4, 2 + 2);
16
+    }
17
+}

+ 29
- 0
build.gradle 查看文件

1
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
2
+
3
+buildscript {
4
+    
5
+    repositories {
6
+        google()
7
+        jcenter()
8
+        
9
+    }
10
+    dependencies {
11
+        classpath 'com.android.tools.build:gradle:3.6.1'
12
+        
13
+
14
+        // NOTE: Do not place your application dependencies here; they belong
15
+        // in the individual module build.gradle files
16
+    }
17
+}
18
+
19
+allprojects {
20
+    repositories {
21
+        google()
22
+        jcenter()
23
+        
24
+    }
25
+}
26
+
27
+task clean(type: Delete) {
28
+    delete rootProject.buildDir
29
+}

+ 20
- 0
gradle.properties 查看文件

1
+# Project-wide Gradle settings.
2
+# IDE (e.g. Android Studio) users:
3
+# Gradle settings configured through the IDE *will override*
4
+# any settings specified in this file.
5
+# For more details on how to configure your build environment visit
6
+# http://www.gradle.org/docs/current/userguide/build_environment.html
7
+# Specifies the JVM arguments used for the daemon process.
8
+# The setting is particularly useful for tweaking memory settings.
9
+org.gradle.jvmargs=-Xmx1536m
10
+# When configured, Gradle will run in incubating parallel mode.
11
+# This option should only be used with decoupled projects. More details, visit
12
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13
+# org.gradle.parallel=true
14
+# AndroidX package structure to make it clearer which packages are bundled with the
15
+# Android operating system, and which are packaged with your app's APK
16
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
17
+android.useAndroidX=true
18
+# Automatically convert third-party libraries to use AndroidX
19
+android.enableJetifier=true
20
+

二进制
gradle/wrapper/gradle-wrapper.jar 查看文件


+ 6
- 0
gradle/wrapper/gradle-wrapper.properties 查看文件

1
+#Mon Mar 30 23:58:29 CEST 2020
2
+distributionBase=GRADLE_USER_HOME
3
+distributionPath=wrapper/dists
4
+zipStoreBase=GRADLE_USER_HOME
5
+zipStorePath=wrapper/dists
6
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

+ 172
- 0
gradlew 查看文件

1
+#!/usr/bin/env sh
2
+
3
+##############################################################################
4
+##
5
+##  Gradle start up script for UN*X
6
+##
7
+##############################################################################
8
+
9
+# Attempt to set APP_HOME
10
+# Resolve links: $0 may be a link
11
+PRG="$0"
12
+# Need this for relative symlinks.
13
+while [ -h "$PRG" ] ; do
14
+    ls=`ls -ld "$PRG"`
15
+    link=`expr "$ls" : '.*-> \(.*\)$'`
16
+    if expr "$link" : '/.*' > /dev/null; then
17
+        PRG="$link"
18
+    else
19
+        PRG=`dirname "$PRG"`"/$link"
20
+    fi
21
+done
22
+SAVED="`pwd`"
23
+cd "`dirname \"$PRG\"`/" >/dev/null
24
+APP_HOME="`pwd -P`"
25
+cd "$SAVED" >/dev/null
26
+
27
+APP_NAME="Gradle"
28
+APP_BASE_NAME=`basename "$0"`
29
+
30
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31
+DEFAULT_JVM_OPTS=""
32
+
33
+# Use the maximum available, or set MAX_FD != -1 to use that value.
34
+MAX_FD="maximum"
35
+
36
+warn () {
37
+    echo "$*"
38
+}
39
+
40
+die () {
41
+    echo
42
+    echo "$*"
43
+    echo
44
+    exit 1
45
+}
46
+
47
+# OS specific support (must be 'true' or 'false').
48
+cygwin=false
49
+msys=false
50
+darwin=false
51
+nonstop=false
52
+case "`uname`" in
53
+  CYGWIN* )
54
+    cygwin=true
55
+    ;;
56
+  Darwin* )
57
+    darwin=true
58
+    ;;
59
+  MINGW* )
60
+    msys=true
61
+    ;;
62
+  NONSTOP* )
63
+    nonstop=true
64
+    ;;
65
+esac
66
+
67
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68
+
69
+# Determine the Java command to use to start the JVM.
70
+if [ -n "$JAVA_HOME" ] ; then
71
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72
+        # IBM's JDK on AIX uses strange locations for the executables
73
+        JAVACMD="$JAVA_HOME/jre/sh/java"
74
+    else
75
+        JAVACMD="$JAVA_HOME/bin/java"
76
+    fi
77
+    if [ ! -x "$JAVACMD" ] ; then
78
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79
+
80
+Please set the JAVA_HOME variable in your environment to match the
81
+location of your Java installation."
82
+    fi
83
+else
84
+    JAVACMD="java"
85
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86
+
87
+Please set the JAVA_HOME variable in your environment to match the
88
+location of your Java installation."
89
+fi
90
+
91
+# Increase the maximum file descriptors if we can.
92
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93
+    MAX_FD_LIMIT=`ulimit -H -n`
94
+    if [ $? -eq 0 ] ; then
95
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96
+            MAX_FD="$MAX_FD_LIMIT"
97
+        fi
98
+        ulimit -n $MAX_FD
99
+        if [ $? -ne 0 ] ; then
100
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
101
+        fi
102
+    else
103
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104
+    fi
105
+fi
106
+
107
+# For Darwin, add options to specify how the application appears in the dock
108
+if $darwin; then
109
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110
+fi
111
+
112
+# For Cygwin, switch paths to Windows format before running java
113
+if $cygwin ; then
114
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116
+    JAVACMD=`cygpath --unix "$JAVACMD"`
117
+
118
+    # We build the pattern for arguments to be converted via cygpath
119
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120
+    SEP=""
121
+    for dir in $ROOTDIRSRAW ; do
122
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
123
+        SEP="|"
124
+    done
125
+    OURCYGPATTERN="(^($ROOTDIRS))"
126
+    # Add a user-defined pattern to the cygpath arguments
127
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129
+    fi
130
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
131
+    i=0
132
+    for arg in "$@" ; do
133
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
135
+
136
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
137
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138
+        else
139
+            eval `echo args$i`="\"$arg\""
140
+        fi
141
+        i=$((i+1))
142
+    done
143
+    case $i in
144
+        (0) set -- ;;
145
+        (1) set -- "$args0" ;;
146
+        (2) set -- "$args0" "$args1" ;;
147
+        (3) set -- "$args0" "$args1" "$args2" ;;
148
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154
+    esac
155
+fi
156
+
157
+# Escape application args
158
+save () {
159
+    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160
+    echo " "
161
+}
162
+APP_ARGS=$(save "$@")
163
+
164
+# Collect all arguments for the java command, following the shell quoting and substitution rules
165
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166
+
167
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169
+  cd "$(dirname "$0")"
170
+fi
171
+
172
+exec "$JAVACMD" "$@"

+ 84
- 0
gradlew.bat 查看文件

1
+@if "%DEBUG%" == "" @echo off
2
+@rem ##########################################################################
3
+@rem
4
+@rem  Gradle startup script for Windows
5
+@rem
6
+@rem ##########################################################################
7
+
8
+@rem Set local scope for the variables with windows NT shell
9
+if "%OS%"=="Windows_NT" setlocal
10
+
11
+set DIRNAME=%~dp0
12
+if "%DIRNAME%" == "" set DIRNAME=.
13
+set APP_BASE_NAME=%~n0
14
+set APP_HOME=%DIRNAME%
15
+
16
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17
+set DEFAULT_JVM_OPTS=
18
+
19
+@rem Find java.exe
20
+if defined JAVA_HOME goto findJavaFromJavaHome
21
+
22
+set JAVA_EXE=java.exe
23
+%JAVA_EXE% -version >NUL 2>&1
24
+if "%ERRORLEVEL%" == "0" goto init
25
+
26
+echo.
27
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28
+echo.
29
+echo Please set the JAVA_HOME variable in your environment to match the
30
+echo location of your Java installation.
31
+
32
+goto fail
33
+
34
+:findJavaFromJavaHome
35
+set JAVA_HOME=%JAVA_HOME:"=%
36
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37
+
38
+if exist "%JAVA_EXE%" goto init
39
+
40
+echo.
41
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42
+echo.
43
+echo Please set the JAVA_HOME variable in your environment to match the
44
+echo location of your Java installation.
45
+
46
+goto fail
47
+
48
+:init
49
+@rem Get command-line arguments, handling Windows variants
50
+
51
+if not "%OS%" == "Windows_NT" goto win9xME_args
52
+
53
+:win9xME_args
54
+@rem Slurp the command line arguments.
55
+set CMD_LINE_ARGS=
56
+set _SKIP=2
57
+
58
+:win9xME_args_slurp
59
+if "x%~1" == "x" goto execute
60
+
61
+set CMD_LINE_ARGS=%*
62
+
63
+:execute
64
+@rem Setup the command line
65
+
66
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67
+
68
+@rem Execute Gradle
69
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70
+
71
+:end
72
+@rem End local scope for the variables with windows NT shell
73
+if "%ERRORLEVEL%"=="0" goto mainEnd
74
+
75
+:fail
76
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77
+rem the _cmd.exe /c_ return code!
78
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79
+exit /b 1
80
+
81
+:mainEnd
82
+if "%OS%"=="Windows_NT" endlocal
83
+
84
+:omega

+ 2
- 0
settings.gradle 查看文件

1
+rootProject.name='KFBv1'
2
+include ':app'

+ 59722
- 0
test.patch
文件差异内容过多而无法显示
查看文件