diff --git a/serenity-app/src/main/java/us/nineworlds/serenity/AboutDialog.java b/serenity-app/src/main/java/us/nineworlds/serenity/AboutDialog.java deleted file mode 100644 index f17c01260..000000000 --- a/serenity-app/src/main/java/us/nineworlds/serenity/AboutDialog.java +++ /dev/null @@ -1,65 +0,0 @@ -package us.nineworlds.serenity; - -import android.app.Dialog; -import android.content.Context; -import android.content.pm.PackageManager.NameNotFoundException; -import android.graphics.Color; -import android.os.Bundle; -import android.text.Html; -import android.text.method.ScrollingMovementMethod; -import android.widget.TextView; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; - -public class AboutDialog extends Dialog { - private Context mContext = null; - - public AboutDialog(Context context) { - super(context); - mContext = context; - } - - @Override public void onCreate(Bundle savedInstanceState) { - setContentView(R.layout.about); - TextView tv = (TextView) findViewById(R.id.legal_text); - tv.setText(Html.fromHtml(readRawTextFile(R.raw.legal))); - tv.setMovementMethod(new ScrollingMovementMethod()); - - tv = (TextView) findViewById(R.id.info_text); - tv.setText(Html.fromHtml(readRawTextFile(R.raw.info))); - tv.setLinkTextColor(Color.WHITE); - String versionName; - try { - versionName = mContext.getPackageManager().getPackageInfo(mContext.getPackageName(), 0).versionName; - } catch (NameNotFoundException e) { - versionName = ""; - } - setTitle(mContext.getString(R.string.about_title_serenity_for_google_tv) + " v" + versionName); - } - - public String readRawTextFile(int id) { - InputStream inputStream = mContext.getResources().openRawResource(id); - InputStreamReader in = new InputStreamReader(inputStream); - BufferedReader buf = new BufferedReader(in); - String line; - StringBuilder text = new StringBuilder(); - try { - while ((line = buf.readLine()) != null) { - text.append(line); - } - } catch (IOException e) { - return null; - } finally { - try { - buf.close(); - in.close(); - inputStream.close(); - } catch (IOException e) { - } - } - return text.toString(); - } -} \ No newline at end of file diff --git a/serenity-app/src/main/java/us/nineworlds/serenity/recyclerutils/GridSpacingItemDecoration.java b/serenity-app/src/main/java/us/nineworlds/serenity/recyclerutils/GridSpacingItemDecoration.java deleted file mode 100644 index 162208005..000000000 --- a/serenity-app/src/main/java/us/nineworlds/serenity/recyclerutils/GridSpacingItemDecoration.java +++ /dev/null @@ -1,45 +0,0 @@ -package us.nineworlds.serenity.recyclerutils; - -import android.graphics.Rect; -import android.view.View; - -import androidx.recyclerview.widget.RecyclerView; - -public class GridSpacingItemDecoration extends RecyclerView.ItemDecoration { - - private int spanCount; - private int spacing; - private boolean includeEdge; - - public GridSpacingItemDecoration(int spanCount, int spacing, boolean includeEdge) { - this.spanCount = spanCount; - this.spacing = spacing; - this.includeEdge = includeEdge; - } - - @Override public void getItemOffsets(Rect outRect, View view, RecyclerView parent, - RecyclerView.State state) { - int position = parent.getChildAdapterPosition(view); // item position - int column = position % spanCount; // item column - - if (includeEdge) { - outRect.left = - spacing - column * spacing / spanCount; // spacing - column * ((1f / spanCount) * spacing) - outRect.right = - (column + 1) * spacing / spanCount; // (column + 1) * ((1f / spanCount) * spacing) - - if (position < spanCount) { // top edge - outRect.top = spacing; - } - outRect.bottom = spacing; // item bottom - } else { - outRect.left = column * spacing / spanCount; // column * ((1f / spanCount) * spacing) - outRect.right = spacing - - (column + 1) * spacing - / spanCount; // spacing - (column + 1) * ((1f / spanCount) * spacing) - if (position >= spanCount) { - outRect.top = spacing; // item top - } - } - } -} \ No newline at end of file diff --git a/serenity-app/src/main/java/us/nineworlds/serenity/recyclerutils/ItemOffsetDecoration.java b/serenity-app/src/main/java/us/nineworlds/serenity/recyclerutils/ItemOffsetDecoration.java deleted file mode 100644 index e7107a184..000000000 --- a/serenity-app/src/main/java/us/nineworlds/serenity/recyclerutils/ItemOffsetDecoration.java +++ /dev/null @@ -1,28 +0,0 @@ -package us.nineworlds.serenity.recyclerutils; - -import android.content.Context; -import android.graphics.Rect; -import android.view.View; - -import androidx.annotation.DimenRes; -import androidx.annotation.NonNull; -import androidx.recyclerview.widget.RecyclerView; - -public class ItemOffsetDecoration extends RecyclerView.ItemDecoration { - - private int mItemOffset; - - public ItemOffsetDecoration(int itemOffset) { - mItemOffset = itemOffset; - } - - public ItemOffsetDecoration(@NonNull Context context, @DimenRes int itemOffsetId) { - this(context.getResources().getDimensionPixelSize(itemOffsetId)); - } - - @Override public void getItemOffsets(Rect outRect, View view, RecyclerView parent, - RecyclerView.State state) { - super.getItemOffsets(outRect, view, parent, state); - outRect.set(mItemOffset, mItemOffset, mItemOffset, mItemOffset); - } -} \ No newline at end of file diff --git a/serenity-app/src/main/java/us/nineworlds/serenity/recyclerutils/SpaceItemDecoration.java b/serenity-app/src/main/java/us/nineworlds/serenity/recyclerutils/SpaceItemDecoration.java deleted file mode 100644 index a4fcb491e..000000000 --- a/serenity-app/src/main/java/us/nineworlds/serenity/recyclerutils/SpaceItemDecoration.java +++ /dev/null @@ -1,66 +0,0 @@ -package us.nineworlds.serenity.recyclerutils; - -import android.graphics.Rect; -import android.view.View; - -import androidx.recyclerview.widget.LinearLayoutManager; -import androidx.recyclerview.widget.RecyclerView; - -public class SpaceItemDecoration extends RecyclerView.ItemDecoration { - private static final boolean DEFAULT_ADD_SPACE_ABOVE_FIRST_ITEM = false; - private static final boolean DEFAULT_ADD_SPACE_BELOW_LAST_ITEM = false; - - private final int space; - private final boolean addSpaceAboveFirstItem; - private final boolean addSpaceBelowLastItem; - - public SpaceItemDecoration(int space) { - this(space, DEFAULT_ADD_SPACE_ABOVE_FIRST_ITEM, DEFAULT_ADD_SPACE_BELOW_LAST_ITEM); - } - - public SpaceItemDecoration(int space, boolean addSpaceAboveFirstItem, - boolean addSpaceBelowLastItem) { - this.space = space; - this.addSpaceAboveFirstItem = addSpaceAboveFirstItem; - this.addSpaceBelowLastItem = addSpaceBelowLastItem; - } - - @Override public void getItemOffsets(Rect outRect, View view, RecyclerView parent, - RecyclerView.State state) { - super.getItemOffsets(outRect, view, parent, state); - if (space <= 0) { - return; - } - - if (addSpaceAboveFirstItem && parent.getChildLayoutPosition(view) < 1 - || parent.getChildLayoutPosition(view) >= 1) { - if (getOrientation(parent) == LinearLayoutManager.VERTICAL) { - outRect.top = space; - } else { - outRect.left = space; - } - } - - if (addSpaceBelowLastItem - && parent.getChildAdapterPosition(view) == getTotalItemCount(parent) - 1) { - if (getOrientation(parent) == LinearLayoutManager.VERTICAL) { - outRect.bottom = space; - } else { - outRect.right = space; - } - } - } - - private int getTotalItemCount(RecyclerView parent) { - return parent.getAdapter().getItemCount(); - } - - private int getOrientation(RecyclerView parent) { - if (parent.getLayoutManager() instanceof LinearLayoutManager) { - return ((LinearLayoutManager) parent.getLayoutManager()).getOrientation(); - } else { - throw new IllegalStateException( - "SpaceItemDecoration can only be used with a LinearLayoutManager."); - } - } -} \ No newline at end of file diff --git a/serenity-app/src/main/java/us/nineworlds/serenity/ui/activity/SerenityMultiViewVideoActivity.java b/serenity-app/src/main/java/us/nineworlds/serenity/ui/activity/SerenityMultiViewVideoActivity.java deleted file mode 100644 index b1e65b0a9..000000000 --- a/serenity-app/src/main/java/us/nineworlds/serenity/ui/activity/SerenityMultiViewVideoActivity.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * The MIT License (MIT) - * Copyright (c) 2012 David Carver - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - *
- * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package us.nineworlds.serenity.ui.activity;
-
-/**
- * A activity that handles the indicator of whether toggling between Grid and
- * Detail view should occur. Views that need to support Detail and Grid view
- * should extend this view.
- *
- * @author dcarver
- */
-public abstract class SerenityMultiViewVideoActivity extends SerenityVideoActivity {
-
- protected boolean gridViewActive = false;
-
- @Override public void finish() {
- super.finish();
- }
-
- protected boolean posterLayoutActive = false;
-
- public boolean isGridViewActive() {
- return gridViewActive;
- }
-
- /**
- * Used to indicate whether posters or banners are shown.
- */
- public boolean isPosterLayoutActive() {
- return posterLayoutActive;
- }
-
- public void setGridViewEnabled(boolean sw) {
- gridViewActive = sw;
- }
-
- public void setPosterLayoutActive(boolean sw) {
- posterLayoutActive = sw;
- }
-}
diff --git a/serenity-app/src/main/java/us/nineworlds/serenity/ui/adapters/RecyclerViewDiffUtil.kt b/serenity-app/src/main/java/us/nineworlds/serenity/ui/adapters/RecyclerViewDiffUtil.kt
deleted file mode 100644
index 808a45c18..000000000
--- a/serenity-app/src/main/java/us/nineworlds/serenity/ui/adapters/RecyclerViewDiffUtil.kt
+++ /dev/null
@@ -1,21 +0,0 @@
-package us.nineworlds.serenity.ui.adapters
-
-import androidx.recyclerview.widget.DiffUtil
-import us.nineworlds.serenity.core.model.ContentInfo
-
-class RecyclerViewDiffUtil(private val oldList: List