1
0
Fork 0

Fixes #1204 - Fixes the home screen animation

master
Jeff Boek 2019-04-08 13:48:37 -07:00 committed by Colin Lee
parent 3654289c8a
commit 9434f01b42
5 changed files with 55 additions and 0 deletions

View File

@ -153,6 +153,9 @@ class HomeFragment : Fragment(), CoroutineScope {
BrowsingModeManager.Mode.Private -> BrowsingModeManager.Mode.Normal
}
}
// We need the shadow to be above the components.
homeDividerShadow.bringToFront()
}
override fun onDestroyView() {

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="@color/home_header_shadow"
android:endColor="@android:color/transparent"
android:angle="270" />
</shape>

View File

@ -89,5 +89,15 @@
android:layout_marginStart="40dp"
android:layout_marginEnd="40dp"/>
<View
android:id="@+id/homeDividerShadow"
android:layout_width="0dp"
android:layout_height="3dp"
android:alpha="0"
android:background="@drawable/home_header_shadow"
app:layout_constraintTop_toBottomOf="@id/homeDivider"
app:layout_constraintStart_toStartOf="@+id/homeDivider"
app:layout_constraintEnd_toEndOf="@+id/homeDivider" />
</androidx.constraintlayout.motion.widget.MotionLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -140,4 +140,6 @@
<color name="quick_action_background_private_theme">@color/toolbar_dark_mode</color>
<color name="fenix_snackbar_background">#232749</color>
<color name="home_header_shadow">#1F1B215E</color>
</resources>

View File

@ -50,6 +50,21 @@
motion:framePosition="90"
android:alpha="0" />
<KeyAttribute
motion:motionTarget="@id/homeDividerShadow"
motion:framePosition="90">
<CustomAttribute
motion:attributeName="layoutMarginStart"
motion:customPixelDimension="0dp" />
<CustomAttribute
motion:attributeName="layoutMarginEnd"
motion:customPixelDimension="0dp" />
</KeyAttribute>
<KeyAttribute
motion:motionTarget="@id/homeDividerShadow"
motion:framePosition="90"
android:alpha="0" />
<KeyAttribute
motion:motionTarget="@id/toolbar_wrapper"
motion:framePosition="0"
@ -120,5 +135,23 @@
android:layout_width="@dimen/glyph_button_height"
motion:layout_constraintEnd_toStartOf="@id/menuButton"
motion:layout_constraintTop_toTopOf="@id/menuButton"/>
<Constraint
android:id="@+id/homeDivider"
android:layout_height="1dp"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:layout_marginTop="8dp"
motion:layout_constraintTop_toBottomOf="@id/toolbar_wrapper"
motion:layout_constraintStart_toStartOf="parent"
motion:layout_constraintEnd_toEndOf="parent" />
<Constraint
android:id="@+id/homeDividerShadow"
android:layout_height="3dp"
android:alpha="1"
motion:layout_constraintTop_toBottomOf="@id/homeDivider"
motion:layout_constraintStart_toStartOf="@+id/homeDivider"
motion:layout_constraintEnd_toEndOf="@+id/homeDivider" />
</ConstraintSet>
</MotionScene>