Ver Fonte

首页统计

everywindchase há 5 meses atrás
pai
commit
ea84c91ff3

+ 1 - 1
app/src/main/java/jx/cn/escort/adapter/IndexRecycleAdapter.kt

@@ -31,7 +31,7 @@ class IndexRecycleAdapter(): RecyclerView.Adapter<IndexRecycleAdapter.IndexRecyc
     }
 
     override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): IndexRecycleViewHolder {
-        val view= LayoutInflater.from(context).inflate(R.layout.fragment_index_card,parent,false)
+        val view= LayoutInflater.from(context).inflate(R.layout.fragment_tasks_card,parent,false)
         return IndexRecycleViewHolder(view)
 
     }

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

@@ -11,20 +11,14 @@ import android.view.View
 import android.view.ViewGroup
 import android.widget.Toast
 import androidx.appcompat.app.AppCompatActivity
-import androidx.appcompat.view.menu.MenuItemImpl
 import androidx.appcompat.widget.AppCompatTextView
-import androidx.core.view.children
 import androidx.fragment.app.Fragment
 import androidx.fragment.app.FragmentContainerView
 import androidx.fragment.app.FragmentTransaction
-import com.google.android.material.bottomnavigation.BottomNavigationItemView
 import com.google.android.material.bottomnavigation.BottomNavigationView
-import com.google.android.material.floatingactionbutton.FloatingActionButton
 import com.google.android.material.navigation.NavigationBarView
 import com.xuexiang.xui.widget.actionbar.TitleBar
-import com.xuexiang.xui.widget.searchview.MaterialSearchView
 import jx.cn.escort.R
-import jx.cn.escort.databinding.ActivityLoginBinding
 import jx.cn.escort.databinding.ActivityMainBinding
 import jx.cn.escort.extension.ExtensionBinding.Companion.binding
 import jx.cn.escort.ui.fragment.BaseNavFragment
@@ -104,12 +98,16 @@ class MainActivity : AppCompatActivity(), KoinComponent {
                 when(id){
                    jx.cn.escort.R.id.index-> {
 
+                       switchFragment(BaseNavFragment(R.layout.fragment_index, context = baseContext),item)
 
 
-                       var indexMenu=bottomNav.menu.findItem(R.id.index);
+                   }
+                    R.id.tasks->{
 
-                       indexMenu.menuInfo
-                       var  fragmentContainerView=findViewById<FragmentContainerView>(R.id.nav_content)
+                        var indexMenu=bottomNav.menu.findItem(R.id.tasks);
+
+                        indexMenu.menuInfo
+                        var  fragmentContainerView=findViewById<FragmentContainerView>(R.id.nav_content)
 //                       var density=resources.displayMetrics.density
 //                       fragmentContainerView.setPadding(
 //                           fragmentContainerView.paddingLeft,
@@ -117,10 +115,9 @@ class MainActivity : AppCompatActivity(), KoinComponent {
 //                           fragmentContainerView.paddingRight,
 //                           fragmentContainerView.paddingBottom
 //                       )
-                       fragmentContainerView.requestLayout()
-                       switchFragment(BaseNavFragment(R.layout.fragment_index, context = baseContext),item)
-                   }
-                    R.id.tasks->{
+                        fragmentContainerView.requestLayout()
+
+
                         switchFragment(BaseNavFragment(R.layout.fragment_tasks, context = baseContext),item)
                     }
                     R.id.mine->{

+ 2 - 5
app/src/main/java/jx/cn/escort/ui/fragment/BaseNavFragment.kt

@@ -7,13 +7,10 @@ import android.os.Bundle
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
-import androidx.core.view.marginTop
 import androidx.fragment.app.Fragment
 import androidx.recyclerview.widget.GridLayoutManager
 import androidx.recyclerview.widget.RecyclerView
-import com.xuexiang.xui.widget.banner.recycler.BannerLayout
 import jx.cn.escort.R
-import jx.cn.escort.adapter.IndexBannerAdapter
 import jx.cn.escort.adapter.IndexRecycleAdapter
 
 class BaseNavFragment(name:Int,context: Context?):Fragment() {
@@ -30,10 +27,10 @@ class BaseNavFragment(name:Int,context: Context?):Fragment() {
 
     override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
         if(null!=name){
-            if(name==R.layout.fragment_index){
+            if(name==R.layout.fragment_tasks){
 
                val view:View=inflater.inflate(name!!,container,false)
-                val recycle=view.findViewById<RecyclerView>(R.id.index_recycle)
+                val recycle=view.findViewById<RecyclerView>(R.id.tasks_recycle)
                 var layoutManager=GridLayoutManager(context,1)
                 recycle.layoutManager=layoutManager
                 var indexRecycleAdapter=IndexRecycleAdapter(context)

+ 90 - 8
app/src/main/res/layout/fragment_index.xml

@@ -3,21 +3,103 @@
         xmlns:android="http://schemas.android.com/apk/res/android"
         xmlns:app="http://schemas.android.com/apk/res-auto"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:id="@+id/index_card"
+        android:layout_height="match_parent"
         >
 
-        <androidx.recyclerview.widget.RecyclerView
-                android:id="@+id/index_recycle"
-                android:layout_width="match_parent" android:layout_height="match_parent"
-                android:scrollbars="vertical"
-                android:background="#EFE9E9"
 
-        />
 
 
 
 
+        <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="match_parent"
+           android:layout_marginHorizontal="6dp" android:layout_marginVertical="6dp"
+        >
+
+
+
+                <androidx.cardview.widget.CardView
+
+                        android:id="@+id/notification_layout"
+                        android:layout_width="match_parent" android:layout_height="245dp"
+                        android:layout_gravity="center"
+                        app:layout_constraintStart_toStartOf="parent"
+                        app:layout_constraintEnd_toEndOf="parent"
+                        app:layout_constraintBottom_toTopOf="@id/statistics_layout"
+                        android:layout_marginBottom="6dp"
+                >
+
+
+
+                </androidx.cardview.widget.CardView>
+
+
+                <androidx.cardview.widget.CardView
+                        android:id="@+id/statistics_layout"
+                        android:layout_width="match_parent" android:layout_height="80dp"
+                                                   android:layout_gravity="center"
+                        app:layout_constraintStart_toStartOf="parent"
+                        app:layout_constraintEnd_toEndOf="parent"
+                        app:layout_constraintBottom_toTopOf="@id/ability_layout"
+                        android:layout_marginBottom="6dp"
+
+                >
+
+                        <com.xuexiang.xui.widget.textview.supertextview.SuperTextView
+                                app:sCenterTextColor="#46DCB1"
+                                app:sCenterTextIsBold="true"
+                                app:sCenterTextSize="20sp"
+                                app:sCenterTextString="10"
+                                app:sCenterBottomTextString="当日线路"
+                                app:sDividerLineColor="#F12323"
+                                android:layout_width="80dp" android:layout_height="70dp"
+                                app:sDividerLineType="bottom"
+                        />
+                        <com.xuexiang.xui.widget.textview.supertextview.SuperTextView
+                                app:sCenterTextColor="#46DCB1"
+                                app:sCenterTextIsBold="true"
+                                app:sCenterTextSize="20sp"
+                                app:sCenterTextString="120"
+                                android:layout_marginStart="110dp"
+                                app:sDividerLineColor="#F12323"
+                                app:sCenterBottomTextString="网点任务"
+                                android:layout_width="80dp" android:layout_height="70dp"
+                        />
+                        <com.xuexiang.xui.widget.textview.supertextview.SuperTextView
+                                app:sCenterTextColor="#46DCB1"
+                                app:sCenterTextIsBold="true"
+                                app:sCenterTextSize="20sp"
+                                app:sCenterTextString="30"
+                                android:layout_marginStart="220dp"
+                                app:sDividerLineColor="#F12323"
+                                app:sCenterBottomTextString="周转箱(出)"
+                                android:layout_width="80dp" android:layout_height="70dp"
+                        />
+                        <com.xuexiang.xui.widget.textview.supertextview.SuperTextView
+                                app:sCenterTextColor="#46DCB1"
+                                app:sCenterTextIsBold="true"
+                                app:sCenterTextSize="20sp"
+                                app:sCenterTextString="50"
+                                android:layout_marginStart="320dp"
+                                app:sDividerLineColor="#F12323"
+                                app:sCenterBottomTextString="周转箱(入)"
+                                android:layout_width="80dp" android:layout_height="70dp"
+                        />
+
+
+                </androidx.cardview.widget.CardView>
+
+
+
+                        <androidx.cardview.widget.CardView
+                                android:id="@+id/ability_layout"
+                                android:layout_width="match_parent" android:layout_height="300dp"
+                                app:layout_constraintStart_toStartOf="parent"
+                                app:layout_constraintEnd_toEndOf="parent"
+                                app:layout_constraintTop_toBottomOf="@id/ability_layout"
+                                app:layout_constraintBottom_toBottomOf="parent"
+                        />
+
+        </androidx.constraintlayout.widget.ConstraintLayout>
 
 
 

+ 7 - 0
app/src/main/res/layout/fragment_tasks.xml

@@ -5,6 +5,13 @@
         android:layout_height="match_parent"
 >
 
+    <androidx.recyclerview.widget.RecyclerView
+            android:id="@+id/tasks_recycle"
+            android:layout_width="match_parent" android:layout_height="match_parent"
+            android:scrollbars="vertical"
+            android:background="#EFE9E9"
+
+    />
 
 
 </com.xuexiang.xui.widget.alpha.XUIAlphaLinearLayout>

+ 0 - 9
app/src/main/res/layout/fragment_index_card.xml → app/src/main/res/layout/fragment_tasks_card.xml

@@ -17,15 +17,6 @@
 
 
 
-<!--                <com.google.android.material.floatingactionbutton.FloatingActionButton-->
-<!--                        android:id="@+id/search_btn"-->
-<!--                        android:layout_width="50dp"-->
-<!--                        android:layout_height="41dp"-->
-<!--                        app:srcCompat="@drawable/icon_action_query"-->
-<!--                        android:layout_marginStart="150dp"-->
-<!--                        app:layout_constraintHorizontal_bias="0.0"-->
-
-<!--                />-->
 
         </androidx.cardview.widget.CardView>