Skip to content

Commit 4f16e89

Browse files
author
Paul Ruiz
committed
Added Android L animations demo
1 parent e200e7b commit 4f16e89

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Animations/app/src/main/java/com/ptrprograms/animations/activity/SharedElementAnimationActivity.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,12 @@ protected void onCreate(Bundle savedInstanceState) {
3838
public void onClick(View view) {
3939
if( view.getId() == R.id.button ) {
4040
Intent intent = new Intent( this, SharedElementSecondAnimationActivity.class );
41-
intent.putExtra( "image", R.drawable.ic_launcher );
41+
4242
((ViewGroup) mImageView.getParent()).setTransitionGroup( false );
4343

4444
ByteArrayOutputStream stream = new ByteArrayOutputStream();
4545
( (BitmapDrawable) mImageView.getDrawable() ).getBitmap().compress(Bitmap.CompressFormat.PNG, 100, stream);
46-
byte[] byteArray = stream.toByteArray();
47-
intent.putExtra( "image", byteArray );
46+
intent.putExtra( "image", stream.toByteArray() );
4847

4948
ActivityOptions options;
5049

Animations/app/src/main/java/com/ptrprograms/animations/activity/SharedElementSecondAnimationActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
*/
1616
public class SharedElementSecondAnimationActivity extends Activity {
1717

18-
ImageView mImageView;
18+
private ImageView mImageView;
1919
@Override
2020
protected void onCreate(Bundle savedInstanceState) {
2121
super.onCreate(savedInstanceState);
2222
setContentView(R.layout.activity_shared_element_second_animation);
2323
mImageView = (ImageView) findViewById( R.id.image );
24+
2425
byte[] byteArray = getIntent().getByteArrayExtra("image");
2526
Bitmap bitmap = BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length);
26-
//Bitmap bitmap = SharedElementAnimationActivity.sPhotoCache.get( getIntent().getIntExtra("image", R.drawable.ic_launcher) );
2727
mImageView.setImageBitmap(bitmap);
2828
}
2929

0 commit comments

Comments
 (0)