summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2011-11-26 12:29:19 +0300
committerAndrew Dolgov <[email protected]>2011-11-26 12:29:19 +0300
commit743627cd516efd1f77fc3d756c54f4241453b56d (patch)
tree3c38580d679e22606fdc9751f73379ba871c613e
parent2229ae0fc4d8ee23ca64632292e74e86c3f43ee9 (diff)
implement basic view animations
-rw-r--r--AndroidManifest.xml4
-rw-r--r--res/anim/slide_left.xml20
-rw-r--r--res/anim/slide_right.xml20
-rw-r--r--src/org/fox/ttrss/MainActivity.java6
4 files changed, 48 insertions, 2 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index cb69d038..4892cd90 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fox.ttrss"
- android:versionCode="6"
- android:versionName="0.1.5">
+ android:versionCode="7"
+ android:versionName="0.1.6">
<uses-sdk android:minSdkVersion="8" />
<!-- <supports-screens android:smallScreens="false" android:normalScreens="false" /> -->
diff --git a/res/anim/slide_left.xml b/res/anim/slide_left.xml
new file mode 100644
index 00000000..80caa7d7
--- /dev/null
+++ b/res/anim/slide_left.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 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:fromXDelta="100%p" android:toXDelta="0"
+ android:duration="@android:integer/config_shortAnimTime" />
+</set> \ No newline at end of file
diff --git a/res/anim/slide_right.xml b/res/anim/slide_right.xml
new file mode 100644
index 00000000..a5617eae
--- /dev/null
+++ b/res/anim/slide_right.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 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:fromXDelta="-100%p" android:toXDelta="0"
+ android:duration="@android:integer/config_shortAnimTime" />
+</set> \ No newline at end of file
diff --git a/src/org/fox/ttrss/MainActivity.java b/src/org/fox/ttrss/MainActivity.java
index b7a8f967..e6c7fd42 100644
--- a/src/org/fox/ttrss/MainActivity.java
+++ b/src/org/fox/ttrss/MainActivity.java
@@ -18,6 +18,7 @@ import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
+import android.view.animation.AnimationUtils;
import android.widget.LinearLayout;
import android.widget.TextView;
@@ -253,8 +254,11 @@ public class MainActivity extends FragmentActivity implements FeedsFragment.OnFe
if (m_smallScreenMode) {
if (m_selectedArticle != null) {
+ findViewById(R.id.main).setAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_right));
closeArticle();
} else if (m_activeFeed != null) {
+ findViewById(R.id.main).setAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_right));
+
findViewById(R.id.headlines_fragment).setVisibility(View.GONE);
findViewById(R.id.feeds_fragment).setVisibility(View.VISIBLE);
@@ -524,6 +528,8 @@ public class MainActivity extends FragmentActivity implements FeedsFragment.OnFe
ft.commit();
if (m_smallScreenMode) {
+ findViewById(R.id.main).setAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_left));
+
findViewById(R.id.headlines_fragment).setVisibility(View.GONE);
findViewById(R.id.article_fragment).setVisibility(View.VISIBLE);
} else {