liuzhenxing 3 年之前
父节点
当前提交
ac53287d8d

+ 1 - 0
.idea/misc.xml

@@ -4,6 +4,7 @@
     <option name="filePathToZoomLevelMap">
       <map>
         <entry key="app/src/main/res/layout/activity_main.xml" value="0.3546195652173913" />
+        <entry key="app/src/main/res/layout/display_activity.xml" value="0.20199275362318841" />
         <entry key="app/src/main/res/layout/item_connections.xml" value="0.19300911854103345" />
         <entry key="app/src/main/res/layout/item_icon.xml" value="0.25" />
         <entry key="app/src/main/res/layout/item_icon_title.xml" value="0.19300911854103345" />

+ 17 - 0
app/src/main/java/com/xplora/xpsettings/Activity/BaseActivity.java

@@ -2,7 +2,9 @@ package com.xplora.xpsettings.Activity;
 
 import android.app.Activity;
 import android.os.Bundle;
+import android.view.View;
 import android.view.Window;
+import android.view.WindowManager;
 import android.widget.TextView;
 
 
@@ -15,6 +17,9 @@ public class BaseActivity extends Activity {
     protected void onCreate(Bundle savedInstanceState) {
         requestWindowFeature(Window.FEATURE_NO_TITLE);// 不显示标题
         super.onCreate(savedInstanceState);
+
+        setFullView();
+        setHardKey();
     }
 
     void setWatchTitle(String titleStr) {
@@ -22,4 +27,16 @@ public class BaseActivity extends Activity {
         if (title != null)
             title.setText(titleStr);
     }
+
+    private void setFullView() {
+        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
+        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
+    }
+
+    private void setHardKey() {
+        View decorView = getWindow().getDecorView();
+        int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+                | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_FULLSCREEN;
+        decorView.setSystemUiVisibility(uiOptions);
+    }
 }

+ 1 - 1
app/src/main/java/com/xplora/xpsettings/Activity/DisplayActivity.java

@@ -20,7 +20,7 @@ public class DisplayActivity extends BaseActivity {
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        setContentView(R.layout.list_activity);
+        setContentView(R.layout.display_activity);
 
         ResUtils.initResUtils(this, Constant.PACKAGE_NAME);
 

+ 32 - 0
app/src/main/res/layout/display_activity.xml

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/black"
+    android:orientation="vertical"
+    >
+
+    <ListView
+        android:id="@+id/list_view"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="45dp"
+        >
+    </ListView>
+
+    <TextView
+        android:id="@+id/hint"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center_horizontal"
+        android:layout_marginStart="8dp"
+        android:layout_marginEnd="8dp"
+        android:layout_marginBottom="20dp"
+        android:textSize="10dp"
+        android:textColor="#FFFFFFFF"
+        android:fontFamily="Roboto"
+        android:textFontWeight="400"
+        android:textAlignment="center"
+        android:text="@string/app_name_status_hint"
+        />
+</LinearLayout>

+ 1 - 1
app/src/main/res/layout/list_activity.xml

@@ -22,7 +22,7 @@
         android:id="@+id/list_view"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginTop="4dp"
+        android:layout_marginTop="45dp"
         >
     </ListView>
 </LinearLayout>

+ 1 - 0
app/src/main/res/values/strings.xml

@@ -33,4 +33,5 @@
 
     <string name="available_devices">Available devices</string>
     <string name="networks">Networks</string>
+    <string name="app_name_status_hint">When turned on, \n will display the watch app name</string>
 </resources>