diff --git a/mobile/src/main/AndroidManifest.xml b/mobile/src/main/AndroidManifest.xml index e54bf1667..7b4355d74 100644 --- a/mobile/src/main/AndroidManifest.xml +++ b/mobile/src/main/AndroidManifest.xml @@ -34,7 +34,7 @@ android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" - android:theme="@style/AppTheme" > + android:theme="@style/UAmpAppTheme" > = 0) { - int position = mItemToOpenWhenDrawerCloses; - mItemToOpenWhenDrawerCloses = -1; + int position = mItemToOpenWhenDrawerCloses; + if (position >= 0) { Bundle extras = ActivityOptions.makeCustomAnimation( - ActionBarCastActivity.this, 0, 0).toBundle(); + ActionBarCastActivity.this, R.anim.fade_in, R.anim.fade_out).toBundle(); Class activityClass = mDrawerMenuContents.getActivity(position); - startActivity(new Intent(ActionBarCastActivity.this,activityClass), extras); + startActivity(new Intent(ActionBarCastActivity.this, activityClass), extras); } } diff --git a/mobile/src/main/java/com/example/android/uamp/ui/BaseActivity.java b/mobile/src/main/java/com/example/android/uamp/ui/BaseActivity.java index 30d01af33..bfbc3d3e1 100644 --- a/mobile/src/main/java/com/example/android/uamp/ui/BaseActivity.java +++ b/mobile/src/main/java/com/example/android/uamp/ui/BaseActivity.java @@ -92,9 +92,12 @@ protected void showPlaybackControls() { PlaybackControlsFragment controlsFragment = (PlaybackControlsFragment) getFragmentManager().findFragmentById(R.id.controls); if (controlsFragment == null && NetworkHelper.isOnline(this)) { - PlaybackControlsFragment fragment = new PlaybackControlsFragment(); + controlsFragment = new PlaybackControlsFragment(); getFragmentManager().beginTransaction() - .replace(R.id.controls, fragment) + .setCustomAnimations( + R.animator.slide_in_from_bottom, R.animator.slide_out_to_bottom, + R.animator.slide_in_from_bottom, R.animator.slide_out_to_bottom) + .add(R.id.controls, controlsFragment) .commit(); } } diff --git a/mobile/src/main/java/com/example/android/uamp/ui/MusicPlayerActivity.java b/mobile/src/main/java/com/example/android/uamp/ui/MusicPlayerActivity.java index cb2c02d53..772ecb575 100644 --- a/mobile/src/main/java/com/example/android/uamp/ui/MusicPlayerActivity.java +++ b/mobile/src/main/java/com/example/android/uamp/ui/MusicPlayerActivity.java @@ -108,6 +108,9 @@ private void navigateToBrowser(String mediaId) { fragment = new MediaBrowserFragment(); fragment.setMediaId(mediaId); FragmentTransaction transaction = getFragmentManager().beginTransaction(); + transaction.setCustomAnimations( + R.animator.slide_in_from_right, R.animator.slide_out_to_left, + R.animator.slide_in_from_left, R.animator.slide_out_to_right); transaction.replace(R.id.container, fragment); // If this is not the top level media (root), we add it to the fragment back stack, // so that actionbar toggle and Back will work appropriately: diff --git a/mobile/src/main/res/anim/fade_in.xml b/mobile/src/main/res/anim/fade_in.xml new file mode 100644 index 000000000..4f40a4deb --- /dev/null +++ b/mobile/src/main/res/anim/fade_in.xml @@ -0,0 +1,22 @@ + + + diff --git a/mobile/src/main/res/anim/fade_out.xml b/mobile/src/main/res/anim/fade_out.xml new file mode 100644 index 000000000..86a1421bd --- /dev/null +++ b/mobile/src/main/res/anim/fade_out.xml @@ -0,0 +1,22 @@ + + + diff --git a/mobile/src/main/res/animator/slide_in_from_bottom.xml b/mobile/src/main/res/animator/slide_in_from_bottom.xml new file mode 100644 index 000000000..499c4b1b8 --- /dev/null +++ b/mobile/src/main/res/animator/slide_in_from_bottom.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/mobile/src/main/res/animator/slide_in_from_left.xml b/mobile/src/main/res/animator/slide_in_from_left.xml new file mode 100644 index 000000000..e87f3b771 --- /dev/null +++ b/mobile/src/main/res/animator/slide_in_from_left.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/mobile/src/main/res/animator/slide_in_from_right.xml b/mobile/src/main/res/animator/slide_in_from_right.xml new file mode 100644 index 000000000..724b865f8 --- /dev/null +++ b/mobile/src/main/res/animator/slide_in_from_right.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/mobile/src/main/res/animator/slide_out_to_bottom.xml b/mobile/src/main/res/animator/slide_out_to_bottom.xml new file mode 100644 index 000000000..41d8a34ed --- /dev/null +++ b/mobile/src/main/res/animator/slide_out_to_bottom.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/mobile/src/main/res/animator/slide_out_to_left.xml b/mobile/src/main/res/animator/slide_out_to_left.xml new file mode 100644 index 000000000..4bacdc143 --- /dev/null +++ b/mobile/src/main/res/animator/slide_out_to_left.xml @@ -0,0 +1,30 @@ + + + + + + diff --git a/mobile/src/main/res/animator/slide_out_to_right.xml b/mobile/src/main/res/animator/slide_out_to_right.xml new file mode 100644 index 000000000..97b55522a --- /dev/null +++ b/mobile/src/main/res/animator/slide_out_to_right.xml @@ -0,0 +1,30 @@ + + + + + + diff --git a/mobile/src/main/res/values/styles.xml b/mobile/src/main/res/values/styles.xml index 22500ef1b..ecdaef7da 100644 --- a/mobile/src/main/res/values/styles.xml +++ b/mobile/src/main/res/values/styles.xml @@ -15,8 +15,9 @@ limitations under the License. --> + - \ No newline at end of file +