everywindchase 5 mēneši atpakaļ
vecāks
revīzija
178ff2ac53

+ 1 - 0
app/src/main/java/jx/cn/escort/apps/InternalApp.kt

@@ -5,6 +5,7 @@ import android.util.Log
 import androidx.lifecycle.Lifecycle
 import androidx.lifecycle.LifecycleOwner
 import androidx.lifecycle.LifecycleRegistry
+import com.xuexiang.xui.XUI
 import org.koin.android.ext.koin.androidContext
 import org.koin.core.context.startKoin
 import org.koin.core.logger.Level

+ 2 - 0
app/src/main/java/jx/cn/escort/ui/activity/LoginActivity.kt

@@ -13,6 +13,7 @@ import android.view.animation.RotateAnimation
 import android.view.animation.ScaleAnimation
 import androidx.appcompat.app.AppCompatActivity
 import androidx.lifecycle.lifecycleScope
+import com.xuexiang.xui.XUI
 import jx.cn.escort.R
 import jx.cn.escort.databinding.ActivityLoginBinding
 import jx.cn.escort.extension.ExtensionBinding.Companion.binding
@@ -38,6 +39,7 @@ class LoginActivity : AppCompatActivity(), KoinComponent {
 
 
     override fun onCreate(savedInstanceState: Bundle?) {
+        XUI.initTheme(this@LoginActivity);
         super.onCreate(savedInstanceState)
         setContentView(mBinding.root)
 

+ 2 - 2
app/src/main/java/jx/cn/escort/ui/activity/MainActivity.kt

@@ -17,6 +17,7 @@ import androidx.fragment.app.FragmentContainerView
 import androidx.fragment.app.FragmentTransaction
 import com.google.android.material.bottomnavigation.BottomNavigationView
 import com.google.android.material.navigation.NavigationBarView
+import com.xuexiang.xui.XUI
 import com.xuexiang.xui.widget.actionbar.TitleBar
 import jx.cn.escort.R
 import jx.cn.escort.databinding.ActivityMainBinding
@@ -38,10 +39,9 @@ class MainActivity : AppCompatActivity(), KoinComponent {
 
 
     override fun onCreate(savedInstanceState: Bundle?) {
+        XUI.initTheme(this@MainActivity);
         super.onCreate(savedInstanceState)
         setContentView(mBinding.root)
-
-
         var layout= findViewById<View>(R.id.top_bar)
         var topBarView=(layout as ViewGroup).getChildAt(0)  as  TitleBar
         var logoutView=(layout as ViewGroup).getChildAt(1)  as AppCompatTextView

+ 19 - 5
app/src/main/res/layout/activity_login.xml

@@ -6,6 +6,7 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:background="@drawable/login_bg"
+        android:theme="@style/App.Material"
 >
 
     <androidx.appcompat.widget.LinearLayoutCompat
@@ -33,7 +34,7 @@
             android:paddingHorizontal="30dp"
             android:paddingVertical="20dp"
             android:background="@drawable/login_compose_bg"
-            android:layout_marginTop="20dp">
+            android:layout_marginTop="16dp" app:layout_constraintHorizontal_bias="0.491">
         <androidx.appcompat.widget.AppCompatTextView
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
@@ -45,12 +46,25 @@
         />
 
 
+        <com.xuexiang.xui.widget.edittext.ClearEditText
+                android:id="@+id/login_account"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="50dp"
+                android:hint="输入账号"
+        />
 
-        <com.xuexiang.xui.widget.edittext.materialedittext.MaterialEditText
+
+        <com.xuexiang.xui.widget.edittext.PasswordEditText
+                android:id="@+id/input_password"
                 android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:inputType="text"
-                tools:text="23112"
+                android:layout_height="wrap_content"
+                android:gravity="start"
+                android:hint="输入密码"
+                android:inputType="textPassword"
+                android:textAlignment="viewStart"
+                app:pet_enableIconAlpha="true"
+                android:layout_marginTop="30dp"
         />
 
 

+ 12 - 3
app/src/main/res/layout/fragment_tasks.xml

@@ -5,13 +5,22 @@
         android:layout_height="match_parent"
 >
 
+
+    <com.google.android.material.divider.MaterialDivider android:layout_width="match_parent"
+                                                         android:layout_height="118dp">
+
+
+    </com.google.android.material.divider.MaterialDivider>
+
     <androidx.recyclerview.widget.RecyclerView
             android:id="@+id/tasks_recycle"
-            android:layout_width="match_parent" android:layout_height="match_parent"
+            android:layout_width="match_parent" android:layout_height="120dp"
             android:scrollbars="vertical"
-            android:background="#EFE9E9"
-
+            android:background="#DA0D0D"
+            android:layout_marginTop="300dp"
     />
 
 
+
+
 </com.xuexiang.xui.widget.alpha.XUIAlphaLinearLayout>

+ 1 - 0
app/src/main/res/layout/layout_nav_bar.xml

@@ -5,6 +5,7 @@
         xmlns:tools="http://schemas.android.com/tools"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
+        android:theme="@style/App.Material"
        >
 
 

+ 104 - 3
app/src/main/res/values/themes.xml

@@ -1,9 +1,110 @@
 <resources xmlns:tools="http://schemas.android.com/tools">
     <!-- Base application theme. -->
-    <style name="Base.Theme.Escortapp" parent="Theme.Material3.DayNight.NoActionBar">
-        <!-- Customize your light theme here. -->
-        <!-- <item name="colorPrimary">@color/my_light_primary</item> -->
+
+    <!-- 自定义XUI的主题. -->
+    <style name="Base.Theme.Escortapp" parent="XUITheme.Phone">
+
+        <item name="colorControlNormal">@color/xui_config_color_control_normal</item>
+
+        <!--**********************************************
+        *               通用颜色属性设置                    *
+        ***********************************************-->
+        <item name="xui_config_color_error_text">@color/xui_config_color_red</item>
+        <item name="xui_config_color_input_text">@color/xui_config_color_edittext_input_text</item>
+        <item name="xui_config_color_hint_text">@color/xui_config_color_edittext_hint_text</item>
+        <item name="xui_config_color_stroke">@color/xui_config_color_edittext_stroke</item>
+        <item name="xui_config_color_disable">@color/xui_config_color_edittext_disable</item>
+        <item name="xui_config_color_pressed">@color/xui_config_color_background_pressed</item>
+
+
+
+
+        <!--全局样式-->
+        <item name="xui_config_content_spacing_horizontal">16dp</item>
+        <item name="xui_config_content_spacing_vertical">10dp</item>
+
+        <!--文字字号样式-->
+        <item name="xui_config_size_title_text">21sp</item>
+        <item name="xui_config_size_content_text">18sp</item>
+        <item name="xui_config_size_explain_text">14sp</item>
+        <item name="xui_config_size_spinner_text">14sp</item>
+
+        <!--按钮样式-->
+        <item name="xui_btn_view_radius">8dp</item>
+        <item name="xui_btn_view_width">@dimen/default_btn_view_width_phone</item>
+        <item name="xui_btn_view_height">36dp</item>
+        <item name="xui_btn_view_text_size">14sp</item>
+        <item name="xui_btn_view_border_width">0.8dp</item>
+        <item name="xui_config_icon_drawable_padding">8dp</item>
+
+        <!--输入框样式-->
+        <item name="xui_config_size_edittext_input_text">14sp</item>
+        <item name="xui_config_size_edittext_helper_text">10sp</item>
+        <item name="xui_config_size_edittext_components_spacing">8dp</item>
+        <item name="xui_config_size_edittext_left_padding">12dp</item>
+        <item name="xui_config_size_edittext_radius">5dp</item>
+        <item name="xui_config_size_edittext_height">36dp</item>
+
+        <!--actionbar-->
+        <item name="xui_actionbar_height">60dp</item>
+        <item name="search_view_actionbar_height">60dp</item>
+        <item name="xui_actionbar_title_text_size">21dp</item>
+        <item name="xui_actionbar_action_text_size">18sp</item>
+        <item name="xui_actionbar_sub_text_size">@dimen/xui_actionbar_sub_text_size_phone</item>
+        <item name="xui_actionbar_action_padding">8dp</item>
+        <item name="xui_actionbar_side_text_padding">15dp</item>
+
+        <!--spinner-->
+        <item name="ms_padding_left_size">10dp</item>
+        <item name="ms_padding_top_size">8dp</item>
+        <item name="ms_item_height_size">36dp</item>
+        <item name="ms_dropdown_offset">2dp</item>
+        <item name="ms_arrow_size">10dp</item>
+        <!--StatefulLayout-->
+        <item name="stf_progressbar_size">70dp</item>
+        <item name="stf_tip_img_size">90dp</item>
+        <!--*********************************************
+        *                  Dialog                       *
+        **********************************************-->
+        <item name="xui_dialog_radius_size">8dp</item>
+        <item name="xui_dialog_loading_padding_size">30dp</item>
+        <item name="xui_dialog_loading_min_size">110dp</item>
+        <item name="xui_dialog_mini_loading_padding_size">20dp</item>
+        <item name="xui_dialog_mini_loading_min_size">100dp</item>
+        <item name="xui_loading_view_size">85dp</item>
+        <item name="xui_mini_loading_view_size">30dp</item>
+        <item name="xui_loading_text_size">14sp</item>
+        <item name="xui_loading_view_width">5dp</item>
+        <item name="xui_loading_margin_size">8dp</item>
+        <item name="xui_mini_loading_margin_size">15dp</item>
+        <item name="mini_loading_view_size">25dp</item>
     </style>
 
+
+
+
+    <style name="App.Material" parent="Theme.MaterialComponents.Light.NoActionBar">
+        <item name="colorAccent">@color/xui_config_color_main_theme</item>
+        <item name="colorPrimary">@color/xui_config_color_main_theme</item>
+        <item name="colorPrimaryDark">@color/xui_config_color_main_theme</item>
+        <item name="colorControlNormal">@color/xui_config_color_control_normal</item>
+
+        <item name="xui_config_color_error_text">@color/xui_config_color_red</item>
+        <item name="xui_config_color_input_text">@color/xui_config_color_edittext_input_text</item>
+        <item name="xui_config_color_hint_text">@color/xui_config_color_edittext_hint_text</item>
+        <item name="xui_config_color_stroke">@color/xui_config_color_edittext_stroke</item>
+        <item name="xui_config_color_disable">@color/xui_config_color_edittext_disable</item>
+        <item name="xui_config_color_pressed">@color/xui_config_color_background_pressed</item>
+        <item name="xui_btn_view_normal_color">@color/xui_btn_blue_normal_color</item>
+        <item name="xui_btn_view_touch_color">@color/xui_btn_blue_select_color</item>
+
+        <item name="xui_config_color_title_text">@color/xui_config_color_title_text</item>
+        <item name="xui_config_color_content_text">@color/xui_config_color_content_text</item>
+        <item name="xui_config_color_explain_text">@color/xui_config_color_explain_text</item>
+    </style>
+
+
+
+
     <style name="Theme.Escortapp" parent="Base.Theme.Escortapp"/>
 </resources>