Closed
Bug 1058574
Opened 10 years ago
Closed 10 years ago
Remove package level access to class variables within the tabs package
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 35
People
(Reporter: mhaigh, Assigned: mhaigh)
References
Details
Attachments
(1 file, 1 obsolete file)
7.28 KB,
patch
|
lucasr
:
review+
|
Details | Diff | Splinter Review |
Accessing class variables directly is dirty and needs to stop. Make all class level variables private and provide a better API to access them
Assignee | ||
Comment 1•10 years ago
|
||
https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=947e2f32d075
Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8499634 -
Flags: feedback?(lucasr.at.mozilla)
Comment 3•10 years ago
|
||
Comment on attachment 8499634 [details] [diff] [review] Remove package level access to class variables within the tabs package Review of attachment 8499634 [details] [diff] [review]: ----------------------------------------------------------------- Looks good but needs better encapsulation. ::: mobile/android/base/tabs/TabsGridLayout.java @@ +55,4 @@ > @Override > public void onMovedToScrapHeap(View view) { > TabsLayoutItemView item = (TabsLayoutItemView) view; > + item.getThumbnail().setImageDrawable(null); Just do setThumbnail(Drawable) instead of exposing individual views. @@ +72,4 @@ > @Override > public void onClick(View v) { > TabsLayoutItemView itemView = (TabsLayoutItemView) v.getTag(); > + Tab tab = Tabs.getInstance().getTab(itemView.getId()); getId -> getTabId() for clarity. ::: mobile/android/base/tabs/TabsLayoutItemView.java @@ +110,5 @@ > + public int getId() { > + return mId; > + } > + > + public TextView getTitle() { No need to add getters for stuff that is not being used. Besides, we probably want to hide details of the internal view structure. So, remove all these unused view getters. ::: mobile/android/base/tabs/TabsListLayout.java @@ +80,5 @@ > @Override > public void onMovedToScrapHeap(View view) { > TabsLayoutItemView item = (TabsLayoutItemView) view; > + item.getThumbnail().setImageDrawable(null); > + item.getCloseButton().setVisibility(View.VISIBLE); Add a setCloseVisible(boolean) instead.
Attachment #8499634 -
Flags: feedback?(lucasr.at.mozilla) → feedback+
Assignee | ||
Comment 4•10 years ago
|
||
Ack - that was sloppy of me. Encapsulation sorted now. https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=dbe615cff1fd
Attachment #8499634 -
Attachment is obsolete: true
Attachment #8500446 -
Flags: review?(lucasr.at.mozilla)
Comment 5•10 years ago
|
||
Comment on attachment 8500446 [details] [diff] [review] Remove package level access to class variables within the tabs package Review of attachment 8500446 [details] [diff] [review]: ----------------------------------------------------------------- Nice, thanks.
Attachment #8500446 -
Flags: review?(lucasr.at.mozilla) → review+
Assignee | ||
Comment 6•10 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/65258607c89d
https://hg.mozilla.org/mozilla-central/rev/65258607c89d
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 35
Updated•3 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•