Skip to content

Commit

Permalink
Merge pull request #1841 from UCSD/availability-busyness
Browse files Browse the repository at this point in the history
Change Availability to Busyness
  • Loading branch information
c3bryant authored Oct 3, 2022
2 parents f606639 + fc9c7e6 commit 4cf8eda
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions lib/app_constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class RouteTitles {
'dining/dining_list_view': 'Dining',
'dining/dining_detail_view': 'Dining',
'dining/dining_nutrition_view': 'Dining',
'availability/detailed_view': 'Availability'
'availability/detailed_view': 'Busyness'
};
}

Expand Down Expand Up @@ -181,7 +181,7 @@ class CardTitleConstants {
'schedule': 'Classes',
'shuttle': "Shuttle",
'dining': 'Dining',
'availability': 'Availability',
'availability': 'Busyness',
'events': 'Events',
'news': 'News',
'parking': 'Parking',
Expand Down
2 changes: 1 addition & 1 deletion lib/core/services/cards.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class CardsService {
/// API Manager Service
try {
String cardListEndpoint =
"https://api-qa.ucsd.edu:8243/mobilecardsservice/v1.0.0/mobilecardslist?version=8&ucsdaffiliation=" +
"https://api-qa.ucsd.edu:8243/mobilecardsservice/v1.0.0/mobilecardslist?version=9&ucsdaffiliation=" +
ucsdAffiliation;
String _response =
await _networkHelper.authorizedFetch(cardListEndpoint, headers);
Expand Down
10 changes: 5 additions & 5 deletions lib/ui/availability/availability_detail_view.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:campus_mobile_experimental/core/models/availability.dart';
import 'package:campus_mobile_experimental/ui/common/container_view.dart';
import 'package:campus_mobile_experimental/ui/availability/availability_constants.dart';
import 'package:campus_mobile_experimental/ui/common/container_view.dart';
import 'package:flutter/material.dart';

class AvailabilityDetailedView extends StatelessWidget {
Expand Down Expand Up @@ -44,7 +44,7 @@ class AvailabilityDetailedView extends StatelessWidget {
alignment: Alignment.centerLeft,
child: Text(
(100 * percentAvailability(floor)).toInt().toString() +
'% Availability',
'% Busy',
// style: TextStyle(color: Colors.black),
)),
Align(
Expand Down Expand Up @@ -79,15 +79,15 @@ class AvailabilityDetailedView extends StatelessWidget {

// Calculate the percent available
num percentAvailability(Floor subLocationFloor) =>
1 - subLocationFloor.percentage!;
subLocationFloor.percentage!;

// Color options
setIndicatorColor(num percentage) {
if (percentage >= .75)
return Colors.green;
return Colors.red;
else if (percentage >= .25)
return Colors.yellow;
else
return Colors.red;
return Colors.green;
}
}
10 changes: 5 additions & 5 deletions lib/ui/availability/availability_display.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:campus_mobile_experimental/app_constants.dart';
import 'package:campus_mobile_experimental/core/models/availability.dart';
import 'package:campus_mobile_experimental/ui/availability/availability_constants.dart';
import 'package:campus_mobile_experimental/app_constants.dart';
import 'package:flutter/material.dart';

class AvailabilityDisplay extends StatelessWidget {
Expand Down Expand Up @@ -70,7 +70,7 @@ class AvailabilityDisplay extends StatelessWidget {
(100 * percentAvailability(subLocation))
.toInt()
.toString() +
'% Availability',
'% Busy',
// style: TextStyle(color: Colors.black),
)),
Align(
Expand Down Expand Up @@ -124,14 +124,14 @@ class AvailabilityDisplay extends StatelessWidget {
);
}

num percentAvailability(SubLocations location) => 1 - location.percentage!;
num percentAvailability(SubLocations location) => location.percentage!;

setIndicatorColor(num percentage) {
if (percentage >= .75)
return Colors.green;
return Colors.red;
else if (percentage >= .25)
return Colors.yellow;
else
return Colors.red;
return Colors.green;
}
}
2 changes: 1 addition & 1 deletion lib/ui/common/card_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class CardContainer extends StatelessWidget {
)),
),
);
} else if (titleText == "Availability") {
} else if (titleText == "Busyness") {
// web cards are still sized with static values
return Container(
width: double.infinity,
Expand Down

0 comments on commit 4cf8eda

Please sign in to comment.