瀏覽代碼

1.优化UI

王鹏鹏 2 年之前
父節點
當前提交
47b2d7d4b7

+ 5 - 5
home/src/main/java/com/yingyangfly/home/activity/HomeActivity.kt

@@ -176,12 +176,12 @@ class HomeActivity : BaseMVVMActivity<ActivityHomeBinding, HomeViewModel>() {
         viewModel.selectNewVersion(versionCode, fail = {
             launchTask()
         }, success = {
-            if (it != null) {
-                val appUpdater = AppUpdater(this, it.versionUrl)
-                appUpdater.start()
-            } else {
+//            if (it != null) {
+//                val appUpdater = AppUpdater(this, it.versionUrl)
+//                appUpdater.start()
+//            } else {
                 launchTask()
-            }
+//            }
         })
     }
 

+ 1 - 1
workbenches/src/main/java/com/yingyang/workbenches/freetraining/FreeTrainActivity.kt

@@ -137,7 +137,7 @@ class FreeTrainActivity : BaseMVVMActivity<ActivityFreeTrainBinding, FreeTrainVi
                 if (page >= it.pages) {
                     binding.freeTrainSwipe.finishLoadMoreWithNoMoreData()
                 }
-                binding.rvTrain.show(freeTrainList.isNullOrEmpty().not())
+                binding.freeTrainSwipe.show(freeTrainList.isNullOrEmpty().not())
                 binding.emptyLayout.show(freeTrainList.isNullOrEmpty())
                 freeTrainListAdapter.setData(freeTrainList)
             }

+ 15 - 11
workbenches/src/main/res/layout/activity_free_train.xml

@@ -94,21 +94,25 @@
                         android:layout_marginTop="@dimen/divider_8px"
                         android:layout_marginBottom="@dimen/divider_8px" />
 
-                    <LinearLayout
-                        android:id="@+id/emptyLayout"
-                        style="@style/empty_linear_layout_style"
-                        android:layout_height="match_parent"
-                        android:visibility="gone"
-                        app:layout_constraintTop_toBottomOf="@+id/tvTitle"
-                        tools:ignore="MissingConstraints">
+                </com.scwang.smartrefresh.layout.SmartRefreshLayout>
 
-                        <androidx.appcompat.widget.AppCompatImageView style="@style/empty_image_view_style" />
+                <LinearLayout
+                    android:id="@+id/emptyLayout"
+                    android:layout_width="match_parent"
+                    android:layout_height="0dp"
+                    android:orientation="vertical"
+                    android:visibility="gone"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintLeft_toLeftOf="parent"
+                    app:layout_constraintRight_toRightOf="parent"
+                    app:layout_constraintTop_toBottomOf="@+id/tvTitle"
+                    tools:ignore="MissingConstraints">
 
-                        <androidx.appcompat.widget.AppCompatTextView style="@style/empty_text_view_style" />
+                    <androidx.appcompat.widget.AppCompatImageView style="@style/empty_image_view_style" />
 
-                    </LinearLayout>
+                    <androidx.appcompat.widget.AppCompatTextView style="@style/empty_text_view_style" />
 
-                </com.scwang.smartrefresh.layout.SmartRefreshLayout>
+                </LinearLayout>
             </androidx.constraintlayout.widget.ConstraintLayout>
         </androidx.cardview.widget.CardView>
     </androidx.constraintlayout.widget.ConstraintLayout>