Loading app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt +15 −0 Original line number Original line Diff line number Diff line Loading @@ -20,6 +20,9 @@ import android.widget.PopupWindow import androidx.annotation.StringRes import androidx.annotation.StringRes import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintSet import androidx.constraintlayout.widget.ConstraintSet.BOTTOM import androidx.constraintlayout.widget.ConstraintSet.TOP import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat import androidx.core.view.updateLayoutParams import androidx.core.view.updateLayoutParams Loading Loading @@ -229,6 +232,18 @@ class HomeFragment : Fragment() { gravity = Gravity.TOP gravity = Gravity.TOP } } ConstraintSet().apply { clone(view.toolbarLayout) clear(view.bottomBarShadow.id, BOTTOM) connect(view.bottomBarShadow.id, TOP, view.bottom_bar.id, BOTTOM) applyTo(view.toolbarLayout) } view.bottom_bar.background = resources.getDrawable( ThemeManager.resolveAttribute(R.attr.bottomBarBackgroundTop, requireContext()), null ) view.homeAppBar.updateLayoutParams<ViewGroup.MarginLayoutParams> { view.homeAppBar.updateLayoutParams<ViewGroup.MarginLayoutParams> { topMargin = HEADER_MARGIN.dpToPx(resources.displayMetrics) topMargin = HEADER_MARGIN.dpToPx(resources.displayMetrics) } } Loading app/src/main/res/drawable/home_bottom_bar_background_top.xml 0 → 100644 +17 −0 Original line number Original line Diff line number Diff line <?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> <shape> <solid android:color="@color/foundation_normal_theme" /> </shape> </item> <item android:height="1dp" android:gravity="bottom"> <shape android:shape="rectangle"> <solid android:color="#1AFFFFFF" /> </shape> </item> </layer-list> app/src/main/res/drawable/private_home_bottom_bar_background_gradient_top.xml 0 → 100644 +22 −0 Original line number Original line Diff line number Diff line <?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> <shape> <gradient android:angle="45" android:startColor="#7529A7" android:centerColor="#492E85" android:endColor="#383372" android:type="linear" /> </shape> </item> <item android:height="1dp" android:gravity="bottom"> <shape android:shape="rectangle"> <solid android:color="#1AFFFFFF" /> </shape> </item> </layer-list> app/src/main/res/layout/fragment_home.xml +10 −0 Original line number Original line Diff line number Diff line Loading @@ -91,11 +91,21 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintBottom_toTopOf="@id/bottom_bar" /> app:layout_constraintBottom_toTopOf="@id/bottom_bar" /> <View android:id="@+id/bottomBarHighlight" android:layout_width="0dp" android:layout_height="1dp" android:background="@color/bottom_bar_shadow" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintBottom_toTopOf="@id/bottom_bar" /> <View <View android:id="@+id/bottom_bar" android:id="@+id/bottom_bar" android:layout_width="0dp" android:layout_width="0dp" android:layout_height="56dp" android:layout_height="56dp" android:background="?bottomBarBackground" android:background="?bottomBarBackground" android:foregroundGravity="bottom" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent" /> Loading app/src/main/res/values/attrs.xml +1 −0 Original line number Original line Diff line number Diff line Loading @@ -31,6 +31,7 @@ <!-- Misc --> <!-- Misc --> <attr name="homeBackground" format="reference"/> <attr name="homeBackground" format="reference"/> <attr name="bottomBarBackground" format="reference"/> <attr name="bottomBarBackground" format="reference"/> <attr name="bottomBarBackgroundTop" format="reference"/> <attr name="privateBrowsingButtonBackground" format="reference" /> <attr name="privateBrowsingButtonBackground" format="reference" /> <attr name="privateBrowsingButtonAccent" format="reference" /> <attr name="privateBrowsingButtonAccent" format="reference" /> <attr name="fenixLogo" format="reference" /> <attr name="fenixLogo" format="reference" /> Loading Loading
app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt +15 −0 Original line number Original line Diff line number Diff line Loading @@ -20,6 +20,9 @@ import android.widget.PopupWindow import androidx.annotation.StringRes import androidx.annotation.StringRes import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintSet import androidx.constraintlayout.widget.ConstraintSet.BOTTOM import androidx.constraintlayout.widget.ConstraintSet.TOP import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat import androidx.core.view.updateLayoutParams import androidx.core.view.updateLayoutParams Loading Loading @@ -229,6 +232,18 @@ class HomeFragment : Fragment() { gravity = Gravity.TOP gravity = Gravity.TOP } } ConstraintSet().apply { clone(view.toolbarLayout) clear(view.bottomBarShadow.id, BOTTOM) connect(view.bottomBarShadow.id, TOP, view.bottom_bar.id, BOTTOM) applyTo(view.toolbarLayout) } view.bottom_bar.background = resources.getDrawable( ThemeManager.resolveAttribute(R.attr.bottomBarBackgroundTop, requireContext()), null ) view.homeAppBar.updateLayoutParams<ViewGroup.MarginLayoutParams> { view.homeAppBar.updateLayoutParams<ViewGroup.MarginLayoutParams> { topMargin = HEADER_MARGIN.dpToPx(resources.displayMetrics) topMargin = HEADER_MARGIN.dpToPx(resources.displayMetrics) } } Loading
app/src/main/res/drawable/home_bottom_bar_background_top.xml 0 → 100644 +17 −0 Original line number Original line Diff line number Diff line <?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> <shape> <solid android:color="@color/foundation_normal_theme" /> </shape> </item> <item android:height="1dp" android:gravity="bottom"> <shape android:shape="rectangle"> <solid android:color="#1AFFFFFF" /> </shape> </item> </layer-list>
app/src/main/res/drawable/private_home_bottom_bar_background_gradient_top.xml 0 → 100644 +22 −0 Original line number Original line Diff line number Diff line <?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> <shape> <gradient android:angle="45" android:startColor="#7529A7" android:centerColor="#492E85" android:endColor="#383372" android:type="linear" /> </shape> </item> <item android:height="1dp" android:gravity="bottom"> <shape android:shape="rectangle"> <solid android:color="#1AFFFFFF" /> </shape> </item> </layer-list>
app/src/main/res/layout/fragment_home.xml +10 −0 Original line number Original line Diff line number Diff line Loading @@ -91,11 +91,21 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintBottom_toTopOf="@id/bottom_bar" /> app:layout_constraintBottom_toTopOf="@id/bottom_bar" /> <View android:id="@+id/bottomBarHighlight" android:layout_width="0dp" android:layout_height="1dp" android:background="@color/bottom_bar_shadow" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintBottom_toTopOf="@id/bottom_bar" /> <View <View android:id="@+id/bottom_bar" android:id="@+id/bottom_bar" android:layout_width="0dp" android:layout_width="0dp" android:layout_height="56dp" android:layout_height="56dp" android:background="?bottomBarBackground" android:background="?bottomBarBackground" android:foregroundGravity="bottom" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent" /> Loading
app/src/main/res/values/attrs.xml +1 −0 Original line number Original line Diff line number Diff line Loading @@ -31,6 +31,7 @@ <!-- Misc --> <!-- Misc --> <attr name="homeBackground" format="reference"/> <attr name="homeBackground" format="reference"/> <attr name="bottomBarBackground" format="reference"/> <attr name="bottomBarBackground" format="reference"/> <attr name="bottomBarBackgroundTop" format="reference"/> <attr name="privateBrowsingButtonBackground" format="reference" /> <attr name="privateBrowsingButtonBackground" format="reference" /> <attr name="privateBrowsingButtonAccent" format="reference" /> <attr name="privateBrowsingButtonAccent" format="reference" /> <attr name="fenixLogo" format="reference" /> <attr name="fenixLogo" format="reference" /> Loading