Skip to content

Commit

Permalink
Merge branch 'master' into LarsRefsgaard/message-images-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsRefsgaard authored Jul 20, 2023
2 parents 71c6b12 + 72b0838 commit 041f504
Show file tree
Hide file tree
Showing 18 changed files with 97 additions and 107 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy_play_store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
- name: Configure Keystore
run: |
echo "$PLAY_STORE_UPLOAD_KEY" | base64 --decode > app/upload-keystore.jks
echo "$PLAY_STORE_CONFIG_JSON" > PLAY_STORE_CONFIG.json
echo "storeFile=upload-keystore.jks" >> key.properties
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> key.properties
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> key.properties
Expand Down
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if (flutterRoot == null) {

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '17'
flutterVersionCode = '18'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
Expand Down
1 change: 1 addition & 0 deletions android/fastlane/Appfile
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
package_name("dk.cachet.carp_study_app") #
json_key_file("PLAY_STORE_CONFIG.json")
2 changes: 0 additions & 2 deletions android/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ platform :android do
upload_to_play_store(
track: 'beta',
aab: '../build/app/outputs/bundle/release/app-release.aab',
json_key_data: ENV['PLAY_STORE_CONFIG_JSON'],
)
end

Expand All @@ -38,7 +37,6 @@ platform :android do
track: 'beta',
track_promote_to: 'production',
skip_upload_changelogs: true,
json_key_data: ENV['PLAY_STORE_CONFIG_JSON'],
)
end
end
8 changes: 4 additions & 4 deletions android/fastlane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ Runs all the tests
[bundle exec] fastlane android beta
```

Submit a new Beta Build to Crashlytics Beta
Submit a new beta build to Google Play

### android deploy
### android promote_to_production

```sh
[bundle exec] fastlane android deploy
[bundle exec] fastlane android promote_to_production
```

Deploy a new version to the Google Play
Promote beta track to prod

----

Expand Down
20 changes: 0 additions & 20 deletions android/fastlane/report.xml

This file was deleted.

12 changes: 6 additions & 6 deletions lib/blocs/app_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ class StudyAppBLoC {
// set up and initialize sensing
await Sensing().initialize();

// add the study and configure sensing
await Sensing().addStudy();

// initialize the UI data models
data.init(Sensing().controller!);

// set up the messaging part
messageManager.initialize().then(
(value) {
Expand All @@ -164,12 +170,6 @@ class StudyAppBLoC {
},
);

// add the study and configure sensing
await Sensing().addStudy();

// initialize the UI data models
data.init(Sensing().controller!);

debug('$runtimeType configuration done.');
_state = StudyAppState.configured;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/main.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions lib/ui/cards/heart_rate_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ class HeartRateCardWidgetState extends State<HeartRateCardWidget>
StreamBuilder(
stream: widget.model.heartRateEvents,
builder: (context, AsyncSnapshot<Measurement> snapshot) {
animationController.duration = Duration(
milliseconds: 1000 ~/
(((widget.model.currentHeartRate ?? 0) + 1) / 60));
// animationController.duration = Duration(
// milliseconds: 1000 ~/
// (((widget.model.currentHeartRate ?? 0) + 1) / 60));

return Column(
children: [
Expand Down Expand Up @@ -177,12 +177,12 @@ class HeartRateCardWidgetState extends State<HeartRateCardWidget>
RepaintBoundary(
child: ScaleTransition(
// scale should be _animation if the isOnWrist is true otherwise it should be no scale
scale: !widget.model.contactStatus
scale: widget.model.contactStatus
? Tween<double>(begin: 1, end: 1)
.animate(animationController)
: animation,
child: Icon(
!widget.model.contactStatus
widget.model.contactStatus
? Icons.favorite_outline_rounded
: Icons.favorite_rounded,
color: HeartRateCardWidget.colors[0],
Expand Down
86 changes: 48 additions & 38 deletions lib/ui/pages/data_visualization_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,56 @@ class DataVisualizationPage extends StatelessWidget {
return Scaffold(
backgroundColor: Theme.of(context).colorScheme.secondary,
body: SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const CarpAppBar(),
Container(
color: Theme.of(context).colorScheme.secondary,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Align(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'${locale.translate('pages.data_viz.hello')} ${bloc.friendlyUsername}'
.toUpperCase(),
style: dataCardTitleStyle.copyWith(
color: Theme.of(context).primaryColor),
child: FutureBuilder(
future: bloc.data._dataVisualizationPageViewModel
.init(Sensing().controller!),
builder: (context, data) {
if (!data.hasData) {
return const Center(child: CircularProgressIndicator());
} else {
return Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const CarpAppBar(),
Container(
color: Theme.of(context).colorScheme.secondary,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Align(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'${locale.translate('pages.data_viz.hello')} ${bloc.friendlyUsername}'
.toUpperCase(),
style: dataCardTitleStyle.copyWith(
color: Theme.of(context).primaryColor),
),
Text(locale.translate('pages.data_viz.thanks'),
style: aboutCardSubtitleStyle),
const SizedBox(height: 15),
],
),
),
Text(locale.translate('pages.data_viz.thanks'),
style: aboutCardSubtitleStyle),
const SizedBox(height: 15),
],
),
),
),
),
),
Expanded(
flex: 4,
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: _dataVizCards,
),
),
)
],
Expanded(
flex: 4,
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: _dataVizCards,
),
),
)
],
);
}
},
),
),
);
Expand Down
4 changes: 2 additions & 2 deletions lib/view_models/cards/activity_data_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class ActivityCardViewModel extends SerializableViewModel<WeeklyActivities> {
.where((measurement) => measurement.data is Activity);

@override
void init(SmartphoneDeploymentController ctrl) {
super.init(ctrl);
Future<void> init(SmartphoneDeploymentController ctrl) async {
await super.init(ctrl);

// listen for activity events and count the minutes
activityEvents?.listen((measurement) {
Expand Down
4 changes: 2 additions & 2 deletions lib/view_models/cards/heart_rate_data_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class HeartRateCardViewModel extends SerializableViewModel<HourlyHeartRate> {
.where((measurement) => measurement.data is PolarHR);

@override
void init(SmartphoneDeploymentController ctrl) {
super.init(ctrl);
Future<void> init(SmartphoneDeploymentController ctrl) async {
await super.init(ctrl);

heartRateEvents?.listen(
(heartRateDataPoint) {
Expand Down
4 changes: 2 additions & 2 deletions lib/view_models/cards/mobility_data_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class MobilityCardViewModel extends SerializableViewModel<WeeklyMobility> {

MobilityCardViewModel();
@override
void init(SmartphoneDeploymentController ctrl) {
super.init(ctrl);
Future<void> init(SmartphoneDeploymentController ctrl) async {
await super.init(ctrl);

// listen for mobility events and update the features
mobilityEvents?.listen((measurement) {
Expand Down
4 changes: 2 additions & 2 deletions lib/view_models/cards/steps_data_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class StepsCardViewModel extends SerializableViewModel<WeeklySteps> {
.where((dataPoint) => dataPoint.data is StepCount);

@override
void init(SmartphoneDeploymentController ctrl) {
super.init(ctrl);
Future<void> init(SmartphoneDeploymentController ctrl) async {
await super.init(ctrl);

// listen for pedometer events and count them
pedometerEvents?.listen((pedometerDataPoint) {
Expand Down
11 changes: 6 additions & 5 deletions lib/view_models/data_visualization_page_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,19 @@ class DataVisualizationPageViewModel extends ViewModel {
DataVisualizationPageViewModel();

@override
void init(SmartphoneDeploymentController ctrl) {
Future<int> init(SmartphoneDeploymentController ctrl) async {
super.init(ctrl);
_activityCardDataModel.init(ctrl);
_stepsCardDataModel.init(ctrl);
await _activityCardDataModel.init(ctrl);
await _stepsCardDataModel.init(ctrl);
_measuresCardDataModel.init(ctrl);
_mobilityCardDataModel.init(ctrl);
await _mobilityCardDataModel.init(ctrl);
_surveysCardDataModel.init(ctrl);
_audioCardDataModel.init(ctrl);
_videoCardDataModel.init(ctrl);
_imageCardDataModel.init(ctrl);
_studyProgressCardDataModel.init(ctrl);
_heartRateCardDataModel.init(ctrl);
await _heartRateCardDataModel.init(ctrl);
return 1;
}

/// Delete all persistent view models.
Expand Down
7 changes: 3 additions & 4 deletions lib/view_models/view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ abstract class SerializableViewModel<D extends DataModel> extends ViewModel {

@override
@mustCallSuper
void init(SmartphoneDeploymentController ctrl) {
Future<void> init(SmartphoneDeploymentController ctrl) async {
super.init(ctrl);
_model = createModel();

// restore the data model (if any saved)
restore().then((savedModel) => _model = savedModel ?? _model);
await restore().then((savedModel) => _model = savedModel ?? _model);

// save the data model on a regular basis.
Timer.periodic(const Duration(minutes: 3), (_) => save(model.toJson()));
Expand Down Expand Up @@ -161,9 +161,8 @@ class CarpStudyAppViewModel extends ViewModel {
_informedConsentViewModel;

@override
void init(SmartphoneDeploymentController ctrl) {
void init(SmartphoneDeploymentController ctrl) async {
super.init(ctrl);
_dataVisualizationPageViewModel.init(ctrl);
_studyPageViewModel.init(ctrl);
_taskListPageViewModel.init(ctrl);
_profilePageViewModel.init(ctrl);
Expand Down
Loading

0 comments on commit 041f504

Please sign in to comment.