Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[locker] Show sync status in app bar instead of blocking spinner

AmanRajSinghMourya6628fd7c5087
diff --git a/mobile/apps/locker/lib/ui/pages/home_page.dart b/mobile/apps/locker/lib/ui/pages/home_page.dart
index a993cf6c73..e31e069981 100644
--- a/mobile/apps/locker/lib/ui/pages/home_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/home_page.dart
@@ -33,6 +33,7 @@ class CustomLockerAppBar extends StatelessWidget
implements PreferredSizeWidget {
final GlobalKey<ScaffoldState> scaffoldKey;
final bool isSearchActive;
+ final bool isSyncing;
final TextEditingController searchController;
final FocusNode searchFocusNode;
final VoidCallback onSearchFocused;
@@ -43,6 +44,7 @@ class CustomLockerAppBar extends StatelessWidget
super.key,
required this.scaffoldKey,
required this.isSearchActive,
+ this.isSyncing = false,
required this.searchController,
required this.searchFocusNode,
required this.onSearchFocused,
@@ -91,10 +93,35 @@ class CustomLockerAppBar extends StatelessWidget
),
),
),
- Image.asset(
- 'assets/locker-logo.png',
- height: 28,
- ),
+ isSyncing
+ ? const Row(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ SizedBox(
+ width: 16,
+ height: 16,
+ child: CircularProgressIndicator(
+ strokeWidth: 2,
+ valueColor: AlwaysStoppedAnimation<Color>(
+ Colors.white,
+ ),
+ ),
+ ),
+ SizedBox(width: 8),
+ Text(
+ "Syncing...",
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 16,
+ fontWeight: FontWeight.w500,
+ ),
+ ),
+ ],
+ )
+ : Image.asset(
+ 'assets/locker-logo.png',
+ height: 28,
+ ),
],
),
),
@@ -590,6 +617,7 @@ class _HomePageState extends UploaderPageState<HomePage>
appBar: CustomLockerAppBar(
scaffoldKey: scaffoldKey,
isSearchActive: isSearchActive,
+ isSyncing: !_hasCompletedInitialLoad || _isLoading,
searchController: searchController,
searchFocusNode: _searchFocusNode,
onSearchFocused: _handleSearchFocused,
@@ -616,12 +644,6 @@ class _HomePageState extends UploaderPageState<HomePage>
}
Widget _buildBody() {
- if (_isLoading || !_hasCompletedInitialLoad) {
- return const Center(
- child: CircularProgressIndicator(),
- );
- }
-
if (_error != null) {
return SingleChildScrollView(
physics: const AlwaysScrollableScrollPhysics(),