Ver Fonte

添加首页基础样式

Frankensteinly há 1 ano atrás
pai
commit
f2fca80b9b

+ 1 - 1
app/src/main/AndroidManifest.xml

@@ -25,7 +25,7 @@
             android:name=".activity.SopActivity"
             android:exported="false" />
         <activity
-            android:name=".activity.WelcomeActivity"
+            android:name=".activity.HomeActivity"
             android:exported="false" />
         <activity
             android:name=".activity.AuthActivity"

+ 20 - 0
app/src/main/java/com/grkj/iscs/activity/HomeActivity.kt

@@ -0,0 +1,20 @@
+package com.grkj.iscs.activity
+
+import com.grkj.iscs.base.BaseMvpActivity
+import com.grkj.iscs.databinding.ActivityHomeBinding
+import com.grkj.iscs.iview.IHomeView
+import com.grkj.iscs.presenter.HomePresenter
+
+class HomeActivity : BaseMvpActivity<IHomeView, HomePresenter, ActivityHomeBinding>() {
+
+    override val viewBinding: ActivityHomeBinding
+        get() = ActivityHomeBinding.inflate(layoutInflater)
+
+    override fun initView() {
+
+    }
+
+    override fun initPresenter(): HomePresenter {
+        return HomePresenter()
+    }
+}

+ 1 - 1
app/src/main/java/com/grkj/iscs/activity/MainActivity.kt

@@ -31,7 +31,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
         }
 
         mBinding?.home?.setOnClickListener {
-            startActivity(Intent(this, WelcomeActivity::class.java))
+            startActivity(Intent(this, HomeActivity::class.java))
         }
 
         mBinding?.sop?.setOnClickListener {

+ 0 - 14
app/src/main/java/com/grkj/iscs/activity/WelcomeActivity.kt

@@ -1,14 +0,0 @@
-package com.grkj.iscs.activity
-
-import com.grkj.iscs.base.BaseActivity
-import com.grkj.iscs.databinding.ActivityWelcomeBinding
-
-class WelcomeActivity : BaseActivity<ActivityWelcomeBinding>() {
-
-    override val viewBinding: ActivityWelcomeBinding
-        get() = ActivityWelcomeBinding.inflate(layoutInflater)
-
-    override fun initView() {
-
-    }
-}

+ 5 - 0
app/src/main/java/com/grkj/iscs/iview/IHomeView.kt

@@ -0,0 +1,5 @@
+package com.grkj.iscs.iview
+
+import com.grkj.iscs.base.IView
+
+interface IHomeView : IView {}

+ 6 - 0
app/src/main/java/com/grkj/iscs/presenter/HomePresenter.kt

@@ -0,0 +1,6 @@
+package com.grkj.iscs.presenter
+
+import com.grkj.iscs.base.BasePresenter
+import com.grkj.iscs.iview.IHomeView
+
+class HomePresenter : BasePresenter<IHomeView>() {}

+ 162 - 0
app/src/main/res/layout/activity_home.xml

@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout 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"
+    android:id="@+id/main"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:background="@color/main_color"
+    tools:context=".activity.HomeActivity">
+
+    <!--    <com.grkj.iscs.widget.TitleBar-->
+    <!--        android:id="@+id/title_bar"-->
+    <!--        android:layout_width="match_parent"-->
+    <!--        android:layout_height="wrap_content"-->
+    <!--        app:layout_constraintLeft_toLeftOf="parent"-->
+    <!--        app:layout_constraintTop_toTopOf="parent"-->
+    <!--        app:title="@string/home_page" />-->
+
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:layout_width="0dp"
+        android:layout_height="0dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintHeight_percent="0.6"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintWidth_percent="0.8">
+
+        <!--    当前时间    -->
+        <LinearLayout
+            android:id="@+id/ll_time"
+            android:layout_width="0dp"
+            android:layout_height="0dp"
+            android:layout_margin="10px"
+            android:background="@color/colorPrimary"
+            android:orientation="vertical"
+            app:layout_constraintBottom_toTopOf="@id/ll_sop"
+            app:layout_constraintLeft_toLeftOf="@id/barrier"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintWidth_percent="0.25">
+
+            <TextView
+                style="@style/CommonTextView"
+                android:text="@string/current_time" />
+
+            <TextClock style="@style/CommonTextView" />
+        </LinearLayout>
+
+        <!--   当前作业票     -->
+        <LinearLayout
+            android:id="@+id/ll_sop"
+            android:layout_width="0dp"
+            android:layout_height="0dp"
+            android:layout_margin="10px"
+            android:background="@color/colorPrimary"
+            android:orientation="vertical"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintLeft_toLeftOf="@id/ll_time"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintTop_toBottomOf="@id/ll_time">
+
+            <TextView
+                style="@style/CommonTextView"
+                android:text="@string/current_sop_number" />
+
+            <TextView style="@style/CommonTextView" />
+        </LinearLayout>
+
+        <androidx.constraintlayout.widget.Barrier
+            android:id="@+id/barrier"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            app:barrierDirection="start"
+            app:constraint_referenced_ids="ll_time,ll_sop" />
+
+        <!--    2按钮    -->
+        <LinearLayout
+            android:id="@+id/ll_type_two"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:orientation="horizontal"
+            app:layout_constraintHorizontal_weight="1"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintRight_toLeftOf="@id/barrier"
+            app:layout_constraintTop_toTopOf="parent"
+            android:visibility="gone">
+
+            <LinearLayout
+                android:id="@+id/ll_module_left"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_margin="10px"
+                android:layout_weight="1"
+                android:background="@color/colorPrimary"
+                android:orientation="vertical">
+
+            </LinearLayout>
+
+            <LinearLayout
+                android:id="@+id/ll_module_right"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_margin="10px"
+                android:layout_weight="1"
+                android:background="@color/colorPrimary"
+                android:orientation="vertical">
+
+            </LinearLayout>
+        </LinearLayout>
+
+        <!--    4按钮    -->
+        <LinearLayout
+            android:id="@+id/ll_type_four"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:orientation="vertical"
+            app:layout_constraintHorizontal_weight="1"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintRight_toLeftOf="@id/barrier"
+            app:layout_constraintTop_toTopOf="parent">
+
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:layout_weight="1"
+                android:background="@color/colorPrimary"
+                android:layout_margin="10px">
+
+            </androidx.constraintlayout.widget.ConstraintLayout>
+
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:layout_weight="1"
+                android:background="@color/colorPrimary"
+                android:layout_margin="10px">
+
+            </androidx.constraintlayout.widget.ConstraintLayout>
+
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:layout_weight="1"
+                android:background="@color/colorPrimary"
+                android:layout_margin="10px">
+
+            </androidx.constraintlayout.widget.ConstraintLayout>
+
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:layout_weight="1"
+                android:background="@color/colorPrimary"
+                android:layout_margin="10px">
+
+            </androidx.constraintlayout.widget.ConstraintLayout>
+        </LinearLayout>
+    </androidx.constraintlayout.widget.ConstraintLayout>
+
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 0 - 48
app/src/main/res/layout/activity_welcome.xml

@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<androidx.constraintlayout.widget.ConstraintLayout 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"
-    android:id="@+id/main"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    tools:context=".activity.WelcomeActivity">
-
-    <com.grkj.iscs.widget.TitleBar
-        android:id="@+id/title_bar"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintTop_toTopOf="parent"
-        app:title="@string/home_page" />
-
-    <ImageView
-        android:id="@+id/start"
-        android:layout_width="@dimen/home_navi_width"
-        android:layout_height="@dimen/home_navi_height"
-        android:background="@color/main_color"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintRight_toLeftOf="@id/current"
-        app:layout_constraintTop_toBottomOf="@id/title_bar" />
-
-    <ImageView
-        android:id="@+id/current"
-        android:layout_width="@dimen/home_navi_width"
-        android:layout_height="@dimen/home_navi_height"
-        android:background="@color/main_color"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintLeft_toRightOf="@id/start"
-        app:layout_constraintRight_toLeftOf="@id/history"
-        app:layout_constraintTop_toBottomOf="@id/title_bar" />
-
-    <ImageView
-        android:id="@+id/history"
-        android:layout_width="@dimen/home_navi_width"
-        android:layout_height="@dimen/home_navi_height"
-        android:background="@color/main_color"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintLeft_toRightOf="@id/current"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toBottomOf="@id/title_bar" />
-
-</androidx.constraintlayout.widget.ConstraintLayout>

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

@@ -21,4 +21,6 @@
     <string name="sop_type">作业类型</string>
     <string name="start_time">开始时间</string>
     <string name="end_time">结束时间</string>
+    <string name="current_time">当前时间</string>
+    <string name="current_sop_number">当前作业票</string>
 </resources>