From 394e4ef236830505c12012343672962f0ba102ee Mon Sep 17 00:00:00 2001 From: Mohammed Mohsin <59914433+mdmohsin7@users.noreply.github.com> Date: Sun, 29 Dec 2024 13:43:55 +0530 Subject: [PATCH 1/6] do not show device name after connected --- app/lib/pages/home/widgets/battery_info_widget.dart | 7 ------- 1 file changed, 7 deletions(-) diff --git a/app/lib/pages/home/widgets/battery_info_widget.dart b/app/lib/pages/home/widgets/battery_info_widget.dart index 7da365b104..4b0c632135 100644 --- a/app/lib/pages/home/widgets/battery_info_widget.dart +++ b/app/lib/pages/home/widgets/battery_info_widget.dart @@ -59,13 +59,6 @@ class BatteryInfoWidget extends StatelessWidget { ), ), const SizedBox(width: 8.0), - isMemoriesPage - ? Text( - deviceProvider.connectedDevice?.name ?? SharedPreferencesUtil().deviceName, - style: const TextStyle(color: Colors.white, fontSize: 14), - ) - : const SizedBox.shrink(), - isMemoriesPage ? const SizedBox(width: 8) : const SizedBox.shrink(), Text( deviceProvider.batteryLevel > 0 ? '${deviceProvider.batteryLevel.toString()}%' : "", style: const TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.bold), From 358602d755e3909f2e158fe5691e4179e3002153 Mon Sep 17 00:00:00 2001 From: Mohammed Mohsin <59914433+mdmohsin7@users.noreply.github.com> Date: Sun, 29 Dec 2024 13:55:50 +0530 Subject: [PATCH 2/6] show sync icon at top --- .../conversations/conversations_page.dart | 2 +- .../conversations/widgets/local_sync.dart | 65 ++++++++++--------- app/lib/pages/home/page.dart | 12 ++++ 3 files changed, 46 insertions(+), 33 deletions(-) diff --git a/app/lib/pages/conversations/conversations_page.dart b/app/lib/pages/conversations/conversations_page.dart index e7a55ab5c3..b3627ec0a6 100644 --- a/app/lib/pages/conversations/conversations_page.dart +++ b/app/lib/pages/conversations/conversations_page.dart @@ -50,8 +50,8 @@ class _ConversationsPageState extends State with AutomaticKee const SliverToBoxAdapter(child: SizedBox(height: 26)), const SliverToBoxAdapter(child: SpeechProfileCardWidget()), const SliverToBoxAdapter(child: UpdateFirmwareCardWidget()), - const SliverToBoxAdapter(child: ConversationCaptureWidget()), const SliverToBoxAdapter(child: LocalSyncWidget()), + const SliverToBoxAdapter(child: ConversationCaptureWidget()), const SliverToBoxAdapter(child: SearchWidget()), getProcessingConversationsWidget(convoProvider.processingConversations), if (convoProvider.groupedConversations.isEmpty && !convoProvider.isLoadingConversations) diff --git a/app/lib/pages/conversations/widgets/local_sync.dart b/app/lib/pages/conversations/widgets/local_sync.dart index 8adbb4677d..ba83db2582 100644 --- a/app/lib/pages/conversations/widgets/local_sync.dart +++ b/app/lib/pages/conversations/widgets/local_sync.dart @@ -95,38 +95,39 @@ class _LocalSyncWidgetState extends State { // ready to sync if (_status == LocalSyncStatus.flush) { - return GestureDetector( - onTap: () { - routeToPage(context, const SyncPage()); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.grey.shade900, - borderRadius: const BorderRadius.all(Radius.circular(12)), - ), - padding: const EdgeInsets.all(16), - margin: const EdgeInsets.fromLTRB(16, 16, 16, 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const Row( - children: [ - Text( - 'Stay in Sync', - style: TextStyle(color: Colors.white, fontSize: 16), - textAlign: TextAlign.center, - ), - ], - ), - Text( - '${secondsToHumanReadable(_missSeconds.toString())} available', - style: Theme.of(context).textTheme.bodyMedium!.copyWith(decoration: TextDecoration.underline), - ), - ], - ), - ), - ); + return SizedBox.shrink(); + // return GestureDetector( + // onTap: () { + // routeToPage(context, const SyncPage()); + // }, + // child: Container( + // decoration: BoxDecoration( + // color: Colors.grey.shade900, + // borderRadius: const BorderRadius.all(Radius.circular(12)), + // ), + // padding: const EdgeInsets.all(16), + // margin: const EdgeInsets.fromLTRB(16, 16, 16, 0), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // const Row( + // children: [ + // Text( + // 'Stay in Sync', + // style: TextStyle(color: Colors.white, fontSize: 16), + // textAlign: TextAlign.center, + // ), + // ], + // ), + // Text( + // '${secondsToHumanReadable(_missSeconds.toString())} available', + // style: Theme.of(context).textTheme.bodyMedium!.copyWith(decoration: TextDecoration.underline), + // ), + // ], + // ), + // ), + // ); } return const SizedBox.shrink(); diff --git a/app/lib/pages/home/page.dart b/app/lib/pages/home/page.dart index b474be98f7..c2380182e3 100644 --- a/app/lib/pages/home/page.dart +++ b/app/lib/pages/home/page.dart @@ -34,6 +34,7 @@ import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; import 'package:upgrader/upgrader.dart'; +import '../conversations/sync_page.dart'; import 'widgets/battery_info_widget.dart'; class HomePageWrapper extends StatefulWidget { @@ -438,6 +439,17 @@ class _HomePageState extends State with WidgetsBindingObserver, Ticker crossAxisAlignment: CrossAxisAlignment.center, children: [ const BatteryInfoWidget(), + context.read().missingWalsInSeconds >= 120 + ? GestureDetector( + onTap: () { + routeToPage(context, const SyncPage()); + }, + child: Container( + padding: const EdgeInsets.only(left: 12), + child: const Icon(Icons.sync, color: Colors.white, size: 24), + ), + ) + : const SizedBox.shrink(), Consumer( builder: (context, provider, child) { if (provider.selectedIndex == 1) { From 8e70b18b314494ae934966e48aa6fe624b318be0 Mon Sep 17 00:00:00 2001 From: Mohammed Mohsin <59914433+mdmohsin7@users.noreply.github.com> Date: Sun, 29 Dec 2024 13:59:59 +0530 Subject: [PATCH 3/6] misc --- app/lib/pages/home/page.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/lib/pages/home/page.dart b/app/lib/pages/home/page.dart index c2380182e3..33e6c88386 100644 --- a/app/lib/pages/home/page.dart +++ b/app/lib/pages/home/page.dart @@ -439,14 +439,15 @@ class _HomePageState extends State with WidgetsBindingObserver, Ticker crossAxisAlignment: CrossAxisAlignment.center, children: [ const BatteryInfoWidget(), - context.read().missingWalsInSeconds >= 120 + context.read().missingWalsInSeconds >= 120 && + context.read().selectedIndex == 0 ? GestureDetector( onTap: () { routeToPage(context, const SyncPage()); }, child: Container( padding: const EdgeInsets.only(left: 12), - child: const Icon(Icons.sync, color: Colors.white, size: 24), + child: const Icon(Icons.download, color: Colors.white, size: 24), ), ) : const SizedBox.shrink(), @@ -458,7 +459,7 @@ class _HomePageState extends State with WidgetsBindingObserver, Ticker ); } else if (provider.selectedIndex == 2) { return Padding( - padding: EdgeInsets.only(left: MediaQuery.sizeOf(context).width * 0.12), + padding: EdgeInsets.only(left: MediaQuery.sizeOf(context).width * 0.06), child: const Text('Apps', style: TextStyle(color: Colors.white, fontSize: 18)), ); } else { From f4c1e770ca0273386afb06c197d5336abe8b78db Mon Sep 17 00:00:00 2001 From: Mohammed Mohsin <59914433+mdmohsin7@users.noreply.github.com> Date: Sun, 29 Dec 2024 14:16:24 +0530 Subject: [PATCH 4/6] replace outlines --- app/lib/pages/home/widgets/battery_info_widget.dart | 6 +----- .../pages/home/widgets/speech_language_sheet.dart | 13 +++++-------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/app/lib/pages/home/widgets/battery_info_widget.dart b/app/lib/pages/home/widgets/battery_info_widget.dart index 4b0c632135..a6fb124fae 100644 --- a/app/lib/pages/home/widgets/battery_info_widget.dart +++ b/app/lib/pages/home/widgets/battery_info_widget.dart @@ -33,12 +33,8 @@ class BatteryInfoWidget extends StatelessWidget { child: Container( padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 10), decoration: BoxDecoration( - color: Colors.transparent, + color: Colors.grey.shade900, borderRadius: BorderRadius.circular(10), - border: Border.all( - color: Colors.grey, - width: 1, - ), ), child: Row( mainAxisSize: MainAxisSize.min, diff --git a/app/lib/pages/home/widgets/speech_language_sheet.dart b/app/lib/pages/home/widgets/speech_language_sheet.dart index 4319e40f3e..dc4f6f7241 100644 --- a/app/lib/pages/home/widgets/speech_language_sheet.dart +++ b/app/lib/pages/home/widgets/speech_language_sheet.dart @@ -102,27 +102,24 @@ class SpeechLanguageSheet extends StatelessWidget { width: MediaQuery.of(context).size.width * 0.19, height: MediaQuery.of(context).size.height * 0.041, decoration: BoxDecoration( - border: Border.all( - color: Colors.grey, - width: 1, - ), borderRadius: BorderRadius.circular(10), + color: Colors.grey.shade900, ), - padding: const EdgeInsets.only(left: 12, right: 4), + padding: const EdgeInsets.only(left: 8, right: 2), child: Row( children: [ + const Icon(Icons.language, color: Colors.white), const Spacer( flex: 1, ), Text( - SharedPreferencesUtil().recordingsLanguage, - style: const TextStyle(color: Colors.white, fontWeight: FontWeight.w500, fontSize: 16), + SharedPreferencesUtil().recordingsLanguage.toUpperCase(), + style: const TextStyle(color: Colors.white, fontWeight: FontWeight.w500, fontSize: 14), textAlign: TextAlign.center, ), const Spacer( flex: 2, ), - const Icon(Icons.arrow_drop_down, color: Colors.white), ], ), ), From a7437702fbf97bc81797fc17c77fb4d479d9a869 Mon Sep 17 00:00:00 2001 From: Mohammed Mohsin <59914433+mdmohsin7@users.noreply.github.com> Date: Sun, 29 Dec 2024 14:16:35 +0530 Subject: [PATCH 5/6] minor fix --- app/lib/pages/home/page.dart | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/app/lib/pages/home/page.dart b/app/lib/pages/home/page.dart index 33e6c88386..c3517b4403 100644 --- a/app/lib/pages/home/page.dart +++ b/app/lib/pages/home/page.dart @@ -439,18 +439,23 @@ class _HomePageState extends State with WidgetsBindingObserver, Ticker crossAxisAlignment: CrossAxisAlignment.center, children: [ const BatteryInfoWidget(), - context.read().missingWalsInSeconds >= 120 && - context.read().selectedIndex == 0 - ? GestureDetector( - onTap: () { - routeToPage(context, const SyncPage()); - }, - child: Container( - padding: const EdgeInsets.only(left: 12), - child: const Icon(Icons.download, color: Colors.white, size: 24), - ), - ) - : const SizedBox.shrink(), + Consumer(builder: (context, provider, child) { + if (provider.selectedIndex == 0) { + return (context.read().missingWalsInSeconds >= 120 + ? GestureDetector( + onTap: () { + routeToPage(context, const SyncPage()); + }, + child: Container( + padding: const EdgeInsets.only(left: 12), + child: const Icon(Icons.download, color: Colors.white, size: 24), + ), + ) + : const SizedBox.shrink()); + } else { + return const SizedBox.shrink(); + } + }), Consumer( builder: (context, provider, child) { if (provider.selectedIndex == 1) { @@ -458,10 +463,7 @@ class _HomePageState extends State with WidgetsBindingObserver, Ticker controller: _controller, ); } else if (provider.selectedIndex == 2) { - return Padding( - padding: EdgeInsets.only(left: MediaQuery.sizeOf(context).width * 0.06), - child: const Text('Apps', style: TextStyle(color: Colors.white, fontSize: 18)), - ); + return const Text('Apps', style: TextStyle(color: Colors.white, fontSize: 18)); } else { return Flexible( child: Row( From 5b36cd34da3f7bf170a8cca052ff78bfbe057501 Mon Sep 17 00:00:00 2001 From: Mohammed Mohsin <59914433+mdmohsin7@users.noreply.github.com> Date: Sun, 29 Dec 2024 14:26:44 +0530 Subject: [PATCH 6/6] minor size changes --- .../pages/home/widgets/battery_info_widget.dart | 3 +-- .../pages/home/widgets/speech_language_sheet.dart | 14 +++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/lib/pages/home/widgets/battery_info_widget.dart b/app/lib/pages/home/widgets/battery_info_widget.dart index a6fb124fae..3fe80d734a 100644 --- a/app/lib/pages/home/widgets/battery_info_widget.dart +++ b/app/lib/pages/home/widgets/battery_info_widget.dart @@ -75,9 +75,8 @@ class BatteryInfoWidget extends StatelessWidget { child: Container( padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 7), decoration: BoxDecoration( - color: Colors.transparent, + color: Colors.grey.shade900, borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.grey, width: 1), ), child: Row( children: [ diff --git a/app/lib/pages/home/widgets/speech_language_sheet.dart b/app/lib/pages/home/widgets/speech_language_sheet.dart index dc4f6f7241..e7822db0e0 100644 --- a/app/lib/pages/home/widgets/speech_language_sheet.dart +++ b/app/lib/pages/home/widgets/speech_language_sheet.dart @@ -99,8 +99,8 @@ class SpeechLanguageSheet extends StatelessWidget { ); }, child: Container( - width: MediaQuery.of(context).size.width * 0.19, - height: MediaQuery.of(context).size.height * 0.041, + width: MediaQuery.of(context).size.width * 0.18, + height: MediaQuery.of(context).size.height * 0.0375, decoration: BoxDecoration( borderRadius: BorderRadius.circular(10), color: Colors.grey.shade900, @@ -108,9 +108,13 @@ class SpeechLanguageSheet extends StatelessWidget { padding: const EdgeInsets.only(left: 8, right: 2), child: Row( children: [ - const Icon(Icons.language, color: Colors.white), + const Icon( + Icons.language, + color: Colors.white, + size: 20, + ), const Spacer( - flex: 1, + flex: 2, ), Text( SharedPreferencesUtil().recordingsLanguage.toUpperCase(), @@ -118,7 +122,7 @@ class SpeechLanguageSheet extends StatelessWidget { textAlign: TextAlign.center, ), const Spacer( - flex: 2, + flex: 3, ), ], ),