Code rearanged
This commit is contained in:
parent
00e3724ab4
commit
6aaf926ff7
27 changed files with 107 additions and 158 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
package com.kabouzeid.gramophone;
|
package com.kabouzeid.gramophone;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.res.Configuration;
|
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
|
||||||
import com.android.volley.Request;
|
import com.android.volley.Request;
|
||||||
|
|
@ -12,7 +11,6 @@ import com.kabouzeid.gramophone.helper.MusicPlayerRemote;
|
||||||
import com.kabouzeid.gramophone.misc.AppKeys;
|
import com.kabouzeid.gramophone.misc.AppKeys;
|
||||||
import com.squareup.otto.Bus;
|
import com.squareup.otto.Bus;
|
||||||
import com.squareup.otto.ThreadEnforcer;
|
import com.squareup.otto.ThreadEnforcer;
|
||||||
import com.squareup.picasso.Picasso;
|
|
||||||
|
|
||||||
import io.fabric.sdk.android.Fabric;
|
import io.fabric.sdk.android.Fabric;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,9 @@ public class CreatePlaylistDialogHelper {
|
||||||
public static MaterialDialog getDialog(final Context context, final List<Song> songs) {
|
public static MaterialDialog getDialog(final Context context, final List<Song> songs) {
|
||||||
final EditText editText = new EditText(context);
|
final EditText editText = new EditText(context);
|
||||||
ViewGroup layout = (ViewGroup) LayoutInflater.from(context).inflate(R.layout.dialog_empty_frame, null);
|
ViewGroup layout = (ViewGroup) LayoutInflater.from(context).inflate(R.layout.dialog_empty_frame, null);
|
||||||
if (editText.getParent() != null) {((ViewGroup) editText.getParent()).removeView(editText);}
|
if (editText.getParent() != null) {
|
||||||
|
((ViewGroup) editText.getParent()).removeView(editText);
|
||||||
|
}
|
||||||
layout.addView(editText, new LinearLayout.LayoutParams(
|
layout.addView(editText, new LinearLayout.LayoutParams(
|
||||||
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
|
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
|
||||||
return new MaterialDialog.Builder(context)
|
return new MaterialDialog.Builder(context)
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,6 @@ import android.app.TaskStackBuilder;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Bitmap;
|
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import android.support.v4.app.NotificationCompat;
|
import android.support.v4.app.NotificationCompat;
|
||||||
import android.widget.RemoteViews;
|
import android.widget.RemoteViews;
|
||||||
|
|
||||||
|
|
@ -21,9 +19,7 @@ import com.kabouzeid.gramophone.model.Song;
|
||||||
import com.kabouzeid.gramophone.service.MusicService;
|
import com.kabouzeid.gramophone.service.MusicService;
|
||||||
import com.kabouzeid.gramophone.ui.activities.MusicControllerActivity;
|
import com.kabouzeid.gramophone.ui.activities.MusicControllerActivity;
|
||||||
import com.kabouzeid.gramophone.util.MusicUtil;
|
import com.kabouzeid.gramophone.util.MusicUtil;
|
||||||
import com.squareup.picasso.MemoryPolicy;
|
|
||||||
import com.squareup.picasso.Picasso;
|
import com.squareup.picasso.Picasso;
|
||||||
import com.squareup.picasso.Target;
|
|
||||||
|
|
||||||
public class PlayingNotificationHelper {
|
public class PlayingNotificationHelper {
|
||||||
public static final String TAG = PlayingNotificationHelper.class.getSimpleName();
|
public static final String TAG = PlayingNotificationHelper.class.getSimpleName();
|
||||||
|
|
@ -165,7 +161,9 @@ public class PlayingNotificationHelper {
|
||||||
notificationLayout.setImageViewResource(R.id.album_art, R.drawable.default_album_art);
|
notificationLayout.setImageViewResource(R.id.album_art, R.drawable.default_album_art);
|
||||||
notificationLayoutExpanded.setImageViewResource(R.id.album_art, R.drawable.default_album_art);
|
notificationLayoutExpanded.setImageViewResource(R.id.album_art, R.drawable.default_album_art);
|
||||||
notificationManager.notify(NOTIFICATION_ID, notification);
|
notificationManager.notify(NOTIFICATION_ID, notification);
|
||||||
};
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
public void killNotification() {
|
public void killNotification() {
|
||||||
service.stopForeground(true);
|
service.stopForeground(true);
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import com.afollestad.materialdialogs.MaterialDialog;
|
||||||
import com.kabouzeid.gramophone.R;
|
import com.kabouzeid.gramophone.R;
|
||||||
import com.kabouzeid.gramophone.adapter.PlayingQueueAdapter;
|
import com.kabouzeid.gramophone.adapter.PlayingQueueAdapter;
|
||||||
import com.kabouzeid.gramophone.model.Song;
|
import com.kabouzeid.gramophone.model.Song;
|
||||||
import com.kabouzeid.gramophone.util.PlaylistsUtil;
|
|
||||||
import com.mobeta.android.dslv.DragSortListView;
|
import com.mobeta.android.dslv.DragSortListView;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,10 @@
|
||||||
package com.kabouzeid.gramophone.lastfm.artist;
|
package com.kabouzeid.gramophone.lastfm.artist;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Bitmap;
|
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.android.volley.Response;
|
import com.android.volley.Response;
|
||||||
import com.kabouzeid.gramophone.provider.ArtistJSONStore;
|
import com.kabouzeid.gramophone.provider.ArtistJSONStore;
|
||||||
import com.squareup.picasso.Picasso;
|
|
||||||
import com.squareup.picasso.Target;
|
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,7 @@ import android.database.Cursor;
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
import android.provider.MediaStore.Audio.AudioColumns;
|
import android.provider.MediaStore.Audio.AudioColumns;
|
||||||
|
|
||||||
import com.kabouzeid.gramophone.model.Playlist;
|
|
||||||
import com.kabouzeid.gramophone.model.PlaylistSong;
|
import com.kabouzeid.gramophone.model.PlaylistSong;
|
||||||
import com.kabouzeid.gramophone.model.Song;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
||||||
|
|
@ -26,13 +26,11 @@ import android.graphics.Canvas;
|
||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.graphics.drawable.BitmapDrawable;
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.support.annotation.Nullable;
|
|
||||||
|
|
||||||
import java.lang.reflect.Modifier;
|
|
||||||
|
|
||||||
|
|
||||||
public class DragSortRecycler extends RecyclerView.ItemDecoration implements RecyclerView.OnItemTouchListener {
|
public class DragSortRecycler extends RecyclerView.ItemDecoration implements RecyclerView.OnItemTouchListener {
|
||||||
|
|
@ -72,69 +70,60 @@ public class DragSortRecycler extends RecyclerView.ItemDecoration implements Rec
|
||||||
OnDragStateChangedListener dragStateChangedListener;
|
OnDragStateChangedListener dragStateChangedListener;
|
||||||
|
|
||||||
|
|
||||||
|
public interface OnItemMovedListener {
|
||||||
public interface OnItemMovedListener
|
|
||||||
{
|
|
||||||
public void onItemMoved(int from, int to);
|
public void onItemMoved(int from, int to);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface OnDragStateChangedListener {
|
public interface OnDragStateChangedListener {
|
||||||
public void onDragStart();
|
public void onDragStart();
|
||||||
|
|
||||||
public void onDragStop();
|
public void onDragStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void debugLog(String log)
|
private void debugLog(String log) {
|
||||||
{
|
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
Log.d(TAG, log);
|
Log.d(TAG, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
public RecyclerView.OnScrollListener getScrollListener()
|
public RecyclerView.OnScrollListener getScrollListener() {
|
||||||
{
|
|
||||||
return scrollListener;
|
return scrollListener;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set the item move interface
|
* Set the item move interface
|
||||||
*/
|
*/
|
||||||
public void setOnItemMovedListener(OnItemMovedListener swif)
|
public void setOnItemMovedListener(OnItemMovedListener swif) {
|
||||||
{
|
|
||||||
moveInterface = swif;
|
moveInterface = swif;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setViewHandleId(int id)
|
public void setViewHandleId(int id) {
|
||||||
{
|
|
||||||
viewHandleId = id;
|
viewHandleId = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLeftDragArea(int w)
|
public void setLeftDragArea(int w) {
|
||||||
{
|
|
||||||
dragHandleWidth = w;
|
dragHandleWidth = w;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFloatingAlpha(float a)
|
public void setFloatingAlpha(float a) {
|
||||||
{
|
|
||||||
floatingItemAlpha = a;
|
floatingItemAlpha = a;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFloatingBgColor(int c)
|
public void setFloatingBgColor(int c) {
|
||||||
{
|
|
||||||
floatingItemBgColor = c;
|
floatingItemBgColor = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Set the window at top and bottom of list, must be between 0 and 0.5
|
Set the window at top and bottom of list, must be between 0 and 0.5
|
||||||
For example 0.1 uses the top and bottom 10% of the lists for scrolling
|
For example 0.1 uses the top and bottom 10% of the lists for scrolling
|
||||||
*/
|
*/
|
||||||
public void setAutoScrollWindow(float w)
|
public void setAutoScrollWindow(float w) {
|
||||||
{
|
|
||||||
autoScrollWindow = w;
|
autoScrollWindow = w;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Set the autoscroll speed, default is 0.5
|
Set the autoscroll speed, default is 0.5
|
||||||
*/
|
*/
|
||||||
public void setAutoScrollSpeed(float speed)
|
public void setAutoScrollSpeed(float speed) {
|
||||||
{
|
|
||||||
autoScrollSpeed = speed;
|
autoScrollSpeed = speed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -145,8 +134,7 @@ public class DragSortRecycler extends RecyclerView.ItemDecoration implements Rec
|
||||||
debugLog("getItemOffsets");
|
debugLog("getItemOffsets");
|
||||||
|
|
||||||
debugLog("View top = " + view.getTop());
|
debugLog("View top = " + view.getTop());
|
||||||
if (selectedDragItemPos != -1)
|
if (selectedDragItemPos != -1) {
|
||||||
{
|
|
||||||
int itemPos = rv.getChildPosition(view);
|
int itemPos = rv.getChildPosition(view);
|
||||||
debugLog("itemPos =" + itemPos);
|
debugLog("itemPos =" + itemPos);
|
||||||
|
|
||||||
|
|
@ -157,12 +145,9 @@ public class DragSortRecycler extends RecyclerView.ItemDecoration implements Rec
|
||||||
//Movement of finger
|
//Movement of finger
|
||||||
float totalMovement = fingerY - fingerAnchorY;
|
float totalMovement = fingerY - fingerAnchorY;
|
||||||
|
|
||||||
if (itemPos == selectedDragItemPos)
|
if (itemPos == selectedDragItemPos) {
|
||||||
{
|
|
||||||
view.setVisibility(View.INVISIBLE);
|
view.setVisibility(View.INVISIBLE);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
//Make view visible incase invisible
|
//Make view visible incase invisible
|
||||||
view.setVisibility(View.VISIBLE);
|
view.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
|
@ -173,8 +158,7 @@ public class DragSortRecycler extends RecyclerView.ItemDecoration implements Rec
|
||||||
//These will auto-animate if the device continually sends touch motion events
|
//These will auto-animate if the device continually sends touch motion events
|
||||||
// if (totalMovment>0)
|
// if (totalMovment>0)
|
||||||
{
|
{
|
||||||
if ((itemPos > selectedDragItemPos) && (view.getTop() < floatMiddleY))
|
if ((itemPos > selectedDragItemPos) && (view.getTop() < floatMiddleY)) {
|
||||||
{
|
|
||||||
float amountUp = (floatMiddleY - view.getTop()) / (float) view.getHeight();
|
float amountUp = (floatMiddleY - view.getTop()) / (float) view.getHeight();
|
||||||
// amountUp *= 0.5f;
|
// amountUp *= 0.5f;
|
||||||
if (amountUp > 1)
|
if (amountUp > 1)
|
||||||
|
|
@ -187,8 +171,7 @@ public class DragSortRecycler extends RecyclerView.ItemDecoration implements Rec
|
||||||
}//Moving up the list
|
}//Moving up the list
|
||||||
// else if (totalMovment < 0)
|
// else if (totalMovment < 0)
|
||||||
{
|
{
|
||||||
if((itemPos < selectedDragItemPos) && (view.getBottom() > floatMiddleY))
|
if ((itemPos < selectedDragItemPos) && (view.getBottom() > floatMiddleY)) {
|
||||||
{
|
|
||||||
float amountDown = ((float) view.getBottom() - floatMiddleY) / (float) view.getHeight();
|
float amountDown = ((float) view.getBottom() - floatMiddleY) / (float) view.getHeight();
|
||||||
// amountDown *= 0.5f;
|
// amountDown *= 0.5f;
|
||||||
if (amountDown > 1)
|
if (amountDown > 1)
|
||||||
|
|
@ -199,9 +182,7 @@ public class DragSortRecycler extends RecyclerView.ItemDecoration implements Rec
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
outRect.top = 0;
|
outRect.top = 0;
|
||||||
outRect.bottom = 0;
|
outRect.bottom = 0;
|
||||||
//Make view visible incase invisible
|
//Make view visible incase invisible
|
||||||
|
|
@ -215,8 +196,7 @@ public class DragSortRecycler extends RecyclerView.ItemDecoration implements Rec
|
||||||
* This *seems* to work, another method would be to use
|
* This *seems* to work, another method would be to use
|
||||||
* getItemOffsets, but I think that could miss items?..
|
* getItemOffsets, but I think that could miss items?..
|
||||||
*/
|
*/
|
||||||
private int getNewPostion(RecyclerView rv)
|
private int getNewPostion(RecyclerView rv) {
|
||||||
{
|
|
||||||
int itemsOnScreen = rv.getLayoutManager().getChildCount();
|
int itemsOnScreen = rv.getLayoutManager().getChildCount();
|
||||||
|
|
||||||
float floatMiddleY = floatingItemBounds.top + floatingItemBounds.height() / 2;
|
float floatMiddleY = floatingItemBounds.top + floatingItemBounds.height() / 2;
|
||||||
|
|
@ -241,8 +221,7 @@ public class DragSortRecycler extends RecyclerView.ItemDecoration implements Rec
|
||||||
{
|
{
|
||||||
if (itemPos > above)
|
if (itemPos > above)
|
||||||
above = itemPos;
|
above = itemPos;
|
||||||
}
|
} else if (floatMiddleY <= viewMiddleY) //Is below this item
|
||||||
else if (floatMiddleY <= viewMiddleY) //Is below this item
|
|
||||||
{
|
{
|
||||||
if (itemPos < below)
|
if (itemPos < below)
|
||||||
below = itemPos;
|
below = itemPos;
|
||||||
|
|
@ -254,9 +233,7 @@ public class DragSortRecycler extends RecyclerView.ItemDecoration implements Rec
|
||||||
if (below < selectedDragItemPos) //Need to count itself
|
if (below < selectedDragItemPos) //Need to count itself
|
||||||
below++;
|
below++;
|
||||||
return below - 1;
|
return below - 1;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
if (above < selectedDragItemPos)
|
if (above < selectedDragItemPos)
|
||||||
above++;
|
above++;
|
||||||
|
|
||||||
|
|
@ -278,17 +255,13 @@ public class DragSortRecycler extends RecyclerView.ItemDecoration implements Rec
|
||||||
|
|
||||||
boolean dragging = false;
|
boolean dragging = false;
|
||||||
|
|
||||||
if ((dragHandleWidth > 0 ) && (e.getX() < dragHandleWidth))
|
if ((dragHandleWidth > 0) && (e.getX() < dragHandleWidth)) {
|
||||||
{
|
|
||||||
dragging = true;
|
dragging = true;
|
||||||
}
|
} else if (viewHandleId != -1) {
|
||||||
else if (viewHandleId != -1)
|
|
||||||
{
|
|
||||||
//Find the handle in the list item
|
//Find the handle in the list item
|
||||||
View handleView = itemView.findViewById(viewHandleId);
|
View handleView = itemView.findViewById(viewHandleId);
|
||||||
|
|
||||||
if (handleView == null)
|
if (handleView == null) {
|
||||||
{
|
|
||||||
Log.e(TAG, "The view ID " + viewHandleId + " was not found in the RecycleView item");
|
Log.e(TAG, "The view ID " + viewHandleId + " was not found in the RecycleView item");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -322,8 +295,7 @@ public class DragSortRecycler extends RecyclerView.ItemDecoration implements Rec
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (dragging)
|
if (dragging) {
|
||||||
{
|
|
||||||
debugLog("Started Drag");
|
debugLog("Started Drag");
|
||||||
|
|
||||||
setIsDragging(true);
|
setIsDragging(true);
|
||||||
|
|
@ -348,10 +320,8 @@ public class DragSortRecycler extends RecyclerView.ItemDecoration implements Rec
|
||||||
debugLog("onTouchEvent");
|
debugLog("onTouchEvent");
|
||||||
|
|
||||||
if ((e.getAction() == MotionEvent.ACTION_UP) ||
|
if ((e.getAction() == MotionEvent.ACTION_UP) ||
|
||||||
(e.getAction() == MotionEvent.ACTION_CANCEL))
|
(e.getAction() == MotionEvent.ACTION_CANCEL)) {
|
||||||
{
|
if ((e.getAction() == MotionEvent.ACTION_UP) && selectedDragItemPos != -1) {
|
||||||
if ((e.getAction() == MotionEvent.ACTION_UP) && selectedDragItemPos != -1)
|
|
||||||
{
|
|
||||||
int newPos = getNewPostion(rv);
|
int newPos = getNewPostion(rv);
|
||||||
if (moveInterface != null)
|
if (moveInterface != null)
|
||||||
moveInterface.onItemMoved(selectedDragItemPos, newPos);
|
moveInterface.onItemMoved(selectedDragItemPos, newPos);
|
||||||
|
|
@ -367,8 +337,7 @@ public class DragSortRecycler extends RecyclerView.ItemDecoration implements Rec
|
||||||
|
|
||||||
fingerY = (int) e.getY();
|
fingerY = (int) e.getY();
|
||||||
|
|
||||||
if (floatingItem!=null)
|
if (floatingItem != null) {
|
||||||
{
|
|
||||||
floatingItemBounds.top = fingerY - fingerOffsetInViewY;
|
floatingItemBounds.top = fingerY - fingerOffsetInViewY;
|
||||||
|
|
||||||
if (floatingItemBounds.top < -floatingItemStatingBounds.height() / 2) //Allow half the view out the top
|
if (floatingItemBounds.top < -floatingItemStatingBounds.height() / 2) //Allow half the view out the top
|
||||||
|
|
@ -381,12 +350,9 @@ public class DragSortRecycler extends RecyclerView.ItemDecoration implements Rec
|
||||||
|
|
||||||
//Do auto scrolling at end of list
|
//Do auto scrolling at end of list
|
||||||
float scrollAmount = 0;
|
float scrollAmount = 0;
|
||||||
if (fingerY > (rv.getHeight() * (1-autoScrollWindow)))
|
if (fingerY > (rv.getHeight() * (1 - autoScrollWindow))) {
|
||||||
{
|
|
||||||
scrollAmount = (fingerY - (rv.getHeight() * (1 - autoScrollWindow)));
|
scrollAmount = (fingerY - (rv.getHeight() * (1 - autoScrollWindow)));
|
||||||
}
|
} else if (fingerY < (rv.getHeight() * autoScrollWindow)) {
|
||||||
else if (fingerY < (rv.getHeight() * autoScrollWindow))
|
|
||||||
{
|
|
||||||
scrollAmount = (fingerY - (rv.getHeight() * autoScrollWindow));
|
scrollAmount = (fingerY - (rv.getHeight() * autoScrollWindow));
|
||||||
}
|
}
|
||||||
debugLog("Scroll: " + scrollAmount);
|
debugLog("Scroll: " + scrollAmount);
|
||||||
|
|
@ -416,6 +382,7 @@ public class DragSortRecycler extends RecyclerView.ItemDecoration implements Rec
|
||||||
|
|
||||||
|
|
||||||
Paint bgColor = new Paint();
|
Paint bgColor = new Paint();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) {
|
public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) {
|
||||||
if (floatingItem != null) {
|
if (floatingItem != null) {
|
||||||
|
|
@ -441,8 +408,6 @@ public class DragSortRecycler extends RecyclerView.ItemDecoration implements Rec
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param position
|
* @param position
|
||||||
* @return True if we can drag the item over this position, False if not.
|
* @return True if we can drag the item over this position, False if not.
|
||||||
*/
|
*/
|
||||||
|
|
@ -451,8 +416,7 @@ public class DragSortRecycler extends RecyclerView.ItemDecoration implements Rec
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private BitmapDrawable createFloatingBitmap(View v)
|
private BitmapDrawable createFloatingBitmap(View v) {
|
||||||
{
|
|
||||||
floatingItemStatingBounds = new Rect(v.getLeft(), v.getTop(), v.getRight(), v.getBottom());
|
floatingItemStatingBounds = new Rect(v.getLeft(), v.getTop(), v.getRight(), v.getBottom());
|
||||||
floatingItemBounds = new Rect(floatingItemStatingBounds);
|
floatingItemBounds = new Rect(floatingItemStatingBounds);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package com.kabouzeid.gramophone.model;
|
package com.kabouzeid.gramophone.model;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Bitmap;
|
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
|
||||||
import com.kabouzeid.gramophone.R;
|
import com.kabouzeid.gramophone.R;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ package com.kabouzeid.gramophone.service;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
|
||||||
public class MediaButtonIntentReceiver extends BroadcastReceiver {
|
public class MediaButtonIntentReceiver extends BroadcastReceiver {
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ import com.kabouzeid.gramophone.App;
|
||||||
import com.kabouzeid.gramophone.R;
|
import com.kabouzeid.gramophone.R;
|
||||||
import com.kabouzeid.gramophone.adapter.songadapter.AlbumSongAdapter;
|
import com.kabouzeid.gramophone.adapter.songadapter.AlbumSongAdapter;
|
||||||
import com.kabouzeid.gramophone.comparator.SongTrackNumberComparator;
|
import com.kabouzeid.gramophone.comparator.SongTrackNumberComparator;
|
||||||
import com.kabouzeid.gramophone.interfaces.KabViewsDisableAble;
|
|
||||||
import com.kabouzeid.gramophone.loader.AlbumLoader;
|
import com.kabouzeid.gramophone.loader.AlbumLoader;
|
||||||
import com.kabouzeid.gramophone.loader.AlbumSongLoader;
|
import com.kabouzeid.gramophone.loader.AlbumSongLoader;
|
||||||
import com.kabouzeid.gramophone.misc.AppKeys;
|
import com.kabouzeid.gramophone.misc.AppKeys;
|
||||||
|
|
|
||||||
|
|
@ -14,29 +14,24 @@ import android.support.v7.app.ActionBar;
|
||||||
import android.support.v7.app.ActionBarDrawerToggle;
|
import android.support.v7.app.ActionBarDrawerToggle;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.util.SparseArray;
|
import android.util.SparseArray;
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.afollestad.materialdialogs.MaterialDialog;
|
|
||||||
import com.google.samples.apps.iosched.ui.widget.SlidingTabLayout;
|
import com.google.samples.apps.iosched.ui.widget.SlidingTabLayout;
|
||||||
import com.kabouzeid.gramophone.R;
|
import com.kabouzeid.gramophone.R;
|
||||||
import com.kabouzeid.gramophone.helper.AboutDeveloperDialogHelper;
|
import com.kabouzeid.gramophone.helper.AboutDeveloperDialogHelper;
|
||||||
import com.kabouzeid.gramophone.helper.CreatePlaylistDialogHelper;
|
import com.kabouzeid.gramophone.helper.CreatePlaylistDialogHelper;
|
||||||
import com.kabouzeid.gramophone.helper.MusicPlayerRemote;
|
import com.kabouzeid.gramophone.helper.MusicPlayerRemote;
|
||||||
import com.kabouzeid.gramophone.helper.PlayingQueueDialogHelper;
|
|
||||||
import com.kabouzeid.gramophone.interfaces.KabViewsDisableAble;
|
import com.kabouzeid.gramophone.interfaces.KabViewsDisableAble;
|
||||||
import com.kabouzeid.gramophone.model.MusicRemoteEvent;
|
import com.kabouzeid.gramophone.model.MusicRemoteEvent;
|
||||||
import com.kabouzeid.gramophone.model.Song;
|
import com.kabouzeid.gramophone.model.Song;
|
||||||
import com.kabouzeid.gramophone.ui.activities.base.AbsFabActivity;
|
import com.kabouzeid.gramophone.ui.activities.base.AbsFabActivity;
|
||||||
import com.kabouzeid.gramophone.ui.fragments.NavigationDrawerFragment;
|
import com.kabouzeid.gramophone.ui.fragments.NavigationDrawerFragment;
|
||||||
|
import com.kabouzeid.gramophone.ui.fragments.mainactivityfragments.AbsMainActivityFragment;
|
||||||
import com.kabouzeid.gramophone.ui.fragments.mainactivityfragments.AlbumViewFragment;
|
import com.kabouzeid.gramophone.ui.fragments.mainactivityfragments.AlbumViewFragment;
|
||||||
import com.kabouzeid.gramophone.ui.fragments.mainactivityfragments.ArtistViewFragment;
|
import com.kabouzeid.gramophone.ui.fragments.mainactivityfragments.ArtistViewFragment;
|
||||||
import com.kabouzeid.gramophone.ui.fragments.mainactivityfragments.AbsMainActivityFragment;
|
|
||||||
import com.kabouzeid.gramophone.ui.fragments.mainactivityfragments.PlaylistViewFragment;
|
import com.kabouzeid.gramophone.ui.fragments.mainactivityfragments.PlaylistViewFragment;
|
||||||
import com.kabouzeid.gramophone.ui.fragments.mainactivityfragments.SongViewFragment;
|
import com.kabouzeid.gramophone.ui.fragments.mainactivityfragments.SongViewFragment;
|
||||||
import com.kabouzeid.gramophone.util.MusicUtil;
|
import com.kabouzeid.gramophone.util.MusicUtil;
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,9 @@ import android.provider.MediaStore;
|
||||||
*/
|
*/
|
||||||
public final class SortOrder {
|
public final class SortOrder {
|
||||||
|
|
||||||
/** This class is never instantiated */
|
/**
|
||||||
|
* This class is never instantiated
|
||||||
|
*/
|
||||||
public SortOrder() {
|
public SortOrder() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue