diff --git a/app/src/main/java/org/schabi/newpipe/fragments/local/bookmark/BookmarkFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/local/bookmark/BookmarkFragment.java index 93b0dea29..2aa648fa9 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/local/bookmark/BookmarkFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/local/bookmark/BookmarkFragment.java @@ -39,8 +39,8 @@ import io.reactivex.disposables.CompositeDisposable; public final class BookmarkFragment extends BaseLocalListFragment, Void> { - private View watchHistoryButton; - private View mostWatchedButton; + private View lastPlayedButton; + private View mostPlayedButton; @State protected Parcelable itemsListState; @@ -96,8 +96,8 @@ public final class BookmarkFragment protected View getListHeader() { final View headerRootLayout = activity.getLayoutInflater() .inflate(R.layout.bookmark_header, itemsList, false); - watchHistoryButton = headerRootLayout.findViewById(R.id.watchHistory); - mostWatchedButton = headerRootLayout.findViewById(R.id.mostWatched); + lastPlayedButton = headerRootLayout.findViewById(R.id.lastPlayed); + mostPlayedButton = headerRootLayout.findViewById(R.id.mostPlayed); return headerRootLayout; } @@ -135,13 +135,13 @@ public final class BookmarkFragment } }); - watchHistoryButton.setOnClickListener(view -> { + lastPlayedButton.setOnClickListener(view -> { if (getParentFragment() != null) { - NavigationHelper.openWatchHistoryFragment(getParentFragment().getFragmentManager()); + NavigationHelper.openLastPlayedFragment(getParentFragment().getFragmentManager()); } }); - mostWatchedButton.setOnClickListener(view -> { + mostPlayedButton.setOnClickListener(view -> { if (getParentFragment() != null) { NavigationHelper.openMostPlayedFragment(getParentFragment().getFragmentManager()); } @@ -178,8 +178,8 @@ public final class BookmarkFragment @Override public void onDestroyView() { super.onDestroyView(); - if (mostWatchedButton != null) mostWatchedButton.setOnClickListener(null); - if (watchHistoryButton != null) watchHistoryButton.setOnClickListener(null); + if (mostPlayedButton != null) mostPlayedButton.setOnClickListener(null); + if (lastPlayedButton != null) lastPlayedButton.setOnClickListener(null); if (disposables != null) disposables.clear(); if (databaseSubscription != null) databaseSubscription.cancel(); diff --git a/app/src/main/java/org/schabi/newpipe/fragments/local/bookmark/WatchHistoryFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/local/bookmark/LastPlayedFragment.java similarity index 79% rename from app/src/main/java/org/schabi/newpipe/fragments/local/bookmark/WatchHistoryFragment.java rename to app/src/main/java/org/schabi/newpipe/fragments/local/bookmark/LastPlayedFragment.java index 84126ad4b..a5b62c63e 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/local/bookmark/WatchHistoryFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/local/bookmark/LastPlayedFragment.java @@ -6,10 +6,10 @@ import org.schabi.newpipe.database.stream.StreamStatisticsEntry; import java.util.Collections; import java.util.List; -public final class WatchHistoryFragment extends StatisticsPlaylistFragment { +public final class LastPlayedFragment extends StatisticsPlaylistFragment { @Override protected String getName() { - return getString(R.string.title_watch_history); + return getString(R.string.title_last_played); } @Override diff --git a/app/src/main/java/org/schabi/newpipe/history/HistoryActivity.java b/app/src/main/java/org/schabi/newpipe/history/HistoryActivity.java index 30589a22c..267d07065 100644 --- a/app/src/main/java/org/schabi/newpipe/history/HistoryActivity.java +++ b/app/src/main/java/org/schabi/newpipe/history/HistoryActivity.java @@ -9,10 +9,8 @@ import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.app.FragmentStatePagerAdapter; import android.support.v4.view.ViewPager; -import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; -import android.util.Log; import android.view.Menu; import android.view.MenuItem; @@ -23,7 +21,6 @@ import org.schabi.newpipe.settings.SettingsActivity; import org.schabi.newpipe.util.ThemeHelper; import io.reactivex.android.schedulers.AndroidSchedulers; -import io.reactivex.functions.Consumer; public class HistoryActivity extends AppCompatActivity { @@ -116,7 +113,7 @@ public class HistoryActivity extends AppCompatActivity { fragment = SearchHistoryFragment.newInstance(); break; case 1: - fragment = WatchedHistoryFragment.newInstance(); + fragment = WatchHistoryFragment.newInstance(); break; default: throw new IllegalArgumentException("position: " + position); diff --git a/app/src/main/java/org/schabi/newpipe/history/WatchedHistoryFragment.java b/app/src/main/java/org/schabi/newpipe/history/WatchHistoryFragment.java similarity index 97% rename from app/src/main/java/org/schabi/newpipe/history/WatchedHistoryFragment.java rename to app/src/main/java/org/schabi/newpipe/history/WatchHistoryFragment.java index 0fabc594a..4830ed33b 100644 --- a/app/src/main/java/org/schabi/newpipe/history/WatchedHistoryFragment.java +++ b/app/src/main/java/org/schabi/newpipe/history/WatchHistoryFragment.java @@ -33,11 +33,11 @@ import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.Disposable; -public class WatchedHistoryFragment extends HistoryFragment { +public class WatchHistoryFragment extends HistoryFragment { @NonNull - public static WatchedHistoryFragment newInstance() { - return new WatchedHistoryFragment(); + public static WatchHistoryFragment newInstance() { + return new WatchHistoryFragment(); } @Override diff --git a/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java b/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java index 3acfb6683..42cf135e3 100644 --- a/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java @@ -36,7 +36,7 @@ import org.schabi.newpipe.fragments.list.playlist.PlaylistFragment; import org.schabi.newpipe.fragments.list.search.SearchFragment; import org.schabi.newpipe.fragments.local.LocalPlaylistFragment; import org.schabi.newpipe.fragments.local.bookmark.MostPlayedFragment; -import org.schabi.newpipe.fragments.local.bookmark.WatchHistoryFragment; +import org.schabi.newpipe.fragments.local.bookmark.LastPlayedFragment; import org.schabi.newpipe.history.HistoryActivity; import org.schabi.newpipe.player.BackgroundPlayer; import org.schabi.newpipe.player.BackgroundPlayerActivity; @@ -335,10 +335,10 @@ public class NavigationHelper { .commit(); } - public static void openWatchHistoryFragment(FragmentManager fragmentManager) { + public static void openLastPlayedFragment(FragmentManager fragmentManager) { fragmentManager.beginTransaction() .setCustomAnimations(R.animator.custom_fade_in, R.animator.custom_fade_out, R.animator.custom_fade_in, R.animator.custom_fade_out) - .replace(R.id.fragment_holder, new WatchHistoryFragment()) + .replace(R.id.fragment_holder, new LastPlayedFragment()) .addToBackStack(null) .commit(); } diff --git a/app/src/main/res/layout/bookmark_header.xml b/app/src/main/res/layout/bookmark_header.xml index b087a5157..8ca5c1228 100644 --- a/app/src/main/res/layout/bookmark_header.xml +++ b/app/src/main/res/layout/bookmark_header.xml @@ -8,14 +8,14 @@ android:background="?attr/selectableItemBackground"> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 032e56b22..21579d3e1 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -313,7 +313,7 @@ Do you want to delete this item from search history? Do you want to delete this item from watch history? Are you sure you want to delete all items from history? - Watch History + Last Played Most Played