aleene / FoodViewer

An app to view and edit Open Food Fact products
Apache License 2.0
10 stars 5 forks source link

Portion edit field has different layout #974

Closed aleene closed 4 years ago

aleene commented 4 years ago

It should mimic the ingredients name for instance.

nameTextView.layer.borderWidth = 0.5
if #available(iOS 13.0, *) {
  nameTextView.backgroundColor = editMode ? .secondarySystemBackground : .systemBackground
 nameTextView?.layer.borderColor = editMode ? UIColor.darkGray.cgColor : UIColor.systemBackground.cgColor
 nameTextView.textColor = editMode ? .secondaryLabel : .label
} else {
  nameTextView.backgroundColor = editMode ? .groupTableViewBackground : .white
 nameTextView?.layer.borderColor = editMode ? UIColor.darkGray.cgColor : UIColor.white.cgColor
 nameTextView.textColor = .black
}  
if editMode {
  nameTextView?.layer.cornerRadius = 5
  nameTextView?.clipsToBounds = true
} else {
  setButtonOrDoubletap(buttonNotDoubleTap)
}