Bug 1366672 - part4: use Photon design for ProgressBar
MozReview-Commit-ID: IMFeVV0Km2i
--- a/mobile/android/app/src/main/res/drawable/progressbar.xml
+++ b/mobile/android/app/src/main/res/drawable/progressbar.xml
@@ -1,9 +1,16 @@
-<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:id="@android:id/progress">
- <clip>
- <shape>
- <solid android:color="@color/fennec_ui_orange"/>
- </shape>
- </clip>
- </item>
-</layer-list>
+<?xml version="1.0" encoding="utf-8"?>
+
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:gecko="http://schemas.android.com/apk/res-auto">
+
+ <!-- private browsing mode -->
+ <item android:drawable="@drawable/progressbar_private" gecko:state_private="true" />
+
+ <!-- normal modes -->
+ <item android:drawable="@drawable/progressbar_normal" />
+
+</selector>
+
new file mode 100644
--- /dev/null
+++ b/mobile/android/app/src/main/res/drawable/progressbar_normal.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@android:id/progress">
+ <scale
+ android:scaleGravity="fill_vertical|start"
+ android:scaleHeight="100%"
+ android:scaleWidth="100%">
+ <shape>
+ <gradient
+ android:centerColor="@color/photon_loading_indicator_dark"
+ android:endColor="@color/photon_loading_indicator_light"
+ android:startColor="@color/photon_loading_indicator_light" />
+ </shape>
+ </scale>
+ </item>
+</layer-list>
new file mode 100644
--- /dev/null
+++ b/mobile/android/app/src/main/res/drawable/progressbar_private.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@android:id/progress">
+ <scale
+ android:scaleGravity="fill_vertical|start"
+ android:scaleHeight="100%"
+ android:scaleWidth="100%">
+ <shape>
+ <gradient
+ android:centerColor="@color/photon_loading_indicator_dark_private"
+ android:endColor="@color/photon_loading_indicator_light_private"
+ android:startColor="@color/photon_loading_indicator_light_private" />
+ </shape>
+ </scale>
+ </item>
+</layer-list>
--- a/mobile/android/app/src/main/res/layout/gecko_app.xml
+++ b/mobile/android/app/src/main/res/layout/gecko_app.xml
@@ -1,18 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:gecko="http://schemas.android.com/apk/res-auto"
- android:id="@+id/root_layout"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
+ xmlns:gecko="http://schemas.android.com/apk/res-auto"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/root_layout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<ViewStub android:id="@+id/tabs_panel"
android:layout="@layout/tabs_panel_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<view class="org.mozilla.gecko.GeckoApp$MainLayout"
android:id="@+id/main_layout"
@@ -140,22 +141,24 @@
</ViewFlipper>
</LinearLayout>
<org.mozilla.gecko.widget.AnimatedProgressBar
android:id="@id/page_progress"
style="@style/Base.Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="match_parent"
- android:layout_height="14dp"
+ android:layout_height="2dp"
android:layout_below="@id/browser_chrome"
- android:layout_marginTop="-8dp"
+ android:layout_marginTop="-2dp"
android:background="@null"
- android:src="@drawable/progress"
- android:visibility="gone" />
+ android:progressDrawable="@drawable/progressbar"
+ android:visibility="gone"
+ app:shiftDuration="@integer/shift_duration_suggestion"
+ app:wrapShiftDrawable="true" />
</view>
<FrameLayout android:id="@+id/tab_history_panel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:visibility="gone" />
--- a/mobile/android/app/src/main/res/values/integers.xml
+++ b/mobile/android/app/src/main/res/values/integers.xml
@@ -8,10 +8,11 @@
<integer name="number_of_top_sites">6</integer>
<integer name="number_of_top_sites_cols">2</integer>
<integer name="max_icon_grid_columns">4</integer>
<integer name="panel_icon_grid_view_columns">3</integer>
<integer name="number_of_inline_share_devices">2</integer>
<integer name="max_search_suggestions">2</integer>
<integer name="max_saved_suggestions">2</integer>
<integer name="search_assist_launch_res">0</integer>
+ <integer name="shift_duration_suggestion">500</integer>
</resources>
--- a/mobile/android/app/src/photon/res/values/colors.xml
+++ b/mobile/android/app/src/photon/res/values/colors.xml
@@ -71,19 +71,16 @@
<color name="photon_two_line_page_row_bg_private">#414146</color>
<color name="photon_search_item_text">@color/photon_text_main</color>
<color name="photon_search_item_text_private">@color/photon_text_main_private</color>
<color name="photon_home_list_divider">@color/photon_two_line_page_row_bg</color>
<color name="photon_home_list_divider_private">@color/photon_two_line_page_row_bg_private</color>
- <color name="progress_start">#00DCFC</color>
- <color name="progress_end">#00A2FE</color>
-
<color name="photon_url_bar_blocked">#D70022</color>
<color name="photon_url_bar_blocked_private">#D70022</color>
<color name="photon_url_bar_certificate_owner">#05A700</color>
<color name="photon_url_bar_certificate_owner_private">#16DA00</color>
<color name="photon_url_bar_domain">@color/photon_text_main</color>
<color name="photon_url_bar_domain_private">@color/photon_text_main_private</color>
<!-- Tab strip color on tablet -->