xiongweixp 2 mesiacov pred
rodič
commit
ac065f8c56

+ 1 - 1
.idea/compiler.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="CompilerConfiguration">
-    <bytecodeTargetLevel target="17" />
+    <bytecodeTargetLevel target="21" />
   </component>
 </project>

+ 1 - 1
.idea/misc.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="ExternalStorageConfigurationManager" enabled="true" />
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="Android API 35, extension level 13 Platform" project-jdk-type="Android SDK">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_21" project-jdk-name="21" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/build/classes" />
   </component>
   <component name="ProjectType">

+ 4 - 4
app/src/main/java/tech/xiongweixp/touchaction/MainActivity.kt

@@ -72,10 +72,10 @@ class MainActivity : ComponentActivity() {
                 var device = 0;
                 when (webhookID) {
                     "computer" -> {
-                        showMessage(0, ret, "电脑已打开")
+                        showMessage(0, ret, "电脑开关操作成功")
                     }
                     "light" -> {
-                        showMessage(1, ret, "灯已打开")
+                        showMessage(1, ret, "灯开关切管成功")
                     }
                     else -> {
                         device = 2
@@ -127,7 +127,7 @@ class MainActivity : ComponentActivity() {
                     computerLayout!!.visibility = ConstraintLayout.VISIBLE
                     lightLayout!!.visibility = ConstraintLayout.INVISIBLE
                     mainLayout!!.visibility = ConstraintLayout.INVISIBLE
-                    computerTextView!!.text = "操作电脑开关"
+                    computerTextView!!.text = "正在操作电脑开关..."
                     hassioRequest("computer")
                 }
                 "light" -> {
@@ -135,7 +135,7 @@ class MainActivity : ComponentActivity() {
                     computerLayout!!.visibility = ConstraintLayout.INVISIBLE
                     lightLayout!!.visibility = ConstraintLayout.VISIBLE
                     mainLayout!!.visibility = ConstraintLayout.INVISIBLE
-                    lightTextView!!.text = "操作灯开关"
+                    lightTextView!!.text = "正在操作灯开关..."
                     hassioRequest("light")
                 }
                 else -> {

+ 4 - 5
app/src/main/res/layout/mainlayout.xml

@@ -74,11 +74,10 @@
         <TextView
                 android:text="电脑"
                 android:layout_width="wrap_content"
-                android:layout_height="42dp" android:id="@+id/computerText"
+                android:layout_height="47dp" android:id="@+id/computerText"
                 tools:text="电脑" android:textSize="24sp"
                 android:layout_marginTop="36dp"
                 app:layout_constraintTop_toBottomOf="@+id/imageView" app:layout_constraintStart_toStartOf="parent"
-                android:layout_marginStart="186dp" android:layout_marginEnd="177dp"
                 app:layout_constraintEnd_toEndOf="parent" app:layout_constraintBottom_toBottomOf="parent"
                 android:layout_marginBottom="295dp"/>
         <Button
@@ -89,7 +88,8 @@
                 app:layout_constraintTop_toBottomOf="@+id/computerText" app:layout_constraintStart_toStartOf="parent"
                 android:layout_marginStart="51dp" android:layout_marginEnd="44dp"
                 app:layout_constraintEnd_toEndOf="parent" app:layout_constraintBottom_toBottomOf="parent"
-                android:layout_marginBottom="198dp" android:background="@drawable/button_shape" android:textColor="@color/white"/>
+                android:layout_marginBottom="198dp" android:background="@drawable/button_shape"
+                android:textColor="@color/white"/>
     </androidx.constraintlayout.widget.ConstraintLayout>
     <androidx.constraintlayout.widget.ConstraintLayout
             android:layout_width="match_parent"
@@ -107,12 +107,11 @@
         <TextView
                 android:text="灯"
                 android:layout_width="wrap_content"
-                android:layout_height="wrap_content" android:id="@+id/lightText"
+                android:layout_height="46dp" android:id="@+id/lightText"
                 android:textSize="24sp"
                 android:layout_marginTop="36dp"
                 app:layout_constraintTop_toBottomOf="@id/lightImageView"
                 app:layout_constraintStart_toStartOf="parent"
-                android:layout_marginStart="186dp" android:layout_marginEnd="177dp"
                 app:layout_constraintEnd_toEndOf="parent" app:layout_constraintBottom_toBottomOf="parent"
                 android:layout_marginBottom="295dp"/>
         <Button