mirror of
https://github.com/KitsunePie/AppErrorsTracking.git
synced 2025-09-04 02:05:16 +08:00
Added loading view and errors records count in AppErrorsRecordActivity, activity_app_errors_record
This commit is contained in:
@@ -152,14 +152,16 @@ class AppErrorsRecordActivity : BaseActivity<ActivityAppErrorsRecordBinding>() {
|
|||||||
/** 更新列表数据 */
|
/** 更新列表数据 */
|
||||||
private fun refreshData() {
|
private fun refreshData() {
|
||||||
FrameworkTool.fetchAppErrorsInfoData(context = this) {
|
FrameworkTool.fetchAppErrorsInfoData(context = this) {
|
||||||
|
binding.titleCountText.text = LocaleString.recordCount(it.size)
|
||||||
|
binding.listProgressView.isVisible = false
|
||||||
|
binding.appErrorSisIcon.isVisible = it.size >= 5
|
||||||
|
binding.clearAllIcon.isVisible = it.isNotEmpty()
|
||||||
|
binding.exportAllIcon.isVisible = it.isNotEmpty()
|
||||||
|
binding.listView.isVisible = it.isNotEmpty()
|
||||||
|
binding.listNoDataView.isVisible = it.isEmpty()
|
||||||
listData.clear()
|
listData.clear()
|
||||||
it.takeIf { e -> e.isNotEmpty() }?.forEach { e -> listData.add(e) }
|
it.takeIf { e -> e.isNotEmpty() }?.forEach { e -> listData.add(e) }
|
||||||
onChanged?.invoke()
|
onChanged?.invoke()
|
||||||
binding.appErrorSisIcon.isVisible = listData.size >= 5
|
|
||||||
binding.clearAllIcon.isVisible = listData.isNotEmpty()
|
|
||||||
binding.exportAllIcon.isVisible = listData.isNotEmpty()
|
|
||||||
binding.listView.isVisible = listData.isNotEmpty()
|
|
||||||
binding.listNoDataView.isVisible = listData.isEmpty()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout 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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
@@ -14,9 +15,9 @@
|
|||||||
android:elevation="0dp"
|
android:elevation="0dp"
|
||||||
android:gravity="center|start"
|
android:gravity="center|start"
|
||||||
android:paddingLeft="15dp"
|
android:paddingLeft="15dp"
|
||||||
android:paddingTop="15dp"
|
android:paddingTop="13dp"
|
||||||
android:paddingRight="15dp"
|
android:paddingRight="15dp"
|
||||||
android:paddingBottom="15dp">
|
android:paddingBottom="5dp">
|
||||||
|
|
||||||
<androidx.constraintlayout.utils.widget.ImageFilterView
|
<androidx.constraintlayout.utils.widget.ImageFilterView
|
||||||
android:id="@+id/title_back_icon"
|
android:id="@+id/title_back_icon"
|
||||||
@@ -29,16 +30,33 @@
|
|||||||
android:tint="@color/colorTextGray"
|
android:tint="@color/colorTextGray"
|
||||||
android:tooltipText="@string/back" />
|
android:tooltipText="@string/back" />
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="2.5dp"
|
android:layout_marginEnd="2.5dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:singleLine="true"
|
android:gravity="center|start"
|
||||||
android:text="@string/errors_record"
|
android:orientation="vertical">
|
||||||
android:textColor="@color/colorTextGray"
|
|
||||||
android:textSize="19sp"
|
<TextView
|
||||||
android:textStyle="bold" />
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="@string/errors_record"
|
||||||
|
android:textColor="@color/colorTextGray"
|
||||||
|
android:textSize="19sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title_count_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="@string/loading"
|
||||||
|
android:textColor="@color/colorTextDark"
|
||||||
|
android:textSize="11.5sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<androidx.constraintlayout.utils.widget.ImageFilterView
|
<androidx.constraintlayout.utils.widget.ImageFilterView
|
||||||
android:id="@+id/app_error_sis_icon"
|
android:id="@+id/app_error_sis_icon"
|
||||||
@@ -74,7 +92,15 @@
|
|||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="5dp">
|
android:layout_marginTop="10dp">
|
||||||
|
|
||||||
|
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||||
|
android:id="@+id/list_progress_view"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:indeterminate="true"
|
||||||
|
app:trackCornerRadius="10dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/list_no_data_view"
|
android:id="@+id/list_no_data_view"
|
||||||
@@ -85,7 +111,8 @@
|
|||||||
android:lineSpacingExtra="6dp"
|
android:lineSpacingExtra="6dp"
|
||||||
android:text="@string/no_list_data"
|
android:text="@string/no_list_data"
|
||||||
android:textColor="@color/colorTextDark"
|
android:textColor="@color/colorTextDark"
|
||||||
android:textSize="17sp" />
|
android:textSize="17sp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
android:id="@+id/list_view"
|
android:id="@+id/list_view"
|
||||||
|
Reference in New Issue
Block a user