Bladeren bron

app渐进式启动页面初始化

everywindchase 9 maanden geleden
bovenliggende
commit
8590390335

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

@@ -70,7 +70,7 @@ class MainActivity : AppCompatActivity() {
 
         })
 
-
+        bottomNav.setSelectedItemId(R.id.index)
 
 
 

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

@@ -37,7 +37,7 @@ class BaseNavFragment(name:Int,context: Context?):Fragment() {
 
     override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
         super.onViewCreated(view, savedInstanceState)
-        if(null!=name&&view.id==R.id.index_banner_card) {
+        if(null!=name&&view.id==R.id.index_card) {
                 var indexBanner=view.findViewById<BannerLayout>(R.id.index_banner)
                 var adapter = IndexBannerAdapter(this@BaseNavFragment.context)
                 indexBanner.setAdapter(adapter)

+ 37 - 9
app/src/main/res/layout/fragment_index.xml

@@ -1,15 +1,20 @@
 <?xml version="1.0" encoding="utf-8"?>
-<androidx.cardview.widget.CardView 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="100dp"
-                                   app:cardCornerRadius="12dp"
-                                   android:id="@+id/index_banner_card"
+<FrameLayout
+        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="match_parent"
+        android:id="@+id/index_card"
+        android:paddingHorizontal="8dp"
 >
 
 
-
-
+        <androidx.cardview.widget.CardView
+                android:layout_width="match_parent"
+                android:layout_height="200dp"
+                android:layout_marginTop="8dp"
+                app:cardCornerRadius="10dp"
+        >
         <com.xuexiang.xui.widget.banner.recycler.BannerLayout
                 android:id="@+id/index_banner"
                 android:layout_width="match_parent"
@@ -18,9 +23,32 @@
                 app:bl_centerScale="1.3"
                 app:bl_itemSpace="10dp"
                 app:bl_moveSpeed="1.8" />
+        </androidx.cardview.widget.CardView>
+
+        <androidx.cardview.widget.CardView
+                android:layout_width="match_parent"
+                android:layout_height="100dp"
+                android:layout_marginTop="216dp"
+                app:cardCornerRadius="10dp"
+        >
+
+
+
+        </androidx.cardview.widget.CardView>
+
+
+        <androidx.cardview.widget.CardView
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginTop="324dp"
+                app:cardCornerRadius="10dp"
+                android:layout_marginBottom="8dp"
+        >
+
 
 
+        </androidx.cardview.widget.CardView>
 
 
 
-</androidx.cardview.widget.CardView>
+</FrameLayout>