// Path: app/src/main/java/android/support/v17/leanback/streamingapp/old/oldmodels/OldCardRow.java
// public class OldCardRow {
// 
//     // default is a list of cards
//     public static final int TYPE_DEFAULT = 0;
//     // section header
//     public static final int TYPE_SECTION_HEADER = 1;
//     // divider
//     public static final int TYPE_DIVIDER = 2;
// 
//     @SerializedName("type") private int mType = TYPE_DEFAULT;
//     // Used to determine whether the row shall use shadows when displaying its cards or not.
//     @SerializedName("shadow") private boolean mShadow = true;
//     @SerializedName("title") private String mTitle;
//     @SerializedName("cards") private List<OldCard> mOldCards;
// 
//     public int getType() {
//         return mType;
//     }
// 
//     public String getTitle() {
//         return mTitle;
//     }
// 
//     public boolean useShadow() {
//         return mShadow;
//     }
// 
//     public List<OldCard> getCards() {
//         return mOldCards;
//     }
// 
// }
// 
// Path: app/src/main/java/android/support/v17/leanback/streamingapp/utils/OldCardListRow.java
// public class OldCardListRow extends ListRow {
// 
//     private OldCardRow mOldCardRow;
// 
//     public OldCardListRow(HeaderItem header, ObjectAdapter adapter, OldCardRow oldCardRow) {
//         super(header, adapter);
//         setCardRow(oldCardRow);
//     }
// 
//     public OldCardRow getCardRow() {
//         return mOldCardRow;
//     }
// 
//     public void setCardRow(OldCardRow oldCardRow) {
//         this.mOldCardRow = oldCardRow;
//     }
// }


import android.support.v17.leanback.streamingapp.old.oldmodels.OldCardRow;
import android.support.v17.leanback.streamingapp.utils.OldCardListRow;
import android.support.v17.leanback.widget.ListRowPresenter;
import android.support.v17.leanback.widget.Presenter;
import android.support.v17.leanback.widget.PresenterSelector;
/*
 * Copyright (C) 2015 The Android Open Source Project
 *
 * 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 android.support.v17.leanback.streamingapp.old.oldapp.olddetails;


/**
 * This {@link PresenterSelector} will return a {@link ListRowPresenter} which has shadow support
 * enabled or not depending on {@link OldCardRow#useShadow()} for a given row.
 */
public class OldShadowRowPresenterSelector extends PresenterSelector {

    private ListRowPresenter mShadowEnabledRowPresenter = new ListRowPresenter();
    private ListRowPresenter mShadowDisabledRowPresenter = new ListRowPresenter();

    public OldShadowRowPresenterSelector() {
        mShadowEnabledRowPresenter.setNumRows(1);
        mShadowDisabledRowPresenter.setShadowEnabled(false);
    }

    @Override public Presenter getPresenter(Object item) {
        if (!(item instanceof OldCardListRow)) return mShadowDisabledRowPresenter;
        OldCardListRow listRow = (OldCardListRow) item;
// Path: app/src/main/java/android/support/v17/leanback/streamingapp/old/oldmodels/OldCardRow.java
// public class OldCardRow {
// 
//     // default is a list of cards
//     public static final int TYPE_DEFAULT = 0;
//     // section header
//     public static final int TYPE_SECTION_HEADER = 1;
//     // divider
//     public static final int TYPE_DIVIDER = 2;
// 
//     @SerializedName("type") private int mType = TYPE_DEFAULT;
//     // Used to determine whether the row shall use shadows when displaying its cards or not.
//     @SerializedName("shadow") private boolean mShadow = true;
//     @SerializedName("title") private String mTitle;
//     @SerializedName("cards") private List<OldCard> mOldCards;
// 
//     public int getType() {
//         return mType;
//     }
// 
//     public String getTitle() {
//         return mTitle;
//     }
// 
//     public boolean useShadow() {
//         return mShadow;
//     }
// 
//     public List<OldCard> getCards() {
//         return mOldCards;
//     }
// 
// }
// 
// Path: app/src/main/java/android/support/v17/leanback/streamingapp/utils/OldCardListRow.java
// public class OldCardListRow extends ListRow {
// 
//     private OldCardRow mOldCardRow;
// 
//     public OldCardListRow(HeaderItem header, ObjectAdapter adapter, OldCardRow oldCardRow) {
//         super(header, adapter);
//         setCardRow(oldCardRow);
//     }
// 
//     public OldCardRow getCardRow() {
//         return mOldCardRow;
//     }
// 
//     public void setCardRow(OldCardRow oldCardRow) {
//         this.mOldCardRow = oldCardRow;
//     }
// }


// Path: app/src/main/java/android/support/v17/leanback/streamingapp/old/oldapp/olddetails/OldShadowRowPresenterSelector.java
import android.support.v17.leanback.streamingapp.old.oldmodels.OldCardRow;
import android.support.v17.leanback.streamingapp.utils.OldCardListRow;
import android.support.v17.leanback.widget.ListRowPresenter;
import android.support.v17.leanback.widget.Presenter;
import android.support.v17.leanback.widget.PresenterSelector;

/*
 * Copyright (C) 2015 The Android Open Source Project
 *
 * 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 android.support.v17.leanback.streamingapp.old.oldapp.olddetails;


/**
 * This {@link PresenterSelector} will return a {@link ListRowPresenter} which has shadow support
 * enabled or not depending on {@link OldCardRow#useShadow()} for a given row.
 */
public class OldShadowRowPresenterSelector extends PresenterSelector {

    private ListRowPresenter mShadowEnabledRowPresenter = new ListRowPresenter();
    private ListRowPresenter mShadowDisabledRowPresenter = new ListRowPresenter();

    public OldShadowRowPresenterSelector() {
        mShadowEnabledRowPresenter.setNumRows(1);
        mShadowDisabledRowPresenter.setShadowEnabled(false);
    }

    @Override public Presenter getPresenter(Object item) {
        if (!(item instanceof OldCardListRow)) return mShadowDisabledRowPresenter;
        OldCardListRow listRow = (OldCardListRow) item;
        OldCardRow row = listRow.getCardRow();