Code rearanged
This commit is contained in:
parent
00e3724ab4
commit
6aaf926ff7
27 changed files with 107 additions and 158 deletions
|
|
@ -28,7 +28,7 @@ public class AddToPlaylistDialogHelper {
|
|||
CharSequence[] playlistNames = new CharSequence[playlists.size() + 1];
|
||||
playlistNames[0] = context.getResources().getString(R.string.action_new_playlist);
|
||||
for (int i = 1; i < playlistNames.length; i++) {
|
||||
playlistNames[i] = playlists.get(i-1).name;
|
||||
playlistNames[i] = playlists.get(i - 1).name;
|
||||
}
|
||||
return new MaterialDialog.Builder(context)
|
||||
.items(playlistNames)
|
||||
|
|
|
|||
|
|
@ -27,7 +27,9 @@ public class CreatePlaylistDialogHelper {
|
|||
public static MaterialDialog getDialog(final Context context, final List<Song> songs) {
|
||||
final EditText editText = new EditText(context);
|
||||
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(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
|
||||
return new MaterialDialog.Builder(context)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import com.kabouzeid.gramophone.util.PlaylistsUtil;
|
|||
* Created by karim on 19.03.15.
|
||||
*/
|
||||
public class DeletePlaylistDialogHelper {
|
||||
public static MaterialDialog getDialog(final Context context, final int playlistId){
|
||||
public static MaterialDialog getDialog(final Context context, final int playlistId) {
|
||||
return new MaterialDialog.Builder(context)
|
||||
.title(context.getResources().getString(R.string.delete_playlist) + PlaylistsUtil.getNameForPlaylist(context, playlistId))
|
||||
.positiveText(context.getResources().getString(R.string.ok))
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ public class MusicPlayerRemote {
|
|||
}
|
||||
|
||||
public static void moveSong(int from, int to) {
|
||||
if(musicService != null){
|
||||
if (musicService != null) {
|
||||
musicService.moveSong(from, to);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,8 +11,6 @@ import android.app.TaskStackBuilder;
|
|||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
import android.widget.RemoteViews;
|
||||
|
||||
|
|
@ -21,9 +19,7 @@ import com.kabouzeid.gramophone.model.Song;
|
|||
import com.kabouzeid.gramophone.service.MusicService;
|
||||
import com.kabouzeid.gramophone.ui.activities.MusicControllerActivity;
|
||||
import com.kabouzeid.gramophone.util.MusicUtil;
|
||||
import com.squareup.picasso.MemoryPolicy;
|
||||
import com.squareup.picasso.Picasso;
|
||||
import com.squareup.picasso.Target;
|
||||
|
||||
public class PlayingNotificationHelper {
|
||||
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);
|
||||
notificationLayoutExpanded.setImageViewResource(R.id.album_art, R.drawable.default_album_art);
|
||||
notificationManager.notify(NOTIFICATION_ID, notification);
|
||||
};
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
public void killNotification() {
|
||||
service.stopForeground(true);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import com.afollestad.materialdialogs.MaterialDialog;
|
|||
import com.kabouzeid.gramophone.R;
|
||||
import com.kabouzeid.gramophone.adapter.PlayingQueueAdapter;
|
||||
import com.kabouzeid.gramophone.model.Song;
|
||||
import com.kabouzeid.gramophone.util.PlaylistsUtil;
|
||||
import com.mobeta.android.dslv.DragSortListView;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue