package edu.rosehulman.photomessage;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.widget.ImageView;
import android.widget.TextView;

import java.io.FileNotFoundException;

public class DisplayLabeledPhotoActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_display_labeled_photo);

        PhotoMessage photoMessage = getIntent().getParcelableExtra(MainActivity.KEY_PHOTO_MESSAGE);
        Log.d(Constants.TAG, "setMessage message received: " + photoMessage);
        
        ImageView imageView = (ImageView) findViewById(R.id.labeled_image_view);

        Bitmap bitmap = null;
        try {
            Uri uri = Uri.parse(photoMessage.getPath());
            bitmap = BitmapFactory.decodeStream(getContentResolver().openInputStream(uri));
        } catch (FileNotFoundException e) {
            Log.e(Constants.TAG, "Error: " + e);
        }
        // Bitmap bitmap = BitmapFactory.decodeFile(photoMessage.getUri());
        imageView.setImageBitmap(bitmap);

        TextView messageTextView = (TextView) findViewById(R.id.labeled_text_view);
        messageTextView.setText(photoMessage.getMessage());
        messageTextView.setTextSize(32);
        messageTextView.setX(photoMessage.getLeft());
        messageTextView.setY(photoMessage.getTop());
        messageTextView.setTextColor(photoMessage.isWhite() ? Color.WHITE : Color.BLACK);
    }
}

@@ -166,32 +166,8 @@
 or;%0A
-import android.net.Uri;%0A
 impo
@@ -188,16 +188,16 @@
 Bundle;%0A
+
 import a
@@ -283,47 +283,8 @@
 w;%0A%0A
-import java.io.FileNotFoundException;%0A%0A
 publ
@@ -786,24 +786,26 @@
 age_view);%0A%0A
+//
         Bitm
@@ -822,16 +822,18 @@
 = null;%0A
+//
         
@@ -838,16 +838,18 @@
   try %7B%0A
+//
         
@@ -893,24 +893,26 @@
 getPath());%0A
+//
             
@@ -987,24 +987,26 @@
 ream(uri));%0A
+//
         %7D ca
@@ -1033,24 +1033,26 @@
 eption e) %7B%0A
+//
             
@@ -1084,24 +1084,26 @@
 or: %22 + e);%0A
+//
         %7D%0A  
@@ -1111,11 +1111,8 @@
     
- //
  Bit
@@ -1169,13 +1169,82 @@
 .get
-Uri()
+Path());%0A        bitmap = Bitmap.createScaledBitmap(bitmap, 512, 512, true
 );%0A 

Fix scaling issues