// Path: serenity-app/src/main/java/us/nineworlds/serenity/ui/adapters/AbstractPosterImageGalleryAdapter.java
// public abstract class AbstractPosterImageGalleryAdapter extends InjectingRecyclerViewAdapter implements
//     View.OnKeyListener {
// 
//   protected static List<VideoContentInfo> posterList = null;
//   protected Handler handler;
//   protected AbstractVideoOnItemClickListener onItemClickListener;
//   protected AbstractVideoOnItemSelectedListener onItemSelectedListener;
//   protected boolean triggerFocusSelection = true;
// 
//   private Animation scaleSmallAnimation;
//   private Animation scaleBigAnimation;
// 
//   public AbstractPosterImageGalleryAdapter() {
//     posterList = new ArrayList<>();
//   }
// 
//   @Override public int getItemCount() {
//     return posterList.size();
//   }
// 
//   public Object getItem(int position) {
//     if (position < posterList.size()) {
//       return posterList.get(position);
//     }
// 
//     return posterList.get(0);
//   }
// 
//   @Override public long getItemId(int position) {
//     return position;
//   }
// 
// 
//   public List<VideoContentInfo> getItems() {
//     return posterList;
//   }
// 
//   public AbstractVideoOnItemClickListener getOnItemClickListener() {
//     return onItemClickListener;
//   }
// 
//   public void setOnItemClickListener(AbstractVideoOnItemClickListener onItemClickListener) {
//     this.onItemClickListener = onItemClickListener;
//   }
// 
//   public AbstractVideoOnItemSelectedListener getOnItemSelectedListener() {
//     return onItemSelectedListener;
//   }
// 
//   public void setOnItemSelectedListener(AbstractVideoOnItemSelectedListener onItemSelectedListener) {
//     this.onItemSelectedListener = onItemSelectedListener;
//   }
// 
//   protected void zoomIn(View view) {
//     view.clearAnimation();
//     if (scaleSmallAnimation == null) {
//       scaleSmallAnimation = AnimationUtils.loadAnimation(view.getContext(), R.anim.anim_scale_small);
//     }
//     view.startAnimation(scaleSmallAnimation);
//   }
// 
//   protected void zoomOut(View view) {
//     if (scaleBigAnimation == null) {
//       scaleBigAnimation = AnimationUtils.loadAnimation(view.getContext(), R.anim.anim_scale_big);
//     }
//     view.startAnimation(scaleBigAnimation);
//   }
// 
//   public boolean onKey(View v, int keyCode, KeyEvent event) {
//     triggerFocusSelection = true;
// 
//     if (event.getAction() == KeyEvent.ACTION_UP  && isDirectionalPadKeyCode(keyCode)) {
//       v.setBackground(ContextCompat.getDrawable(v.getContext(), R.drawable.rounded_transparent_border));
//       return true;
//     }
// 
//     if (event.getRepeatCount() > 1 && isDirectionalPadKeyCode(keyCode)) {
//       triggerFocusSelection = false;
//     }
// 
//     return false;
//   }
// 
//   protected boolean isDirectionalPadKeyCode(int keyCode) {
//     return keyCode == KeyEvent.KEYCODE_DPAD_LEFT ||
//     keyCode == KeyEvent.KEYCODE_DPAD_RIGHT ||
//     keyCode == KeyEvent.KEYCODE_DPAD_UP ||
//     keyCode == KeyEvent.KEYCODE_DPAD_DOWN;
//   }
// }


import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import androidx.legacy.app.ActionBarDrawerToggle;
import androidx.recyclerview.widget.RecyclerView;
import android.view.KeyEvent;
import android.view.View;
import android.widget.FrameLayout;
import butterknife.ButterKnife;
import moxy.presenter.InjectPresenter;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import us.nineworlds.serenity.R;
import us.nineworlds.serenity.core.menus.MenuDrawerItem;
import us.nineworlds.serenity.core.menus.MenuDrawerItemImpl;
import us.nineworlds.serenity.core.model.VideoContentInfo;
import us.nineworlds.serenity.ui.activity.SerenityVideoActivity;
import us.nineworlds.serenity.ui.adapters.AbstractPosterImageGalleryAdapter;
import us.nineworlds.serenity.ui.adapters.MenuDrawerAdapter;
import us.nineworlds.serenity.ui.util.DisplayUtils;
import static android.view.View.*;

    bgLayout = findViewById(R.id.movieBrowserBackgroundLayout);
    metaData = findViewById(R.id.metaDataRow);
    metaData.setVisibility(VISIBLE);

    DisplayUtils.overscanCompensation(this, getWindow().getDecorView());
    FrameLayout dataLoadingContainer = findViewById(R.id.data_loading_container);
    if (dataLoadingContainer != null) {
      dataLoadingContainer.setVisibility(View.VISIBLE);
    }
  }

  @Override protected String screenName() {
    return "Episode Browser";
  }

  @Override public AbstractPosterImageGalleryAdapter getAdapter() {
    return seasonEpisodeAdapter;
  }

  @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (key != null && key.contains("onDeck")) {
      recreate();
      return;
    }
  }

  public static String getKey() {
// Path: serenity-app/src/main/java/us/nineworlds/serenity/ui/adapters/AbstractPosterImageGalleryAdapter.java
// public abstract class AbstractPosterImageGalleryAdapter extends InjectingRecyclerViewAdapter implements
//     View.OnKeyListener {
// 
//   protected static List<VideoContentInfo> posterList = null;
//   protected Handler handler;
//   protected AbstractVideoOnItemClickListener onItemClickListener;
//   protected AbstractVideoOnItemSelectedListener onItemSelectedListener;
//   protected boolean triggerFocusSelection = true;
// 
//   private Animation scaleSmallAnimation;
//   private Animation scaleBigAnimation;
// 
//   public AbstractPosterImageGalleryAdapter() {
//     posterList = new ArrayList<>();
//   }
// 
//   @Override public int getItemCount() {
//     return posterList.size();
//   }
// 
//   public Object getItem(int position) {
//     if (position < posterList.size()) {
//       return posterList.get(position);
//     }
// 
//     return posterList.get(0);
//   }
// 
//   @Override public long getItemId(int position) {
//     return position;
//   }
// 
// 
//   public List<VideoContentInfo> getItems() {
//     return posterList;
//   }
// 
//   public AbstractVideoOnItemClickListener getOnItemClickListener() {
//     return onItemClickListener;
//   }
// 
//   public void setOnItemClickListener(AbstractVideoOnItemClickListener onItemClickListener) {
//     this.onItemClickListener = onItemClickListener;
//   }
// 
//   public AbstractVideoOnItemSelectedListener getOnItemSelectedListener() {
//     return onItemSelectedListener;
//   }
// 
//   public void setOnItemSelectedListener(AbstractVideoOnItemSelectedListener onItemSelectedListener) {
//     this.onItemSelectedListener = onItemSelectedListener;
//   }
// 
//   protected void zoomIn(View view) {
//     view.clearAnimation();
//     if (scaleSmallAnimation == null) {
//       scaleSmallAnimation = AnimationUtils.loadAnimation(view.getContext(), R.anim.anim_scale_small);
//     }
//     view.startAnimation(scaleSmallAnimation);
//   }
// 
//   protected void zoomOut(View view) {
//     if (scaleBigAnimation == null) {
//       scaleBigAnimation = AnimationUtils.loadAnimation(view.getContext(), R.anim.anim_scale_big);
//     }
//     view.startAnimation(scaleBigAnimation);
//   }
// 
//   public boolean onKey(View v, int keyCode, KeyEvent event) {
//     triggerFocusSelection = true;
// 
//     if (event.getAction() == KeyEvent.ACTION_UP  && isDirectionalPadKeyCode(keyCode)) {
//       v.setBackground(ContextCompat.getDrawable(v.getContext(), R.drawable.rounded_transparent_border));
//       return true;
//     }
// 
//     if (event.getRepeatCount() > 1 && isDirectionalPadKeyCode(keyCode)) {
//       triggerFocusSelection = false;
//     }
// 
//     return false;
//   }
// 
//   protected boolean isDirectionalPadKeyCode(int keyCode) {
//     return keyCode == KeyEvent.KEYCODE_DPAD_LEFT ||
//     keyCode == KeyEvent.KEYCODE_DPAD_RIGHT ||
//     keyCode == KeyEvent.KEYCODE_DPAD_UP ||
//     keyCode == KeyEvent.KEYCODE_DPAD_DOWN;
//   }
// }


// Path: serenity-app/src/main/java/us/nineworlds/serenity/ui/browser/tv/episodes/EpisodeBrowserActivity.java
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import androidx.legacy.app.ActionBarDrawerToggle;
import androidx.recyclerview.widget.RecyclerView;
import android.view.KeyEvent;
import android.view.View;
import android.widget.FrameLayout;
import butterknife.ButterKnife;
import moxy.presenter.InjectPresenter;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import us.nineworlds.serenity.R;
import us.nineworlds.serenity.core.menus.MenuDrawerItem;
import us.nineworlds.serenity.core.menus.MenuDrawerItemImpl;
import us.nineworlds.serenity.core.model.VideoContentInfo;
import us.nineworlds.serenity.ui.activity.SerenityVideoActivity;
import us.nineworlds.serenity.ui.adapters.AbstractPosterImageGalleryAdapter;
import us.nineworlds.serenity.ui.adapters.MenuDrawerAdapter;
import us.nineworlds.serenity.ui.util.DisplayUtils;
import static android.view.View.*;


    bgLayout = findViewById(R.id.movieBrowserBackgroundLayout);
    metaData = findViewById(R.id.metaDataRow);
    metaData.setVisibility(VISIBLE);

    DisplayUtils.overscanCompensation(this, getWindow().getDecorView());
    FrameLayout dataLoadingContainer = findViewById(R.id.data_loading_container);
    if (dataLoadingContainer != null) {
      dataLoadingContainer.setVisibility(View.VISIBLE);
    }
  }

  @Override protected String screenName() {
    return "Episode Browser";
  }

  @Override public AbstractPosterImageGalleryAdapter getAdapter() {
    return seasonEpisodeAdapter;
  }

  @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (key != null && key.contains("onDeck")) {
      recreate();
      return;
    }
  }

  public static String getKey() {
    return key;