Skip to content
Snippets Groups Projects
Commit d59e5071 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Remove dead code

parent 8c653b5b
No related branches found
No related tags found
No related merge requests found
......@@ -23,43 +23,15 @@
package org.videolan.vlc.gui;
import android.content.Context;
import androidx.annotation.MainThread;
import androidx.fragment.app.FragmentActivity;
import org.videolan.vlc.PlaybackService;
import java.util.ArrayList;
import java.util.List;
public class PlaybackServiceActivity extends FragmentActivity implements PlaybackService.Client.Callback {
final private Helper mHelper = new Helper(this, this);
protected PlaybackService mService;
@Override
protected void onStart() {
super.onStart();
mHelper.onStart();
}
@Override
protected void onStop() {
super.onStop();
mHelper.onStop();
}
public Helper getHelper() {
return mHelper;
}
@Override
public void onConnected(PlaybackService service) {
mService = service;
}
import androidx.annotation.MainThread;
@Override
public void onDisconnected() {
mService = null;
}
public class PlaybackServiceActivity {
public static class Helper {
private List<PlaybackService.Client.Callback> mFragmentCallbacks = new ArrayList<PlaybackService.Client.Callback>();
......
/*
* *************************************************************************
* PlaybackServiceFragment.java
* **************************************************************************
* Copyright © 2015 VLC authors, VideoLAN, and VideoLabs
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* ***************************************************************************
*/
package org.videolan.vlc.gui;
import android.app.Activity;
import androidx.fragment.app.Fragment;
import org.videolan.vlc.PlaybackService;
import org.videolan.vlc.gui.video.VideoPlayerActivity;
public abstract class PlaybackServiceFragment extends Fragment implements PlaybackService.Client.Callback {
protected PlaybackService mService;
public static PlaybackServiceActivity.Helper getHelper(Activity activity) {
if (activity == null)
return null;
else if ((activity instanceof PlaybackServiceActivity))
return ((PlaybackServiceActivity) activity).getHelper();
else if ((activity instanceof VideoPlayerActivity))
return ((VideoPlayerActivity) activity).getHelper();
else
return null;
}
private static void registerPlaybackService(Activity activity, PlaybackService.Client.Callback cb) {
final PlaybackServiceActivity.Helper helper = getHelper(activity);
if (helper != null)
helper.registerFragment(cb);
}
private static void unregisterPlaybackService(Activity activity, PlaybackService.Client.Callback cb) {
final PlaybackServiceActivity.Helper helper = getHelper(activity);
if (helper != null)
helper.unregisterFragment(cb);
}
public static void registerPlaybackService(Fragment fragment, PlaybackService.Client.Callback cb) {
registerPlaybackService(fragment.getActivity(), cb);
}
public static void registerPlaybackService(android.app.Fragment fragment, PlaybackService.Client.Callback cb) {
registerPlaybackService(fragment.getActivity(), cb);
}
public static void unregisterPlaybackService(Fragment fragment, PlaybackService.Client.Callback cb) {
unregisterPlaybackService(fragment.getActivity(), cb);
}
public static void unregisterPlaybackService(android.app.Fragment fragment, PlaybackService.Client.Callback cb) {
unregisterPlaybackService(fragment.getActivity(), cb);
}
@Override
public void onStart(){
super.onStart();
registerPlaybackService(this, this);
}
@Override
public void onStop() {
super.onStop();
unregisterPlaybackService(this, this);
}
@Override
public void onConnected(PlaybackService service) {
mService = service;
}
@Override
public void onDisconnected() {
mService = null;
}
}
......@@ -23,8 +23,6 @@
package org.videolan.vlc.gui.dialogs;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -34,9 +32,10 @@ import android.widget.TextView;
import org.videolan.vlc.PlaybackService;
import org.videolan.vlc.R;
import org.videolan.vlc.gui.PlaybackServiceActivity;
import org.videolan.vlc.gui.PlaybackServiceFragment;
import org.videolan.vlc.gui.helpers.UiTools;
import androidx.annotation.Nullable;
public abstract class PickTimeFragment extends DismissDialogFragment implements View.OnClickListener, View.OnFocusChangeListener,
PlaybackService.Client.Callback {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment