Commit e6df84c3 authored by Tiger Oakes's avatar Tiger Oakes Committed by Tiger Oakes
Browse files

Fixes #3032 - Add animation for browser-menu

parent 63478b81
......@@ -44,6 +44,10 @@ class BrowserMenu internal constructor(
WindowManager.LayoutParams.WRAP_CONTENT
).apply {
setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
animationStyle = when (orientation) {
Orientation.DOWN -> R.style.Mozac_Browser_Menu_Animation_OverflowMenuTop
Orientation.UP -> R.style.Mozac_Browser_Menu_Animation_OverflowMenuBottom
}
isFocusable = true
elevation = view.resources.pxToDp(MENU_ELEVATION_DP).toFloat()
......
<?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/. -->
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:fromXScale="0"
android:toXScale="1"
android:fromYScale="0"
android:toYScale="1"
android:pivotX="95%"
android:pivotY="100%"
android:duration="@android:integer/config_shortAnimTime" />
<alpha android:interpolator="@android:anim/linear_interpolator"
android:fromAlpha="0"
android:toAlpha="1"
android:duration="@android:integer/config_shortAnimTime" />
<translate android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:fromYDelta="0"
android:toYDelta="0"
android:duration="@android:integer/config_shortAnimTime" />
</set>
<?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/. -->
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:fromXScale="0"
android:toXScale="1"
android:fromYScale="0"
android:toYScale="1"
android:pivotX="95%"
android:pivotY="5%"
android:duration="@android:integer/config_shortAnimTime" />
<alpha android:interpolator="@android:anim/linear_interpolator"
android:fromAlpha="0"
android:toAlpha="1"
android:duration="@android:integer/config_shortAnimTime" />
<translate android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:fromYDelta="0"
android:toYDelta="0"
android:duration="@android:integer/config_shortAnimTime" />
</set>
<?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/. -->
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha android:interpolator="@android:anim/linear_interpolator"
android:fromAlpha="1"
android:toAlpha="0"
android:duration="@android:integer/config_shortAnimTime" />
</set>
......@@ -47,4 +47,16 @@
<item name="android:paddingStart">@dimen/mozac_browser_menu_item_image_text_label_padding_start</item>
</style>
<!-- BrowserMenuImageText -->
<!-- Animation -->
<style name="Mozac.Browser.Menu.Animation.OverflowMenuTop" parent="">
<item name="android:windowEnterAnimation">@anim/menu_enter_top</item>
<item name="android:windowExitAnimation">@anim/menu_exit</item>
</style>
<style name="Mozac.Browser.Menu.Animation.OverflowMenuBottom" parent="">
<item name="android:windowEnterAnimation">@anim/menu_enter_bottom</item>
<item name="android:windowExitAnimation">@anim/menu_exit</item>
</style>
<!-- Animation -->
</resources>
......@@ -40,6 +40,7 @@ permalink: /changelog/
* **browser-menu**
* Fixed a bug where overscroll effects would appear on the overflow menu.
* Added enter and exit animations.
* **browser-session**
* Added handler for `onWebAppManifestLoaded` to update `session.webAppManifest`.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment