The final version for lede-gui (the phone app for device registration)
[iot2.git] / others / lede-gui / src / main / java / com / example / lede2 / ApplicationsList.java
diff --git a/others/lede-gui/src/main/java/com/example/lede2/ApplicationsList.java b/others/lede-gui/src/main/java/com/example/lede2/ApplicationsList.java
new file mode 100644 (file)
index 0000000..26036b6
--- /dev/null
@@ -0,0 +1,80 @@
+package com.example.lede2;\r
+\r
+import android.app.ProgressDialog;\r
+import android.content.Intent;\r
+import android.os.Bundle;\r
+import android.support.v7.app.AppCompatActivity;\r
+import android.view.View;\r
+import android.widget.Button;\r
+\r
+/**\r
+ * Created by Brian on 4/16/2018.\r
+ */\r
+\r
+public class ApplicationsList extends AppCompatActivity implements View.OnClickListener {\r
+    private Button homeSecurityButton;\r
+    private Button irrigationButton;\r
+    private Button lifxTestButton;\r
+    private Button smartLightsButton;\r
+    private Button speakerButton;\r
+    private ProgressDialog dialog;\r
+\r
+    @Override\r
+    protected void onCreate(Bundle savedInstanceState) {\r
+        super.onCreate(savedInstanceState);\r
+        setContentView(R.layout.applications);\r
+        homeSecurityButton = (Button) findViewById(R.id.homeSecurityButton);\r
+        irrigationButton = (Button) findViewById(R.id.irrigationButton);\r
+        lifxTestButton = (Button) findViewById(R.id.lifxTestButton);\r
+        smartLightsButton = (Button) findViewById(R.id.smartLightsButton);\r
+        speakerButton = (Button) findViewById(R.id.speakerButton);\r
+\r
+        homeSecurityButton.setOnClickListener(this);\r
+        irrigationButton.setOnClickListener(this);\r
+        lifxTestButton.setOnClickListener(this);\r
+        smartLightsButton.setOnClickListener(this);\r
+        speakerButton.setOnClickListener(this);\r
+\r
+\r
+\r
+    }\r
+\r
+    @Override\r
+    public void onClick(View view) {\r
+        dialog = new ProgressDialog(this);\r
+        dialog.setMessage("Please Wait");\r
+        dialog.setCancelable(false);\r
+        dialog.setInverseBackgroundForced(false);\r
+        dialog.show();\r
+\r
+        if(view == homeSecurityButton){\r
+            startActivity(new Intent(this, HomeSecurity.class));\r
+        }\r
+        if(view == irrigationButton){\r
+            startActivity(new Intent(this, Irrigation.class));\r
+\r
+        }\r
+        if(view == lifxTestButton){\r
+            startActivity(new Intent(this, Lifxtest.class));\r
+\r
+        }\r
+        if(view == smartLightsButton){\r
+            startActivity(new Intent(this, SmartLights.class));\r
+\r
+        }\r
+        if(view == speakerButton){\r
+            startActivity(new Intent(this, Speaker.class));\r
+\r
+        }\r
+    }\r
+    @Override\r
+    protected void onResume() {\r
+        super.onResume();\r
+        if(dialog != null && dialog.isShowing()){\r
+            dialog.dismiss();\r
+        }\r
+    }\r
+}\r
+\r
+\r
+\r