Skip to content

Commit

Permalink
Some UI fixes of 'Post Activity to steemit' screen
Browse files Browse the repository at this point in the history
  • Loading branch information
hitenkmr committed Aug 16, 2018
1 parent f982440 commit c42f279
Show file tree
Hide file tree
Showing 7 changed files with 268 additions and 263 deletions.
Binary file not shown.
1 change: 1 addition & 0 deletions Actifit/Actifit/AppDelegate/AFAppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class AFAppDelegate: UIResponder, UIApplicationDelegate {

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

//Enabling IBKeyboardManager to handle keyboard for textfields and textviews
IQKeyboardManager.shared.enable = true

//MARK: Start AppCenter services
Expand Down
508 changes: 254 additions & 254 deletions Actifit/Actifit/Controllers/Base.lproj/Main.storyboard

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions Actifit/Actifit/Controllers/PostToSteemitVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,12 @@ class PostToSteemitVC: UIViewController {
@IBOutlet weak var chestTextField : AFTextField!
@IBOutlet weak var postTagsTextView : AFTextView!
@IBOutlet weak var postTagsTextViewHeightConstraint : NSLayoutConstraint!
@IBOutlet weak var postContentTextView : AFTextView!
@IBOutlet weak var postContentTextViewHeightConstraint : NSLayoutConstraint!
@IBOutlet weak var postContentTextView : UITextView!
@IBOutlet weak var postToSteemitBtn : UIButton!

@IBOutlet weak var postTitleTextViewLineLabel : UIView!
@IBOutlet weak var postTagsTextViewLineLabel : UIView!
@IBOutlet weak var postContentTextViewLineLabel : UIView!

var currentTextField : AFTextField?

lazy var todayActivity = {
return Activity.all().first(where: {$0.date == AppDelegate.todayStartDate()})
Expand Down Expand Up @@ -150,7 +147,7 @@ class PostToSteemitVC: UIViewController {
activityJson[PostKeys.waist] = self.waistTextField.text ?? ""
activityJson[PostKeys.thigs] = self.thighTextField.text ?? ""
activityJson[PostKeys.bodyfat] = self.bodyFatTextField.text ?? ""
activityJson[PostKeys.weightUnit] = "cm"
activityJson[PostKeys.weightUnit] = "kg"
activityJson[PostKeys.heightUnit] = "cm"
activityJson[PostKeys.chestUnit] = "cm"
activityJson[PostKeys.waistUnit] = "cm"
Expand All @@ -163,6 +160,11 @@ class PostToSteemitVC: UIViewController {
//MARK: HELPERS

func applyFinishingTouchToUIElements() {
postContentTextView.layer.borderColor = UIColor.lightGray.cgColor
postContentTextView.layer.borderWidth = 1.0
postContentTextView.layer.cornerRadius = 4.0

self.postContentTextView.clipsToBounds = true
self.postTagsTextView.text = ""
self.postTitleTextView.text = defaultPostTitle
self.postToSteemitBtn.layer.cornerRadius = 4.0
Expand All @@ -172,7 +174,6 @@ class PostToSteemitVC: UIViewController {

self.backBtn.setImage(#imageLiteral(resourceName: "back_black").withRenderingMode(.alwaysTemplate), for: .normal)
self.backBtn.tintColor = UIColor.white
self.postContentTextView.heightConstraint = self.postContentTextViewHeightConstraint
self.postTitleTextView.heightConstraint = self.postTitleTextViewHeightConstraint
self.postTagsTextView.heightConstraint = self.postTagsTextViewHeightConstraint
}
Expand Down Expand Up @@ -292,7 +293,7 @@ extension PostToSteemitVC : UITextFieldDelegate {
//MARK: UITextFieldDelegate

func textFieldDidBeginEditing(_ textField: UITextField) {
self.currentTextField = textField as? AFTextField

}

func textFieldDidEndEditing(_ textField: UITextField) {
Expand Down
2 changes: 1 addition & 1 deletion Actifit/Actifit/Controllers/TrackingHistoryVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ extension TrackingHistoryVC : UITableViewDataSource, UITableViewDelegate {
//MARK: UITableViewDataSource

func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
return "Steps History"
return "Activity History"
}
}
3 changes: 3 additions & 0 deletions Actifit/Actifit/Models/Activity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class Activity : Object {
objs.forEach({ (content) in
contents.append(content)
})
contents.sort(by: ({ (activity1, activity2) -> Bool in
return activity1.date > activity2.date
}))
}
return contents
}
Expand Down
2 changes: 1 addition & 1 deletion Actifit/Actifit/Views/ActivityHistoryCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ActivityHistoryCell: UITableViewCell {
}

func configureWith(activity : Activity) {
self.dailyStepsLabel.text = self.formattedDAteStr(date: activity.date) + " - " + "Total Steps: \(activity.steps)"
self.dailyStepsLabel.text = self.formattedDAteStr(date: activity.date) + " - " + "Total Activity: \(activity.steps)"
}


Expand Down

0 comments on commit c42f279

Please sign in to comment.