mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-31 07:13:00 +00:00 
			
		
		
		
	-Fixed playlist bookmark button not showing out when activity / playlist fragment is created by external share.
This commit is contained in:
		| @@ -111,6 +111,7 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> { | |||||||
|         headerPopupButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_popup_button); |         headerPopupButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_popup_button); | ||||||
|         headerBackgroundButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_bg_button); |         headerBackgroundButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_bg_button); | ||||||
|  |  | ||||||
|  |  | ||||||
|         return headerRootLayout; |         return headerRootLayout; | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -175,6 +176,8 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> { | |||||||
|  |  | ||||||
|         playlistBookmarkButton = menu.findItem(R.id.menu_item_bookmark); |         playlistBookmarkButton = menu.findItem(R.id.menu_item_bookmark); | ||||||
|         playlistUnbookmarkButton = menu.findItem(R.id.menu_item_unbookmark); |         playlistUnbookmarkButton = menu.findItem(R.id.menu_item_unbookmark); | ||||||
|  |  | ||||||
|  |         updateBookmarkButtonsVisibility(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
| @@ -338,11 +341,8 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> { | |||||||
|  |  | ||||||
|             @Override |             @Override | ||||||
|             public void onNext(List<PlaylistRemoteEntity> playlist) { |             public void onNext(List<PlaylistRemoteEntity> playlist) { | ||||||
|                 if (playlistBookmarkButton == null || playlistUnbookmarkButton == null) return; |  | ||||||
|  |  | ||||||
|                 playlistBookmarkButton.setVisible(playlist.isEmpty()); |  | ||||||
|                 playlistUnbookmarkButton.setVisible(!playlist.isEmpty()); |  | ||||||
|                 playlistEntity = playlist.isEmpty() ? null : playlist.get(0); |                 playlistEntity = playlist.isEmpty() ? null : playlist.get(0); | ||||||
|  |                 updateBookmarkButtonsVisibility(); | ||||||
|  |  | ||||||
|                 if (bookmarkReactor != null) bookmarkReactor.request(1); |                 if (bookmarkReactor != null) bookmarkReactor.request(1); | ||||||
|             } |             } | ||||||
| @@ -387,4 +387,11 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> { | |||||||
|                 .doFinally(() -> playlistEntity = null) |                 .doFinally(() -> playlistEntity = null) | ||||||
|                 .subscribe(ignored -> {/* Do nothing */}, this::onError); |                 .subscribe(ignored -> {/* Do nothing */}, this::onError); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     private void updateBookmarkButtonsVisibility() { | ||||||
|  |         if (playlistBookmarkButton == null || playlistUnbookmarkButton == null) return; | ||||||
|  |  | ||||||
|  |         playlistBookmarkButton.setVisible(playlistEntity == null); | ||||||
|  |         playlistUnbookmarkButton.setVisible(playlistEntity != null); | ||||||
|  |     } | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 John Zhen Mo
					John Zhen Mo