Merge pull request #3815 from ByteHamster/remove-unused-code
Removed unused code
This commit is contained in:
commit
37ef5438bb
|
@ -111,20 +111,13 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
|
||||||
private Toolbar toolbar;
|
private Toolbar toolbar;
|
||||||
private ExternalPlayerFragment externalPlayerFragment;
|
private ExternalPlayerFragment externalPlayerFragment;
|
||||||
private DrawerLayout drawerLayout;
|
private DrawerLayout drawerLayout;
|
||||||
|
|
||||||
private View navDrawer;
|
private View navDrawer;
|
||||||
private ListView navList;
|
private ListView navList;
|
||||||
private NavListAdapter navAdapter;
|
private NavListAdapter navAdapter;
|
||||||
private int mPosition = -1;
|
private int mPosition = -1;
|
||||||
|
|
||||||
private ActionBarDrawerToggle drawerToggle;
|
private ActionBarDrawerToggle drawerToggle;
|
||||||
|
|
||||||
private CharSequence currentTitle;
|
private CharSequence currentTitle;
|
||||||
|
|
||||||
private ProgressDialog pd;
|
|
||||||
|
|
||||||
private Disposable disposable;
|
private Disposable disposable;
|
||||||
|
|
||||||
private long lastBackButtonPressTime = 0;
|
private long lastBackButtonPressTime = 0;
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
|
@ -282,10 +275,6 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
|
||||||
return drawerLayout != null && navDrawer != null && drawerLayout.isDrawerOpen(navDrawer);
|
return drawerLayout != null && navDrawer != null && drawerLayout.isDrawerOpen(navDrawer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Feed> getFeeds() {
|
|
||||||
return (navDrawerData != null) ? navDrawerData.feeds : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void loadFragment(int index, Bundle args) {
|
private void loadFragment(int index, Bundle args) {
|
||||||
Log.d(TAG, "loadFragment(index: " + index + ", args: " + args + ")");
|
Log.d(TAG, "loadFragment(index: " + index + ", args: " + args + ")");
|
||||||
if (index < navAdapter.getSubscriptionOffset()) {
|
if (index < navAdapter.getSubscriptionOffset()) {
|
||||||
|
@ -518,9 +507,6 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
|
||||||
if (disposable != null) {
|
if (disposable != null) {
|
||||||
disposable.dispose();
|
disposable.dispose();
|
||||||
}
|
}
|
||||||
if(pd != null) {
|
|
||||||
pd.dismiss();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -849,9 +835,4 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
|
||||||
super.onNewIntent(intent);
|
super.onNewIntent(intent);
|
||||||
setIntent(intent);
|
setIntent(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
public void updateNavDrawer() {
|
|
||||||
navAdapter.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,44 +0,0 @@
|
||||||
package de.danoeh.antennapod.view;
|
|
||||||
|
|
||||||
import android.util.Log;
|
|
||||||
import android.view.GestureDetector;
|
|
||||||
import android.view.MotionEvent;
|
|
||||||
|
|
||||||
public class SwipeGestureDetector extends GestureDetector.SimpleOnGestureListener {
|
|
||||||
|
|
||||||
private static final String TAG = "SwipeGestureDetector";
|
|
||||||
|
|
||||||
private static final int SWIPE_MIN_DISTANCE = 120;
|
|
||||||
private static final int SWIPE_MAX_OFF_PATH = 250;
|
|
||||||
private static final int SWIPE_THRESHOLD_VELOCITY = 200;
|
|
||||||
|
|
||||||
private final OnSwipeGesture callback;
|
|
||||||
|
|
||||||
public SwipeGestureDetector(OnSwipeGesture callback) {
|
|
||||||
this.callback = callback;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onDown(MotionEvent e) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
|
|
||||||
try {
|
|
||||||
if (Math.abs(e1.getY() - e2.getY()) > SWIPE_MAX_OFF_PATH)
|
|
||||||
return false;
|
|
||||||
if (e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE
|
|
||||||
&& Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) {
|
|
||||||
return callback.onSwipeRightToLeft();
|
|
||||||
} else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE
|
|
||||||
&& Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) {
|
|
||||||
return callback.onSwipeLeftToRight();
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.d(TAG, Log.getStackTraceString(e));
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -805,14 +805,6 @@ public class UserPreferences {
|
||||||
prefs.edit().putString(PREF_MEDIA_PLAYER, "sonic").apply();
|
prefs.edit().putString(PREF_MEDIA_PLAYER, "sonic").apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void enableExoplayer() {
|
|
||||||
prefs.edit().putString(PREF_MEDIA_PLAYER, PREF_MEDIA_PLAYER_EXOPLAYER).apply();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void enableBuiltin() {
|
|
||||||
prefs.edit().putString(PREF_MEDIA_PLAYER, "builtin").apply();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean stereoToMono() {
|
public static boolean stereoToMono() {
|
||||||
return prefs.getBoolean(PREF_STEREO_TO_MONO, false);
|
return prefs.getBoolean(PREF_STEREO_TO_MONO, false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,7 +151,6 @@ public class PlaybackService extends MediaBrowserServiceCompat {
|
||||||
public static final int EXTRA_CODE_CAST = 3;
|
public static final int EXTRA_CODE_CAST = 3;
|
||||||
|
|
||||||
public static final int NOTIFICATION_TYPE_ERROR = 0;
|
public static final int NOTIFICATION_TYPE_ERROR = 0;
|
||||||
public static final int NOTIFICATION_TYPE_INFO = 1;
|
|
||||||
public static final int NOTIFICATION_TYPE_BUFFER_UPDATE = 2;
|
public static final int NOTIFICATION_TYPE_BUFFER_UPDATE = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -26,36 +26,4 @@ public abstract class QueueAccess {
|
||||||
|
|
||||||
private QueueAccess() {
|
private QueueAccess() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static QueueAccess ItemListAccess(final List<FeedItem> items) {
|
|
||||||
return new QueueAccess() {
|
|
||||||
@Override
|
|
||||||
public boolean contains(long id) {
|
|
||||||
if (items == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
for (FeedItem item : items) {
|
|
||||||
if (item.getId() == id) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean remove(long id) {
|
|
||||||
Iterator<FeedItem> it = items.iterator();
|
|
||||||
FeedItem item;
|
|
||||||
while (it.hasNext()) {
|
|
||||||
item = it.next();
|
|
||||||
if (item.getId() == id) {
|
|
||||||
it.remove();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue