* Rename enum Mode to IconType, and added some types
* to map IconType to drawable-image-level
* add unit test
function `resolve` now returns IconType. IconType is abstraction and
independent from Drawable. It defines possible values of resolving
SiteIdentity.
We use a map to get correspond Drawable image level, then no need to
worry about Drawable-changing and algorithm.
Although unit test haven't cover all possible cases. But it passed
original implementation of `ToolbarDisplayLayout.updateSiteIdentity`.
It means `SecurityModelUtil.resolve` will not have obviously
regression....theoretically.
MozReview-Commit-ID: 3E0JMeBlg8D
Now we only use Light theme, and its look and feel more close to
Full-Browser. Hopefully when we re-use gecko widgets will have less
visual issue.
In ActionBar, the tint color follows text color. And the text color is
decided by Top toolbar background.
MozReview-Commit-ID: JrFAdLmk3Fk
Use notification id to check whether the notification is correct is more stable than just checking the
number of system notification.
MozReview-Commit-ID: BVYdMrBsSLR
Parts of ActivityStream already live under omg.activitystream, lets move the UI code there
too to make it easier to actually find AS code.
MozReview-Commit-ID: 6Aa7AZ9cw5n
This version of the Dynamic Toolbar moves the animation of the toolbar
from the Android UI thread to the compositor thread. All animation for
showing and hiding the toolbar are done with the compositor and a static
snapshot of the real toolbar.
MozReview-Commit-ID: BCe8zpbkWQt
There might be up to 2 Always-show-as-action button in ActionBar.
One for menu-options, one for 3rd-party app action-button, if any.
According to our design spec, the two buttons appearance should be
similiar, therefore now we create them by same method.
MozReview-Commit-ID: GPVteQR3hxr
__Device_Configuration__|__o_Applied_Style_______________
ldrtl-v17 v17 v15 |
o o o | UrlBar.Entry
\ | | |
-----o | | UrlBar.V17.Entry(start/end)
\ | |
\ o | UrlBar.V15.Entry(left/right)
\ | |
--o | UrlBar.Base.Entry(original style)
Though Android support RTL since API level 17(JB_MR1), it's really buggy at that moment.
This patch fix a severe UI layout attribute bug, which only happen on android 4.2 in RTL language context:
If view attributes "start/end" and "left/right" are both written in a view layout xml, they will both be applied and cause UI abnormal. In API 18 and above, "left" will be ignored if "start" also exist.
For example, as below show, alignLeft and alignStart are both exist in ImageView. On android 4.2 with RTL context, it's width will both align Left and Start(Right), cause the symptom that ImageView have the same width and cover on the view "back."
```
<ImageView android:id="@+id/url_bar_entry"
android:layout_alignLeft="@+id/back"
android:layout_alignStart="@+id/back"
```
MozReview-Commit-ID: JptLuWX2w15
This is a bit complicated. But most of that code should go away again as soon as
we can stop shipping the opt-out preference.
With this patch we have three flags that can be controlled via Switchboard:
* activity-stream: This is our global kill switch and allows us to pull the feature
if needed. A user has to be in this experiment to ever see activity stream. The
goal is to enable this experiment for 100% of the Nightly audience.
* activity-stream-opt-out: This is experiment will enable the Activity Stream by
default. The goal is to enable this experiment for 50% of the Nightly audience.
* activity-stream-settings: This experiment controls the visibility of a setting
to enable/disable activity stream (settings -> advanced -> experimental features).
This allows us to control whether users can opt-in or opt-out of the activity
experiment. The goal is to enable this for 100% of the Nightly audience.
MozReview-Commit-ID: BwEoTK6QMQx
This is a bit complicated. But most of that code should go away again as soon as
we can stop shipping the opt-out preference.
With this patch we have three flags that can be controlled via Switchboard:
* activity-stream: This is our global kill switch and allows us to pull the feature
if needed. A user has to be in this experiment to ever see activity stream. The
goal is to enable this experiment for 100% of the Nightly audience.
* activity-stream-opt-out: This is experiment will enable the Activity Stream by
default. The goal is to enable this experiment for 50% of the Nightly audience.
* activity-stream-settings: This experiment controls the visibility of a setting
to enable/disable activity stream (settings -> advanced -> experimental features).
This allows us to control whether users can opt-in or opt-out of the activity
experiment. The goal is to enable this for 100% of the Nightly audience.
MozReview-Commit-ID: BwEoTK6QMQx
Robocop/Robotium gets terribly confused if multiple views use the same R.id, even if they're never shown together at the same time.
Without this patch, opening of the main menu fails once the tabs tray has been opened (and closed again) at least once.
MozReview-Commit-ID: IOyxG4SCyzF
No need to create id resources for common widgets in each activities, e.g.
toolbar. Reuse id resources to make less ambiguous when invoking `findViewById`
In BrowserApp and CustomTabsActivity, both of them have ActionBar and
Progress-Bar. Let them use the same id resource.
MozReview-Commit-ID: 2jq18dwlBlm
The CustomView has three components
* Icon - for site info to indicate whether the visited site is security
* Title
* Url
Icon is for site info to indicate whether the visited site is security.
Its icon type is decided by SecurityModeUtil. All of the components' color
are the same as TextView color.
When onTabChanged happens, it updates CustView of ActionBar to reflect
current site security status. Sometimes the callback will be invoked rapidly
several times in very short time. To avoid icon twinkle, to add a delay when
updating CustomView.
MozReview-Commit-ID: KCu3XLObmmV
Besides custom-menu-items from 3-rd party apps, we designed a custom
menu which always has
* buttons for Forward, Reload
* One menu item for 'Open by Firefox'
* a footer 'Powered by Firefox'
This patch adds a button as an anchor to standard menu. Once user click
it, to show a custom menu (GeckoPopupMenu) base on the anchor.
In current design, there is only one style for menu, regardless of Dark
or Light theme.
MozReview-Commit-ID: 5RMiGDlxLTU
CustomTabsActivity is usually be used by 3rd-party apps. Its look and
feel is usually different from GeckoApp. To give separated themes to
ensure any change to CustomTabs won't effect GeckoApp.
MozReview-Commit-ID: 7aBnnPXv3nQ
We used to scroll in addTab to make sure a new tab created by a close-tab-undo
at the start or the end of the list was made visible instead of staying where it
was created off the edge. We're now taking care of that in selectTab (where it
should have stayed in the first place), where the select in that case occurs
between the time when the new tab is added to the adapter and when the layout
gets updated. In the case where the new tab is at the start, that means the
check 'position < layoutManager.findFirstCompletelyVisibleItemPosition()' in
selectTab reads '0 < 0', which fails (which is why we need the new check for
'position == 0'), but the check 'position >
layoutManager.findLastCompletelyVisibleItemPosition()' for a tab added at the
end reads 'new_lengh -1 > old_length - 1' which already passes, so we don't need
a special case for undo-tab-close adds at the end in selectTab. Tabs added at
the end by a normal "create new tab" still scroll for the same reason.
Robotium was confused by the duplicate 'add_tab' ids from the tab strip and the
tabs panel, so I renamed one of them. Also note that the 'getTabId' added to
TabStripItemView for testing already exists on TabLayoutItemView, but the two
classes don't share a common base.
MozReview-Commit-ID: BzG2r8BSs90
All TabsLayouts are RecyclerViews now.
* Orientation on a RecyclerView is set on the LayoutManager, not the
RecyclerView;
* android:listSelector doesn't apply to RecyclerView;
* android:choiceMode doesn't apply to RecyclerView.
This patch also fixes bug 1337699 when it removes the old
android:scrollbars="horizontal" in values-land/styles.xml from back when the
tabs tray scrolled horizontally in landscape mode.
MozReview-Commit-ID: 97el99fSi5o
Text is currently pushed directly against the pin in those cases
where the entire width is filled with text - this spacing
is needed to separate the pin, and text.
MozReview-Commit-ID: HOVH1SgcrLY