From 8009aa975e9b2344856479cc807e30e7d320235d Mon Sep 17 00:00:00 2001 From: Coffeemakr Date: Tue, 27 Jun 2017 14:08:58 +0200 Subject: [PATCH] Revert unused changes --- app/src/main/java/org/schabi/newpipe/MainActivity.java | 4 +--- .../org/schabi/newpipe/info_list/InfoListAdapter.java | 8 +++----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/MainActivity.java b/app/src/main/java/org/schabi/newpipe/MainActivity.java index 50ce8c55a..f747ca9a5 100644 --- a/app/src/main/java/org/schabi/newpipe/MainActivity.java +++ b/app/src/main/java/org/schabi/newpipe/MainActivity.java @@ -102,9 +102,7 @@ public class MainActivity extends AppCompatActivity { if (DEBUG) Log.d(TAG, "onBackPressed() called"); Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragment_holder); - if (fragment instanceof VideoDetailFragment) { - if (((VideoDetailFragment) fragment).onActivityBackPressed()) return; - } + if (fragment instanceof VideoDetailFragment) if (((VideoDetailFragment) fragment).onActivityBackPressed()) return; super.onBackPressed(); diff --git a/app/src/main/java/org/schabi/newpipe/info_list/InfoListAdapter.java b/app/src/main/java/org/schabi/newpipe/info_list/InfoListAdapter.java index fe3c5ea99..401c137d9 100644 --- a/app/src/main/java/org/schabi/newpipe/info_list/InfoListAdapter.java +++ b/app/src/main/java/org/schabi/newpipe/info_list/InfoListAdapter.java @@ -11,7 +11,6 @@ import org.schabi.newpipe.R; import org.schabi.newpipe.extractor.InfoItem; import java.util.ArrayList; -import java.util.Collection; import java.util.List; /** @@ -38,7 +37,7 @@ public class InfoListAdapter extends RecyclerView.Adapter infoItemList; + private final List infoItemList; private boolean showFooter = false; private View header = null; private View footer = null; @@ -71,11 +70,10 @@ public class InfoListAdapter extends RecyclerView.Adapter data) { + public void addInfoItemList(List data) { if(data != null) { - int sizeBefore = infoItemList.size(); infoItemList.addAll(data); - notifyItemRangeInserted(sizeBefore, data.size()); + notifyDataSetChanged(); } }