// Path: app/src/mx/udlap/is522/tedroid/util/Typefaces.java
// public final class Typefaces {
// 
//     /**
//      * Paths de la fuentes usadas en la aplicación.
//      * 
//      * @author Daniel Pedraza-Arcega
//      * @since 1.0
//      */
//     public static enum Font {
//         TWOBIT ("fonts/twobit.ttf");
// 
//         private final String path;
// 
//         Font(String path) {
//             this.path = path;
//         }
// 
//         public String getPath() {
//             return path;
//         }
//     }
// 
//     /** NO INVOCAR. */
//     private Typefaces() {
//         throw new IllegalAccessError("This class cannot be instantiated nor extended");
//     }
// 
//     /**
//      * @param context el contexto de la aplicación.
//      * @param which que fuente.
//      * @return una fuente que se encuentra en assets
//      */
//     public static Typeface get(Context context, Font which) {
//         return Typeface.createFromAsset(context.getAssets(), which.path);
//     }
// }


import android.graphics.Typeface;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import mx.udlap.is522.tedroid.R;
import mx.udlap.is522.tedroid.util.Typefaces;
/*
 * Copyright 2014 Tedroid developers
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package mx.udlap.is522.tedroid.fragment;



/**
 * Fragmento que representa el layout de instrucciones.
 * 
 * @author Daniel Pedraza-Arcega
 * @since 1.0
 */
public class InstructionsFragment extends Fragment {

    private static final int NOT_AN_ID = -1;
    private int pageNumber;

    /**
     * @param pageNumber el número de página actual. 
     * @return un nuevo InstructionsFragment.
     */
    public static InstructionsFragment create(int pageNumber) {
        InstructionsFragment fragment = new InstructionsFragment();
        fragment.pageNumber = pageNumber;
        return fragment;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_instructions, container, false);
        ImageView instructionImage = (ImageView) rootView.findViewById(R.id.instruction_image);
        TextView instructionText = (TextView) rootView.findViewById(R.id.instruction_text);
        int instructionImageContentDescriptionId = getTextByPageNumber();
        if (instructionImageContentDescriptionId != NOT_AN_ID) {
// Path: app/src/mx/udlap/is522/tedroid/util/Typefaces.java
// public final class Typefaces {
// 
//     /**
//      * Paths de la fuentes usadas en la aplicación.
//      * 
//      * @author Daniel Pedraza-Arcega
//      * @since 1.0
//      */
//     public static enum Font {
//         TWOBIT ("fonts/twobit.ttf");
// 
//         private final String path;
// 
//         Font(String path) {
//             this.path = path;
//         }
// 
//         public String getPath() {
//             return path;
//         }
//     }
// 
//     /** NO INVOCAR. */
//     private Typefaces() {
//         throw new IllegalAccessError("This class cannot be instantiated nor extended");
//     }
// 
//     /**
//      * @param context el contexto de la aplicación.
//      * @param which que fuente.
//      * @return una fuente que se encuentra en assets
//      */
//     public static Typeface get(Context context, Font which) {
//         return Typeface.createFromAsset(context.getAssets(), which.path);
//     }
// }


// Path: app/src/mx/udlap/is522/tedroid/fragment/InstructionsFragment.java
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import mx.udlap.is522.tedroid.R;
import mx.udlap.is522.tedroid.util.Typefaces;

/*
 * Copyright 2014 Tedroid developers
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package mx.udlap.is522.tedroid.fragment;



/**
 * Fragmento que representa el layout de instrucciones.
 * 
 * @author Daniel Pedraza-Arcega
 * @since 1.0
 */
public class InstructionsFragment extends Fragment {

    private static final int NOT_AN_ID = -1;
    private int pageNumber;

    /**
     * @param pageNumber el número de página actual. 
     * @return un nuevo InstructionsFragment.
     */
    public static InstructionsFragment create(int pageNumber) {
        InstructionsFragment fragment = new InstructionsFragment();
        fragment.pageNumber = pageNumber;
        return fragment;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_instructions, container, false);
        ImageView instructionImage = (ImageView) rootView.findViewById(R.id.instruction_image);
        TextView instructionText = (TextView) rootView.findViewById(R.id.instruction_text);
        int instructionImageContentDescriptionId = getTextByPageNumber();
        if (instructionImageContentDescriptionId != NOT_AN_ID) {
            Typeface typeface = Typefaces.get(getActivity(), Typefaces.Font.TWOBIT);