diff --git a/app/src/main/java/com/magnatune/eyecreate/companionformagnatune/fragments/AlbumFragment.java b/app/src/main/java/com/magnatune/eyecreate/companionformagnatune/fragments/AlbumFragment.java index 196e58623b9ab8cc94282a6324e215951892ad5d..37a9b3139aa112e1da3889f5f6f95684e33c468b 100644 --- a/app/src/main/java/com/magnatune/eyecreate/companionformagnatune/fragments/AlbumFragment.java +++ b/app/src/main/java/com/magnatune/eyecreate/companionformagnatune/fragments/AlbumFragment.java @@ -1,16 +1,15 @@ package com.magnatune.eyecreate.companionformagnatune.fragments; +import android.content.res.ColorStateList; import android.graphics.Color; import android.graphics.drawable.BitmapDrawable; import android.os.Build; import android.os.Bundle; import android.support.annotation.Nullable; +import android.support.design.widget.FloatingActionButton; import android.support.v4.app.Fragment; import android.support.v7.graphics.Palette; -import android.support.v7.widget.CardView; -import android.view.Gravity; import android.view.LayoutInflater; -import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.GridLayout; @@ -18,7 +17,6 @@ import android.widget.ImageView; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.TextView; -import android.widget.Toast; import com.magnatune.eyecreate.companionformagnatune.R; import com.magnatune.eyecreate.companionformagnatune.adapters.TracksAdapter; @@ -84,16 +82,6 @@ public class AlbumFragment extends Fragment { Album currentAlbum = db.where(Album.class).equalTo("albumsku",getArguments().getString(ARG_ALBUM_ID)).findFirst(); ((TextView)v.findViewById(R.id.album_name)).setText(currentAlbum.getAlbumname()); ((TextView)v.findViewById(R.id.artist_name)).setText(currentAlbum.getArtist().getArtistname()); - //Set up hint for button like in menu items - v.findViewById(R.id.queue_album).setOnLongClickListener(new View.OnLongClickListener() { - @Override - public boolean onLongClick(View view) { - Toast hint = Toast.makeText(view.getContext(),R.string.queue_album,Toast.LENGTH_SHORT); - hint.setGravity(Gravity.TOP|Gravity.RIGHT,25,20); - hint.show(); - return true; - } - }); Picasso.with(getActivity()).load(currentAlbum.getCover_small()).into((ImageView) v.findViewById(R.id.album_cover), new Callback() { @Override public void onSuccess() { @@ -108,12 +96,11 @@ public class AlbumFragment extends Fragment { } if (swatch != null) { ((TextView) v.findViewById(R.id.album_name)).setTextColor(swatch.getTitleTextColor()); - ((TextView) v.findViewById(R.id.queue_album)).setTextColor(swatch.getTitleTextColor()); //Get a slightly off color for button background. float[] modColor = swatch.getHsl(); modColor[2] = (float) (modColor[2]<=0.5?modColor[2]+0.1:modColor[2]-0.1); - v.findViewById(R.id.queue_album).setBackgroundColor(Color.HSVToColor(modColor)); + ((FloatingActionButton)v.findViewById(R.id.queue_album)).setBackgroundTintList(ColorStateList.valueOf(Color.HSVToColor(modColor))); ((TextView) v.findViewById(R.id.artist_name)).setTextColor(swatch.getBodyTextColor()); v.findViewById(R.id.album_details).setBackgroundColor(swatch.getRgb()); @@ -125,7 +112,7 @@ public class AlbumFragment extends Fragment { } }); - TracksAdapter adapter = new TracksAdapter(getActivity(),db.where(Track.class).equalTo("albumname",currentAlbum.getAlbumname()).equalTo("artist",currentAlbum.getArtist().getArtistname()).findAllSorted("tracknumber"),true); + TracksAdapter adapter = new TracksAdapter(getActivity(),db.where(Track.class).equalTo("albumname",currentAlbum.getAlbumname()).equalTo("artist", currentAlbum.getArtist().getArtistname()).findAllSorted("tracknumber"),true); listView.setAdapter(adapter); setListViewHeightBasedOnChildren(listView); return v; diff --git a/app/src/main/res/layout/fragment_album.xml b/app/src/main/res/layout/fragment_album.xml index dc8de24dd2e12ac28ca8e7f8fffa7209e5ae4ee7..46ddeb4c207d12bff37929562e333cd11684e96a 100644 --- a/app/src/main/res/layout/fragment_album.xml +++ b/app/src/main/res/layout/fragment_album.xml @@ -43,16 +43,14 @@ android:layout_height="wrap_content" android:textSize="16sp" /> -