Optimized layouts and bugfix
Optimized song and artist list item layouts Hopefully fixed a NPE when deleting a track
This commit is contained in:
parent
7c206f5423
commit
31f794336a
8 changed files with 28 additions and 39 deletions
|
|
@ -57,6 +57,7 @@ public class ArtistAdapter extends RecyclerView.Adapter<ArtistAdapter.ViewHolder
|
|||
public void onArtistThumbnailUrlLoaded(String url) {
|
||||
Picasso.with(activity)
|
||||
.load(url)
|
||||
.noFade()
|
||||
.placeholder(R.drawable.default_artist_image)
|
||||
.into(holder.artistImage);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ package com.kabouzeid.gramophone.ui.fragments.mainactivityfragments;
|
|||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.GridLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
|
||||
import com.kabouzeid.gramophone.R;
|
||||
import com.kabouzeid.gramophone.adapter.AlbumAdapter;
|
||||
|
|
@ -20,14 +20,10 @@ public class AlbumViewFragment extends AbsMainActivityFragment {
|
|||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_album_view, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
View view = inflater.inflate(R.layout.fragment_album_view, container, false);
|
||||
recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
|
||||
setUpRecyclerView();
|
||||
return view;
|
||||
}
|
||||
|
||||
private void setUpRecyclerView() {
|
||||
|
|
|
|||
|
|
@ -131,8 +131,8 @@ public class MusicUtil {
|
|||
cursor.moveToFirst();
|
||||
while (!cursor.isAfterLast()) {
|
||||
final String name = cursor.getString(1);
|
||||
final File f = new File(name);
|
||||
try { // File.delete can throw a security exception
|
||||
final File f = new File(name);
|
||||
if (!f.delete()) {
|
||||
// I'm not sure if we'd ever get here (deletion would
|
||||
// have to fail, but no exception thrown)
|
||||
|
|
@ -141,6 +141,8 @@ public class MusicUtil {
|
|||
cursor.moveToNext();
|
||||
} catch (final SecurityException ex) {
|
||||
cursor.moveToNext();
|
||||
} catch (NullPointerException e){
|
||||
Log.e("MusicUtils", "Failed to find file " + name);
|
||||
}
|
||||
}
|
||||
cursor.close();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue