Skip to content
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

Profile Page Redesign #42

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions AHS/AHS/UI/profilePage/profilePage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ class profilePageViewController : mainPageViewController{
internal var scheduleViewHeight : CGFloat = 0;

//static internal let optionsCellTitles = ["Notifications", "ID Card"]; -- with id card
static internal let optionsCellTitles = ["Notifications"];
static internal let infoCellTitles = ["About Us", "Terms and Agreements", "App Version"];
static internal let optionsCellTitles = [""];
static internal let infoCellTitles = ["Dark Mode", "Notifications", "About Us", "Terms and Agreements", "App Version", "Sign out"];

//internal let tableViewContentViewControllers = [[notificationSettingsPageViewController(), idCardSettingsPageViewController()], [aboutUsPageViewController(), termsAndConditionsPageViewController()]]; -- with id card
internal let tableViewContentViewControllers = [[notificationSettingsPageViewController()], [aboutUsPageViewController(), termsAndConditionsPageViewController()]];
internal let tableViewContentViewControllers = [[], [articlePageViewController.toggleUserInterface, notificationSettingsPageViewController(), aboutUsPageViewController(), termsAndConditionsPageViewController()]];

internal var contentTableViewCellTitles : [[String]] = []; // gets populated with optionsCellTitles and infoCellTitles
internal var contentTableViewCellValues : [[String?]] = [];
Expand Down Expand Up @@ -152,7 +152,7 @@ class profilePageViewController : mainPageViewController{
contentTableViewCellTitles = [profilePageViewController.optionsCellTitles, profilePageViewController.infoCellTitles];

contentTableViewCellValues = [Array(repeating: nil, count: profilePageViewController.optionsCellTitles.count), Array(repeating: nil, count: profilePageViewController.infoCellTitles.count)];
contentTableViewCellValues[1][profilePageViewController.infoCellTitles.count - 1] = AppUtility.getAppVersionString(); // set app build number
contentTableViewCellValues[1][profilePageViewController.infoCellTitles.count - 2] = AppUtility.getAppVersionString(); // set app build number
}

internal func renderContent(){
Expand Down
4 changes: 2 additions & 2 deletions AHS/AHS/UI/profilePage/profilePageActions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ extension profilePageViewController{
internal func openTableViewPage(_ indexPath: IndexPath){
switch indexPath.section {
case 1:
self.openPresentablePage(self.tableViewContentViewControllers[0][indexPath.row]);
self.openPresentablePage(self.tableViewContentViewControllers[0][indexPath.row] as! presentableViewController);
case 2:
if indexPath.row < self.tableViewContentViewControllers[1].count{ self.openPresentablePage(self.tableViewContentViewControllers[1][indexPath.row]);
if indexPath.row < self.tableViewContentViewControllers[1].count{ self.openPresentablePage(self.tableViewContentViewControllers[1][indexPath.row] as! presentableViewController);
}
default:
print("invalid indexPath section in profilePage");
Expand Down
12 changes: 2 additions & 10 deletions AHS/AHS/UI/profilePage/profilePageTableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,7 @@ extension profilePageViewController: UITableViewDelegate, UITableViewDataSource
var s : String = "";
switch section {
case 0:
s += "Schedule";
case 1:
s += "Options";
case 2:
s += "Info";
s += "Settings";
default:
s = "";
}
Expand All @@ -114,11 +110,7 @@ extension profilePageViewController: UITableViewDelegate, UITableViewDataSource

cell.selectionStyle = .none;

if (indexPath.section == 0){
cell.updateWithView(indexPath.section, scheduleView);
renderSchedule();
}
else{
if (indexPath.section != 0){
cell.updateWithButton(indexPath.section, title: contentTableViewCellTitles[indexPath.section - 1][indexPath.row], value: contentTableViewCellValues[indexPath.section - 1][indexPath.row]);
}

Expand Down