Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
android-components
Commits
e6df84c3
Commit
e6df84c3
authored
May 30, 2019
by
Tiger Oakes
Committed by
Tiger Oakes
Jun 05, 2019
Browse files
Fixes #3032 - Add animation for browser-menu
parent
63478b81
Changes
6
Hide whitespace changes
Inline
Side-by-side
components/browser/menu/src/main/java/mozilla/components/browser/menu/BrowserMenu.kt
View file @
e6df84c3
...
...
@@ -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
()
...
...
components/browser/menu/src/main/res/anim/menu_enter_bottom.xml
0 → 100644
View file @
e6df84c3
<?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>
components/browser/menu/src/main/res/anim/menu_enter_top.xml
0 → 100644
View file @
e6df84c3
<?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>
components/browser/menu/src/main/res/anim/menu_exit.xml
0 → 100644
View file @
e6df84c3
<?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>
components/browser/menu/src/main/res/values/style.xml
View file @
e6df84c3
...
...
@@ -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>
docs/changelog.md
View file @
e6df84c3
...
...
@@ -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`
.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment