Răsfoiți Sursa

refactor(更新)
- 登录界面完成
- 首页问题修复中

周文健 5 luni în urmă
părinte
comite
608950cdc0

+ 3 - 2
app/src/main/java/com/grkj/iscs/features/main/activity/MainActivity.kt

@@ -58,13 +58,14 @@ class MainActivity() : BaseActivity<ActivityMainBinding>() {
         binding.bottomNav.menu.clear()
         val userPerms = mutableListOf<String>(
             "PERM_HOME",
-            "PERM_JOB_MANAGE",
+            "PERM_DATA_MANAGE",
             "PERM_JOB_MANAGE",
             "PERM_HARDWARE_MANAGE",
             "PERM_EXCEPTION_MANAGE"
         )
         tabConfigs.forEachIndexed { index, cfg ->
             if (userPerms.contains(cfg.permission)) {
+                logger.info("菜单:${index},${cfg}")
                 binding.bottomNav.menu
                     .add(Menu.NONE, cfg.id, index, cfg.title)
                     .setIcon(cfg.icon)
@@ -75,7 +76,7 @@ class MainActivity() : BaseActivity<ActivityMainBinding>() {
         val graphMap = tabConfigs
             .filter { binding.bottomNav.menu.findItem(it.id) != null }
             .associate { it.id to it.graphRes }
-
+        logger.info("graphMap: ${graphMap}")
         // 把 BottomNavigationView 和 NavController 绑定
         setupBottomNavigation(binding.bottomNav, graphMap)
 

+ 9 - 0
app/src/main/res/drawable/icon_login_menu_card.xml

@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="117dp"
+    android:height="91dp"
+    android:viewportWidth="117"
+    android:viewportHeight="91">
+  <path
+      android:pathData="M16.26,90.22C6.06,90.22 0.93,85.19 0.93,75.13V15.46C0.93,5.4 6.06,0.32 16.26,0.32H100.74C110.99,0.32 116.07,5.4 116.07,15.46V75.13C116.07,85.19 110.99,90.22 100.74,90.22H16.26ZM16.36,82.36H100.64C105.47,82.36 108.21,79.77 108.21,74.69V15.9C108.21,10.82 105.47,8.19 100.64,8.19H16.36C11.48,8.19 8.79,10.82 8.79,15.9V74.69C8.79,79.77 11.48,82.36 16.36,82.36ZM38.19,45.05C32.28,45.05 27.49,40.07 27.49,33.38C27.49,27.13 32.28,21.96 38.19,21.96C44.14,21.96 48.88,27.13 48.88,33.38C48.88,40.07 44.14,45.1 38.19,45.05ZM70.02,29.18C68.27,29.18 66.95,27.86 66.95,26.15C66.95,24.49 68.27,23.18 70.02,23.18H96.68C98.39,23.18 99.71,24.49 99.71,26.15C99.71,27.86 98.39,29.18 96.68,29.18H70.02ZM70.02,48.32C68.27,48.32 66.95,46.96 66.95,45.25C66.95,43.59 68.27,42.32 70.02,42.32H96.68C98.39,42.32 99.71,43.59 99.71,45.25C99.71,46.96 98.39,48.32 96.68,48.32H70.02ZM19.14,67.41C17.53,67.41 16.75,66.34 16.75,64.88C16.75,60.29 23.59,48.47 38.19,48.47C52.79,48.47 59.67,60.29 59.67,64.88C59.67,66.34 58.89,67.41 57.28,67.41H19.14ZM70.02,67.41C68.27,67.41 66.95,66.14 66.95,64.48C66.95,62.78 68.27,61.41 70.02,61.41H96.68C98.39,61.41 99.71,62.78 99.71,64.48C99.71,66.14 98.39,67.41 96.68,67.41H70.02Z"
+      android:fillColor="#D7D2D2"/>
+</vector>

+ 128 - 0
app/src/main/res/layout-land/activity_login.xml

@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools">
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@mipmap/bg_main"
+        android:fitsSystemWindows="true"
+        android:orientation="vertical">
+
+        <FrameLayout
+            android:id="@+id/header_layout"
+            android:layout_width="match_parent"
+            android:layout_height="35dp"
+            android:paddingHorizontal="5dp">
+
+            <ImageView
+                android:layout_width="97dp"
+                android:layout_height="17.5dp"
+                android:layout_gravity="center_vertical"
+                android:src="@mipmap/icon_logo" />
+
+            <TextClock
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_gravity="right"
+                android:format12Hour="yyyy-MM-dd HH:mm:ss"
+                android:format24Hour="yyyy-MM-dd HH:mm:ss"
+                android:gravity="center_vertical"
+                android:textColor="@color/white"
+                android:textSize="10sp" />
+        </FrameLayout>
+
+        <View
+            android:id="@+id/header_line"
+            android:layout_width="match_parent"
+            android:layout_height="1.5dp"
+            android:layout_below="@+id/header_layout"
+            android:background="@color/white30" />
+
+        <LinearLayout
+            android:id="@+id/main_content"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_below="@+id/header_line"
+            android:orientation="vertical">
+
+            <TextView
+                android:id="@+id/version"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="right"
+                android:layout_marginTop="5dp"
+                android:layout_marginRight="5dp"
+                android:textColor="@color/white"
+                android:textSize="7sp"
+                tools:text="v1.0" />
+
+            <com.grkj.ui_base.widget.ShadowTextView
+                android:id="@+id/title_cn"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_horizontal"
+                android:layout_marginTop="10dp"
+                android:text="@string/loto"
+                android:textColor="@color/white"
+                android:textSize="30sp"
+                android:textStyle="bold" />
+
+            <com.grkj.ui_base.widget.ShadowTextView
+                android:id="@+id/title_en"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_horizontal"
+                android:layout_marginTop="10dp"
+                android:text="@string/loto_en"
+                android:textColor="@color/white"
+                android:textSize="12.5sp"
+                android:textStyle="bold" />
+
+            <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/login_type_rv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_horizontal"
+                android:layout_marginVertical="20dp" />
+
+            <LinearLayout
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_horizontal"
+                android:divider="@drawable/common_divider_normal_space_horizontal"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:showDividers="middle">
+
+                <View
+                    android:layout_width="10dp"
+                    android:layout_height="10dp"
+                    android:background="@drawable/login_tip_circle" />
+
+                <TextView
+                    android:id="@+id/login_tip_tv"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_alignParentBottom="true"
+                    android:gravity="center_horizontal"
+                    android:text="@string/login_tip"
+                    android:textColor="@color/white"
+                    android:textSize="12.5sp" />
+            </LinearLayout>
+        </LinearLayout>
+
+
+        <TextView
+            android:id="@+id/tec_support"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_alignParentBottom="true"
+            android:layout_marginBottom="10dp"
+            android:gravity="center_horizontal"
+            android:text="@string/tec_support"
+            android:textColor="@color/white"
+            android:textSize="9sp" />
+    </RelativeLayout>
+</layout>

+ 38 - 0
shared/src/main/cpp/CMakeLists.txt

@@ -0,0 +1,38 @@
+
+# For more information about using CMake with Android Studio, read the
+# documentation: https://d.android.com/studio/projects/add-native-code.html.
+# For more examples on how to use CMake, see https://github.com/android/ndk-samples.
+
+# Sets the minimum CMake version required for this project.
+cmake_minimum_required(VERSION 3.22.1)
+
+# Declares the project name. The project name can be accessed via ${ PROJECT_NAME},
+# Since this is the top level CMakeLists.txt, the project name is also accessible
+# with ${CMAKE_PROJECT_NAME} (both CMake variables are in-sync within the top level
+# build script scope).
+project("iscs_shared")
+
+# Creates and names a library, sets it as either STATIC
+# or SHARED, and provides the relative paths to its source code.
+# You can define multiple libraries, and CMake builds them for you.
+# Gradle automatically packages shared libraries with your APK.
+#
+# In this top level CMakeLists.txt, ${CMAKE_PROJECT_NAME} is used to define
+# the target library name; in the sub-module's CMakeLists.txt, ${PROJECT_NAME}
+# is preferred for the same purpose.
+#
+# In order to load a library into your app from Java/Kotlin, you must call
+# System.loadLibrary() and pass the name of the library defined here;
+# for GameActivity/NativeActivity derived applications, the same library name must be
+# used in the AndroidManifest.xml file.
+add_library(${CMAKE_PROJECT_NAME} SHARED
+    # List C/C++ source files with relative paths to this CMakeLists.txt.
+    shared.cpp)
+
+# Specifies libraries CMake should link to your target library. You
+# can link libraries from various origins, such as libraries defined in this
+# build script, prebuilt third-party libraries, or Android system libraries.
+target_link_libraries(${CMAKE_PROJECT_NAME}
+    # List libraries link to the target library
+    android
+    log)

+ 24 - 0
shared/src/main/cpp/shared.cpp

@@ -0,0 +1,24 @@
+#include <jni.h>
+
+// Write C++ code here.
+//
+// Do not forget to dynamically load the C++ library into your application.
+//
+// For instance,
+//
+// In MainActivity.java:
+//    static {
+//       System.loadLibrary("shared");
+//    }
+//
+// Or, in MainActivity.kt:
+//    companion object {
+//      init {
+//         System.loadLibrary("shared")
+//      }
+//    }
+extern "C"
+JNIEXPORT jstring JNICALL
+Java_com_grkj_shared_config_AESConfig_aesKey(JNIEnv *env, jobject thiz) {
+    return env->NewStringUTF("htD3aLklkYBR3ndN");
+}