-Renamed "watch history" fragment under bookmark to "last played".
-Renamed "watched history" fragment under history to "watch history".
This commit is contained in:
parent
7ab41e0c3a
commit
6020dc2b2d
7 changed files with 30 additions and 33 deletions
|
|
@ -39,8 +39,8 @@ import io.reactivex.disposables.CompositeDisposable;
|
|||
public final class BookmarkFragment
|
||||
extends BaseLocalListFragment<List<PlaylistLocalItem>, 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();
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -33,11 +33,11 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
|
|||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
|
||||
public class WatchedHistoryFragment extends HistoryFragment<StreamHistoryEntry> {
|
||||
public class WatchHistoryFragment extends HistoryFragment<StreamHistoryEntry> {
|
||||
|
||||
@NonNull
|
||||
public static WatchedHistoryFragment newInstance() {
|
||||
return new WatchedHistoryFragment();
|
||||
public static WatchHistoryFragment newInstance() {
|
||||
return new WatchHistoryFragment();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue