mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-30 23:03:00 +00:00 
			
		
		
		
	-Renamed "watch history" fragment under bookmark to "last played".
-Renamed "watched history" fragment under history to "watch history".
This commit is contained in:
		| @@ -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(); | ||||
|     } | ||||
|   | ||||
| @@ -8,14 +8,14 @@ | ||||
|     android:background="?attr/selectableItemBackground"> | ||||
|  | ||||
|     <RelativeLayout | ||||
|         android:id="@+id/watchHistory" | ||||
|         android:id="@+id/lastPlayed" | ||||
|         android:layout_width="wrap_content" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:background="?attr/selectableItemBackground" | ||||
|         android:clickable="true" | ||||
|         android:focusable="true"> | ||||
|         <ImageView | ||||
|             android:id="@+id/watchHistoryIcon" | ||||
|             android:id="@+id/lastPlayedIcon" | ||||
|             android:layout_width="48dp" | ||||
|             android:layout_height="28dp" | ||||
|             android:layout_alignParentLeft="true" | ||||
| @@ -26,12 +26,12 @@ | ||||
|             tools:ignore="ContentDescription,RtlHardcoded"/> | ||||
|  | ||||
|         <TextView | ||||
|             android:id="@+id/watchHistoryText" | ||||
|             android:id="@+id/lastPlayedText" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="50dp" | ||||
|             android:layout_toRightOf="@+id/watchHistoryIcon" | ||||
|             android:layout_toRightOf="@+id/lastPlayedIcon" | ||||
|             android:gravity="left|center" | ||||
|             android:text="@string/title_watch_history" | ||||
|             android:text="@string/title_last_played" | ||||
|             android:textAppearance="?android:attr/textAppearanceLarge" | ||||
|             android:textSize="15sp" | ||||
|             android:textStyle="bold" | ||||
| @@ -39,15 +39,15 @@ | ||||
|     </RelativeLayout> | ||||
|  | ||||
|     <RelativeLayout | ||||
|         android:id="@+id/mostWatched" | ||||
|         android:id="@+id/mostPlayed" | ||||
|         android:layout_width="wrap_content" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:layout_below="@id/watchHistory" | ||||
|         android:layout_below="@id/lastPlayed" | ||||
|         android:background="?attr/selectableItemBackground" | ||||
|         android:clickable="true" | ||||
|         android:focusable="true"> | ||||
|         <ImageView | ||||
|             android:id="@+id/mostWatchedIcon" | ||||
|             android:id="@+id/mostPlayedIcon" | ||||
|             android:layout_width="48dp" | ||||
|             android:layout_height="28dp" | ||||
|             android:layout_alignParentLeft="true" | ||||
| @@ -58,10 +58,10 @@ | ||||
|             tools:ignore="ContentDescription,RtlHardcoded"/> | ||||
|  | ||||
|         <TextView | ||||
|             android:id="@+id/mostWatchedText" | ||||
|             android:id="@+id/mostPlayedText" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="50dp" | ||||
|             android:layout_toRightOf="@+id/mostWatchedIcon" | ||||
|             android:layout_toRightOf="@+id/mostPlayedIcon" | ||||
|             android:gravity="left|center" | ||||
|             android:text="@string/title_most_played" | ||||
|             android:textAppearance="?android:attr/textAppearanceLarge" | ||||
| @@ -73,7 +73,7 @@ | ||||
|     <View | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="1dp" | ||||
|         android:layout_below="@+id/mostWatched" | ||||
|         android:layout_below="@+id/mostPlayed" | ||||
|         android:layout_marginLeft="8dp" | ||||
|         android:layout_marginRight="8dp" | ||||
|         android:background="?attr/separator_color"/> | ||||
|   | ||||
| @@ -313,7 +313,7 @@ | ||||
|     <string name="delete_item_search_history">Do you want to delete this item from search history?</string> | ||||
|     <string name="delete_stream_history_prompt">Do you want to delete this item from watch history?</string> | ||||
|     <string name="delete_all_history_prompt">Are you sure you want to delete all items from history?</string> | ||||
|     <string name="title_watch_history">Watch History</string> | ||||
|     <string name="title_last_played">Last Played</string> | ||||
|     <string name="title_most_played">Most Played</string> | ||||
|  | ||||
|     <!-- Content --> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 John Zhen Mo
					John Zhen Mo