aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Ruesga <jorge@ruesga.com>2013-07-29 21:48:42 +0200
committerJorge Ruesga <jorge@ruesga.com>2013-07-29 21:48:42 +0200
commit22eafa91bd62d2c26fc40aaa3aba9b1cfc410039 (patch)
treeedab70da9185488efcdf4650b1b4e9de23f6d09b
parentacef1340bbab09f439470642847c1959c869ef95 (diff)
downloadandroid_packages_wallpapers_PhotoPhase-22eafa91bd62d2c26fc40aaa3aba9b1cfc410039.tar.gz
android_packages_wallpapers_PhotoPhase-22eafa91bd62d2c26fc40aaa3aba9b1cfc410039.tar.bz2
android_packages_wallpapers_PhotoPhase-22eafa91bd62d2c26fc40aaa3aba9b1cfc410039.zip
Fix layouts and use left and right effects
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
-rw-r--r--res/anim/cards_animation_up_left.xml36
-rw-r--r--res/anim/cards_animation_up_right.xml (renamed from res/anim/cards_animation.xml)6
-rw-r--r--res/layout/album_info.xml2
-rw-r--r--res/layout/album_pictures.xml5
-rw-r--r--res/values/integers.xml19
-rw-r--r--src/org/cyanogenmod/wallpapers/photophase/widgets/CardLayout.java9
6 files changed, 69 insertions, 8 deletions
diff --git a/res/anim/cards_animation_up_left.xml b/res/anim/cards_animation_up_left.xml
new file mode 100644
index 0000000..643a633
--- /dev/null
+++ b/res/anim/cards_animation_up_left.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 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.
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:interpolator="@android:anim/accelerate_interpolator" >
+
+ <translate
+ android:duration="@integer/cards_slide_anim"
+ android:fromYDelta="100%p"
+ android:toYDelta="0" />
+
+ <alpha
+ android:duration="@integer/cards_slide_anim"
+ android:fromAlpha="0.0"
+ android:toAlpha="1.0" />
+
+ <rotate
+ android:duration="@integer/cards_slide_anim"
+ android:fromDegrees="25"
+ android:pivotX="0"
+ android:pivotY="0"
+ android:toDegrees="0" />
+</set> \ No newline at end of file
diff --git a/res/anim/cards_animation.xml b/res/anim/cards_animation_up_right.xml
index 8ae21b3..e4d1603 100644
--- a/res/anim/cards_animation.xml
+++ b/res/anim/cards_animation_up_right.xml
@@ -18,17 +18,17 @@
android:interpolator="@android:anim/accelerate_interpolator" >
<translate
- android:duration="800"
+ android:duration="@integer/cards_slide_anim"
android:fromYDelta="100%p"
android:toYDelta="0" />
<alpha
- android:duration="800"
+ android:duration="@integer/cards_slide_anim"
android:fromAlpha="0.0"
android:toAlpha="1.0" />
<rotate
- android:duration="800"
+ android:duration="@integer/cards_slide_anim"
android:fromDegrees="-25"
android:pivotX="100%"
android:pivotY="0"
diff --git a/res/layout/album_info.xml b/res/layout/album_info.xml
index 9cfe287..54000b5 100644
--- a/res/layout/album_info.xml
+++ b/res/layout/album_info.xml
@@ -70,7 +70,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
- android:layout_alignParentBottom="true"
+ android:layout_alignBottom="@id/album_thumbnail"
android:layout_gravity="top"
android:padding="@dimen/small_padding"
android:contentDescription="@null"
diff --git a/res/layout/album_pictures.xml b/res/layout/album_pictures.xml
index 71a1a49..3e57e13 100644
--- a/res/layout/album_pictures.xml
+++ b/res/layout/album_pictures.xml
@@ -33,7 +33,6 @@
android:layout_marginLeft="@dimen/small_margin"
android:layout_marginRight="@dimen/small_margin"
android:layout_alignParentTop="true"
- android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:orientation="vertical">
@@ -59,7 +58,7 @@
<org.cyanogenmod.wallpapers.photophase.widgets.PicturesView
android:id="@+id/album_pictures_scroller"
android:layout_width="match_parent"
- android:layout_height="match_parent"
+ android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/album_title_height"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@id/album_menubar"
@@ -69,7 +68,7 @@
<LinearLayout android:id="@+id/album_pictures_holder"
android:layout_width="wrap_content"
- android:layout_height="match_parent"
+ android:layout_height="wrap_content"
android:orientation="horizontal">
<!-- Pictures go here -->
diff --git a/res/values/integers.xml b/res/values/integers.xml
new file mode 100644
index 0000000..09ee5c2
--- /dev/null
+++ b/res/values/integers.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 The CyanogenMod 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.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android">
+ <integer name="cards_slide_anim">800</integer>
+</resources>
diff --git a/src/org/cyanogenmod/wallpapers/photophase/widgets/CardLayout.java b/src/org/cyanogenmod/wallpapers/photophase/widgets/CardLayout.java
index 386ffbe..5c56d05 100644
--- a/src/org/cyanogenmod/wallpapers/photophase/widgets/CardLayout.java
+++ b/src/org/cyanogenmod/wallpapers/photophase/widgets/CardLayout.java
@@ -85,7 +85,14 @@ public class CardLayout extends LinearLayout {
@Override
public void run() {
addView(card);
- card.startAnimation(AnimationUtils.loadAnimation(getContext(), R.anim.cards_animation));
+ if (inverted) {
+ card.startAnimation(AnimationUtils.loadAnimation(
+ getContext(), R.anim.cards_animation_up_right));
+ } else {
+ card.startAnimation(AnimationUtils.loadAnimation(
+ getContext(), R.anim.cards_animation_up_left));
+ }
+ inverted = !inverted;
}
});
}