diff options
author | Vineet Patil <vpatil@cyngn.com> | 2015-11-17 14:23:05 -0800 |
---|---|---|
committer | Vineet Patil <vpatil@cyngn.com> | 2015-11-18 13:39:02 -0800 |
commit | 35614fdc7d13179ba9cbc80f15eca6d63cf3229d (patch) | |
tree | dfde8498c0ea5a2adb1635120c4f98323f5956ce /res | |
parent | 5fcaab43e603ceabd1d71ec355c8a0b59aac8cf0 (diff) | |
download | android_packages_apps_Trebuchet-35614fdc7d13179ba9cbc80f15eca6d63cf3229d.tar.gz android_packages_apps_Trebuchet-35614fdc7d13179ba9cbc80f15eca6d63cf3229d.tar.bz2 android_packages_apps_Trebuchet-35614fdc7d13179ba9cbc80f15eca6d63cf3229d.zip |
Implementation of folder animation changes as per cm-13.0
Folder animations in parity with cm.
Folder Layout Revision
Updated the folder layout to reflect design revisions based on community feedback
Change-Id: Ica1bb796dfccf779a954cf0903a1ae94a010ea1a
Conflicts:
res/drawable-hdpi/folder_bg.9.png
res/drawable-hdpi/folder_fill_highlight.9.png
res/drawable-mdpi/folder_bg.9.png
res/drawable-mdpi/folder_fill_highlight.9.png
res/drawable-xhdpi/folder_bg.9.png
res/drawable-xhdpi/folder_fill_highlight.9.png
res/drawable-xxhdpi/folder_bg.9.png
res/drawable-xxhdpi/folder_fill_highlight.9.png
res/layout-land/launcher.xml
res/layout-port/launcher.xml
res/layout-sw720dp/launcher.xml
res/layout/user_folder.xml
res/values/dimens.xml
src/com/android/launcher3/Folder.java
src/com/android/launcher3/FolderIcon.java
src/com/android/launcher3/Launcher.java
Folder animation changes as per cm-13.0
Change-Id: I019511a58bd9f6a60a3c9b68c826726881cec83f
Implementing folder animations
Change-Id: I83f17c996ecc894ce22fd195b9b33caf58e2e822
Diffstat (limited to 'res')
31 files changed, 291 insertions, 16 deletions
diff --git a/res/anim/drop_down.xml b/res/anim/drop_down.xml new file mode 100644 index 000000000..49059a048 --- /dev/null +++ b/res/anim/drop_down.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<set xmlns:android="http://schemas.android.com/apk/res/android" + android:interpolator="@android:interpolator/accelerate_decelerate"> + <scale + android:fromXScale="1.0" + android:toXScale="1.0" + android:fromYScale="2.5" + android:toYScale="1.0" + android:pivotX="50%" + android:pivotY="50%" + android:duration="300" + android:fillBefore="false" /> +</set> diff --git a/res/anim/enter_from_left.xml b/res/anim/enter_from_left.xml new file mode 100644 index 000000000..e2bdbdda3 --- /dev/null +++ b/res/anim/enter_from_left.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<set + xmlns:android="http://schemas.android.com/apk/res/android" > + + <objectAnimator + xmlns:android="http://schemas.android.com/apk/res/android" + android:duration="300" + android:propertyName="x" + android:valueFrom="-1000" + android:valueTo="0" + android:valueType="floatType" /> +</set> diff --git a/res/anim/enter_from_right.xml b/res/anim/enter_from_right.xml new file mode 100644 index 000000000..02a56c7ae --- /dev/null +++ b/res/anim/enter_from_right.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<set + xmlns:android="http://schemas.android.com/apk/res/android" > + + <objectAnimator + xmlns:android="http://schemas.android.com/apk/res/android" + android:duration="300" + android:propertyName="x" + android:valueFrom="1000" + android:valueTo="0" + android:valueType="floatType" /> +</set> diff --git a/res/anim/exit_out_left.xml b/res/anim/exit_out_left.xml new file mode 100644 index 000000000..eae925a2a --- /dev/null +++ b/res/anim/exit_out_left.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<set + xmlns:android="http://schemas.android.com/apk/res/android" > + + <objectAnimator + xmlns:android="http://schemas.android.com/apk/res/android" + android:duration="300" + android:propertyName="x" + android:valueFrom="0" + android:valueTo="-1000" + android:valueType="floatType" /> +</set> + diff --git a/res/anim/exit_out_right.xml b/res/anim/exit_out_right.xml new file mode 100644 index 000000000..7345c942d --- /dev/null +++ b/res/anim/exit_out_right.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<set + xmlns:android="http://schemas.android.com/apk/res/android" > + + <objectAnimator + xmlns:android="http://schemas.android.com/apk/res/android" + android:duration="300" + android:propertyName="x" + android:valueFrom="0" + android:valueTo="1000" + android:valueType="floatType" /> +</set> diff --git a/res/anim/fade_in_fast.xml b/res/anim/fade_in_fast.xml new file mode 100644 index 000000000..4fa9847aa --- /dev/null +++ b/res/anim/fade_in_fast.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2009 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<alpha xmlns:android="http://schemas.android.com/apk/res/android" + android:interpolator="@android:anim/accelerate_interpolator" + + android:fromAlpha="0.0" + android:toAlpha="1.0" + + android:duration="@android:integer/config_mediumAnimTime" /> diff --git a/res/anim/fade_out_fast.xml b/res/anim/fade_out_fast.xml new file mode 100644 index 000000000..a061a6ca9 --- /dev/null +++ b/res/anim/fade_out_fast.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2009 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<alpha xmlns:android="http://schemas.android.com/apk/res/android" + android:interpolator="@android:anim/accelerate_interpolator" + + android:fromAlpha="1.0" + android:toAlpha="0.0" + + android:duration="@android:integer/config_mediumAnimTime" /> diff --git a/res/drawable-hdpi/folder_bg.9.png b/res/drawable-hdpi/folder_bg.9.png Binary files differnew file mode 100644 index 000000000..ee0090c09 --- /dev/null +++ b/res/drawable-hdpi/folder_bg.9.png diff --git a/res/drawable-hdpi/folder_bg_opaque.9.png b/res/drawable-hdpi/folder_bg_opaque.9.png Binary files differnew file mode 100755 index 000000000..08e152e49 --- /dev/null +++ b/res/drawable-hdpi/folder_bg_opaque.9.png diff --git a/res/drawable-hdpi/folder_fill_highlight.9.png b/res/drawable-hdpi/folder_fill_highlight.9.png Binary files differnew file mode 100644 index 000000000..b82302ba6 --- /dev/null +++ b/res/drawable-hdpi/folder_fill_highlight.9.png diff --git a/res/drawable-mdpi/folder_bg.9.png b/res/drawable-mdpi/folder_bg.9.png Binary files differnew file mode 100644 index 000000000..4039da560 --- /dev/null +++ b/res/drawable-mdpi/folder_bg.9.png diff --git a/res/drawable-mdpi/folder_bg_opaque.9.png b/res/drawable-mdpi/folder_bg_opaque.9.png Binary files differnew file mode 100755 index 000000000..673d740ae --- /dev/null +++ b/res/drawable-mdpi/folder_bg_opaque.9.png diff --git a/res/drawable-mdpi/folder_fill_highlight.9.png b/res/drawable-mdpi/folder_fill_highlight.9.png Binary files differnew file mode 100644 index 000000000..7c6a0d456 --- /dev/null +++ b/res/drawable-mdpi/folder_fill_highlight.9.png diff --git a/res/drawable-xhdpi/folder_bg.9.png b/res/drawable-xhdpi/folder_bg.9.png Binary files differnew file mode 100644 index 000000000..1fbe1d80f --- /dev/null +++ b/res/drawable-xhdpi/folder_bg.9.png diff --git a/res/drawable-xhdpi/folder_bg_opaque.9.png b/res/drawable-xhdpi/folder_bg_opaque.9.png Binary files differnew file mode 100755 index 000000000..42a1e1d5d --- /dev/null +++ b/res/drawable-xhdpi/folder_bg_opaque.9.png diff --git a/res/drawable-xhdpi/folder_fill_highlight.9.png b/res/drawable-xhdpi/folder_fill_highlight.9.png Binary files differnew file mode 100644 index 000000000..f5f0bd08d --- /dev/null +++ b/res/drawable-xhdpi/folder_fill_highlight.9.png diff --git a/res/drawable-xxhdpi/folder_bg.9.png b/res/drawable-xxhdpi/folder_bg.9.png Binary files differnew file mode 100644 index 000000000..3b2bc4253 --- /dev/null +++ b/res/drawable-xxhdpi/folder_bg.9.png diff --git a/res/drawable-xxhdpi/folder_bg_opaque.9.png b/res/drawable-xxhdpi/folder_bg_opaque.9.png Binary files differnew file mode 100755 index 000000000..25a4ffffb --- /dev/null +++ b/res/drawable-xxhdpi/folder_bg_opaque.9.png diff --git a/res/drawable-xxhdpi/folder_fill_highlight.9.png b/res/drawable-xxhdpi/folder_fill_highlight.9.png Binary files differnew file mode 100644 index 000000000..4dc29f46c --- /dev/null +++ b/res/drawable-xxhdpi/folder_fill_highlight.9.png diff --git a/res/drawable/folder_container.xml b/res/drawable/folder_container.xml new file mode 100644 index 000000000..b0a1c8492 --- /dev/null +++ b/res/drawable/folder_container.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:height="72dp" + android:width="72dp" + android:viewportHeight="72" + android:viewportWidth="72"> + + <group + android:name="folder_container"> + <path + android:name="folder_path" + android:pathData=" M6,4 + h60 + c1.2,0 2,0.8 2,2 + v60 + c0,1.2 -0.8,2 -2,2 + h-60 + c-1.2,0 -2,-0.8 -2,-2 + v-60 + c0,-1.2 0.8,-2 2,-2 + z" + android:fillColor="#ff524e5e"/> + </group> + +</vector>
\ No newline at end of file diff --git a/res/drawable/folder_locked.xml b/res/drawable/folder_locked.xml new file mode 100644 index 000000000..8b887896d --- /dev/null +++ b/res/drawable/folder_locked.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + + <path + android:fillColor="#fafafa" + android:pathData="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1 .9 2 2 +2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6-5.1c1.71 0 3.1 1.39 3.1 +3.1v2H9V6h-.1c0-1.71 1.39-3.1 3.1-3.1zM18 20H6V10h12v10zm-6-3c1.1 0 2-.9 +2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z" /> +</vector> diff --git a/res/drawable/folder_unlocked.xml b/res/drawable/folder_unlocked.xml new file mode 100644 index 000000000..d34d9b764 --- /dev/null +++ b/res/drawable/folder_unlocked.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + + <path + android:fillColor="#fafafa" + android:pathData="M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6-9h-1V6c0-2.76-2.24-5-5-5S7 +3.24 7 6h1.9c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2H6c-1.1 0-2 .9-2 +2v10c0 1.1 .9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10z" /> +</vector> diff --git a/res/layout-land/launcher.xml b/res/layout-land/launcher.xml index 6500ebcd2..3a93365a7 100644 --- a/res/layout-land/launcher.xml +++ b/res/layout-land/launcher.xml @@ -21,7 +21,24 @@ android:id="@+id/launcher" android:layout_width="match_parent" android:layout_height="match_parent" - android:fitsSystemWindows="true"> + android:fitsSystemWindows="true" + android:background="@drawable/workspace_bg"> + + <FrameLayout + android:id="@+id/reveal_fake_page_container" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:visibility="invisible" + android:alpha="1.0" + android:clipToPadding="false"> + + <ImageView + android:id="@+id/reveal_fake_folder_icon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:visibility="invisible" + android:background="@drawable/folder_bg_opaque"/> + </FrameLayout> <com.android.launcher3.DragLayer android:id="@+id/drag_layer" diff --git a/res/layout-port/launcher.xml b/res/layout-port/launcher.xml index d0772ee70..cbdb00103 100644 --- a/res/layout-port/launcher.xml +++ b/res/layout-port/launcher.xml @@ -18,11 +18,30 @@ <com.android.launcher3.LauncherRootView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:launcher="http://schemas.android.com/apk/res-auto" + xmlns:insettable="http://schemas.android.com/apk/res-auto" android:id="@+id/launcher" android:layout_width="match_parent" android:layout_height="match_parent" - android:fitsSystemWindows="true"> + android:fitsSystemWindows="true" + android:background="@drawable/workspace_bg"> + + <FrameLayout + android:id="@+id/reveal_fake_page_container" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:visibility="invisible" + android:alpha="1.0" + insettable:layout_ignoreInsets="true" + android:clipToPadding="false"> + + <ImageView + android:id="@+id/reveal_fake_folder_icon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:visibility="invisible" + android:background="@drawable/folder_bg_opaque"/> + </FrameLayout> <com.android.launcher3.DragLayer android:id="@+id/drag_layer" diff --git a/res/layout-sw720dp/launcher.xml b/res/layout-sw720dp/launcher.xml index 802922ec1..c448e760c 100644 --- a/res/layout-sw720dp/launcher.xml +++ b/res/layout-sw720dp/launcher.xml @@ -21,7 +21,24 @@ android:id="@+id/launcher" android:layout_width="match_parent" android:layout_height="match_parent" - android:fitsSystemWindows="true"> + android:fitsSystemWindows="true" + android:background="@drawable/workspace_bg"> + + <FrameLayout + android:id="@+id/reveal_fake_page_container" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:visibility="invisible" + android:alpha="1.0" + android:clipToPadding="false"> + + <ImageView + android:id="@+id/reveal_fake_folder_icon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:visibility="invisible" + android:background="@drawable/folder_bg_opaque"/> + </FrameLayout> <com.android.launcher3.DragLayer android:id="@+id/drag_layer" diff --git a/res/layout/folder_icon.xml b/res/layout/folder_icon.xml index 237af6890..5e29a1a0d 100644 --- a/res/layout/folder_icon.xml +++ b/res/layout/folder_icon.xml @@ -20,17 +20,53 @@ android:layout_height="match_parent" android:orientation="vertical" android:focusable="true" > - <ImageView + <RelativeLayout android:id="@+id/preview_background" - android:layout_gravity="center_horizontal" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:antialias="true" - android:src="@drawable/portal_ring_inner"/> + android:layout_width="@dimen/folder_icon" + android:layout_height="@dimen/folder_icon" + android:layout_gravity="center_horizontal|top" + android:background="@drawable/folder_bg" > + <ImageView + android:id="@+id/folder_lock_image" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:src="@drawable/folder_locked" + android:scaleType="center" + android:visibility="invisible" /> + <ImageView + android:id="@+id/app_0" + android:layout_width="@dimen/folder_icon_app_preview" + android:layout_height="@dimen/folder_icon_app_preview" + android:layout_alignParentLeft="true" + android:layout_alignParentTop="true" + android:antialias="true"/> + <ImageView + android:id="@+id/app_1" + android:layout_width="@dimen/folder_icon_app_preview" + android:layout_height="@dimen/folder_icon_app_preview" + android:layout_alignParentTop="true" + android:layout_alignParentRight="true" + android:antialias="true"/> + <ImageView + android:id="@+id/app_2" + android:layout_width="@dimen/folder_icon_app_preview" + android:layout_height="@dimen/folder_icon_app_preview" + android:layout_alignParentLeft="true" + android:layout_alignParentBottom="true" + android:antialias="true"/> + <ImageView + android:id="@+id/app_3" + android:layout_width="@dimen/folder_icon_app_preview" + android:layout_height="@dimen/folder_icon_app_preview" + android:layout_alignParentBottom="true" + android:layout_alignParentRight="true" + android:antialias="true"/> + </RelativeLayout> + <com.android.launcher3.BubbleTextView style="@style/Icon" android:id="@+id/folder_icon_name" - android:layout_gravity="top" + android:layout_gravity="bottom" android:layout_width="match_parent" android:layout_height="match_parent" /> </com.android.launcher3.FolderIcon> diff --git a/res/layout/user_folder.xml b/res/layout/user_folder.xml index 252ebf01e..2152a9986 100644 --- a/res/layout/user_folder.xml +++ b/res/layout/user_folder.xml @@ -18,7 +18,7 @@ xmlns:launcher="http://schemas.android.com/apk/res-auto" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@drawable/quantum_panel" + android:background="@drawable/folder_bg" android:elevation="5dp" android:orientation="vertical" > @@ -67,7 +67,7 @@ android:paddingBottom="8dp" android:paddingTop="4dp" android:singleLine="true" - android:textColor="#ff777777" + android:textColor="@color/workspace_icon_text_color" android:textColorHighlight="#ffCCCCCC" android:textColorHint="#ff808080" android:textSize="14sp" /> @@ -81,4 +81,4 @@ </LinearLayout> -</com.android.launcher3.Folder>
\ No newline at end of file +</com.android.launcher3.Folder> diff --git a/res/values/attrs.xml b/res/values/attrs.xml index 827332ad7..7ffebce9b 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -113,7 +113,19 @@ <attr name="indicatorSize" format="dimension" /> </declare-styleable> + <attr name="layout_ignoreInsets" format="boolean" /> + <attr name="layout_ignoreBottomInsets" format="boolean" /> + <attr name="layout_ignoreTopInsets" format="boolean" /> + <declare-styleable name="InsettableFrameLayout_Layout"> - <attr name="layout_ignoreInsets" format="boolean" /> + <attr name="layout_ignoreInsets" /> + <attr name="layout_ignoreTopInsets" /> + <attr name="layout_ignoreBottomInsets" /> + </declare-styleable> + + <declare-styleable name="InsettableLinearLayout_Layout"> + <attr name="layout_ignoreInsets" /> + <attr name="layout_ignoreTopInsets" /> + <attr name="layout_ignoreBottomInsets" /> </declare-styleable> </resources> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 36721797e..e3c81941c 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -121,6 +121,13 @@ <!-- Folders --> <!-- The amount that the preview contents are inset from the preview background --> <dimen name="folder_preview_padding">4dp</dimen> + <dimen name="folder_lock_margin">6dp</dimen> + <dimen name="folder_name_padding">10dp</dimen> + <dimen name="folder_lock_icon">48dp</dimen> + + <!-- Folder icon dimens --> + <dimen name="folder_icon">64dp</dimen> + <dimen name="folder_icon_app_preview">22dp</dimen> <!-- Sizes for managed profile badges --> <dimen name="profile_badge_size">24dp</dimen> @@ -137,4 +144,8 @@ <dimen name="pending_widget_min_padding">8dp</dimen> <dimen name="pending_widget_elevation">2dp</dimen> +<!-- Folder open animation --> + <integer name="folder_translate_y_dist">300</integer> + <integer name="folder_icon_translate_y_dist">100</integer> + </resources> diff --git a/res/values/strings.xml b/res/values/strings.xml index fefadef28..b54478860 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -31,7 +31,7 @@ <string name="receive_first_load_broadcast_permission" translatable="false">com.android.launcher3.permission.RECEIVE_FIRST_LOAD_BROADCAST</string> <!-- Application name --> - <string name="application_name">Launcher3</string> + <string name="app_name">Launcher3</string> <!-- Default folder name --> <string name="folder_name"></string> <!-- Work folder name --> @@ -103,6 +103,9 @@ <string name="permdesc_write_settings">Allows the app to change the settings and shortcuts in Home.</string> + <!-- Toast shown on clicking a direct call shortcut. [CHAR_LIMIT=80] --> + <string name="msg_no_phone_permission"><xliff:g id="app_name" example="Launcher3">%1$s</xliff:g> is not allowed to make phone calls</string> + <!-- Widgets: --> <skip /> diff --git a/res/values/styles.xml b/res/values/styles.xml index 7d60cbe0a..9104bc92d 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -49,7 +49,7 @@ <style name="Icon.Folder"> <item name="android:background">@null</item> - <item name="android:textColor">@color/quantum_panel_text_color</item> + <item name="android:textColor">@color/workspace_icon_text_color</item> <item name="android:shadowRadius">0</item> <item name="customShadows">false</item> </style> |