Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use view binding in remaining places. #5461

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
355e192
Use view binding in SuggestionListAdapter.
Isira-Seneviratne Jan 18, 2021
c21d2cc
Use view binding in StreamItemAdapter.
Isira-Seneviratne Jan 18, 2021
29bd32f
Use view binding in MissionsFragment and MissionAdapter.
Isira-Seneviratne Jan 18, 2021
2b417f6
Use view binding in PlaylistCreationDialog.
Isira-Seneviratne Jan 18, 2021
a8e2a17
Use view binding in AddTabDialog.
Isira-Seneviratne Jan 18, 2021
d765fba
Use view binding in InfoItemDialog.
Isira-Seneviratne Jan 18, 2021
6aca797
Use view binding in PlaybackParameterDialog.
Isira-Seneviratne Jan 18, 2021
9522fe4
Use view binding in LocalPlaylistFragment.
Isira-Seneviratne Jan 18, 2021
0d896ab
Use view binding in ChooseTabsFragment.
Isira-Seneviratne Jan 18, 2021
7611f7a
Use SubscriptionImportExportItemBinding in FeedImportExportItem.
Isira-Seneviratne Jan 18, 2021
2174863
Use ToolbarSearchLayoutBinding in SearchFragment.
Isira-Seneviratne Jan 18, 2021
aa631cd
Use view binding in StreamSegmentItem.
Isira-Seneviratne Jan 18, 2021
8919580
Add calls to 'metadataView' in Player.
Isira-Seneviratne Jan 18, 2021
611ba56
Use view binding in PlaylistAppendDialog.
Isira-Seneviratne Jan 18, 2021
42a910b
Use view binding in BookmarkFragment.
Isira-Seneviratne Jan 18, 2021
250b307
Use view binding in PlayQueueItemHolder.
Isira-Seneviratne Jan 19, 2021
43fcc69
Use view binding in SelectPlaylistFragment.
Isira-Seneviratne Jan 22, 2021
8caeab7
Use view binding in PeertubeInstanceListFragment.
Isira-Seneviratne Feb 2, 2021
c8edab0
Set the Fragment view bindings to null after the CompositeDisposables…
Isira-Seneviratne Feb 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -334,16 +334,11 @@ private void fetchStreamsSize() {
}));
}

@Override
public void onDestroy() {
super.onDestroy();
disposables.clear();
}

@Override
public void onDestroyView() {
dialogBinding = null;
super.onDestroyView();
disposables.clear();
dialogBinding = null;
}

/*//////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,26 @@ public void onStop() {
}
}

@Override
public void onDestroyView() {
super.onDestroyView();

if (positionSubscriber != null) {
positionSubscriber.dispose();
}
if (currentWorker != null) {
currentWorker.dispose();
}
disposables.clear();
positionSubscriber = null;
currentWorker = null;
bottomSheetBehavior.setBottomSheetCallback(null);
binding = null;
}

@Override
public void onDestroy() {
super.onDestroy();
binding = null;

// Stop the service when user leaves the app with double back press
// if video player is selected. Otherwise unbind
Expand All @@ -372,17 +388,6 @@ public void onDestroy() {
activity.unregisterReceiver(broadcastReceiver);
activity.getContentResolver().unregisterContentObserver(settingsContentObserver);

if (positionSubscriber != null) {
positionSubscriber.dispose();
}
if (currentWorker != null) {
currentWorker.dispose();
}
disposables.clear();
positionSubscriber = null;
currentWorker = null;
bottomSheetBehavior.setBottomSheetCallback(null);

if (activity.isFinishing()) {
playQueue = null;
currentInfo = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ public void onViewCreated(@NonNull final View rootView, final Bundle savedInstan
}

@Override
public void onDestroy() {
super.onDestroy();
public void onDestroyView() {
super.onDestroyView();
disposables.clear();
if (subscribeButtonMonitor != null) {
subscribeButtonMonitor.dispose();
Expand Down Expand Up @@ -487,9 +487,7 @@ public void handleResult(@NonNull final ChannelInfo result) {
}
}

if (disposables != null) {
disposables.clear();
}
disposables.clear();
if (subscribeButtonMonitor != null) {
subscribeButtonMonitor.dispose();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
import static org.schabi.newpipe.util.ThemeHelper.resolveResourceIdFromAttr;

public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
private CompositeDisposable disposables;
private final CompositeDisposable disposables = new CompositeDisposable();
private Subscription bookmarkReactor;
private AtomicBoolean isBookmarkButtonReady;

Expand Down Expand Up @@ -94,7 +94,6 @@ public static PlaylistFragment getInstance(final int serviceId, final String url
@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
disposables = new CompositeDisposable();
isBookmarkButtonReady = new AtomicBoolean(false);
remotePlaylistManager = new RemotePlaylistManager(NewPipeDatabase
.getInstance(requireContext()));
Expand Down Expand Up @@ -186,17 +185,15 @@ public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) {

@Override
public void onDestroyView() {
headerBinding = null;
playlistControlBinding = null;

super.onDestroyView();
if (isBookmarkButtonReady != null) {
isBookmarkButtonReady.set(false);
}

if (disposables != null) {
disposables.clear();
}
disposables.clear();
headerBinding = null;
playlistControlBinding = null;

if (bookmarkReactor != null) {
bookmarkReactor.cancel();
}
Expand All @@ -208,11 +205,8 @@ public void onDestroyView() {
public void onDestroy() {
super.onDestroy();

if (disposables != null) {
disposables.dispose();
}
disposables.dispose();

disposables = null;
remotePlaylistManager = null;
playlistEntity = null;
isBookmarkButtonReady = null;
Expand Down
Loading