// Path: backbone/src/main/java/org/researchstack/backbone/ui/step/layout/InstructionStepLayout.java
// public class InstructionStepLayout extends FixedSubmitBarLayout implements StepLayout {
//     private StepCallbacks callbacks;
//     private Step step;
// 
//     public InstructionStepLayout(Context context) {
//         super(context);
//     }
// 
//     public InstructionStepLayout(Context context, AttributeSet attrs) {
//         super(context, attrs);
//     }
// 
//     public InstructionStepLayout(Context context, AttributeSet attrs, int defStyleAttr) {
//         super(context, attrs, defStyleAttr);
//     }
// 
//     @Override
//     public void initialize(Step step, StepResult result) {
//         this.step = step;
//         initializeStep();
//     }
// 
//     @Override
//     public View getLayout() {
//         return this;
//     }
// 
//     @Override
//     public boolean isBackEventConsumed() {
//         callbacks.onSaveStep(StepCallbacks.ACTION_PREV, step, null);
//         return false;
//     }
// 
//     @Override
//     public void setCallbacks(StepCallbacks callbacks) {
//         this.callbacks = callbacks;
//     }
// 
//     @Override
//     public int getContentResourceId() {
//         return R.layout.rsb_step_layout_instruction;
//     }
// 
//     private void initializeStep() {
//         if (step != null) {
// 
//             // Set Title
//             if (!TextUtils.isEmpty(step.getTitle())) {
//                 TextView title = (TextView) findViewById(R.id.rsb_intruction_title);
//                 title.setVisibility(View.VISIBLE);
//                 title.setText(step.getTitle());
//             }
// 
//             // Set Summary
//             if (!TextUtils.isEmpty(step.getText())) {
//                 TextView summary = (TextView) findViewById(R.id.rsb_intruction_text);
//                 summary.setVisibility(View.VISIBLE);
//                 summary.setText(Html.fromHtml(step.getText()));
//                 summary.setMovementMethod(new TextViewLinkHandler() {
//                     @Override
//                     public void onLinkClick(String url) {
//                         String path = ResourcePathManager.getInstance().
//                                 generateAbsolutePath(ResourcePathManager.Resource.TYPE_HTML, url);
//                         Intent intent = ViewWebDocumentActivity.newIntentForPath(getContext(),
//                                 step.getTitle(),
//                                 path);
//                         getContext().startActivity(intent);
//                     }
//                 });
//             }
// 
//             // Set Next / Skip
//             SubmitBar submitBar = (SubmitBar) findViewById(R.id.rsb_submit_bar);
//             submitBar.setPositiveTitle(R.string.rsb_next);
//             submitBar.setPositiveAction(v -> callbacks.onSaveStep(StepCallbacks.ACTION_NEXT,
//                     step,
//                     null));
// 
//             if (step.isOptional()) {
//                 submitBar.setNegativeTitle(R.string.rsb_step_skip);
//                 submitBar.setNegativeAction(v -> {
//                     if (callbacks != null) {
//                         callbacks.onSaveStep(StepCallbacks.ACTION_NEXT, step, null);
//                     }
//                 });
//             } else {
//                 submitBar.getNegativeActionView().setVisibility(View.GONE);
//             }
//         }
//     }
// }


import org.researchstack.backbone.ui.step.layout.InstructionStepLayout;
package org.researchstack.backbone.step;


/**
 * An InstructionStep object gives the participant instructions for a task.
 * <p>
 * You can use instruction steps to present various types of content during a task, such as
 * introductory content, instructions in the middle of a task, or a final message at the completion
 * of a task.
 */
public class InstructionStep extends Step {
    public InstructionStep(String identifier, String title, String detailText) {
        super(identifier, title);
        setText(detailText);
        setOptional(false);
    }

    @Override
    public Class getStepLayoutClass() {
// Path: backbone/src/main/java/org/researchstack/backbone/ui/step/layout/InstructionStepLayout.java
// public class InstructionStepLayout extends FixedSubmitBarLayout implements StepLayout {
//     private StepCallbacks callbacks;
//     private Step step;
// 
//     public InstructionStepLayout(Context context) {
//         super(context);
//     }
// 
//     public InstructionStepLayout(Context context, AttributeSet attrs) {
//         super(context, attrs);
//     }
// 
//     public InstructionStepLayout(Context context, AttributeSet attrs, int defStyleAttr) {
//         super(context, attrs, defStyleAttr);
//     }
// 
//     @Override
//     public void initialize(Step step, StepResult result) {
//         this.step = step;
//         initializeStep();
//     }
// 
//     @Override
//     public View getLayout() {
//         return this;
//     }
// 
//     @Override
//     public boolean isBackEventConsumed() {
//         callbacks.onSaveStep(StepCallbacks.ACTION_PREV, step, null);
//         return false;
//     }
// 
//     @Override
//     public void setCallbacks(StepCallbacks callbacks) {
//         this.callbacks = callbacks;
//     }
// 
//     @Override
//     public int getContentResourceId() {
//         return R.layout.rsb_step_layout_instruction;
//     }
// 
//     private void initializeStep() {
//         if (step != null) {
// 
//             // Set Title
//             if (!TextUtils.isEmpty(step.getTitle())) {
//                 TextView title = (TextView) findViewById(R.id.rsb_intruction_title);
//                 title.setVisibility(View.VISIBLE);
//                 title.setText(step.getTitle());
//             }
// 
//             // Set Summary
//             if (!TextUtils.isEmpty(step.getText())) {
//                 TextView summary = (TextView) findViewById(R.id.rsb_intruction_text);
//                 summary.setVisibility(View.VISIBLE);
//                 summary.setText(Html.fromHtml(step.getText()));
//                 summary.setMovementMethod(new TextViewLinkHandler() {
//                     @Override
//                     public void onLinkClick(String url) {
//                         String path = ResourcePathManager.getInstance().
//                                 generateAbsolutePath(ResourcePathManager.Resource.TYPE_HTML, url);
//                         Intent intent = ViewWebDocumentActivity.newIntentForPath(getContext(),
//                                 step.getTitle(),
//                                 path);
//                         getContext().startActivity(intent);
//                     }
//                 });
//             }
// 
//             // Set Next / Skip
//             SubmitBar submitBar = (SubmitBar) findViewById(R.id.rsb_submit_bar);
//             submitBar.setPositiveTitle(R.string.rsb_next);
//             submitBar.setPositiveAction(v -> callbacks.onSaveStep(StepCallbacks.ACTION_NEXT,
//                     step,
//                     null));
// 
//             if (step.isOptional()) {
//                 submitBar.setNegativeTitle(R.string.rsb_step_skip);
//                 submitBar.setNegativeAction(v -> {
//                     if (callbacks != null) {
//                         callbacks.onSaveStep(StepCallbacks.ACTION_NEXT, step, null);
//                     }
//                 });
//             } else {
//                 submitBar.getNegativeActionView().setVisibility(View.GONE);
//             }
//         }
//     }
// }


// Path: backbone/src/main/java/org/researchstack/backbone/step/InstructionStep.java
import org.researchstack.backbone.ui.step.layout.InstructionStepLayout;

package org.researchstack.backbone.step;


/**
 * An InstructionStep object gives the participant instructions for a task.
 * <p>
 * You can use instruction steps to present various types of content during a task, such as
 * introductory content, instructions in the middle of a task, or a final message at the completion
 * of a task.
 */
public class InstructionStep extends Step {
    public InstructionStep(String identifier, String title, String detailText) {
        super(identifier, title);
        setText(detailText);
        setOptional(false);
    }

    @Override
    public Class getStepLayoutClass() {
        return InstructionStepLayout.class;