Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Treehouse

Android Fragments Course (How To)

via Treehouse

Overview

In this course we'll learn how we can reuse parts of an Activity called Fragments to cut down on repetitive code and better support our tablet users.

What you'll learn

  • Fragments
  • RecyclerViews
  • ViewPagers

Syllabus

Introducing Fragments

Fragments are a great way to reuse code, especially for tablet layouts. In this stage we'll introduce the project and create our very first Fragment!

Chevron 13 steps
  • What are Fragments?

    2:15

  • My First Fragment

    6:05

  • Fragments?

    5 questions

  • Adding Fragments to Activities

    4:13

  • Adding a Fragment

    2 objectives

  • Making a List

    8:56

  • Checking It Twice

    3:42

  • Handling Clicks

    5:20

  • Handling Clicks

    2 objectives

  • Fragment Lifecycle

    7:00

  • Fragment Lifecycle

    5 questions

  • Keeping Track of Instance State

    6:09

  • Saving State

    2 objectives

Managing Fragments

In this stage we'll learn more about how to manage our Fragments, and we'll get to use a new class named ViewPager!

Chevron 8 steps
  • A New Fragment

    3:48

  • Managing the Back Stack

    4:37

  • Attack of the Back Stack

    5 questions

  • Initializing a Fragment with Data

    7:34

  • Fragment Flavors

    3 objectives

  • Adding the ViewPager

    6:56

  • Adding the Tabs

    3:56

  • ViewPager Details

    3 questions

Ingredients and Directions

In this stage we'll finish up the ingredients and directions Fragments. Then we'll take a step back and think about a couple refactoring options.

Chevron 8 steps
  • The Ingredients Fragment

    7:44

  • The State of the CheckBoxes

    8:14

  • Becoming Scrollable

    1:58

  • Becoming Scrollable

    1 question

  • The Directions Fragment

    4:36

  • Refactor

    6:47

  • Refactor - Again?

    6:18

  • Refactoring Reflection

    3 questions

Tablet Time

In this stage we'll finally make our tablet users happy by creating a new layout just for tablets!

Chevron 6 steps
  • Tablet Layout

    6:45

  • Tablet Layout

    6 questions

  • Enter the Grid

    6:28

  • Adapt Together

    5:19

  • Exit the Grid

    3 questions

  • Side by Side

    8:03

Reviews

Start your review of Android Fragments Course (How To)

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.