diff --git a/app/src/main/java/com/example/android/android_me/ui/AndroidMeActivity.java b/app/src/main/java/com/example/android/android_me/ui/AndroidMeActivity.java index db6f37c88..5d98c17bc 100644 --- a/app/src/main/java/com/example/android/android_me/ui/AndroidMeActivity.java +++ b/app/src/main/java/com/example/android/android_me/ui/AndroidMeActivity.java @@ -34,11 +34,16 @@ protected void onCreate(Bundle savedInstanceState) { // Create a new head BodyPartFragment BodyPartFragment headFragment = new BodyPartFragment(); + // TODO (4) Set the list of image id's for the head fragment and set the position to the second image in the list + // Add the fragment to its container using a FragmentManager and a Transaction FragmentManager fragmentManager = getSupportFragmentManager(); fragmentManager.beginTransaction() .add(R.id.head_container, headFragment) .commit(); + + // TODO (5) Create and display the body and leg BodyPartFragments + } } diff --git a/app/src/main/java/com/example/android/android_me/ui/BodyPartFragment.java b/app/src/main/java/com/example/android/android_me/ui/BodyPartFragment.java index bc065113c..cdb944a3a 100644 --- a/app/src/main/java/com/example/android/android_me/ui/BodyPartFragment.java +++ b/app/src/main/java/com/example/android/android_me/ui/BodyPartFragment.java @@ -28,6 +28,11 @@ public class BodyPartFragment extends Fragment { + // TODO (1) Create a setter method and class variable to set and store of a list of image resources + + // TODO (2) Create another setter method and variable to track and set the index of the list item to display + // ex. index = 0 is the first image id in the given list , index 1 is the second, and so on + /** * Mandatory empty constructor for the fragment manager to instantiate the fragment */ @@ -49,6 +54,9 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa // Set the image to the first in our list of head images imageView.setImageResource(AndroidImageAssets.getHeads().get(0)); + // TODO (3) If a list of image ids exists, set the image resource to the correct item in that list + // Otherwise, create a Log statement that indicates that the list was not found + // Return the rootView return rootView; }