[Android] Remove dead code

Geoffrey Métais git at videolan.org
Thu Aug 31 17:48:13 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Aug 31 17:04:57 2017 +0200| [6ec9eacf625df6d412f5a6920fd7aec88efcd90c] | committer: Geoffrey Métais

Remove dead code

> https://code.videolan.org/videolan/vlc-android/commit/6ec9eacf625df6d412f5a6920fd7aec88efcd90c
---

 .../videolan/vlc/gui/dialogs/AdvOptionsDialog.java    | 14 +++++---------
 .../videolan/vlc/gui/dialogs/JumpToTimeDialog.java    | 19 ++-----------------
 .../videolan/vlc/gui/dialogs/PlaybackSpeedDialog.java | 16 ++--------------
 .../videolan/vlc/gui/dialogs/SelectChapterDialog.java | 18 +++---------------
 .../videolan/vlc/gui/dialogs/SleepTimerDialog.java    | 17 ++---------------
 5 files changed, 14 insertions(+), 70 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java b/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
index e083ba7e3..ff5a6bb08 100644
--- a/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
+++ b/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
@@ -35,7 +35,6 @@ import android.graphics.Color;
 import android.os.Build;
 import android.os.Bundle;
 import android.support.v4.app.DialogFragment;
-import android.support.v4.content.ContextCompat;
 import android.support.v7.preference.PreferenceManager;
 import android.support.v7.widget.GridLayoutManager;
 import android.support.v7.widget.RecyclerView;
@@ -91,7 +90,6 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
     private static final int ID_SHUFFLE = 11 ;
 
     private Activity mActivity;
-    private int mTheme;
     private int mMode = -1;
 
     AutoFitRecyclerView mRecyclerView;
@@ -204,19 +202,19 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
         String tag;
         switch (id) {
             case ID_PLAYBACK_SPEED:
-                newFragment = PlaybackSpeedDialog.newInstance(mTheme);
+                newFragment = PlaybackSpeedDialog.newInstance();
                 tag = "playback_speed";
                 break;
             case ID_JUMP_TO:
-                newFragment = JumpToTimeDialog.newInstance(mTheme);
+                newFragment = JumpToTimeDialog.newInstance();
                 tag = "time";
                 break;
             case ID_SLEEP:
-                newFragment = SleepTimerDialog.newInstance(mTheme);
+                newFragment = SleepTimerDialog.newInstance();
                 tag = "time";
                 break;
             case ID_CHAPTER_TITLE:
-                newFragment = SelectChapterDialog.newInstance(mTheme);
+                newFragment = SelectChapterDialog.newInstance();
                 tag = "select_chapter";
                 break;
             case ID_EQUALIZER:
@@ -230,8 +228,7 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
             default:
                 return;
         }
-        if (newFragment != null)
-            newFragment.show(getActivity().getSupportFragmentManager(), tag);
+        newFragment.show(getActivity().getSupportFragmentManager(), tag);
         dismiss();
     }
 
@@ -661,7 +658,6 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
         public void setSelection(int position) {
             if (mSelection == position || position < 0 || position >= mList.size())
                 return;
-            int formerSelection = mSelection;
             mSelection = position;
             notifyDataSetChanged();
         }
diff --git a/vlc-android/src/org/videolan/vlc/gui/dialogs/JumpToTimeDialog.java b/vlc-android/src/org/videolan/vlc/gui/dialogs/JumpToTimeDialog.java
index 0987cd8ca..914e0835e 100644
--- a/vlc-android/src/org/videolan/vlc/gui/dialogs/JumpToTimeDialog.java
+++ b/vlc-android/src/org/videolan/vlc/gui/dialogs/JumpToTimeDialog.java
@@ -23,9 +23,6 @@
 
 package org.videolan.vlc.gui.dialogs;
 
-import android.os.Bundle;
-import android.support.v4.app.DialogFragment;
-
 import org.videolan.vlc.R;
 
 public class JumpToTimeDialog extends PickTimeFragment {
@@ -34,20 +31,8 @@ public class JumpToTimeDialog extends PickTimeFragment {
         super();
     }
 
-    public static JumpToTimeDialog newInstance(int theme) {
-        JumpToTimeDialog myFragment = new JumpToTimeDialog();
-
-        Bundle args = new Bundle();
-        args.putInt("theme", theme);
-        myFragment.setArguments(args);
-
-        return myFragment;
-    }
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setStyle(DialogFragment.STYLE_NO_FRAME, getArguments().getInt("theme"));
+    public static JumpToTimeDialog newInstance() {
+        return new JumpToTimeDialog();
     }
 
     protected void executeAction() {
diff --git a/vlc-android/src/org/videolan/vlc/gui/dialogs/PlaybackSpeedDialog.java b/vlc-android/src/org/videolan/vlc/gui/dialogs/PlaybackSpeedDialog.java
index 08a710d3f..f0fd1ade5 100644
--- a/vlc-android/src/org/videolan/vlc/gui/dialogs/PlaybackSpeedDialog.java
+++ b/vlc-android/src/org/videolan/vlc/gui/dialogs/PlaybackSpeedDialog.java
@@ -56,20 +56,8 @@ public class PlaybackSpeedDialog extends DialogFragment implements PlaybackServi
     public PlaybackSpeedDialog() {
     }
 
-    public static PlaybackSpeedDialog newInstance(int theme) {
-        PlaybackSpeedDialog myFragment = new PlaybackSpeedDialog();
-
-        Bundle args = new Bundle();
-        args.putInt("theme", theme);
-        myFragment.setArguments(args);
-
-        return myFragment;
-    }
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setStyle(DialogFragment.STYLE_NO_FRAME, getArguments().getInt("theme"));
+    public static PlaybackSpeedDialog newInstance() {
+        return new PlaybackSpeedDialog();
     }
 
     @Override
diff --git a/vlc-android/src/org/videolan/vlc/gui/dialogs/SelectChapterDialog.java b/vlc-android/src/org/videolan/vlc/gui/dialogs/SelectChapterDialog.java
index 0721f169b..4dd002e8a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/dialogs/SelectChapterDialog.java
+++ b/vlc-android/src/org/videolan/vlc/gui/dialogs/SelectChapterDialog.java
@@ -54,27 +54,15 @@ public class SelectChapterDialog extends DialogFragment implements PlaybackServi
     public SelectChapterDialog() {
     }
 
-    public static SelectChapterDialog newInstance(int theme) {
-        SelectChapterDialog myFragment = new SelectChapterDialog();
-
-        Bundle args = new Bundle();
-        args.putInt("theme", theme);
-        myFragment.setArguments(args);
-
-        return myFragment;
-    }
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setStyle(DialogFragment.STYLE_NO_FRAME, getArguments().getInt("theme"));
+    public static SelectChapterDialog newInstance() {
+        return new SelectChapterDialog();
     }
 
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container,
                              Bundle savedInstanceState) {
         View view = inflater.inflate(R.layout.dialog_select_chapter, container);
-        mChapterList = (ListView) view.findViewById(R.id.chapter_list);
+        mChapterList = view.findViewById(R.id.chapter_list);
 
         getDialog().setCancelable(true);
         getDialog().setCanceledOnTouchOutside(true);
diff --git a/vlc-android/src/org/videolan/vlc/gui/dialogs/SleepTimerDialog.java b/vlc-android/src/org/videolan/vlc/gui/dialogs/SleepTimerDialog.java
index e4eeaf4e3..e84a94780 100644
--- a/vlc-android/src/org/videolan/vlc/gui/dialogs/SleepTimerDialog.java
+++ b/vlc-android/src/org/videolan/vlc/gui/dialogs/SleepTimerDialog.java
@@ -23,7 +23,6 @@
 package org.videolan.vlc.gui.dialogs;
 
 import android.os.Bundle;
-import android.support.v4.app.DialogFragment;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -40,20 +39,8 @@ public class SleepTimerDialog extends PickTimeFragment {
         super();
     }
 
-    public static SleepTimerDialog newInstance(int theme) {
-        SleepTimerDialog myFragment = new SleepTimerDialog();
-
-        Bundle args = new Bundle();
-        args.putInt("theme", theme);
-        myFragment.setArguments(args);
-
-        return myFragment;
-    }
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setStyle(DialogFragment.STYLE_NO_FRAME, getArguments().getInt("theme"));
+    public static SleepTimerDialog newInstance() {
+        return new SleepTimerDialog();
     }
 
     @Override



More information about the Android mailing list