-
Notifications
You must be signed in to change notification settings - Fork 3
Mobile/install guide #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9224a6b
New sliverbar asset & app icon
5e4ddac
Purple accent color in match of webapp, new sliverbar background
c21955c
Changed drawer top image
ee4ac04
Added card with link to setup guide
93852ed
Merge branch 'master' into mobile/install-guide
fceab41
Merge remote-tracking branch 'origin/master' into mobile/install-guide
d27b892
SliverAppBar title dissapears when collapsed
230684a
renamed setup guide button
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+8.08 KB
(530%)
mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5.46 KB
(560%)
mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+11.1 KB
(510%)
mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+18.6 KB
(510%)
mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+27.5 KB
(510%)
mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| const SETUP_GUIDE_URL = | ||
| 'https://polycortex.github.io/polydodo/#/record-my-sleep'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
mobile/lib/src/presentation/pages/dashboard/sliver_app_bar_title.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| import 'package:flutter/material.dart'; | ||
|
|
||
| class SliverAppBarTitle extends StatefulWidget { | ||
| final Widget child; | ||
| const SliverAppBarTitle({ | ||
| Key key, | ||
| @required this.child, | ||
| }) : super(key: key); | ||
| @override | ||
| _SliverAppBarTitleState createState() { | ||
| return _SliverAppBarTitleState(); | ||
| } | ||
| } | ||
|
|
||
| class _SliverAppBarTitleState extends State<SliverAppBarTitle> { | ||
| ScrollPosition _position; | ||
| bool _visible; | ||
| @override | ||
| void dispose() { | ||
| _removeListener(); | ||
| super.dispose(); | ||
| } | ||
|
|
||
| @override | ||
| void didChangeDependencies() { | ||
| super.didChangeDependencies(); | ||
| _removeListener(); | ||
| _addListener(); | ||
| } | ||
|
|
||
| void _addListener() { | ||
| _position = Scrollable.of(context)?.position; | ||
| _position?.addListener(_positionListener); | ||
| _positionListener(); | ||
| } | ||
|
|
||
| void _removeListener() { | ||
| _position?.removeListener(_positionListener); | ||
| } | ||
|
|
||
| void _positionListener() { | ||
| var settings = | ||
| context.dependOnInheritedWidgetOfExactType<FlexibleSpaceBarSettings>(); | ||
| var visible = | ||
| settings == null || settings.currentExtent <= settings.minExtent; | ||
| if (_visible != visible) { | ||
| setState(() { | ||
| _visible = visible; | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| return Visibility( | ||
| visible: _visible, | ||
| child: widget.child, | ||
| ); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,20 +2,40 @@ import 'package:auto_route/auto_route.dart'; | |
| import 'package:flutter/material.dart'; | ||
| import 'package:flutter_bloc/flutter_bloc.dart'; | ||
| import 'package:polydodo/src/application/blocs.dart'; | ||
| import 'package:polydodo/src/constants.dart'; | ||
| import 'package:polydodo/src/presentation/navigation/navdrawer_tabs.dart'; | ||
| import 'package:polydodo/src/presentation/navigation/navdrawer_widget.dart'; | ||
| import 'package:polydodo/src/presentation/navigation/routes/router.gr.dart'; | ||
| import 'package:url_launcher/url_launcher.dart'; | ||
|
|
||
| class RecordSleepGuidePage extends StatelessWidget { | ||
| @override | ||
| Widget build(BuildContext context) { | ||
| return Scaffold( | ||
| appBar: AppBar(title: Text('Record Sleep')), | ||
| appBar: AppBar(title: Text('Record a sleep sequence')), | ||
| drawer: NavDrawer(activeTab: NavdrawerTab.RecordSleep), | ||
| body: PageView( | ||
| children: [ | ||
| Container(child: Center(child: Text('Record Sleep Guide'))), | ||
| Container(child: Center(child: Text('Record Sleep next'))), | ||
| Container( | ||
| child: Center( | ||
| child: Column( | ||
| children: [ | ||
| Row( | ||
| mainAxisAlignment: MainAxisAlignment.center, | ||
| children: [ | ||
| Padding( | ||
| padding: const EdgeInsets.symmetric( | ||
| vertical: 100.0, | ||
| horizontal: 20, | ||
| ), | ||
| ), | ||
| ], | ||
| ), | ||
| _buildSleepGuideCard(context), | ||
| ], | ||
| ), | ||
| ), | ||
| ), | ||
| ], | ||
| ), | ||
| floatingActionButton: FloatingActionButton.extended( | ||
|
|
@@ -30,3 +50,119 @@ class RecordSleepGuidePage extends StatelessWidget { | |
| ); | ||
| } | ||
| } | ||
|
|
||
| void _launchURL() async { | ||
| if (await canLaunch(SETUP_GUIDE_URL)) { | ||
| await launch(SETUP_GUIDE_URL); | ||
| } else { | ||
| throw 'Could not launch $SETUP_GUIDE_URL'; | ||
| } | ||
| } | ||
|
|
||
| Widget _buildSleepGuideCard(BuildContext context) { | ||
| return Container( | ||
| child: InkWell( | ||
| onTap: _launchURL, | ||
| child: Container( | ||
| height: 345.0, | ||
| margin: EdgeInsets.all(10.0), | ||
| width: 400.0, | ||
| child: Stack( | ||
| alignment: Alignment.topCenter, | ||
| children: <Widget>[ | ||
| Positioned( | ||
| bottom: 15.0, | ||
| child: Container( | ||
| height: 150.0, | ||
| width: 320.0, | ||
| decoration: BoxDecoration( | ||
| color: Colors.white, | ||
| borderRadius: BorderRadius.circular(10.0), | ||
| ), | ||
| child: Padding( | ||
| padding: EdgeInsets.all(5.0), | ||
| child: Column( | ||
| mainAxisAlignment: MainAxisAlignment.end, | ||
| crossAxisAlignment: CrossAxisAlignment.start, | ||
| children: <Widget>[ | ||
| Text( | ||
| 'Setup Guide', | ||
| style: TextStyle( | ||
| fontSize: 22.0, | ||
| fontWeight: FontWeight.w600, | ||
| letterSpacing: 1.2, | ||
| ), | ||
| ), | ||
| Text( | ||
| "Prior to starting the recording, make sure that you've followed the installation procedures stated in this guide.", | ||
| style: TextStyle( | ||
| color: Colors.grey, | ||
| fontSize: 12, | ||
| ), | ||
| ), | ||
| ], | ||
| ), | ||
| ), | ||
| ), | ||
| ), | ||
| Container( | ||
| decoration: BoxDecoration( | ||
| color: Theme.of(context).primaryColor, | ||
| borderRadius: BorderRadius.circular(20.0), | ||
| boxShadow: [ | ||
| BoxShadow( | ||
| color: Colors.black26, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add to theme |
||
| offset: Offset(0.0, 2.0), | ||
| blurRadius: 6.0, | ||
| ), | ||
| ], | ||
| ), | ||
| child: Stack( | ||
| children: <Widget>[ | ||
| Hero( | ||
| tag: 'common/assets/img/Objets.png', | ||
| child: ClipRRect( | ||
| borderRadius: BorderRadius.circular(20.0), | ||
| child: Image( | ||
| height: 250.0, | ||
| width: 305.0, | ||
| image: AssetImage('common/assets/img/Objets.png'), | ||
| fit: BoxFit.cover, | ||
| ), | ||
| ), | ||
| ), | ||
| Positioned( | ||
| left: 80.0, | ||
| bottom: 10.0, | ||
| child: Column( | ||
| crossAxisAlignment: CrossAxisAlignment.center, | ||
| mainAxisAlignment: MainAxisAlignment.center, | ||
| children: <Widget>[ | ||
| Row( | ||
| children: <Widget>[ | ||
| Icon( | ||
| Icons.book, | ||
| size: 15.0, | ||
| color: Colors.white, | ||
| ), | ||
| SizedBox(width: 5.0), | ||
| Text( | ||
| 'Tap to open the guide', | ||
| style: TextStyle( | ||
| color: Colors.white, | ||
| ), | ||
| ), | ||
| ], | ||
| ), | ||
| ], | ||
| ), | ||
| ), | ||
| ], | ||
| ), | ||
| ) | ||
| ], | ||
| ), | ||
| ), | ||
| ), | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,21 @@ | ||
| import 'package:flutter/material.dart'; | ||
|
|
||
| final theme = ThemeData( | ||
| primarySwatch: Colors.blue, | ||
| primaryColor: HexColor('32325D'), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ici tu emploie HexColor. Pourquoi pas pour les autres couleurs aussi? |
||
| buttonColor: HexColor('FC7C5F'), | ||
| floatingActionButtonTheme: | ||
| FloatingActionButtonThemeData(backgroundColor: HexColor('FC7C5F')), | ||
| visualDensity: VisualDensity.adaptivePlatformDensity, | ||
| ); | ||
|
|
||
| class HexColor extends Color { | ||
| static int _getColorFromHex(String hexColor) { | ||
| hexColor = hexColor.toUpperCase().replaceAll('#', ''); | ||
| if (hexColor.length == 6) { | ||
| hexColor = 'FF' + hexColor; | ||
| } | ||
| return int.parse(hexColor, radix: 16); | ||
| } | ||
|
|
||
| HexColor(final String hexColor) : super(_getColorFromHex(hexColor)); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.