Closed Bug 1148469 Opened 10 years ago Closed 10 years ago

Pull constant dimens and fonts into a central place

Categories

(Firefox for iOS :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: wesj, Unassigned)

References

Details

Attachments

(1 file)

47 bytes, text/x-github-pull-request
st3fan
: review+
Details | Review
We use a lot of the same dimens in different places (ToolbarHeight and StatusBarHeight for instance). We should try to consolidate these numbers somewhere and use them consistently. At the same time, I want to make StatusBarHeight dynamic so that we can adjust when we're in landscape and its hidden. We also use a lot of the same fonts, although we actually have quite a few different sizes (ranging from 11pt to 13pt). We should consolidate these and try to be a bit more consistent with them as well. I think we should probably also do the same thing with a palette (just using Android's palette? [1]). I pulled a few custom colors over here, but I haven't really dug into that yet. [1] https://bug1127517.bugzilla.mozilla.org/attachment.cgi?id=8566330
Attached file Pull request
Attachment #8584638 - Flags: review?(sarentz)
I think this is a good idea except for things like `UIFont.DefaultMediumFont()`. Two reasons. I think it is very confusing to add things to standard classes like this. What is ours, what is from the system. I think it also defeats the point of having things in a central location. So + on `AppConstants` but - on adding extensions to things like `UIColor` and `UIFont`. I would rather see AppConstants.DefaultButtonFont or AppConstants.HighlightColor.
I also don't want to stop using the following, which we are putting more and more above UI elements so that they are easy to tweak: private struct SomeThingUX { static let RowHeight = 20 static let FooButtonFont = UIFont(name: "Charis", size: 15) } I think we can simply reference AppConstants from there if defaults suffice. But my experience so far is that there are many things that need subtle non standard changes.
> I think we can simply reference AppConstants from there if defaults suffice. > But my experience so far is that there are many things that need subtle non > standard changes. Yeah, looking around for things to pull in, this scared me a bit to be honest. We use lots of different paddings all over. It risks feeling a bit unpolished. Then again, sometimes things just need different paddings. I think for fonts, colors, and some basic dimensions though, this should be good (and won't require importing all of BrowserViewController to use).
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Attachment #8584638 - Flags: review?(sarentz) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: